mirror of
https://github.com/linuxkit/linuxkit.git
synced 2025-09-01 15:08:33 +00:00
Merge pull request #1264 from tych0/hoist-kernel-cmdline
Hoist kernel cmdline
This commit is contained in:
@@ -10,4 +10,4 @@ RUN \
|
||||
|
||||
COPY . .
|
||||
|
||||
CMD [ "/make-iso" ]
|
||||
ENTRYPOINT [ "/make-iso" ]
|
||||
|
@@ -14,6 +14,7 @@ cd /tmp/iso
|
||||
|
||||
INITRD="$(find . -name '*.img')"
|
||||
KERNEL="$(find . -name vmlinuz64 -or -name bzImage)"
|
||||
CMDLINE="$*"
|
||||
|
||||
[ "$KERNEL" = "vmlinuz64" ] || mv "$KERNEL" vmlinuz64
|
||||
[ "$INITRD" = "initrd.img" ] || mv "$INITRD" initrd.img
|
||||
@@ -29,7 +30,7 @@ CFG="DEFAULT linux
|
||||
LABEL linux
|
||||
KERNEL /vmlinuz64
|
||||
INITRD /initrd.img
|
||||
APPEND earlyprintk=serial console=ttyS0 console=tty1 $*
|
||||
APPEND ${CMDLINE}
|
||||
"
|
||||
|
||||
printf "$CFG" > isolinux/isolinux.cfg
|
||||
|
@@ -12,4 +12,4 @@ RUN \
|
||||
|
||||
COPY . .
|
||||
|
||||
CMD [ "/make-efi" ]
|
||||
ENTRYPOINT [ "/make-efi" ]
|
||||
|
@@ -14,6 +14,7 @@ cd /tmp/efi
|
||||
|
||||
INITRD="$(find . -name '*.img')"
|
||||
KERNEL="$(find . -name vmlinuz64 -or -name bzImage)"
|
||||
CMDLINE="$*"
|
||||
|
||||
[ "$KERNEL" = "vmlinuz64" ] || mv "$KERNEL" vmlinuz64
|
||||
[ "$INITRD" = "initrd.img" ] || mv "$INITRD" initrd.img
|
||||
@@ -21,13 +22,10 @@ KERNEL="$(find . -name vmlinuz64 -or -name bzImage)"
|
||||
# clean up subdirectories
|
||||
find . -mindepth 1 -maxdepth 1 -type d | xargs rm -rf
|
||||
|
||||
# Docker for Windows specific options, should be moved
|
||||
WINDOWS_OPTIONS="mobyplatform=windows vsyscall=emulate page_poison=1 panic=1 rootdelay=300 noautodetect"
|
||||
|
||||
# Create a EFI boot file with kernel and initrd. From:
|
||||
# https://github.com/haraldh/mkrescue-uefi/blob/master/mkrescue-uefi.sh
|
||||
cp /usr/lib/gummiboot/linuxx64.efi.stub .
|
||||
echo "earlyprintk=ttyS0,115200 console=ttyS0,115200 $WINDOWS_OPTIONS" > cmdline.txt
|
||||
echo "${CMDLINE} rootdelay=300 noautodetect" > cmdline.txt
|
||||
|
||||
objcopy \
|
||||
--add-section .osrel=/etc/os-release --change-section-vma .osrel=0x20000 \
|
||||
|
@@ -30,7 +30,7 @@ then
|
||||
then
|
||||
ARGS="$ARGS -initrd $INITRD"
|
||||
fi
|
||||
ARGS="$ARGS -append console=ttyS0 -drive file=systemdisk.img,format=raw"
|
||||
ARGS="$ARGS -drive file=systemdisk.img,format=raw"
|
||||
else
|
||||
echo "no recognised boot media" >2
|
||||
exit 1
|
||||
@@ -38,4 +38,10 @@ fi
|
||||
|
||||
echo "$ARGS" | grep -q systemdisk && qemu-img create -f raw systemdisk.img 256M
|
||||
|
||||
qemu-system-x86_64 -device virtio-rng-pci -serial stdio -vnc none -m 1024 $ARGS $*
|
||||
CMDLINE="$*"
|
||||
if [ -z "${CMDLINE}" ]
|
||||
then
|
||||
CMDLINE="console=ttyS0"
|
||||
fi
|
||||
|
||||
qemu-system-x86_64 -device virtio-rng-pci -serial stdio -vnc none -m 1024 -append "${CMDLINE}" $ARGS
|
||||
|
Reference in New Issue
Block a user