Running OccamBSD on non-HAMMER platforms
antranigv opened this issue · comments
Currently, if I run ./occambsd.sh -p some-profile.txt
on a non-AMD64 machine, I get an error like this.
buildkernel failed
root@devbsd14:~/occambsd # tail -5 /tmp/occambsd/logs/build-kernel.log
/tmp/occambsd/OCCAMBSD: unknown option "HAMMER"
make[1]: stopped in /usr/src
make: stopped in /usr/src
Obviously, the issue is that we're setting the CPU to HAMMER, while we're on a non-AMD64 machine.
I did a simple change which is
-echo "cpu HAMMER" > $work_dir/OCCAMBSD
+case "$(uname -m)" in
+ arm64) CPU=ARM64;;
+ amd64) CPU=HAMMER;;
+esac
+
+echo "cpu ${CPU}" > $work_dir/OCCAMBSD
And now I get
buildkernel failed
root@devbsd14:~/occambsd # tail -10 /tmp/occambsd/logs/build-kernel.log
WARNING: duplicate device `scbus' encountered in /tmp/occambsd/OCCAMBSD
config: Error: device "aesni" is unknown
config: Error: device "atkbdc" is unknown
config: Error: device "psm" is unknown
config: Error: device "vga" is unknown
config: 4 errors
make[1]: stopped in /usr/src
make: stopped in /usr/src
Clearly, OccamBSD is AMD64 specific.
Digging into the code I found things such as
Line 92 in 50eca54
Line 108 in 50eca54
Lines 144 to 171 in 50eca54
And the list goes on.
Maybe under this issue we can discuss how can we make OccamBSD platform-agnostic, which steps we need to take and test it on multiple systems.
Personally, I AMD64 and ARM64 as well as IBM Power8, which should cover most of the cases.
The complex part is going to be adding some grepping and what-not to get the list of the modules that we need.
Fixed. Please test.
ARM uses kernel includes while the other platforms support kernel options and devices.
I have added support for this and it builds, but I have not tried it on QEMU or hardware.
The only bug I see is that the CD-ROM step fails with:
install -T release -o root -g wheel -m 555 cc_cdg.ko /usr/obj/usr/src/arm64.aarch64/release/dist/kernel/boot/kernel/
install: cc_cdg.ko: No such file or directory
*** Error code 71
I did not investigate to see if the ARM* CD-ROM images are built differently (like the RPi images).
It is HIGHLY LIKELY that you will need to modify the profile-arm64-minimum.txt profile to get it to boot, but, the infrastructure is there.