From 2909df32ac0b1cb6d6afe155232e2404ffad3f65 Mon Sep 17 00:00:00 2001 From: Francis Rowe Date: Fri, 21 Nov 2014 03:43:35 +0000 Subject: Move CBFS files to GRUB memdisk, except grub.cfg and grubtest.cfg Set the GRUB configs to use (memdisk) instead of (cbfsdisk) for these files. This reduces the space used in CBFS because coreboot compresses it's payloads with LZMA by default. Most users will only want to use cbfstool to modify the grub.cfg or grubtest.cfg. --- buildrom-withgrub | 94 ++++++++++++++++++------------------------------------- 1 file changed, 31 insertions(+), 63 deletions(-) (limited to 'buildrom-withgrub') diff --git a/buildrom-withgrub b/buildrom-withgrub index 1f06038..489fac6 100755 --- a/buildrom-withgrub +++ b/buildrom-withgrub @@ -31,68 +31,38 @@ if (( $# != 1 )); then exit fi -# Build the ROM images: -# ---------------------------------------------------------------------------------------------------------------------- - cd coreboot -rm -rf .config - -# prepare libreboot configuration and build it -# it is assumed that these configs use coreboot text-mode -# instead of coreboot framebuffer, by default -cp ../resources/libreboot/config/"$1"/config .config -# coreboot.rom will appear under ./coreboot/build -make -# move it out (we'll be cleaning the build) -mv build/coreboot.rom "$1"_txtmode.rom -# clean the build -make clean - -# Now prepare ROM images that use coreboot vesa framebuffer instead of text mode. -mv .config config_txtmode -# create .config for vesa framebuffer (instead of text mode) -sed 's/# CONFIG_FRAMEBUFFER_KEEP_VESA_MODE is not set/CONFIG_FRAMEBUFFER_KEEP_VESA_MODE=y/' < config_txtmode > .config -# build new ROM -make -mv build/coreboot.rom "$1"_vesafb.rom -# clean coreboot (again) -make clean - -# copies no longer needed -rm -rf .config config_txtmode - -# Insert files/configurations and perform operations that are common on all images -# --------------------------------------------------------------------------------------------------------------- - -# for rom in "$1"_vesafb.rom "$1"_txtmode.rom -# do - # Nothing to do here -# done - -# Insert files/configurations and perform operations that are common on "$1"_vesafb.rom (coreboot framebuffer configuration) -# --------------------------------------------------------------------------------------------------------------- - -# Add background image and font -./util/cbfstool/cbfstool "$1"_vesafb.rom add -f ../resources/grub/background/background.jpg -n background.jpg -t raw -# ./util/cbfstool/cbfstool "$1"_vesafb.rom add -f ../resources/grub/background/gnulove.jpg -n gnulove.jpg -t raw -./util/cbfstool/cbfstool "$1"_vesafb.rom add -f ../resources/grub/font/dejavusansmono.pf2 -n dejavusansmono.pf2 -t raw - -# Insert files/configurations and perform operations that are common on "$1"_txtmode.rom (coreboot text mode) -# --------------------------------------------------------------------------------------------------------------- -# Add memtest86+ -./util/cbfstool/cbfstool "$1"_txtmode.rom add -f ../memtest86+-5.01/memtest -n memtest -t raw - -# Add GRUB Invaders -./util/cbfstool/cbfstool "$1"_txtmode.rom add -f ../grubinvaders/invaders -n invaders -t raw -./util/cbfstool/cbfstool "$1"_txtmode.rom add -f ../grubinvaders/invaders.exec -n invaders.exec -t raw - -# Generate the GRUB configurations and add them to each ROM image as grub.cfg and grubtest.cfg +# Build ROM images with text-mode and corebootfb modes. # --------------------------------------------------------------------------------------------------------------- -for keymap in $(ls ../resources/utilities/grub-assemble/keymap/original) +for romtype in txtmode vesafb do - for romtype in txtmode vesafb + # Build the GRUB payload (ELF executable) + # and add it to coreboot directory: + cd ../resources/utilities/grub-assemble + ./gen."$romtype".sh + rm -rf ../../../coreboot/grub.elf + mv grub.elf ../../../coreboot/ + cd ../../../coreboot + + # Build coreboot ROM image + rm -rf .config + make clean + cp ../resources/libreboot/config/"$1"/config .config + if [ "$romtype" = "vesafb" ] + then + mv .config config_txtmode + sed 's/# CONFIG_FRAMEBUFFER_KEEP_VESA_MODE is not set/CONFIG_FRAMEBUFFER_KEEP_VESA_MODE=y/' < config_txtmode > .config + rm -rf config_txtmode + fi + make + mv build/coreboot.rom "$1"_"$romtype".rom + # .config no longer needed + rm -rf .config + + # Generate each type of GRUB configuration for this type of ROM image + for keymap in $(ls ../resources/utilities/grub-assemble/keymap/original) do # copy the images based on the keymap cp "$1"_"$romtype".rom "$1"_"$keymap"_"$romtype".rom @@ -115,18 +85,16 @@ do # Insert grub test config into the image (for the user to test modifications to before modifying the main one) ./util/cbfstool/cbfstool "$1"_"$keymap"_"$romtype".rom add -f grub_"$keymap"_"$romtype"_test.cfg -n grubtest.cfg -t raw done + + rm -rf "$1"_"$romtype".rom done -# we don't need the generic rom images anymore -rm -rf "$1"_txtmode.rom -rm -rf "$1"_vesafb.rom +# Now we clean up and prepare the bin directory containing all the images +# ---------------------------------------------------------------------------------------------------------------------------- # we don't need the grub configs anymore rm -rf grub*cfg -# Now we clean up and prepare the bin directory containing all the images -# ---------------------------------------------------------------------------------------------------------------------------- - # prepare directory for new ROM images rm -rf "$1" mkdir "$1" -- cgit v1.2.3-54-g00ecf