From 7d396510dec7b6fb0535cb3b56a4c03b9fbe4d3b Mon Sep 17 00:00:00 2001 From: Martin Whitaker Date: Sun, 11 Mar 2018 11:53:03 +0000 Subject: Get both arch's when updating bootloader files. --- update_bootloader_files.sh | 35 +++++++++++++++++------------------ 1 file changed, 17 insertions(+), 18 deletions(-) (limited to 'update_bootloader_files.sh') diff --git a/update_bootloader_files.sh b/update_bootloader_files.sh index aaf381b..4e7b2e8 100755 --- a/update_bootloader_files.sh +++ b/update_bootloader_files.sh @@ -1,26 +1,25 @@ #!/bin/sh -repository=$(grep ^repository config/settings.cfg | sed s/repository=//) -if [ $# -eq 0 ]; then - arch=$(grep arch config/settings.cfg | sed s/arch=//) -else - arch=$1 -fi -echo "Fetching $arch bootloader files from $repository" +repository=$(grep repository config/settings.cfg | sed s/repository=//) +echo "Fetching bootloader files from $repository" # Remove old files rm -rf bootloader +mkdir bootloader -path=`ls -1v $repository/$arch/media/core/{release,updates}/drakiso-bootloader-files*.rpm 2> /dev/null | tail -1` -if [ -z $path ] ; then - echo "ERROR: couldn't find $arch drakiso-bootloader-files RPM in $repository." - exit 1 -else - echo "Extracting $arch bootloader files from repository." - rpm2cpio $path | cpio -idm --quiet - if [ $? -ne 0 ] ; then - echo "ERROR: failed to extract files from archive." +archs="i586 x86_64" +for arch in $archs; do + path=`ls -1v $repository/$arch/media/core/{release,updates}/drakiso-bootloader-files*.rpm 2> /dev/null | tail -1` + if [ -z $path ] ; then + echo "ERROR: couldn't find $arch drakiso-bootloader-files RPM in $repository." exit 1 + else + echo "Extracting $arch bootloader files from repository." + rpm2cpio $path | cpio -idm --quiet + if [ $? -ne 0 ] ; then + echo "ERROR: failed to extract files from archive." + exit 1 + fi fi - mv usr/share/drakiso-bootloader bootloader + cp -ru usr/share/drakiso-bootloader/* bootloader rm -r usr -fi +done -- cgit v1.2.1