logo

live-bootstrap

Mirror of <https://github.com/fosslinux/live-bootstrap>
commit: 96320a1b3f2ea608ed00688739c2839982b60750
parent 329afda94d6b5f412e43f30d6be7a210ffa1e490
Author: fosslinux <fosslinux@aussies.space>
Date:   Thu, 21 Jan 2021 09:52:27 +1100

Merge pull request #17 from bittorf/add_ci_helper

Add new build target 'minikernel'

Diffstat:

Mrootfs.sh38++++++++++++++++++++++++++++----------
1 file changed, 28 insertions(+), 10 deletions(-)

diff --git a/rootfs.sh b/rootfs.sh @@ -1,7 +1,7 @@ #!/bin/bash set -ex -QEMU_CMD="${1:-qemu-system-x86_64}" # or 'chroot' +QEMU_CMD="${1:-qemu-system-x86_64}" # or 'chroot' or 'minikernel' QEMU_RAM="${2:-8G}" pushd sysa @@ -12,6 +12,8 @@ pushd sysa mkdir -p tmp/ sudo mount -t tmpfs -o size=8G tmpfs tmp +LOGFILE="$PWD/tmp/bootstrap.log" + # base: mescc-tools-seed # copy in all the mescc-tools-seed stuff cp -r mescc-tools-seed/src/mescc-tools-seed/x86/* tmp @@ -125,17 +127,33 @@ cd tmp find . | cpio -H newc -o | gzip > initramfs.igz # Run -if [ "${QEMU_CMD}" = 'chroot' ]; then - sudo PATH="/after/bin:${PATH}" chroot . /init -else - ${QEMU_CMD} -enable-kvm \ - -m "${QEMU_RAM}" \ - -nographic \ - -no-reboot \ - -kernel ../../kernel -initrd initramfs.igz -append console=ttyS0 -fi +case "${QEMU_CMD}" in + chroot) + sudo PATH="/after/bin:${PATH}" chroot . /init | tee "$LOGFILE" + ;; + minikernel) + git clone --depth 1 --branch v0.4 https://github.com/bittorf/kritis-linux.git + + kritis-linux/ci_helper.sh \ + --arch x86_64 \ + --ramsize 4G \ + --kernel 5.10.8 \ + --initrd initramfs.igz \ + --log "$LOGFILE" + ;; + *) + ${QEMU_CMD} -enable-kvm \ + -m "${QEMU_RAM:-8G}" \ + -nographic \ + -no-reboot \ + -kernel ../../kernel -initrd initramfs.igz -append console=ttyS0 | tee "$LOGFILE" + ;; +esac cd ../.. +# eventually keep logfile before unmount: +echo "see logfile: $LOGFILE" + # Cleanup sudo umount sysa/tmp