-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathsetup-chroot.sh
executable file
·54 lines (42 loc) · 1.26 KB
/
setup-chroot.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
#!/bin/bash
cd "$(dirname "$0")"
RUNDIR=$(pwd)
source config.sh
if [ -n "$SETTIMESTAMP" ]; then
date -s "$SETTIMESTAMP"
fi
for moduleName in ${MODULES[@]}; do
echo "Executing ${moduleName}"
cd ${RUNDIR}
source "${moduleName}" 2>&1 | tee "/root/installer/logs/${moduleName}.log"
done
# flatten all permissions
chown -R ${USERNAME}:users /home/${USERNAME}
# boot managers
if [ x"${BOOTMNGR}" = x"grub" ]; then
grub-install --recheck /dev/sda
# hack for misnamed devices -> grub bug?
grub-mkconfig -o /boot/grub/grub.cfg.mkc
mv /boot/grub/grub.cfg.mkc /boot/grub/grub.cfg
fi
if [ x"${BOOTMNGR}" = x"refind" ]; then
refind-install
fi
if [ x"${BOOTMNGR}" = x"efistub" ]; then
# generate unified kernels
mkinitcpio -p linux
efibootmgr --create --unicode \
--disk /dev/sda --part 1 \
--label "Arch Linux" --loader '\EFI\Linux\arch-linux.efi'
fi
if [ x"${BOOTMNGR}" = x"systemd" ]; then
bootctl install
efibootmgr --create --unicode \
--disk /dev/nvme0n1 --part 1 \
--label "Systemd Boot Manager" \
--loader '\EFI\systemd\systemd-bootx64.efi'
fi
if [ x"${BOOTMNGR}" = x"xbootldr" ]; then
echo 'Installing bootloader for XBOOTLDR: `bootctl --esp-path=/efi --boot-path=/boot install`'
bootctl --esp-path=/efi --boot-path=/boot install
fi