aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rwxr-xr-xbuild48
-rwxr-xr-xbuildrom-withgrub94
-rw-r--r--resources/grub/config/extra/vesafb.cfg4
-rw-r--r--resources/grub/config/menuentries/txtmode.cfg4
-rwxr-xr-xresources/utilities/grub-assemble/gen.txtmode.sh (renamed from resources/utilities/grub-assemble/gen.sh)7
-rwxr-xr-xresources/utilities/grub-assemble/gen.vesafb.sh32
6 files changed, 78 insertions, 111 deletions
diff --git a/build b/build
index 64d42c25..284da34a 100755
--- a/build
+++ b/build
@@ -19,58 +19,22 @@
# along with this program. If not, see <http://www.gnu.org/licenses/>.
#
+set -u -e -v
+
# Build the ROM's
# MAKE SURE THAT YOU RAN "buildall" OR "builddeps" *AT LEAST ONCE*
# BEFORE RUNNING THIS!
-set -u -e -v
-
-echo "running 'make clean' in coreboot"
-
-# prepare coreboot
-cd coreboot
-
-# run "make clean" in coreboot (will re-build later)
-make clean
-rm -rf grub.elf
-
-# come back to main directory
-cd ../
-
-echo "finished running 'make clean' in coreboot"
-
-# Build the GRUB payload (ELF executable):
-# ----------------------------------------------------------------------------------------------------------------------
-
-echo "generating grub.elf payload"
-
-cd resources/utilities/grub-assemble
-
-# Generate grub.elf inside the directory
-./gen.sh
-
-# Replace the old one
-rm -rf ../../../coreboot/grub.elf
-mv grub.elf ../../../coreboot/
-
-# come back to main directory
-cd ../../../
-
-echo "finished generating grub.elf payload (it's now in coreboot/ directory)"
-
-# Build the ROM's (for flashing)
-# ----------------------------------------------------------------------------------------------------------------------
-
# ROM images for supported Thinkpads
# (x60 also means x60s)
-for board in x60 t60 x60t
+for i945lenovoboard in x60 t60 x60t
do
# Build the ROM (with GRUB payload)
- ./buildrom-withgrub $board
+ ./buildrom-withgrub $i945lenovoboard
# These are needed for the 'bucts' workarounds on X60/T60
- cd bin/$board
+ cd bin/$i945lenovoboard
for rom in $(find -type f)
do
dd if=$rom of=top64k.bin bs=1 skip=$[$(stat -c %s $rom) - 0x10000] count=64k
@@ -84,7 +48,5 @@ done
# build macbook21 rom
./buildrom-withgrub macbook21
-echo "BUILD COMPLETE. ROM IMAGES ARE IN ./bin/"
-
# ------------------- DONE ----------------------
diff --git a/buildrom-withgrub b/buildrom-withgrub
index 1f060381..489fac6b 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"
diff --git a/resources/grub/config/extra/vesafb.cfg b/resources/grub/config/extra/vesafb.cfg
index bcad5cbc..bf56ced1 100644
--- a/resources/grub/config/extra/vesafb.cfg
+++ b/resources/grub/config/extra/vesafb.cfg
@@ -1,5 +1,5 @@
insmod jpeg
-background_image (cbfsdisk)/background.jpg
-loadfont (cbfsdisk)/dejavusansmono.pf2
+background_image (memdisk)/background.jpg
+loadfont (memdisk)/dejavusansmono.pf2
diff --git a/resources/grub/config/menuentries/txtmode.cfg b/resources/grub/config/menuentries/txtmode.cfg
index 087886ef..ded51bd3 100644
--- a/resources/grub/config/menuentries/txtmode.cfg
+++ b/resources/grub/config/menuentries/txtmode.cfg
@@ -1,9 +1,9 @@
menuentry 'Load GRUB Invaders' {
- set root='cbfsdisk'
+ set root='memdisk'
chainloader /invaders.exec
}
menuentry 'Load MemTest86+' {
- set root='cbfsdisk'
+ set root='memdisk'
chainloader /memtest
}
diff --git a/resources/utilities/grub-assemble/gen.sh b/resources/utilities/grub-assemble/gen.txtmode.sh
index fb1896bc..cfe74821 100755
--- a/resources/utilities/grub-assemble/gen.sh
+++ b/resources/utilities/grub-assemble/gen.txtmode.sh
@@ -17,6 +17,8 @@ grub_install_modules="adler32 all_video archelp ata backtrace bitmap bitmap_scal
# Modules (and always loaded)
grub_modules="acpi ahci at_keyboard boot cat cbfs cbls cbtime chain cmosdump cmostest cbmemc crypto cryptodisk configfile datehook date datetime diskfilter disk echo ext2 ehci fat halt help iorw iso9660 keystatus linux loopback ls lsacpi lsmmap lspci luks lvm memdisk minicmd memrw morse normal ohci part_gpt part_msdos password password_pbkdf2 pbkdf2 pcidump pci play probe reboot serial terminal test usb_keyboard usbms uhci gcry_arcfour gcry_blowfish gcry_camellia gcry_cast5 gcry_crc gcry_des gcry_dsa gcry_idea gcry_md4 gcry_md5 gcry_rfc2268 gcry_rijndael gcry_rmd160 gcry_rsa gcry_seed gcry_serpent gcry_sha1 gcry_sha256 gcry_sha512 gcry_tiger gcry_twofish gcry_whirlpool hdparm regexp spkmodem syslinuxcfg usb verify videoinfo videotest xfs btrfs zfs sfs romfs reiserfs nilfs2 minix_be minix3_be minix3 minix2_be minix2 minix jfs hfsplus hfs bfs afs affs gfxmenu gfxterm_background gfxterm_menu jpeg png tga pata"
+pwd
+
# Generate the grub.elf
$grubdir/grub-mkstandalone \
--grub-mkimage=$grubdir/grub-mkimage \
@@ -26,5 +28,8 @@ $grubdir/grub-mkstandalone \
--fonts= --themes= --locales= \
--modules="$grub_modules" \
--install-modules="$grub_install_modules" \
- /boot/grub/grub.cfg=../../../resources/grub/config/grub_memdisk.cfg \
+ /boot/grub/grub.cfg="../../../resources/grub/config/grub_memdisk.cfg" \
+ /memtest="../../../memtest86+-5.01/memtest" \
+ /invaders.exec="../../../grubinvaders/invaders.exec" \
$(./grub_memdisk_keymap) \
+
diff --git a/resources/utilities/grub-assemble/gen.vesafb.sh b/resources/utilities/grub-assemble/gen.vesafb.sh
new file mode 100755
index 00000000..1c0b5936
--- /dev/null
+++ b/resources/utilities/grub-assemble/gen.vesafb.sh
@@ -0,0 +1,32 @@
+#!/bin/sh
+# Copying and distribution of this file, with or without modification,
+# are permitted in any medium without royalty provided the copyright
+# notice and this notice are preserved. This file is offered as-is,
+# without any warranty.
+
+set -u -e -v
+
+# TODO: Fail (and clean up) if GRUB isn't actually built. Error checking.
+
+# This is where GRUB is expected to be (outside of the grub-assemble, instead in main checkout)
+grubdir="../../../grub"
+
+# Install modules (installed, but not automatically loaded)
+grub_install_modules="adler32 all_video archelp ata backtrace bitmap bitmap_scale cmp cpio_be cpio cpuid crc64 cs5536 div_test efiemu elf eval exfat extcmd file fshelp gettext gfxmenu gptsync gzio hashsum hexdump http linux16 loadenv lzopio mda_text mmap mpi msdospart multiboot2 multiboot nativedisk net newc ntfscomp ntfs odc offsetio parttool priority_queue procfs progress read relocator scsi search_fs_file search_fs_uuid search_label search setjmp setpci sleep squash4 tar terminfo testload testspeed tftp time trig tr true udf ufs1_be ufs1 ufs2 usbserial_common usbserial_ftdi usbserial_pl2303 usbserial_usbdebug usbtest video_colors videotest_checksum xzio"
+
+# Modules (and always loaded)
+grub_modules="acpi ahci at_keyboard boot cat cbfs cbls cbtime chain cmosdump cmostest cbmemc crypto cryptodisk configfile datehook date datetime diskfilter disk echo ext2 ehci fat halt help iorw iso9660 keystatus linux loopback ls lsacpi lsmmap lspci luks lvm memdisk minicmd memrw morse normal ohci part_gpt part_msdos password password_pbkdf2 pbkdf2 pcidump pci play probe reboot serial terminal test usb_keyboard usbms uhci gcry_arcfour gcry_blowfish gcry_camellia gcry_cast5 gcry_crc gcry_des gcry_dsa gcry_idea gcry_md4 gcry_md5 gcry_rfc2268 gcry_rijndael gcry_rmd160 gcry_rsa gcry_seed gcry_serpent gcry_sha1 gcry_sha256 gcry_sha512 gcry_tiger gcry_twofish gcry_whirlpool hdparm regexp spkmodem syslinuxcfg usb verify videoinfo videotest xfs btrfs zfs sfs romfs reiserfs nilfs2 minix_be minix3_be minix3 minix2_be minix2 minix jfs hfsplus hfs bfs afs affs gfxmenu gfxterm_background gfxterm_menu jpeg png tga pata"
+
+# Generate the grub.elf
+$grubdir/grub-mkstandalone \
+ --grub-mkimage=$grubdir/grub-mkimage \
+ -O i386-coreboot \
+ -o grub.elf \
+ -d $grubdir/grub-core/ \
+ --fonts= --themes= --locales= \
+ --modules="$grub_modules" \
+ --install-modules="$grub_install_modules" \
+ /boot/grub/grub.cfg="../../../resources/grub/config/grub_memdisk.cfg" \
+ /background.jpg="../../../resources/grub/background/background.jpg" \
+ /dejavusansmono.pf2="../../../resources/grub/font/dejavusansmono.pf2" \
+ $(./grub_memdisk_keymap) \