- μ ν¬-λΆμ μμ¦ μ¬λ―Έκ° λΆμ΄μ κΈμ μ΅μ ννλκ² λλ₯λλ€
- λλ©μΈ μ΄λ¦μ
jeonality.com
, μ΄λ©μΌμjeon@jeonality.com
μΌλ‘ λ³κ²½ν©λλ€! - λ³Έ λΈλ‘κ·Έλ νμ¬ μμ μ μ μ견μ΄λ μ§μμ λ°μν©λλ€. νΉν, βμ μ견βμ ν΄λΉνλ ννΈλ λ§€μ° λ³λμ€λ½μ΅λλ€.
- λ³Έ λΈλ‘κ·Έλ μΈλ―Έ-μν€ μ€νμΌλ‘ μ μν©λλ€. μ΄λ ν¬μ€νΈμ μλ§ λ¬΄μμ λλ €λκ°μ§ μμμ μλ―Έν©λλ€. λ°λΌμ λ΄μ©μ΄ μμ£Ό λ°λ μ μμΌλ©° λ³λ κ³΅μ§ μμ΄ κΈμ΄ μμ λκ±°λ λ€λ₯Έ κΈμ ν΅ν©λ μλ μμ΅λλ€.
- λ³Έ λΈλ‘κ·Έμ 볡μ¬, μμ , νμ©κ³Ό κ΄λ ¨ν λΌμ΄μ μ€λ μ¬κΈ°μμ νμΈνμκΈ° λ°λλλ€. λ²μλ κΈμ κ²½μ°λ λ³Έ λΈλ‘κ·Έμ λΌμ΄μ μ€λ₯Ό λ°λ₯΄μ§ μκ³ μλ¬Έμ λΌμ΄μ μ€λ₯Ό λ°λ¦ λλ€.
Prerequisite
Do not blindly copy this script and run. It would destroy your machine. You must fully understand the full installation process.
And, also these scripts are made for my personal usage, AND for my specific hardware. So you have to change some settings.
To DO
Currently, Iβm considering move these scripts to independent repository, and start to generalize. However, thereβs already a good install software written in python.
Pre-chroot.sh
You can download this by $curl -LO https://github.com/jeonality/ais/raw/main/pre-chroot.sh
.
As you can see below, YOU HAVE TO CHANGE SEVERAL SETTINGS TO FIT YOUR HARDWARE & ENVIRONMENT.
You have to first plan your partition. Script below starts with formating a disk. It means that you have to do
wipefs β-all /dev/sdX
parted /dev/sdX
(parted) mklabel gpt
cfdisk /dev/sdX
This script will download pro-chroot.sh under /mnt
.
#!/bin/sh
# Preparing for arch-chroot
# You must prepare disk format
# before running below.
#
# Also, you must check each variables
# that are mounted along the script.
#
# That means you should have already
# done below commands.
# #wipefs --all $DISK
# #parted $DISK mklabel gpt
# #cfdisk
# You should modify these.
DISK="/dev/sda"
# Script
VFAT_PART="${DISK}1"
SWAP_PART="${DISK}2"
EXT4_PART="${DISK}3"
mkfs.vfat -F 32 $VFAT_PART
mkfs.ext4 -j $EXT4_PART
mkswap $SWAP_PART
swapon $SWAP_PART
mount $EXT4_PART /mnt
mkdir -p /mnt/boot
mount $VFAT_PART /mnt/boot
timedatectl set-ntp true
sleep 3s
hwclock --systohc --utc
reflector -c KR > /etc/pacman.d/mirrorlist
pacstrap /mnt base base-devel linux linux-firmware networkmanager emacs man-db man-pages
genfstab -U /mnt >> /mnt/etc/fstab
curl -L -o /mnt/pro-chroot.sh https://github.com/jeonality/ais/raw/main/pro-chroot.sh
echo "========================================================================="
echo "Everything's prepared to be chrooted..."
echo "Now you can..."
echo "========================================================================="
echo "#arch-chroot /mnt"
echo "And run ./pro-chroot.sh"
Pro-chroot.sh
You can download this by $curl -LO https://github.com/jeonality/ais/raw/main/pre-chroot.sh
.
As you can see below, YOU HAVE TO CHANGE SEVERAL SETTINGS TO FIT YOUR HARDWARE & ENVIRONMENT.
#!/bin/sh
# You should modify these.
DISK="/dev/sda"
MYHOSTNAME="vm"
MYUSERNAME="jeon"
# Script
EXT4_PART="${DISK}3"
# Locale
sed -e 's/#en_US.UTF-8\ UTF-8/en_US.UTF-8 UTF-8/g' -i /etc/locale.gen
locale-gen
echo LANG=en_US.UTF-8 > /etc/locale.conf
export LANG=en_US.UTF-8
# Timezone
ln -sf /usr/share/zoneinfo/Asia/Seoul /etc/localtime
# Hostname
echo ${MYHOSTNAME} > /etc/hostname
# Pacman/Makepkg
PACMAN_CONF_FILE="/etc/pacman.conf"
sed -e 's/#UseSyslog/UseSyslog/g' \
-e 's/#Color/Color/g' \
-e 's/#VerbosePkgLists/VerbosePkgLists/g' \
-e 's/#ParallelDownloads = 5/ParallelDownloads = 10/g' \
-i ${PACMAN_CONF_FILE}
MAKEPKG_CONF_FILE="/etc/makepkg.conf"
sed -e 's/#MAKEFLAGS="-j2"/MAKEFLAGS="-j8"/g' -i ${MAKEPKG_CONF_FILE}
# Installing Arch Linux after arch-chroot.
echo "========================================================================="
echo "Setting root password"
passwd
# Add a user
useradd -m -g users -G wheel ${MYUSERNAME}
echo "========================================================================="
echo "Setting user password"
passwd ${MYUSERNAME}
# Bootloader
bootctl --path=/boot install
cat > /boot/loader/loader.conf << EOF
default arch
editor 1
timeout 1
EOF
pacman -S --noconfirm amd-ucode
cat > /boot/loader/entries/arch.conf << EOF
title ArchLinux
linux /vmlinuz-linux
initrd /amd-ucode.img
initrd /initramfs-linux.img
EOF
echo "options root=${EXT4_PART} rw" >> /boot/loader/entries/arch.conf
# If you want PARTUUID in bootloader-arch.conf
#echo "options root=PARTUUID=$(blkid -s PARTUUID -o value /dev/nvme0n1p3) rw">> /boot/loader/entries/arch.conf
systemctl enable NetworkManager.service
echo "========================================================================="
echo "Everything's installed..."
echo "Now you can..."
echo "========================================================================="
echo "#exit"
echo "#umount -lR /mnt"
echo "#reboot"