From 82d0f92ab8b84466ae20ab919c1f9c3577b5cecb Mon Sep 17 00:00:00 2001 From: Laurent Bercot Date: Mon, 22 May 2017 21:56:04 +0000 Subject: Initial commit --- sub/disk-image/make-disk-image | 107 +++++++++++++++++++++++++++++++++++++++++ 1 file changed, 107 insertions(+) create mode 100755 sub/disk-image/make-disk-image (limited to 'sub/disk-image/make-disk-image') diff --git a/sub/disk-image/make-disk-image b/sub/disk-image/make-disk-image new file mode 100755 index 0000000..64d2c40 --- /dev/null +++ b/sub/disk-image/make-disk-image @@ -0,0 +1,107 @@ +#!/bin/sh -e + +# umount is given with -l because some operating systems have triggers that will launch processes keep file descriptors open to the mount, preventing unmounting + +output="$1" +rootfs_size="$2" +swap_size="$3" +rwfs_size="$4" +userfs_size="$5" +extra_size="$6" + +totalsize=$(s6-expr ${rootfs_size} + ${swap_size} + ${rwfs_size} + ${userfs_size} + ${extra_size} + 4) + +# prepare extlinux.conf + +if s6-test ${KERNEL_GENERIC_ARCH} = x86 ; then + consolearg="console=ttyS0,115200n8" + if ${USE_GRAPHIC} ; then + consolearg= + fi + if s6-test ${KERNEL_ARCH} = x86_64 ; then + bootpartition=/dev/sda1 + else + bootpartition=/dev/hda1 + fi + s6-cat > ${output}/rootfs/boot/extlinux.conf <