Move script to create a Linux-based boot image into a sub-directory.
This commit is contained in:
Kartik Agaram 2020-01-01 19:38:50 -08:00
parent 65409d2312
commit f4bef91bd9
3 changed files with 5 additions and 6 deletions

View File

@ -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

View File

@ -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