Files
linuxkit/base/mkimage-gce/make-gce
Justin Cormack f8e0a3d61c Move base images directory to top level
These are standalone, better to have them at the top.

Signed-off-by: Justin Cormack <justin.cormack@docker.com>
2017-01-24 18:55:23 +00:00

26 lines
524 B
Bash
Executable File

#!/bin/sh
set -e
# input is a tarball of vmlinuz64 and initrd.img on stdin
# output is a compressed tarball of a raw disk image on stdout
mkdir -p files
tar xf - -C files
cp syslinux.cfg files
tar cf files.tar -C files .
virt-make-fs --size=1G --type=ext4 --partition files.tar disk.raw
guestfish -a disk.raw -m /dev/sda1 <<EOF
upload /usr/lib/SYSLINUX/mbr.bin /mbr.bin
copy-file-to-device /mbr.bin /dev/sda size:440
rm /mbr.bin
extlinux /
part-set-bootable /dev/sda 1 true
EOF
tar cf - disk.raw | gzip -9