add chroot-mode, so it works without qemu/kernel
This commit is contained in:
parent
206d7adb64
commit
9010e9786e
18
rootfs.sh
18
rootfs.sh
|
@ -1,8 +1,8 @@
|
||||||
#!/bin/bash
|
#!/bin/bash
|
||||||
set -ex
|
set -ex
|
||||||
|
|
||||||
QEMU_CMD=$1
|
QEMU_CMD="${1:-qemu-system-x86_64}" # or 'chroot'
|
||||||
RAM=$2
|
QEMU_RAM="${2:-8G}"
|
||||||
|
|
||||||
pushd sysa
|
pushd sysa
|
||||||
|
|
||||||
|
@ -116,11 +116,15 @@ cd tmp
|
||||||
find . | cpio -H newc -o | gzip > initramfs.igz
|
find . | cpio -H newc -o | gzip > initramfs.igz
|
||||||
|
|
||||||
# Run
|
# Run
|
||||||
${QEMU_CMD:-qemu-system-x86_64} -enable-kvm \
|
if [ "${QEMU_CMD}" = 'chroot' ]; then
|
||||||
-m "${RAM:-8G}" \
|
sudo PATH="/after/bin:${PATH}" chroot . /init
|
||||||
-nographic \
|
else
|
||||||
-no-reboot \
|
${QEMU_CMD} -enable-kvm \
|
||||||
-kernel ../../kernel -initrd initramfs.igz -append console=ttyS0
|
-m "${QEMU_RAM:-8G}" \
|
||||||
|
-nographic \
|
||||||
|
-no-reboot \
|
||||||
|
-kernel ../../kernel -initrd initramfs.igz -append console=ttyS0
|
||||||
|
fi
|
||||||
|
|
||||||
cd ../..
|
cd ../..
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue