after-reboot.sh
· 462 B · Bash
Orginalformat
systemctl enable NetworkManager
echo "export EDITOR=nvim" >> ~/.bash_profile
source ~/.bash_profile
useradd -m -G wheel -s /bin/bash frain
passwd frain
visudo
pacman -S plasma-meta konsole dolphin
systemctl enable sddm
systemctl start sddm
# Chinese Input Method
sudo pacman -S fcitx5-im
sudo pacman -S fcitx5-chinese-addons
cat << EOF >> /etc/environment
GTK_IM_MODULE=fcitx
QT_IM_MODULE=fcitx
XMODIFIERS=@im=fcitx
SDL_IM_MODULE=fcitx
GLFW_IM_MODULE=ibus
EOF
| 1 | systemctl enable NetworkManager |
| 2 | echo "export EDITOR=nvim" >> ~/.bash_profile |
| 3 | source ~/.bash_profile |
| 4 | useradd -m -G wheel -s /bin/bash frain |
| 5 | passwd frain |
| 6 | visudo |
| 7 | pacman -S plasma-meta konsole dolphin |
| 8 | systemctl enable sddm |
| 9 | systemctl start sddm |
| 10 | |
| 11 | # Chinese Input Method |
| 12 | sudo pacman -S fcitx5-im |
| 13 | sudo pacman -S fcitx5-chinese-addons |
| 14 | cat << EOF >> /etc/environment |
| 15 | GTK_IM_MODULE=fcitx |
| 16 | QT_IM_MODULE=fcitx |
| 17 | XMODIFIERS=@im=fcitx |
| 18 | SDL_IM_MODULE=fcitx |
| 19 | GLFW_IM_MODULE=ibus |
| 20 | EOF |
| 21 | |
| 22 |
arch-install-btrfs.sh
· 1.3 KiB · Bash
Orginalformat
ESP=/dev/nvme0n1p1
ROOT=/dev/nvme0n1p2
SWAPFILESIZE=2G
mkfs.btrfs -L ROOT $ROOT
mount $ROOT /mnt
btrfs sub create /mnt/@
btrfs sub create /mnt/@swap
btrfs sub create /mnt/@home
btrfs sub create /mnt/@pkg
btrfs sub create /mnt/@snapshots
btrfs sub create /mnt/@vm
umount /mnt
# For configure mount options, see https://btrfs.wiki.kernel.org/index.php/FAQ#Can_I_mount_subvolumes_with_different_mount_options.3F
mount -o noatime,nodiratime,compress=zstd,space_cache=v2,ssd,subvol=@ $ROOT /mnt
mkdir -p /mnt/{boot,home,var/cache/pacman/pkg,.snapshots,btrfs,/var/lib/libvirt}
mount -o noatime,nodiratime,compress=zstd,space_cache=v2,ssd,subvol=@home $ROOT /mnt/home
mount -o noatime,nodiratime,compress=zstd,space_cache=v2,ssd,subvol=@pkg $ROOT /mnt/var/cache/pacman/pkg
mount -o noatime,nodiratime,compress=zstd,space_cache=v2,ssd,subvol=@snapshots $ROOT /mnt/.snapshots
mount -o noatime,nodiratime,compress=zstd,space_cache=v2,ssd,subvol=@vm $ROOT /mnt/var/lib/libvirt
mount -o noatime,nodiratime,compress=zstd,space_cache=v2,ssd,subvolid=5 $ROOT /mnt/btrfs
mount $ESP /mnt/boot
# Create swapfile
btrfs filesystem mkswapfile --size $SWAPFILESIZE --uuid clear /mnt/btrfs/@swap/swapfile
swapon /mnt/btrfs/@swap/swapfile
pacstrap -K /mnt base linux linux-firmware intel-ucode sof-firmware networkmanager man-db man-pages neovim grub efibootmgr zsh
| 1 | ESP=/dev/nvme0n1p1 |
| 2 | ROOT=/dev/nvme0n1p2 |
| 3 | SWAPFILESIZE=2G |
| 4 | |
| 5 | mkfs.btrfs -L ROOT $ROOT |
| 6 | |
| 7 | mount $ROOT /mnt |
| 8 | btrfs sub create /mnt/@ |
| 9 | btrfs sub create /mnt/@swap |
| 10 | btrfs sub create /mnt/@home |
| 11 | btrfs sub create /mnt/@pkg |
| 12 | btrfs sub create /mnt/@snapshots |
| 13 | btrfs sub create /mnt/@vm |
| 14 | umount /mnt |
| 15 | |
| 16 | # For configure mount options, see https://btrfs.wiki.kernel.org/index.php/FAQ#Can_I_mount_subvolumes_with_different_mount_options.3F |
| 17 | mount -o noatime,nodiratime,compress=zstd,space_cache=v2,ssd,subvol=@ $ROOT /mnt |
| 18 | mkdir -p /mnt/{boot,home,var/cache/pacman/pkg,.snapshots,btrfs,/var/lib/libvirt} |
| 19 | mount -o noatime,nodiratime,compress=zstd,space_cache=v2,ssd,subvol=@home $ROOT /mnt/home |
| 20 | mount -o noatime,nodiratime,compress=zstd,space_cache=v2,ssd,subvol=@pkg $ROOT /mnt/var/cache/pacman/pkg |
| 21 | mount -o noatime,nodiratime,compress=zstd,space_cache=v2,ssd,subvol=@snapshots $ROOT /mnt/.snapshots |
| 22 | mount -o noatime,nodiratime,compress=zstd,space_cache=v2,ssd,subvol=@vm $ROOT /mnt/var/lib/libvirt |
| 23 | mount -o noatime,nodiratime,compress=zstd,space_cache=v2,ssd,subvolid=5 $ROOT /mnt/btrfs |
| 24 | mount $ESP /mnt/boot |
| 25 | |
| 26 | # Create swapfile |
| 27 | btrfs filesystem mkswapfile --size $SWAPFILESIZE --uuid clear /mnt/btrfs/@swap/swapfile |
| 28 | swapon /mnt/btrfs/@swap/swapfile |
| 29 | |
| 30 | pacstrap -K /mnt base linux linux-firmware intel-ucode sof-firmware networkmanager man-db man-pages neovim grub efibootmgr zsh |
arch-install-chroot.sh
· 660 B · Bash
Orginalformat
# Replace hostname with the name for your host
export HOST=hostname
# Replace Europe/London with your Region/City
export TZ="Europe/London"
echo $HOST > /etc/hostname
cat << EOF >> /etc/hosts
127.0.0.1 localhost
::1 localhost
127.0.1.1 $HOST.localdomain $HOST
EOF
ln -sf /usr/share/zoneinfo/$TZ /etc/localtime
# Sync system time to hardware clock
hwclock --systohc
# - set locale
echo "en_US.UTF-8 UTF-8" >> /etc/locale.gen
#echo "zh_CN.UTF-8 UTF-8" >> /etc/locale.gen
locale-gen
echo 'LANG=en_US.UTF-8' > /etc/locale.conf
grub-install --target=x86_64-efi --efi-directory=/boot --bootloader-id=GRUB
grub-mkconfig -o /boot/grub/grub.cfg
passwd root
| 1 | # Replace hostname with the name for your host |
| 2 | export HOST=hostname |
| 3 | # Replace Europe/London with your Region/City |
| 4 | export TZ="Europe/London" |
| 5 | |
| 6 | echo $HOST > /etc/hostname |
| 7 | cat << EOF >> /etc/hosts |
| 8 | 127.0.0.1 localhost |
| 9 | ::1 localhost |
| 10 | 127.0.1.1 $HOST.localdomain $HOST |
| 11 | EOF |
| 12 | |
| 13 | ln -sf /usr/share/zoneinfo/$TZ /etc/localtime |
| 14 | # Sync system time to hardware clock |
| 15 | hwclock --systohc |
| 16 | |
| 17 | # - set locale |
| 18 | echo "en_US.UTF-8 UTF-8" >> /etc/locale.gen |
| 19 | #echo "zh_CN.UTF-8 UTF-8" >> /etc/locale.gen |
| 20 | locale-gen |
| 21 | echo 'LANG=en_US.UTF-8' > /etc/locale.conf |
| 22 | |
| 23 | grub-install --target=x86_64-efi --efi-directory=/boot --bootloader-id=GRUB |
| 24 | grub-mkconfig -o /boot/grub/grub.cfg |
| 25 | |
| 26 | passwd root |
| 27 |