Files
linuxkit/tools/mkimage-iso-bios/make-iso
Justin Cormack 6155e8c8bc Change to use kernel not bzImage everywhere
Previously we hardcoded `bzImage` which is not used for all
use cases or architectures.

fix #1630

Signed-off-by: Justin Cormack <justin.cormack@docker.com>
2017-04-28 16:24:15 +01:00

47 lines
1.1 KiB
Bash
Executable File

#!/bin/sh
set -e
mkdir -p /tmp/iso
cd /tmp/iso
# input is a tarball of kernel and initrd.img on stdin
# output is an iso on stdout
# extract. BSD tar auto recognises compression, unlike GNU tar
# only if stdin is a tty, if so need files volume mounted...
[ -t 0 ] || bsdtar xzf -
INITRD="$(find . -name '*.img')"
KERNEL="$(find . -name kernel -or -name '*bzImage')"
CMDLINE="$*"
[ "$KERNEL" = "kernel" ] || mv "$KERNEL" kernel
[ "$INITRD" = "initrd.img" ] || mv "$INITRD" initrd.img
# clean up subdirectories
find . -mindepth 1 -maxdepth 1 -type d | xargs rm -rf
mkdir -p isolinux
cp /usr/share/syslinux/isolinux.bin ./isolinux/
cp /usr/share/syslinux/ldlinux.c32 ./isolinux/
CFG="DEFAULT linux
LABEL linux
KERNEL /kernel
INITRD /initrd.img
APPEND ${CMDLINE}
"
printf "$CFG" > isolinux/isolinux.cfg
genisoimage -o ../linuxkit-bios.iso -l -J -R \
-c isolinux/boot.cat \
-b isolinux/isolinux.bin \
-no-emul-boot -boot-load-size 4 -boot-info-table \
-V LinuxKit .
isohybrid ../linuxkit-bios.iso
cat ../linuxkit-bios.iso