-
Notifications
You must be signed in to change notification settings - Fork 7
/
mkarchiso.sh
28 lines (20 loc) · 969 Bytes
/
mkarchiso.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
#!/usr/bin/bash
# Build archlinux ISO file with optional extra kernel parameters.
# extra kernel command
KERNEL_CMD="console=ttyS0"
# create a temp directory in current directory
tempdir=$(mktemp -d --tmpdir=.)
# copy releng profile used in montly ISO relase
cp -r /usr/share/archiso/configs/releng/ "$tempdir/archlive"
# copy installation scripts to /root/
cp arch_install.sh "$tempdir/archlive/airootfs/root/"
cp arch_install_bcachefs.sh "$tempdir/archlive/airootfs/root/"
cp homed.sh "$tempdir/archlive/airootfs/root/"
if [[ -n "$KERNEL_CMD" ]] ; then
# add kernel command to systemd-boot
echo "options $KERNEL_CMD" >> "$tempdir/archlive/efiboot/loader/entries/01-archiso-x86_64-linux.conf"
# add kernel command to grub
sed -i "/\\s*linux.*archisodevice=UUID=\${ARCHISO_UUID}\$/ s|\$| $KERNEL_CMD|" "$tempdir/archlive/grub/grub.cfg"
fi
mkarchiso -v -w "$tempdir/work" -o /tmp "$tempdir/archlive"
rm -r "$tempdir"