extlinux-builder: respect target directory CLI arg
This commit is contained in:
parent
a299f111a4
commit
c6f2eaca45
|
@ -1,15 +1,27 @@
|
||||||
#! @bash@/bin/sh -ex
|
#! @bash@/bin/sh -ex
|
||||||
|
|
||||||
|
# this wraps <nixpkgs>/nixos/modules/system/boot/loader/generic-extlinux-compatible/extlinux-conf-builder.sh
|
||||||
|
# to expose a COMPLETE extlinux bootloader installation.
|
||||||
|
|
||||||
|
# parse CLI. we only care about some of the flags
|
||||||
|
target=/boot # default target
|
||||||
|
while getopts "t:c:d:g:n:r" opt; do
|
||||||
|
case "$opt" in
|
||||||
|
d) target="$OPTARG" ;;
|
||||||
|
*) ;;
|
||||||
|
esac
|
||||||
|
done
|
||||||
|
|
||||||
# populate /boot/extlinux/extlinux.conf & /boot/nixos
|
# populate /boot/extlinux/extlinux.conf & /boot/nixos
|
||||||
@genericBuilder@ $@
|
@genericBuilder@ $@
|
||||||
|
|
||||||
# populate the EFI directory with syslinux, and configure it to read that extlinux.conf file managed by nixos
|
# populate the EFI directory with syslinux, and configure it to read that extlinux.conf file managed by nixos
|
||||||
# TODO: read output directory
|
mkdir -p $target/EFI/syslinux
|
||||||
mkdir -p ./EFI/syslinux
|
cp @syslinux@/share/syslinux/efi64/* $target/EFI/syslinux/
|
||||||
cp @syslinux@/share/syslinux/efi64/* ./EFI/syslinux/
|
echo "DEFAULT trampoline" > $target/EFI/syslinux/syslinux.cfg
|
||||||
echo "DEFAULT trampoline" > ./EFI/syslinux/syslinux.cfg
|
echo "LABEL trampoline" >> $target/EFI/syslinux/syslinux.cfg
|
||||||
echo "LABEL trampoline" >> ./EFI/syslinux/syslinux.cfg
|
echo "CONFIG ../../extlinux/extlinux.conf ../../extlinux" >> $target/EFI/syslinux/syslinux.cfg
|
||||||
echo "CONFIG ../../extlinux/extlinux.conf ../../extlinux" >> ./EFI/syslinux/syslinux.cfg
|
|
||||||
|
|
||||||
# create the EFI/BOOT/BOOTX64.EFI default entry
|
# create the EFI/BOOT/BOOTX64.EFI default entry
|
||||||
cp -R ./EFI/syslinux ./EFI/BOOT
|
cp -R $target/EFI/syslinux $target/EFI/BOOT
|
||||||
mv ./EFI/BOOT/syslinux.efi ./EFI/BOOT/BOOTX64.EFI
|
mv $target/EFI/BOOT/syslinux.efi $target/EFI/BOOT/BOOTX64.EFI
|
||||||
|
|
Loading…
Reference in New Issue
Block a user