diff --git a/pkg/eve/runme.sh b/pkg/eve/runme.sh index 112947236c..1b41ec46b4 100755 --- a/pkg/eve/runme.sh +++ b/pkg/eve/runme.sh @@ -157,9 +157,17 @@ do_installer_raw() { dump "$OUTPUT_IMG" installer.raw } +# create_installer_iso creates the installer iso and leaves it as /output.iso +# common base for other usages like do_installer_iso and do_installer_net +create_installer_iso() { + mkdir -p /installer_root + unsquashfs -f -d /installer_root /bits/installer.img 1>&2 + tar -C /installer_root -cf - . | /make-efi installer + rm -rf /installer_root +} + do_installer_iso() { - rm -rf /parts - /make-efi installer + create_installer_iso dump /output.iso installer.iso } @@ -170,7 +178,7 @@ do_installer_net() { cp /bits/ipxe.efi.cfg /installer mkdir -p /installer/EFI/BOOT cp /bits/EFI/BOOT/BOOT*EFI /installer/EFI/BOOT/ - /make-efi installer + create_installer_iso mv /output.iso /installer/installer.iso # all of this is taken straight from ../../tools/makenet.sh diff --git a/pkg/mkimage-iso-efi/make-efi b/pkg/mkimage-iso-efi/make-efi index a529aa994b..6af5671282 100755 --- a/pkg/mkimage-iso-efi/make-efi +++ b/pkg/mkimage-iso-efi/make-efi @@ -14,16 +14,14 @@ copy() { } # -# Extract partitions from stdin or look them up in /bits +# Extract partitions from stdin to a working directory +# We could do this in /tmp, but it might be really big, and for cases where +# /tmp is tmpfs, that might use up a lot of memory # -mkdir -p /parts 2>/dev/null || : -cd /parts -if [ -d /bits ]; then - ln -s /bits/* . - rm \* >/dev/null 2>&1 || : -else - bsdtar xzf - -fi +TMPDIR=/var/efiparts-$$ +mkdir -p $TMPDIR +cd $TMPDIR +bsdtar xzf - # create a ISO with a EFI boot partition # Stuff it into a FAT filesystem, making it as small as possible. 511KiB