summaryrefslogtreecommitdiff
path: root/buildrom-withgrub
diff options
context:
space:
mode:
authorFrancis Rowe <info@gluglug.org.uk>2014-07-20 07:37:00 +0000
committerMichał Masłowski <mtjm@mtjm.eu>2014-08-22 19:15:07 +0200
commit488242eb941305ef61319b8499d4a1e8ccf218a1 (patch)
treeb0347f360df51ac5a8edd06068e7ae24510864d6 /buildrom-withgrub
parent8b484a19b51fb0591d938b3b7cf4fcb8f06c7a2f (diff)
Libreboot release 6 beta 3.
- Fixed typo that existed in 2nd beta where the release date of the 2nd beta was listed as being in year 2016, when in actual fact it was 2014. - Documentation: added (preliminary) details about (rare) buggy CPU's on the ThinkPad T60 that were found to fail (instability, kernel panics, etc) without the microcode updates. - Documentation: added docs/howtos/x60_heatsink.html for showing how to change the heatsink on the Thinkpad X60 - Added ROM images for Azerty (French) keyboard layout in GRUB (courtesy of Olivier Mondoloni) - Tidied up some scripts: - Re-factored those scripts (made easier to read/maintain): build-x60, build-x60t, build-t60, build-macbook21 - Reduced the number of grub configs to 2 (or 1, for macbook21), the build scripts now generate the other configs at build time. - Deleted build-x60, build-x60t, build-t60, build-macbook21 and replaced with intelligent (generic) buildrom-withgrub script - Updated build to use buildrom-withgrub script for building the ROM images. - coreboot.rom and coreboot_serial.rom renamed to coreboot_usqwerty.rom and coreboot_serial_usqwerty.rom - coreboot_dvorak and coreboot_serial_dvorak.rom renamed to coreboot_usdvorak.rom and coreboot_serial_usdvorak.rom - Renamed coreboot*rom to libreboot*rom - Made flash, lenovobios_firstflash and lenovobios_secondflash scripts fail if the specified file does not exist. - Updated all relevant parts of the documentation to reflect the above. - Replaced background.png with background.jpg. added gnulove.jpg. (resources/grub/background/) - Updated buildrom-withgrub to use background.jpg instead of background.png - Updated buildrom-withgrub to use gnulove.jpg aswell - Updated resources/grub/config/macbook21/grub*cfg to use gnulove.jpg background. - Updated resources/grub/config/{x60,t60,x60t}/grub*cfg to use background.jpg background. - Documentation: updated docs/index.html#grub_custom_keyboard to be more generally useful. - nvramtool: - Updated builddeps-coreboot script to build it - Updated build script to include it in libreboot_bin - Documentation: added docs/howtos/x60_security.html (security hardening for X60)
Diffstat (limited to 'buildrom-withgrub')
-rwxr-xr-xbuildrom-withgrub135
1 files changed, 135 insertions, 0 deletions
diff --git a/buildrom-withgrub b/buildrom-withgrub
new file mode 100755
index 0000000..49e3b05
--- /dev/null
+++ b/buildrom-withgrub
@@ -0,0 +1,135 @@
+#!/bin/bash
+
+# buildrom-withgrub script: this generically builds the ROM images.
+# The ROM images built by this script will use the GRUB payload.
+#
+# Copyright (C) 2014 Francis Rowe
+#
+# This program is free software: you can redistribute it and/or modify
+# it under the terms of the GNU General Public License as published by
+# the Free Software Foundation, either version 3 of the License, or
+# (at your option) any later version.
+#
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+# GNU General Public License for more details.
+#
+# You should have received a copy of the GNU General Public License
+# along with this program. If not, see <http://www.gnu.org/licenses/>.
+#
+
+# DO NOT RUN THIS DIRECTLY!
+# Use "build"
+
+# base ROM's: coreboot_usqwerty.rom and coreboot_serial_usqwerty.rom
+# All other ROM's will be based on one of these.
+
+if (( $# != 1 )); then
+ echo "Usage: ./buildrom-withgrub boardname"
+ echo "Example: ./buildrom-withgrub x60"
+ echo "You need to specify exactly 1 argument"
+ exit
+fi
+
+# Build the ROM images:
+# ----------------------------------------------------------------------------------------------------------------------
+
+cd coreboot
+rm -rf .config
+
+# cbfstool will be used quite heavily here.
+mv util/cbfstool/cbfstool .
+
+# prepare libreboot configuration and build it
+cp ../resources/libreboot/config/$1/config .config
+
+# coreboot.rom will appear under ./coreboot/build
+make
+
+# move it out (we'll be cleaning the build)
+# also rename it to libreboot_usqwerty.rom
+mv build/coreboot.rom libreboot_usqwerty.rom
+
+# clean the build
+make clean
+rm -rf .config
+
+# Insert files/configurations and perform operations that are common on all ROM images
+# ---------------------------------------------------------------------------------------------------------------
+
+# Add background image and font
+./cbfstool libreboot_usqwerty.rom add -f ../resources/grub/background/background.jpg -n background.jpg -t raw
+./cbfstool libreboot_usqwerty.rom add -f ../resources/grub/background/gnulove.jpg -n gnulove.jpg -t raw
+./cbfstool libreboot_usqwerty.rom add -f ../resources/grub/font/dejavusansmono.pf2 -n dejavusansmono.pf2 -t raw
+
+# Insert files/configurations and perform operations that are common on *serial* ROM images
+# ---------------------------------------------------------------------------------------------------------------
+
+# ROM's based on this will have MemTest86+ included inside.
+cp libreboot_usqwerty.rom libreboot_serial_usqwerty.rom
+
+# Add memtest86+ to libreboot_serial_usqwerty.rom
+./cbfstool libreboot_serial_usqwerty.rom add -f ../memtest86+-5.01/memtest -n memtest -t raw
+
+# Prepare ROM's (based on libreboot_usqwerty.rom and libreboot_serial_usqwerty.rom) with
+# alternative keyboard layout configurations inside GRUB
+# ---------------------------------------------------------------------------------------------------------------
+
+# The for loops MUST be separate. Do NOT re-factor them!
+
+# default configs
+cp ../resources/grub/config/$1/grub_usqwerty.cfg .
+cp ../resources/grub/config/$1/grub_serial_usqwerty.cfg .
+
+for keymap in $(ls ../resources/grub/keymap/original)
+do
+ # copy the ROM based on the keymap
+ cp libreboot_usqwerty.rom libreboot_"$keymap".rom
+ cp libreboot_serial_usqwerty.rom libreboot_serial_"$keymap".rom
+done
+
+for keymap in $(ls ../resources/grub/keymap/original)
+do
+ # copy the config based on the keymap:
+ cp grub_usqwerty.cfg grub_"$keymap".cfg
+ cp grub_serial_usqwerty.cfg grub_serial_"$keymap".cfg
+done
+
+for keymap in $(ls ../resources/grub/keymap/original)
+do
+ # Insert GRUB keymap instructions into the config
+ echo "keymap $keymap" >> grub_"$keymap".cfg
+ echo "keymap $keymap" >> grub_serial_"$keymap".cfg
+done
+
+for keymap in $(ls ../resources/grub/keymap/original)
+do
+ # Set the GRUB keymap for the given ROM image
+ ./cbfstool libreboot_"$keymap".rom add -f grub_"$keymap".cfg -n grub.cfg -t raw
+ ./cbfstool libreboot_serial_"$keymap".rom add -f grub_serial_"$keymap".cfg -n grub.cfg -t raw
+done
+
+# Now we clean up and prepare the binary archive ready for release.
+# ----------------------------------------------------------------------------------------------------------------------------
+
+# we don't need the grub.cfg's anymore
+rm -rf grub*cfg
+
+# prepare directory for new ROM images
+rm -rf $1
+mkdir $1
+# move the ROM's into the newly created directory
+mv libreboot*rom $1
+
+# delete the old ROM's from ../bin
+rm -rf ../bin/$1
+# now put the new ROM's in ./bin
+mv $1 ../bin
+
+# cbfstool no longer needed here, so put it back
+mv cbfstool util/cbfstool/
+
+# go back to main source directory
+cd ../
+