From e4ab26d8ee2e9e2e24d47852474d453b19cb0ced Mon Sep 17 00:00:00 2001 From: Ivan Davidov Date: Sat, 23 Jun 2018 21:28:41 +0300 Subject: [PATCH] Updated the core components. Added option to run MLL in QEMU console mode. This is suitable for remote SSH work. --- src/.config | 6 +-- src/02_build_kernel.sh | 3 ++ .../bios/boot/syslinux/syslinux.cfg | 26 ++++++----- src/qemu-bios-console.sh | 44 +++++++++++++++++++ src/qemu-bios.sh | 4 +- src/qemu-uefi.sh | 4 +- 6 files changed, 70 insertions(+), 17 deletions(-) create mode 100755 src/qemu-bios-console.sh diff --git a/src/.config b/src/.config index ca32b0988..5b1e0f452 100644 --- a/src/.config +++ b/src/.config @@ -11,7 +11,7 @@ # # http://kernel.org # -KERNEL_SOURCE_URL=http://kernel.org/pub/linux/kernel/v4.x/linux-4.16.5.tar.xz +KERNEL_SOURCE_URL=http://kernel.org/pub/linux/kernel/v4.x/linux-4.17.2.tar.xz # You can find the latest GNU C library source bundles here: # @@ -23,7 +23,7 @@ GLIBC_SOURCE_URL=http://ftp.gnu.org/gnu/glibc/glibc-2.27.tar.bz2 # # http://busybox.net # -BUSYBOX_SOURCE_URL=http://busybox.net/downloads/busybox-1.28.3.tar.bz2 +BUSYBOX_SOURCE_URL=http://busybox.net/downloads/busybox-1.28.4.tar.bz2 # You can find the latest Syslinux source bundles here: # @@ -37,7 +37,7 @@ SYSLINUX_SOURCE_URL=http://kernel.org/pub/linux/utils/boot/syslinux/syslinux-6.0 # # http://github.com/ivandavidov/systemd-boot # -SYSTEMD-BOOT_SOURCE_URL=https://github.com/ivandavidov/systemd-boot/releases/download/systemd-boot_10-Dec-2017/systemd-boot_10-Dec-2017.tar.xz +SYSTEMD-BOOT_SOURCE_URL=https://github.com/ivandavidov/systemd-boot/releases/download/systemd-boot_26-May-2018/systemd-boot_26-May-2018.tar.xz #################################################### # # diff --git a/src/02_build_kernel.sh b/src/02_build_kernel.sh index 80b0e1fa5..a9bda637e 100755 --- a/src/02_build_kernel.sh +++ b/src/02_build_kernel.sh @@ -49,6 +49,9 @@ else # Turn on NFS export feature by default (4.16+). echo "# CONFIG_OVERLAY_FS_NFS_EXPORT is not set" >> .config + # Auto enable inode number mapping (4.17+). + echo "CONFIG_OVERLAY_FS_XINO_AUTO=y" >> .config + # Step 1 - disable all active kernel compression options (should be only one). sed -i "s/.*\\(CONFIG_KERNEL_.*\\)=y/\\#\\ \\1 is not set/" .config diff --git a/src/minimal_boot/bios/boot/syslinux/syslinux.cfg b/src/minimal_boot/bios/boot/syslinux/syslinux.cfg index b00817be8..4c31f2247 100644 --- a/src/minimal_boot/bios/boot/syslinux/syslinux.cfg +++ b/src/minimal_boot/bios/boot/syslinux/syslinux.cfg @@ -1,6 +1,7 @@ +SERIAL 0 PROMPT 1 TIMEOUT 50 -DEFAULT mll +DEFAULT vga SAY SAY ################################################################## @@ -11,14 +12,19 @@ SAY # Press to view available boot entries or enter Syslinux # SAY # commands directly. # SAY # # SAY ################################################################## -SAY +SAY -LABEL mll - LINUX /boot/kernel.xz - APPEND vga=ask - INITRD /boot/rootfs.xz +LABEL vga + LINUX /boot/kernel.xz + APPEND vga=ask + INITRD /boot/rootfs.xz -LABEL mll_nomodeset - LINUX /boot/kernel.xz - APPEND vga=ask nomodeset - INITRD /boot/rootfs.xz +LABEL vga_nomodeset + LINUX /boot/kernel.xz + APPEND vga=ask nomodeset + INITRD /boot/rootfs.xz + +LABEL console + LINUX /boot/kernel.xz + APPEND console=tty0 console=ttyS0 + INITRD /boot/rootfs.xz diff --git a/src/qemu-bios-console.sh b/src/qemu-bios-console.sh new file mode 100755 index 000000000..d30be8fc5 --- /dev/null +++ b/src/qemu-bios-console.sh @@ -0,0 +1,44 @@ +#!/bin/sh + +# Use this script without arguments to run the generated ISO image with QEMU. +# If you pass '-hdd' or '-h' the virtual hard disk 'hdd.img' will be attached. +# Note that this virtual hard disk has to be created in advance. You can use +# the script 'generate_hdd.sh' to generate the hard disk image file. Once you +# have hard disk image, you can use it as overlay device and persist all your +# changes. See the '.config' file for more information on the overlay support. +# +# If you get kernel panic with message "No working init found", then try to +# increase the RAM from 128M to 256M. +# +# 'Ctrl + A' then 'C' to toggle between guest system console and QEMU monitor. +# 'Ctrl + A' then 'X' to terminate the QEMU instance. +# +# In nographic mode, qemu disables virtual console. To obtain a system console, +# the virtual serial port can be used. In this mode, the virtual serial port is +# redirected to the host's stdio by default. Pass "console=ttySn" (PC) or +# "console=ttyAMAn" (on ARM) where n is 0, 1, ... on the kernel command line. + +cat << CEOF + + 'Ctrl + A' then 'C' to toggle between guest system console and QEMU monitor. + 'Ctrl + A' then 'X' to terminate the QEMU instance. + + Type 'console' in the boot menu to run MLL in QEMU console mode. + +CEOF + +if [ "`uname -m`" = "x86_64" ] ; then + ARCH="x86_64" +else + ARCH="i386" +fi + +cmd="qemu-system-$ARCH -m 128M -cdrom minimal_linux_live.iso -boot d -nographic" + +if [ "$1" = "-hdd" -o "$1" = "-h" ] ; then + echo "Starting QEMU with attached ISO image and hard disk." + echo 'console' | $cmd -hda hdd.img +else + echo "Starting QEMU with attached ISO image." + echo 'console' | $cmd +fi diff --git a/src/qemu-bios.sh b/src/qemu-bios.sh index ec7892740..5a499f006 100755 --- a/src/qemu-bios.sh +++ b/src/qemu-bios.sh @@ -20,8 +20,8 @@ cmd="qemu-system-$ARCH -m 128M -cdrom minimal_linux_live.iso -boot d -vga std" if [ "$1" = "-hdd" -o "$1" = "-h" ] ; then echo "Starting QEMU with attached ISO image and hard disk." - $cmd -hda hdd.img > /dev/null 2>&1 & + $cmd -hda hdd.img else echo "Starting QEMU with attached ISO image." - $cmd > /dev/null 2>&1 & + $cmd fi diff --git a/src/qemu-uefi.sh b/src/qemu-uefi.sh index cfe4083b3..704a2439c 100755 --- a/src/qemu-uefi.sh +++ b/src/qemu-uefi.sh @@ -27,8 +27,8 @@ cmd="qemu-system-$ARCH -pflash $OVMF_LOCATION -m 128M -cdrom minimal_linux_live. if [ "$1" = "-hdd" -o "$1" = "-h" ] ; then echo "Starting QEMU with attached ISO image and hard disk." - $cmd -hda hdd.img > /dev/null 2>&1 & + $cmd -hda hdd.img else echo "Starting QEMU with attached ISO image." - $cmd > /dev/null 2>&1 & + $cmd fi