summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMartin Whitaker <mageia@martin-whitaker.me.uk>2017-12-23 20:39:43 +0000
committerMartin Whitaker <mageia@martin-whitaker.me.uk>2017-12-23 20:39:43 +0000
commitbb243cecd644af1cf359cd29d52504d2bbafde4b (patch)
tree89d80f57233d4cec41cef4049b9e4776d01febc0
parent4f7847f05e437254653dbb89ee1e77edccef26f4 (diff)
downloaddraklive-config-bb243cecd644af1cf359cd29d52504d2bbafde4b.tar
draklive-config-bb243cecd644af1cf359cd29d52504d2bbafde4b.tar.gz
draklive-config-bb243cecd644af1cf359cd29d52504d2bbafde4b.tar.bz2
draklive-config-bb243cecd644af1cf359cd29d52504d2bbafde4b.tar.xz
draklive-config-bb243cecd644af1cf359cd29d52504d2bbafde4b.zip
Add script for fetching the grub2 bootloader files from the repo.
-rwxr-xr-xupdate_bootloader_files.sh22
1 files changed, 22 insertions, 0 deletions
diff --git a/update_bootloader_files.sh b/update_bootloader_files.sh
new file mode 100755
index 0000000..98ff5dc
--- /dev/null
+++ b/update_bootloader_files.sh
@@ -0,0 +1,22 @@
+#!/bin/sh
+repository=$(grep repository config/settings.cfg | sed s/repository=//)
+
+# Remove old files
+rm -rf bootloader
+
+# The 64-bit packge contains everything we need. The non-UEFI grub2 images
+# are built for i386, and everything else should be architecture-independent
+path=`ls -1v $repository/x86_64/media/core/{release,updates}/drakiso-bootloader-files*.rpm 2> /dev/null | tail -1`
+if [ -z $path ] ; then
+ echo "ERROR: couldn't find drakiso-bootloader-files RPM in $repository."
+ exit 1
+else
+ echo "Extracting bootloader files from repository."
+ rpm2cpio $path | cpio -idm
+ if [ $? -ne 0 ] ; then
+ echo "ERROR: failed to extract files from archive."
+ exit 1
+ fi
+ mv usr/share/drakiso-bootloader bootloader
+ rm -r usr
+fi