I'm trying to integrate OpenBIOS to general rom building framework in QEMU but I have some problems with 'make'.
For some reason, build succeeds if run 'make' in 'obj-amd64/pc-bios/openbios' but fails in top level 'obj-amd64'. Maybe some QEMU makefile variables leak to OpenBIOS make? Using a shell in the middle didn't help. GEN config-target.h (sh -c "make -C build build-verbose") Building... GEN openbios/target/include/openbios-version.h GEN openbios/forth/version.fs HOSTCC openbios/host/kernel/dict.o /src/qemu/roms/openbios/kernel/dict.c:320: fatal error: opening dependency file /.d: Read-only file system compilation terminated. make[3]: *** [host/kernel/dict.o] Error 1 make[2]: *** [build-verbose] Error 1 make[1]: *** [all] Error 2 make: *** [romsubdir-openbios] Error 2 make: Leaving directory `/src/qemu/obj-amd64' The problem is with -MF $(*D)/$(*F).d which expands to /.d. How is that? A patch is needed for OpenBIOS for complete out-of-tree build support (sent to openbios list). This is what I have for QEMU at the moment (no probing, error handling, installing etc): diff --git a/.gitmodules b/.gitmodules index 7884471..c3faa38 100644 --- a/.gitmodules +++ b/.gitmodules @@ -10,3 +10,6 @@ [submodule "roms/ipxe"] path = roms/ipxe url = git://git.qemu.org/ipxe.git +[submodule "roms/openbios"] + path = roms/openbios + url = git://git.qemu.org/openbios.git diff --git a/configure b/configure index 1340c33..c408ffa 100755 --- a/configure +++ b/configure @@ -2646,6 +2646,7 @@ fi if test "$cpu" = "ppc64" -a "$targetos" != "Darwin" ; then roms="$roms spapr-rtas" fi +roms="$roms openbios" echo "Install prefix $prefix" echo "BIOS directory `eval echo $datadir`" @@ -3595,7 +3596,7 @@ echo "QEMU_INCLUDES+=$includes" >> $config_target_mak done # for target in $targets # build tree in object directory in case the source is not in the current directory -DIRS="tests tests/cris slirp audio block net pc-bios/optionrom" +DIRS="tests tests/cris slirp audio block net pc-bios/optionrom pc-bios/openbios" DIRS="$DIRS pc-bios/spapr-rtas" DIRS="$DIRS roms/seabios roms/vgabios" DIRS="$DIRS fsdev ui" @@ -3605,6 +3606,7 @@ FILES="Makefile tests/Makefile" FILES="$FILES tests/cris/Makefile tests/cris/.gdbinit" FILES="$FILES pc-bios/optionrom/Makefile pc-bios/keymaps" FILES="$FILES pc-bios/spapr-rtas/Makefile" +FILES="$FILES pc-bios/openbios/Makefile" FILES="$FILES roms/seabios/Makefile roms/vgabios/Makefile" for bios_file in $source_path/pc-bios/*.bin $source_path/pc-bios/*.rom $source_path/pc-bios/*.dtb $source_path/pc-bios/openbios-*; do FILES="$FILES pc-bios/`basename $bios_file`" @@ -3629,6 +3631,9 @@ for rom in seabios vgabios ; do echo "LD=$ld" >> $config_mak done +echo configuring OpenBIOS +(cd pc-bios/openbios/build && $source_path/roms/openbios/config/scripts/switch-arch sparc32 sparc64 ppc) + for hwlib in 32 64; do d=libhw$hwlib mkdir -p $d diff --git a/pc-bios/openbios/Makefile b/pc-bios/openbios/Makefile new file mode 100644 index 0000000..f019de5 --- /dev/null +++ b/pc-bios/openbios/Makefile @@ -0,0 +1,5 @@ +all: + (sh -c "make -C build build-verbose") + +clean: + make -C build $@ diff --git a/roms/openbios b/roms/openbios new file mode 160000 index 0000000..ff61d97 --- /dev/null +++ b/roms/openbios @@ -0,0 +1 @@ +Subproject commit ff61d973e5a4a68b29e485b3f88e6a2d1d96cf45-dirty