summaryrefslogtreecommitdiffstats
path: root/addseabios
diff options
context:
space:
mode:
Diffstat (limited to 'addseabios')
-rwxr-xr-xaddseabios32
1 files changed, 24 insertions, 8 deletions
diff --git a/addseabios b/addseabios
index 1d9147e..1cc1aad 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