aboutsummaryrefslogtreecommitdiff
path: root/arch/riscv/conf/mkimage.sh
diff options
context:
space:
mode:
authorKimplul <kimi.h.kuparinen@gmail.com>2022-01-06 23:39:12 +0200
committerKimplul <kimi.h.kuparinen@gmail.com>2022-01-07 14:05:06 +0200
commit9cc125fb3cfdc2c8ae7153b5ae0fe705980835fb (patch)
treea1974f9513458acab0bd8d09758259b24b6d7d8c /arch/riscv/conf/mkimage.sh
parentf0eba93472e0afecc57180fc0d638eeef8e6f3c6 (diff)
downloadkmi-9cc125fb3cfdc2c8ae7153b5ae0fe705980835fb.tar.gz
kmi-9cc125fb3cfdc2c8ae7153b5ae0fe705980835fb.zip
Allow building with clang
+ Release mode is sort of broken, as lto doesn't work with linker relaxation and turning the relaxation off causes issues with the jump from init to kernel (as I've currently implemented it, could probably be fixed with a manual jump from assembly, I'll add it to my TODO list)
Diffstat (limited to 'arch/riscv/conf/mkimage.sh')
-rwxr-xr-xarch/riscv/conf/mkimage.sh31
1 files changed, 0 insertions, 31 deletions
diff --git a/arch/riscv/conf/mkimage.sh b/arch/riscv/conf/mkimage.sh
deleted file mode 100755
index 5a22d01..0000000
--- a/arch/riscv/conf/mkimage.sh
+++ /dev/null
@@ -1,31 +0,0 @@
-#!/bin/sh
-
-if [ ! -e fs ]; then
- mkdir fs
-fi
-
-if [ ! -e rootfs.img ]; then
- virt-make-fs --partition=mbr --type=vfat --size=10M fs rootfs.img
-fi
-
-
-SSIZE=$(fdisk -l rootfs.img | awk '$1=="Units:" {print $8}')
-OFFSET=$(fdisk -l rootfs.img | awk '$1=="rootfs.img1" {print $2}')
-mount -o loop,offset=$((${SSIZE}*${OFFSET})) rootfs.img fs
-
-# not entirely pleased with this solution, although eventually I should probably
-# move `run` out of the kernel repo and into some `aposos` repo with a runtime
-# and proper initrd etc. so this is good enough for now
-../u-boot-apos/tools/mkimage -f arch/riscv/conf/apos.its fs/apos.itb
-../u-boot-apos/tools/mkimage -A riscv -O apos -T script \
- -d arch/riscv/conf/boot.cmd fs/boot.scr
-
-umount -l fs
-
-qemu-system-riscv64 -machine virt \
- -kernel ../u-boot-apos/u-boot \
- -bios /usr/lib/riscv64-linux-gnu/opensbi/generic/fw_jump.elf \
- -device virtio-blk-device,drive=hd0 \
- -drive file=rootfs.img,format=raw,id=hd0 \
- -S -s -m 2G \
- -serial stdio