From 7ff25fd1932471a23827ef821be97fc4969910e1 Mon Sep 17 00:00:00 2001 From: Francis Rowe Date: Tue, 25 Nov 2014 02:32:35 +0000 Subject: libreboot_bin.tar.xz: Include utils as statically linked binaries This means that the user does not have to install build dependency or build from source anymore. --- addseabios | 32 ++++++++++++++++++++++++-------- 1 file changed, 24 insertions(+), 8 deletions(-) (limited to 'addseabios') diff --git a/addseabios b/addseabios index 1d9147ee..1cc1aad3 100755 --- a/addseabios +++ b/addseabios @@ -30,8 +30,24 @@ if [ -f "DEBLOB" ]; then exit 1 fi -if [ ! -f "cbfstool" ]; then - echo "cbfstool not found. Please run ./builddeps-cbfstool first. Check the docs for how to get build dependencies." +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 @@ -40,23 +56,23 @@ 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 + $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 + $cbfstool $rom extract -n $config -f $config # Delete it from the ROM - ../cbfstool $rom remove -n $config + $cbfstool $rom remove -n $config # Add the menuentry for loading SeaBIOS - cat ../resources/grub/config/seabios.cfg >> $config + cat seabios.cfg >> $config # Re-add the newly modified GRUB configuration to the ROM - ../cbfstool $rom add -f $config -n $config -t raw + $cbfstool $rom add -f $config -n $config -t raw # The GRUB configuration is no longer needed rm -rf $config -- cgit v1.2.3-70-g09d2