浏览代码

split normal and safe arch installer

Noah 4 年之前
父节点
当前提交
30e7fca7ff
共有 4 个文件被更改,包括 42 次插入17 次删除
  1. 13 4
      arch.sh
  2. 1 9
      chroot.sh
  3. 4 4
      testing/safe-arch.sh
  4. 24 0
      testing/safe-chroot.sh

+ 13 - 4
arch.sh

@@ -11,7 +11,11 @@ dialog --defaultno --title "WARNING!" --yesno "Do only run this script if you're
 
 dialog --no-cancel --inputbox "Enter the hostname." 10 60 2>comp
 
-dialog --no-cancel --inputbox "Enter the drive you want do install Arch on.\n\n$(lsblk -d | sed 's/0 disk/0 disk\\n/;s/POINT/POINT\\n/')" 10 60 2>drive
+clear
+lsblk -d | sed 's/0 disk/0 disk\\n/;s/POINT/POINT\\n/'
+read -p "Press any key to continue"
+
+dialog --no-cancel --inputbox "Enter the drive you want do install Arch on." 10 60 2>drive
 
 dialog --defaultno --title "Time Zone select" --yesno "Do you want use the default time zone(Europe/Zurich)?.\n\nPress no for select your own time zone"  10 60 && echo "Europe/Zurich" > tz.tmp || tzselect > tz.tmp
 
@@ -22,10 +26,12 @@ DRIVE=$(cat drive)
 
 timedatectl set-ntp true
 
-cat <<EOF | fdisk /dev/${DRIVE}
+cat <<EOF | fdisk -W always /dev/${DRIVE}
+p
 g
 n
 
+
 +1024M
 t
 4
@@ -36,12 +42,15 @@ n
 t
 2
 19
+p
 n
 
 
+
 t
 3
 20
+p
 w
 EOF
 partprobe
@@ -53,14 +62,14 @@ mount /dev/${DRIVE}3 /mnt
 
 pacman -Sy --noconfirm archlinux-keyring
 
-pacstrap /mnt base base-devel
+pacstrap /mnt base base-devel linux linux-firmware networkmanager rsync
 
 genfstab -U /mnt >> /mnt/etc/fstab
 cat tz.tmp > /mnt/tzfinal.tmp
 rm tz.tmp
 mv drive /mnt
 mv comp /mnt/etc/hostname
-curl https://raw.githubusercontent.com/noahvogt/norisa/master/chroot.sh > /mnt/chroot.sh && arch-chroot /mnt bash chroot.sh && rm /mnt/chroot.sh
+curl https://raw.githubusercontent.com/noahvogt/norisa/main/chroot.sh > /mnt/chroot.sh && arch-chroot /mnt bash chroot.sh && rm /mnt/chroot.sh
 
 dialog --defaultno --title "Final Qs" --yesno "Reboot computer?"  5 30 && reboot
 dialog --defaultno --title "Final Qs" --yesno "Return to chroot environment?"  6 30 && arch-chroot /mnt

+ 1 - 9
chroot.sh

@@ -5,28 +5,20 @@
 # do this if you exactly understand EVERY SINGLE
 # LINE of this bash script. You'll thank me later.
 
-read -p "Press any key to continue"
 passwd
-read -p "Press any key to continue"
 
 TZuser=$(cat tzfinal.tmp)
 
 ln -sf /usr/share/zoneinfo/$TZuser /etc/localtime
-read -p "Press any key to continue"
 
 hwclock --systohc
-read -p "Press any key to continue"
 
 echo "LANG=en_GB.UTF-8" >> /etc/locale.conf
 echo "en_GB.UTF-8 UTF-8" >> /etc/locale.gen
 locale-gen
-read -p "Press any key to continue"
 
 pacman --noconfirm --needed -S networkmanager
 systemctl enable NetworkManager
-systemctl start NetworkManager
-read -p "Press any key to continue"
 
 DRIVE=$(cat drive)
-pacman --noconfirm --needed -S grub && grub-install --target=i386-pc /dev/sda && grub-mkconfig -o /boot/grub/grub.cfg
-read -p "Press any key to continue"
+pacman --noconfirm --needed -S grub && grub-install --target=i386-pc /dev/${DRIVE} && grub-mkconfig -o /boot/grub/grub.cfg

+ 4 - 4
safe-arch.sh → testing/safe-arch.sh

@@ -28,7 +28,7 @@ read -p "Press any key to continue"
 timedatectl set-ntp true
 read -p "Press any key to continue"
 
-cat <<EOF | fdisk /dev/${DRIVE}
+cat <<EOF | fdisk -W always /dev/${DRIVE}
 p
 g
 n
@@ -51,7 +51,7 @@ n
 
 t
 3
-24
+20
 p
 w
 EOF
@@ -70,7 +70,7 @@ read -p "Press any key to continue"
 pacman -Sy --noconfirm archlinux-keyring
 read -p "Press any key to continue"
 
-pacstrap /mnt base base-devel
+pacstrap /mnt base base-devel linux linux-firmware networkmanager rsync
 read -p "Press any key to continue"
 
 genfstab -U /mnt >> /mnt/etc/fstab
@@ -83,7 +83,7 @@ mv drive /mnt
 read -p "Press any key to continue"
 mv comp /mnt/etc/hostname
 read -p "Press any key to continue"
-curl https://raw.githubusercontent.com/noahvogt/norisa/main/chroot.sh > /mnt/chroot.sh && arch-chroot /mnt bash chroot.sh && rm /mnt/chroot.sh
+curl https://raw.githubusercontent.com/noahvogt/norisa/main/testing/safe-chroot.sh > /mnt/chroot.sh && arch-chroot /mnt bash chroot.sh && rm /mnt/chroot.sh
 read -p "Press any key to continue"
 
 dialog --defaultno --title "Final Qs" --yesno "Reboot computer?"  5 30 && reboot

+ 24 - 0
testing/safe-chroot.sh

@@ -0,0 +1,24 @@
+#!/bin/bash
+
+# This a lazy and DANGEROUS way to install Arch.
+# I do not recommend this to other people, ONLY
+# do this if you exactly understand EVERY SINGLE
+# LINE of this bash script. You'll thank me later.
+
+passwd
+
+TZuser=$(cat tzfinal.tmp)
+
+ln -sf /usr/share/zoneinfo/$TZuser /etc/localtime
+
+hwclock --systohc
+
+echo "LANG=en_GB.UTF-8" >> /etc/locale.conf
+echo "en_GB.UTF-8 UTF-8" >> /etc/locale.gen
+locale-gen
+
+pacman --noconfirm --needed -S networkmanager
+systemctl enable NetworkManager
+
+DRIVE=$(cat drive)
+pacman --noconfirm --needed -S grub && grub-install --target=i386-pc /dev/${DRIVE} && grub-mkconfig -o /boot/grub/grub.cfg