Kaynağa Gözat

fix firmware reboot + use batch mode in cryptsetup + remove all /dev/sda2 hardcoding again + fix aur build + add reboot to firmware after stage2 + remove passwd setup for videopc user

Noah Vogt 1 yıl önce
ebeveyn
işleme
11404be4d2
3 değiştirilmiş dosya ile 7 ekleme ve 8 silme
  1. 1 3
      chroot.sh
  2. 3 1
      stage1.sh
  3. 3 4
      stage2.sh

+ 1 - 3
chroot.sh

@@ -31,7 +31,7 @@ mkinitcpio -P
 root_uuid="$(grep ext4 /etc/fstab | sed 's/^UUID=//; s/\s\/.*$//')"
 drive2_uuid="$(blkid | grep "$DRIVE"2 | tr ' ' '\n' | grep ^UUID= | sed 's/^UUID="//; s/"//')"
 
-echo "BOOT_IMAGE=/boot/vmlinuz-linux root=UUID=$root_uuid rw cryptdevice=/dev/sda2:cryptroot loglevel=0 quiet udev.log_level=3" > /etc/kernel/cmdline
+echo "BOOT_IMAGE=/boot/vmlinuz-linux root=UUID=$root_uuid rw cryptdevice=UUID=$drive2_uuid:cryptroot loglevel=0 quiet udev.log_level=3" > /etc/kernel/cmdline
 chmod +w /etc/kernel/cmdline
 
 sb_status="$(sbctl status)"
@@ -59,5 +59,3 @@ efibootmgr --create \
 mkinitcpio -P
 
 rm drive
-
-systemctl reboot --firmware

+ 3 - 1
stage1.sh

@@ -42,7 +42,7 @@ partprobe
 mkfs.fat -F32 /dev/"$DRIVE"1
 
 while true; do
-    cryptsetup luksFormat --type luks2 /dev/"$DRIVE"2 && break
+    cryptsetup luksFormat -q /dev/"$DRIVE"2 && break
 done
 
 while true; do
@@ -65,3 +65,5 @@ echo "videopc" > /mnt/etc/hostname
 
 cp chroot.sh stage2.sh /mnt
 arch-chroot /mnt bash chroot.sh
+
+systemctl reboot --firmware

+ 3 - 4
stage2.sh

@@ -68,9 +68,6 @@ create_videopc_user() {
     echo -e "\e[0;30;34mCreating videopc user ...\e[0m"
     username="videopc"
     useradd -m -g users -G wheel "$username"
-    while true; do
-        passwd "$username" && break
-    done
 }
 
 add_user_to_groups() {
@@ -90,7 +87,7 @@ make_user_owner_of_HOME_and_mnt_dirs() {
 
 aur_build() {
     cd_into /home/"$username"/.local/src
-    git clone https://aur.archlinux.org/"$1".git
+    doas -u "$username" git clone https://aur.archlinux.org/"$1".git
     cd_into "$1"
     doas -u "$username" makepkg --noconfirm -si || exit 1
 }
@@ -165,3 +162,5 @@ systemctl enable sshd
 # remove root autologin
 echo -e "\e[0;30;34mRemoving root autologin ...\e[0m"
 rm -rf /etc/systemd/system/getty@tty1.service.d
+
+systemctl reboot --firmware