-
Notifications
You must be signed in to change notification settings - Fork 2
/
installer.sh
executable file
·92 lines (80 loc) · 1.99 KB
/
installer.sh
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
#!/bin/bash
mountfail () {
echo '/mnt not mount, partition disk first'
exit 1
}
startup () {
mount | grep "$TARGET_MOUNT" || mountfail
script-pre-archiso/arch-mirror.sh
pacstrap /mnt `cat ./packages/${BASE_PACKAGE}`
genfstab -U /mnt >> /mnt/etc/fstab
mkdir -p /mnt/installer/
cp -a . /mnt/installer/
arch-chroot /mnt /installer/`basename $0` systembase
arch-chroot /mnt /installer/`basename $0` system
}
systembase () {
cd /installer
pwd
echo username: $USERNAME
useradd -m -s /bin/zsh "$USERNAME"
echo -e "$USERPASSWORD\n$USERPASSWORD\n" | passwd "$USERNAME"
echo -e "$ROOTPASSWORD\n$ROOTPASSWORD\n" | passwd
script-chroot/arch-sudo.sh
script-chroot/arch-locale.sh
script-chroot/arch-network.sh
script-chroot/arch-multilib.sh
script-chroot/arch-timezone.sh
pacman -Sy
}
system () {
cd /installer
pwd
PACKEGS=""
echo $PACKAGES_LIST
for list in $PACKAGES_LIST; do
PACKAGES="${PACKAGES} `cat packages/${list}`"
done
pacman -S --needed --noconfirm $PACKAGES
for script in $SCRIPT_SYSTEM; do
script-chroot/$script
done
su - "$USERNAME" -c "/installer/`basename $0` user"
}
user () {
cd /installer
pwd
for script in $SCRIPT_USER; do
script-chroot-user/$script
done
}
outside () {
for script in $SCRIPT_POST_ARCHISO; do
script-post-archiso/$script
done
}
aur () {
for list in $PACKAGES_LIST_AUR; do
PACKAGES="${PACKAGES} `cat packages-aur/${list}`"
done
yay -S --needed --removemake --noconfirm $PACKAGES
}
## Main
if [ "$1" == "" ]; then
echo startup
startup
outside
echo all done, after reboot run "\"/installer/${PARENT_SCRIPT} aur\"" to install aur packages
elif [ "$1" == "systembase" ]; then
echo systembase
systembase
elif [ "$1" == "system" ]; then
echo system chroot
system
elif [ "$1" == "user" ]; then
echo user chroot
user
elif [ "$1" == "aur" ]; then
echo aur
aur
fi