Initial commit

As of right now, rootfs.sh creates an initramfs that:
- boots linux
- builds mescc-tools-seed
- compiles blynn-compiler (from oriansj's fork)
This commit is contained in:
fosslinux 2020-12-17 10:19:25 +11:00
commit f0959ba2f4
8 changed files with 163 additions and 0 deletions

35
rootfs.sh Executable file
View file

@ -0,0 +1,35 @@
#!/bin/bash
set -ex
# Setup tmp
mkdir -p tmp/
sudo mount -t tmpfs -o size=8G tmpfs tmp
# Now copy everything over
# base: mescc-tools-seed
cp -r mescc-tools-seed/x86/* tmp
cp -r mescc-tools-seed/{M2-Planet,mes-m2,mescc-tools} tmp/
cp bootstrap-seeds/POSIX/x86/kaem-optional-seed tmp/init
cp bootstrap-seeds/POSIX/x86/kaem-optional-seed tmp/
cp -r bootstrap-seeds tmp/
mkdir tmp/bin
# blynn-compiler
pushd tmp
git clone ../blynn-compiler-oriansj blynn-compiler
cp ../blynn-compiler-extras/go.kaem blynn-compiler/
patch -Np0 -i ../blynn-compiler-extras/kaem.patch
mkdir blynn-compiler/{bin,generated}
popd
# General cleanup
find tmp -name .git -exec rm -rf \;
# initramfs
cd tmp
find . | cpio -H newc -o | gzip > initramfs.igz
qemu-system-x86_64 -enable-kvm -kernel ../kernel -initrd initramfs.igz -append console=ttyS0 -nographic -m 16G
# Cleanup
sudo umount tmp