summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorLuke Shumaker <lukeshu@sbcglobal.net>2014-12-28 19:56:26 -0500
committerLuke Shumaker <lukeshu@sbcglobal.net>2014-12-28 19:56:26 -0500
commitbd2fdf0e616578ede630bd1dd9da5b74ea9b7d3a (patch)
treea3b1ebaa7c9ea2e572a179c32d4273cffd700a9b
parent1bc0aef8870f3c378a29bd93544fec1ce0f4efa5 (diff)
Convert the SeaBIOS script
-rw-r--r--Makefile11
-rwxr-xr-xaddseabios83
-rw-r--r--addseabios.mk18
-rw-r--r--configure.ac5
4 files changed, 29 insertions, 88 deletions
diff --git a/Makefile b/Makefile
index 938e767..38aa453 100644
--- a/Makefile
+++ b/Makefile
@@ -13,12 +13,12 @@ romtypes = txtmode vesafb
i945boards = x60 x60t t60
-build: PHONY \
- $(foreach board,$(boards),\
- $(foreach keymap,$(keymaps),\
- $(foreach romtype,$(romtypes),\
- bin/$(board)_$(keymap)_$(romtype).rom)))
+roms = $(foreach board,$(boards),\
+ $(foreach keymap,$(keymaps),\
+ $(foreach romtype,$(romtypes),\
+ $(board)_$(keymap)_$(romtype))))
+build: PHONY $(foreach rom,$(roms),bin/$(rom).rom bin/$(rom)_with_seabios.rom)
define _nl
@@ -54,6 +54,7 @@ include modules.mk
include build.mk
include grub-mkstandalone.mk
include buildrom-withgrub.mk
+include addseabios.mk
diff --git a/addseabios b/addseabios
deleted file mode 100755
index 1cc1aad..0000000
--- a/addseabios
+++ /dev/null
@@ -1,83 +0,0 @@
-#!/bin/bash
-
-# addseabios script: add SeaBIOS to the ROM images.
-# This also adds SeaVGABIOS, SeaBIOS's free/libre video bios "wrapper" for coreboot native graphics
-#
-# Copyright (C) 2014 Francis Rowe <info@gluglug.org.uk>
-#
-# 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/>.
-#
-
-set -u -e -v
-
-echo "Adding SeaBIOS and SeaVGABIOS to the ROM's"
-
-# Because the DEBLOB script isn't included in the binary archives.
-# This is how we know.
-if [ -f "DEBLOB" ]; then
- echo "Do not run this in meta/src directory. Do it in binary archive, either with libreboot-supplied ROM images or your own binary archive created with 'build-release'."
- exit 1
-fi
-
-if [ $(uname -i) = "i686" ] || [ $(uname -i) = "i686" ]
- then
- echo "You are on an i686 host"
- if [ ! -f "cbfstool/i686/cbfstool" ]; then
- echo "cbfstool binary not found. You will need to build it from source and put it in cbfstool/i686/"
- exit 1
- fi
- $cbfstool = "../cbfstool/i686/cbfstool"
-elif [ $(uname -i) = "x86_64" ] || [ $(uname -i) = "x86_64" ]
- then
- echo "You are on an x86_64 host"
- if [ ! -f "cbfstool/x86_64/cbfstool" ]; then
- echo "cbfstool binary not found. You will need to build it from source and put it in cbfstool/x86_64/"
- exit 1
- fi
- $cbfstool = "../cbfstool/x86_64/cbfstool"
-else
- echo "You need to run this script on an i686 or x86_64 host"
- exit 1
-fi
-
-# Add SeaBIOS and SeaVGABIOS to *all* ROM's
-cd bin/
-for rom in $(find -type f)
-do
- # Add them
- $cbfstool $rom add -f ../vgabios.bin -n vgaroms/vgabios.bin -t raw
- $cbfstool $rom add -f ../bios.bin.elf -n bios.bin.elf -t raw
-
- # Modify the GRUB configuration
- for config in grub.cfg grubtest.cfg
- do
- # Extract (dump) the config
- $cbfstool $rom extract -n $config -f $config
-
- # Delete it from the ROM
- $cbfstool $rom remove -n $config
-
- # Add the menuentry for loading SeaBIOS
- cat seabios.cfg >> $config
-
- # Re-add the newly modified GRUB configuration to the ROM
- $cbfstool $rom add -f $config -n $config -t raw
-
- # The GRUB configuration is no longer needed
- rm -rf $config
- done
-done
-cd ../
-
-echo "DONE! All of the ROM's under bin/ have been modified to include SeaBIOS/SeaVGABIOS and include a GRUB menuentry for it."
diff --git a/addseabios.mk b/addseabios.mk
new file mode 100644
index 0000000..8bc6ef2
--- /dev/null
+++ b/addseabios.mk
@@ -0,0 +1,18 @@
+bin/%_with_seabios.rom: bin/%.rom \
+ src/seabios/out/vgabios.bin \
+ src/seabios/out/bios.bin.elf \
+ resources/grub/config/seabios.cfg \
+ $(CBFSTOOL)
+ cp $< $@.tmp
+ $(CBFSTOOL) $@.tmp add -f src/seabios/out/vgabios.bin -n vgaroms/vgabios.bin -t raw
+ $(CBFSTOOL) $@.tmp add -f src/seabios/out/bios.bin.elf -n bios.bin.elf -t raw
+ $(CBFSTOOL) $@.tmp extract -n grub.cfg -f $@.tmp.grub.cfg
+ $(CBFSTOOL) $@.tmp extract -n grubtest.cfg -f $@.tmp.grubtest.cfg
+ $(CBFSTOOL) $@.tmp remove -n grub.cfg
+ $(CBFSTOOL) $@.tmp remove -n grubtest.cfg
+ cat resources/grub/config/seabios.cfg >> $@.tmp.grub.cfg
+ cat resources/grub/config/seabios.cfg >> $@.tmp.grubtest.cfg
+ $(CBFSTOOL) $@.tmp add -f $@.tmp.grub.cfg -n grub.cfg -t raw
+ $(CBFSTOOL) $@.tmp add -f $@.tmp.grubtest.cfg -n grubtest.cfg -t raw
+ rm -f $@.tmp.grub.cfg $@.tmp.grubtest.cfg
+ mv $@.tmp $@
diff --git a/configure.ac b/configure.ac
index 4ded3ef..9faf3be 100644
--- a/configure.ac
+++ b/configure.ac
@@ -48,6 +48,11 @@ if test "x$HAVE_PYTHON" = x ; then
AC_MSG_ERROR([Please install the 'python' utility])
fi
+AC_CHECK_PROG(HAVE_IASL,iasl,yes)
+if test "x$HAVE_IASL" = x ; then
+ AC_MSG_ERROR([Please install the 'iasl' utility, it is needed for SeaBIOS])
+fi
+
dnl This check is from grub's configure.ac
AC_MSG_CHECKING([for unifont])
FONT_SOURCE=