6610 - tweak the Linux boot image generator

So far we hardcoded the translation process and it only supported SubX.
Now we pass in an ELF binary and outsource how it's generated.
This commit is contained in:
Kartik Agaram 2020-07-05 10:38:18 -07:00
parent ff856aa0ba
commit cf28645f8a
1 changed files with 6 additions and 8 deletions

View File

@ -1,6 +1,6 @@
#!/bin/sh
# Build one or more .subx files into an ELF binary, and package it up into a
# bootable ISO image with a Linux kernel.
# Package up an ELF binary generated by Mu into a bootable ISO image with a
# Linux kernel.
#
# Must be run on Linux, and from the top-level mu/ directory.
#
@ -11,20 +11,18 @@
set -e
if [ $# -eq 0 ]
if [ $# -ne 1 ]
then
echo "Usage: `basename $0` file.subx ..."
echo "Usage: `basename $0` <elf file>"
exit 1
fi
echo "=== building SubX binary"
./translate_subx $*
mv a.elf init
echo "=== constructing initramfs out of SubX binary"
rm -rf tmp_linux/isoimage
mkdir -p tmp_linux/isoimage/boot
cp -i $1 init
echo init | cpio -R root:root -H newc -o | xz -9 --check=none > tmp_linux/isoimage/boot/rootfs.xz
rm init
if [ ! -d kernel.linux ]
then