From: Ralf Neeb Date: Sat, 2 Jul 2016 11:28:02 +0000 (+0200) Subject: made minix3 bootable via EFI X-Git-Url: http://zhaoyanbai.com/repos/?a=commitdiff_plain;h=1717959aeb715ed8fa812a02054cfda1966ed9fd;p=minix.git made minix3 bootable via EFI Change-Id: I61d995e240deb6ebb3027d3ab07e6e3759e52b01 --- diff --git a/releasetools/image.functions b/releasetools/image.functions index 5423a425a..de0c8c0d2 100644 --- a/releasetools/image.functions +++ b/releasetools/image.functions @@ -245,6 +245,85 @@ create_protos() done } +# +# Clone grub repository and build efi boot binary +# +fetch_and_build_grub() +{ + if [ -d ${RELEASETOOLSDIR}/grub ] + then + echo grub is already checked out + else + git clone git://git.savannah.gnu.org/grub.git ${RELEASETOOLSDIR}/grub + pushd ${RELEASETOOLSDIR}/grub + # most recent known working commit at the time of writing + git clone b524fa27f56381bb0efa4944e36f50265113aee5 + ./autogen.sh + ./configure --with-platform=efi --target=i386 + make clean + make -j ${JOBS} + cd grub-core + ../grub-mkimage -v -d . -o booti386.efi -O i386-efi -p /boot/efi normal part_msdos fat chain boot configfile multiboot minix3 gzio efi_uga + ls -l booti386.efi + popd + fi +} + +# +# Create grub.cfg for efi boot +# +create_grub_cfg() +{ + cat > ${EFI_DIR}/boot/efi/grub.cfg < ${OBJ}/efi.img + EFI_START=$((${HOME_START} + ${_HOME_SIZE})) + echo " * EFI" + ${CROSS_TOOLS}/nbmakefs -t msdos -s ${EFI_SIZE} -o "F=32,c=1" ${OBJ}/efi.img ${EFI_DIR} + dd if=${OBJ}/efi.img >> ${IMG} + ${CROSS_TOOLS}/nbpartition -m ${IMG} ${BOOTXX_SECS} 81:${_ROOT_SIZE}* 81:${_USR_SIZE} 81:${_HOME_SIZE} EF:1+ +else + ${CROSS_TOOLS}/nbpartition -m ${IMG} ${BOOTXX_SECS} 81:${_ROOT_SIZE}* 81:${_USR_SIZE} 81:${_HOME_SIZE} +fi + ${CROSS_TOOLS}/nbinstallboot -f -m ${ARCH} ${IMG} ${DESTDIR}/usr/mdec/bootxx_minixfs3 echo "" @@ -108,3 +132,5 @@ echo "qemu-system-i386 --enable-kvm -m 256 -hda `pwd`/${IMG}" echo "" echo "To boot this image on kvm:" echo "cd ${MODDIR} && qemu-system-i386 --enable-kvm -m 256M -kernel kernel -append \"rootdevname=c0d0p0\" -initrd \"${mods}\" -hda `pwd`/${IMG}" +echo "To boot this image on kvm with EFI (tianocore OVMF):" +echo "qemu-system-i386 -L . -bios OVMF-i32.fd -m 256M -drive file=minix_x86.img,if=ide,format=raw"