From f4bef91bd97d7dee60a7718df7b77f8e24b24846 Mon Sep 17 00:00:00 2001 From: Kartik Agaram Date: Wed, 1 Jan 2020 19:38:50 -0800 Subject: [PATCH] 5859 Move script to create a Linux-based boot image into a sub-directory. --- Readme.md | 6 +++--- gen_linux_iso => tools/iso/linux | 5 ++--- syslinux.cfg => tools/iso/syslinux.cfg | 0 3 files changed, 5 insertions(+), 6 deletions(-) rename gen_linux_iso => tools/iso/linux (95%) rename syslinux.cfg => tools/iso/syslinux.cfg (100%) diff --git a/Readme.md b/Readme.md index f1b347ed..7a7e3b2b 100644 --- a/Readme.md +++ b/Readme.md @@ -149,13 +149,13 @@ work on a cloud server.) You can also package up SubX binaries with a Linux kernel and run them on either Qemu or [a cloud server that supports custom images](http://akkartik.name/post/iso-on-linode). -(Takes 12 minutes with 8GB RAM. Requires 12 million LoC of C for the Linux +(Takes 12 minutes with 2GB RAM. Requires 12 million LoC of C for the Linux kernel; that number will gradually go down.) ```sh $ sudo apt install build-essential flex bison wget libelf-dev libssl-dev xorriso - $ ./gen_linux_iso init.linux apps/ex6.subx - $ qemu-system-x86_64 -m 256M -cdrom mu.iso -boot d + $ tools/iso/linux init.linux apps/ex6.subx + $ qemu-system-x86_64 -m 256M -cdrom mu_linux.iso -boot d ``` ## What it looks like diff --git a/gen_linux_iso b/tools/iso/linux similarity index 95% rename from gen_linux_iso rename to tools/iso/linux index 6a3d6b10..ac0f720b 100755 --- a/gen_linux_iso +++ b/tools/iso/linux @@ -2,7 +2,7 @@ # Build one or more .subx files into an ELF binary, and package it up into a # bootable ISO image with a Linux kernel. # -# Must be run on Linux. +# Must be run on Linux, and from the top-level mu/ directory. # # Dependencies: # apt install build-essential flex bison wget libelf-dev libssl-dev xorriso @@ -20,7 +20,6 @@ fi echo "=== building SubX binary" ./translate_subx $* mv a.elf init -chmod +x init echo "=== constructing initramfs out of SubX binary" rm -rf tmp_linux/isoimage @@ -45,7 +44,7 @@ echo "=== unpacking syslinux" tar xf tmp_linux/syslinux-*.tar.xz -C tmp_linux mkdir -p tmp_linux/isoimage/boot/syslinux -cp syslinux.cfg \ +cp tools/iso/syslinux.cfg \ tmp_linux/syslinux-*/bios/core/isolinux.bin \ tmp_linux/syslinux-*/bios/com32/elflink/ldlinux/ldlinux.c32 \ tmp_linux/isoimage/boot/syslinux diff --git a/syslinux.cfg b/tools/iso/syslinux.cfg similarity index 100% rename from syslinux.cfg rename to tools/iso/syslinux.cfg