OSDN Git Service

start instantARCH markers
[instantos/instantARCH.git] / pacstrap / pacstrap.sh
1 #!/bin/bash
2
3 # install base system to target root partition
4
5 if ! mount | grep '/mnt'; then
6     echo "mount failed"
7     exit 1
8 fi
9
10 pacman -Sy --noconfirm
11
12 # kernel selection
13 if iroot kernel; then
14     KERNEL="$(iroot kernel)"
15     if [ "$KERNEL" = "default" ]; then
16         KERNEL="linux-lts"
17     fi
18 else
19     # fallback to linux-lts
20     KERNEL="linux-lts"
21 fi
22
23 # we're on arch
24 if command -v pacstrap; then
25     while ! pacstrap /mnt base ${KERNEL} ${KERNEL}-headers linux-firmware reflector; do
26         dialog --msgbox "package installation failed \nplease reconnect to internet" 700 700
27     done
28 else
29     # artix or manjaro
30     if command -v systemctl; then
31         while ! basestrap /mnt base ${KERNEL} ${KERNEL}-headers linux-firmware; do
32             dialog --msgbox "manjaro package installation failed \nplease reconnect to internet" 700 700
33         done
34     else
35         while ! basestrap /mnt runit elogind-runit base base-devel ${KERNEL} ${KERNEL}-headers linux-firmware; do
36             sleep 2
37             dialog --msgbox "artix package installation failed \nplease reconnect to internet" 700 700
38         done
39     fi
40 fi
41
42 if command -v genfstab; then
43     genfstab -U /mnt >>/mnt/etc/fstab
44 else
45     fstabgen -U /mnt >>/mnt/etc/fstab
46 fi
47
48 cd /root || exit 1
49
50 cp -r ./instantARCH /mnt/root/instantARCH
51 {
52     cat /etc/pacman.d/mirrorlist
53     echo '# modified by instantARCH'
54 } >/mnt/etc/pacman.d/mirrorlist