From 5269566a6c37151015dea0d4cf78f341cca0669c Mon Sep 17 00:00:00 2001 From: Leah Woods Date: Tue, 17 May 2016 03:19:29 -0400 Subject: Implement SeaGRUB and make it the default payload on all current GRUB boards --- (limited to 'resources/scripts/helpers/build') diff --git a/resources/scripts/helpers/build/clean/grub b/resources/scripts/helpers/build/clean/grub index fb16ffb..8e87b47 100755 --- a/resources/scripts/helpers/build/clean/grub +++ b/resources/scripts/helpers/build/clean/grub @@ -2,7 +2,7 @@ # helper script: clean the dependencies that were built in GRUB # -# Copyright (C) 2014, 2015 Leah Woods +# Copyright (C) 2014, 2015, 2016 Leah Woods # Copyright (C) 2015 Klemens Nanni # # This program is free software: you can redistribute it and/or modify @@ -29,4 +29,7 @@ printf "Cleaning the previous build of GRUB\n" # clean GURB [ -d grub/Makefile ] && make -C grub distclean +# Also clean SeaBIOS +./build clean seabios + printf "\n\n" diff --git a/resources/scripts/helpers/build/module/grub b/resources/scripts/helpers/build/module/grub index fb10e6c..8f74135 100755 --- a/resources/scripts/helpers/build/module/grub +++ b/resources/scripts/helpers/build/module/grub @@ -52,3 +52,6 @@ cd grub/ ./configure --with-platform=coreboot make -j${cores} ) + +# Also build SeaBIOS, which we use with GRUB to make SeaGRUB +./build module seabios diff --git a/resources/scripts/helpers/build/roms/withgrub b/resources/scripts/helpers/build/roms/withgrub index bbf3445..3025d97 100755 --- a/resources/scripts/helpers/build/roms/withgrub +++ b/resources/scripts/helpers/build/roms/withgrub @@ -1,7 +1,7 @@ #!/bin/bash # -# helper script: build ROM images with GRUB and put them in ./bin/ +# helper script: build ROM images with SeaGRUB and put them in ./bin/ # # Copyright (C) 2014, 2015, 2016 Leah Woods # Copyright (C) 2015 Klemens Nanni @@ -120,6 +120,7 @@ fi # The GRUB files are no longer needed rm -f "coreboot/grub"*.{elf,cfg} +rm -f "coreboot/seabios"*.elf rm -f "coreboot/"*/*/*.{elf,cfg} printf "\n\n" diff --git a/resources/scripts/helpers/build/roms/withgrub_helper b/resources/scripts/helpers/build/roms/withgrub_helper index 0d823f3..2ceae24 100755 --- a/resources/scripts/helpers/build/roms/withgrub_helper +++ b/resources/scripts/helpers/build/roms/withgrub_helper @@ -1,6 +1,6 @@ #!/bin/bash -# helper script: create ROM images for a given system, with GRUB +# helper script: create ROM images for a given system, with SeaGRUB # # Copyright (C) 2014, 2015, 2016 Leah Woods # Copyright (C) 2015 Klemens Nanni @@ -69,6 +69,7 @@ git checkout ${branchname} # Make sure to remove these first rm -f "grub."*{elf,cfg} +rm -f "seabios"*.elf printf 'libreboot-%s\n' "${version}" > ".coreboot-version" # needed for reproducible builds in coreboot @@ -109,9 +110,32 @@ do make clean mv "config_${romtype}" ".config" cp "../../grub_${romtype}.elf" "grub.elf" + cp "../../../seabios/out/bios.bin.elf" "seabios.elf" make -j${cores} - rm -f "grub.elf" mv "build/coreboot.rom" "${boardtarget}_${romtype}.rom" + + # We dont need seabios.elf anymore + rm -f "seabios.elf" + + # Add the grub.elf to CBFS + ./util/cbfstool/cbfstool "${boardtarget}_${romtype}.rom" add -f grub.elf -c lzma -n img/grub2.lzma -t raw + # we dont need that grub.elf now + rm -f "grub.elf" + + # Set bootorder so that seabios loads grub by default + printf "/rom@img/grub2\n" > bootorder + ./util/cbfstool/cbfstool "${boardtarget}_${romtype}.rom" add -f bootorder -n bootorder -t raw + rm -f bootorder + + # Add 0s delay to seabios, so that the user is not burdened by seeing + # that horrible interface that seabios has + dd if=/dev/zero of=zero bs=1 count=1 conv=notrunc + ./util/cbfstool/cbfstool "${boardtarget}_${romtype}.rom" add -f zero -n etc/show-boot-menu -t raw + rm -f zero + + # SeaVGABIOS stuff + ./util/cbfstool/cbfstool "${boardtarget}_${romtype}.rom" add -f ../../../seabios/out/vgabios.bin -n vgaroms/vgabios.bin -t raw + # .config no longer needed rm -f ".config" -- cgit v0.9.1