aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorFrancis Rowe <info@gluglug.org.uk>2015-08-30 04:47:29 +0100
committerFrancis Rowe <info@gluglug.org.uk>2015-08-30 04:47:29 +0100
commita57f26f2c62805b9e61719361ca17ccf53c897ad (patch)
tree31777747249a8b538fa6f1bbbec39b131be59044
parent8c07c380121cdab4efd50cff453875903b8c67ef (diff)
downloadlibrebootfr-a57f26f2c62805b9e61719361ca17ccf53c897ad.tar.gz
librebootfr-a57f26f2c62805b9e61719361ca17ccf53c897ad.zip
all scripts: general fixes and clean up
-rwxr-xr-xbuild4
-rwxr-xr-xflash4
-rwxr-xr-xresources/scripts/helpers/build/clean/bucts2
-rwxr-xr-xresources/scripts/helpers/build/clean/coreboot2
-rwxr-xr-xresources/scripts/helpers/build/clean/flashrom2
-rwxr-xr-xresources/scripts/helpers/build/clean/grub2
-rwxr-xr-xresources/scripts/helpers/build/clean/i945pwm2
-rwxr-xr-xresources/scripts/helpers/build/clean/ich9deblob2
-rwxr-xr-xresources/scripts/helpers/build/clean/memtest86plus2
-rwxr-xr-xresources/scripts/helpers/build/clean/rom_images2
-rwxr-xr-xresources/scripts/helpers/build/config/corebootmodify2
-rwxr-xr-xresources/scripts/helpers/build/config/corebootreplace2
-rwxr-xr-xresources/scripts/helpers/build/config/corebootupdate2
-rwxr-xr-xresources/scripts/helpers/build/dependencies/parabola7
-rwxr-xr-xresources/scripts/helpers/build/dependencies/trisquel79
-rwxr-xr-xresources/scripts/helpers/build/module/bucts4
-rwxr-xr-xresources/scripts/helpers/build/module/coreboot4
-rwxr-xr-xresources/scripts/helpers/build/module/flashrom15
-rwxr-xr-xresources/scripts/helpers/build/module/grub4
-rwxr-xr-xresources/scripts/helpers/build/module/i945pwm4
-rwxr-xr-xresources/scripts/helpers/build/module/ich9deblob4
-rwxr-xr-xresources/scripts/helpers/build/module/memtest86plus4
-rwxr-xr-xresources/scripts/helpers/build/release/docs4
-rwxr-xr-xresources/scripts/helpers/build/release/roms2
-rwxr-xr-xresources/scripts/helpers/build/release/sha512sums2
-rwxr-xr-xresources/scripts/helpers/build/release/src5
-rwxr-xr-xresources/scripts/helpers/build/release/tobuild4
-rwxr-xr-xresources/scripts/helpers/build/release/util10
-rwxr-xr-xresources/scripts/helpers/build/roms/withgrub7
-rwxr-xr-xresources/scripts/helpers/build/roms/withgrub_helper41
-rwxr-xr-xresources/scripts/helpers/download/bucts3
-rwxr-xr-xresources/scripts/helpers/download/coreboot3
-rwxr-xr-xresources/scripts/helpers/download/flashrom3
-rwxr-xr-xresources/scripts/helpers/download/grub3
-rwxr-xr-xresources/scripts/helpers/download/memtest86plus3
-rwxr-xr-xresources/scripts/misc/powertop.trisquel71
-rwxr-xr-xresources/utilities/grub-assemble/gen.sh2
37 files changed, 60 insertions, 118 deletions
diff --git a/build b/build
index 0ddb8fe7..8ee4d74b 100755
--- a/build
+++ b/build
@@ -52,10 +52,10 @@ if [ -d "${build}/${mode}" ]; then
if [ "${option}" = "list" ]; then
printf "Available options for '%s' are:\nall\n%s\n\n" "${mode}" "${availableoptions}"
elif [ -f "${build}/${mode}/${option}" ]; then
- ${build}/${mode}/${option} "$@"
+ "${build}/${mode}/${option}" "$@"
elif [ "${option}" = "all" ]; then
for option in ${availableoptions}; do
- ${build}/${mode}/${option} "$@"
+ "${build}/${mode}/${option}" "$@"
done
else
printf "Invalid option for '%s'. Available options are:\nall\n%s\n\n" "${mode}" "${availableoptions}"
diff --git a/flash b/flash
index 3c052065..8c1249c1 100755
--- a/flash
+++ b/flash
@@ -31,9 +31,9 @@ if [[ ${EUID} -ne 0 ]]; then
fi
arch="unknown"
-if [ $(uname -i) = "i686" ] || [ $(uname -m) = "i686" ]; then
+if [ "$(uname -i)" = "i686" ] || [ "$(uname -m)" = "i686" ]; then
arch="i686"
-elif [ $(uname -i) = "x86_64" ] || [ $(uname -m) = "x86_64" ]; then
+elif [ "$(uname -i)" = "x86_64" ] || [ "$(uname -m)" = "x86_64" ]; then
arch="x86_64"
else
printf "This script must be run on an i686 or x86_64 host. x86_64 is recommended.\n"
diff --git a/resources/scripts/helpers/build/clean/bucts b/resources/scripts/helpers/build/clean/bucts
index 2d3f9bb5..84bd4da5 100755
--- a/resources/scripts/helpers/build/clean/bucts
+++ b/resources/scripts/helpers/build/clean/bucts
@@ -36,5 +36,3 @@ printf "\n\n"
# done. go back to main directory.
cd "../"
-
-# ------------------- DONE ----------------------
diff --git a/resources/scripts/helpers/build/clean/coreboot b/resources/scripts/helpers/build/clean/coreboot
index 1eb8ab33..58d13bc1 100755
--- a/resources/scripts/helpers/build/clean/coreboot
+++ b/resources/scripts/helpers/build/clean/coreboot
@@ -56,5 +56,3 @@ make crossgcc-clean
cd "../"
printf "\n\n"
-
-# ------------------- DONE ----------------------
diff --git a/resources/scripts/helpers/build/clean/flashrom b/resources/scripts/helpers/build/clean/flashrom
index d7eba900..2a16adcb 100755
--- a/resources/scripts/helpers/build/clean/flashrom
+++ b/resources/scripts/helpers/build/clean/flashrom
@@ -40,5 +40,3 @@ rm -f "flashrom_lenovobios_macronix"
cd "../"
printf "\n\n"
-
-# ------------------- DONE ----------------------
diff --git a/resources/scripts/helpers/build/clean/grub b/resources/scripts/helpers/build/clean/grub
index cf22c8a0..af657f04 100755
--- a/resources/scripts/helpers/build/clean/grub
+++ b/resources/scripts/helpers/build/clean/grub
@@ -36,5 +36,3 @@ printf "Cleaning the previous build of GRUB\n"
cd "../"
printf "\n\n"
-
-# ------------------- DONE ----------------------
diff --git a/resources/scripts/helpers/build/clean/i945pwm b/resources/scripts/helpers/build/clean/i945pwm
index 11838590..3e1d66db 100755
--- a/resources/scripts/helpers/build/clean/i945pwm
+++ b/resources/scripts/helpers/build/clean/i945pwm
@@ -32,5 +32,3 @@ cd "resources/utilities/i945-pwm/"
make clean
cd "../../../"
printf "\n\n"
-
-# ------------------- DONE ----------------------
diff --git a/resources/scripts/helpers/build/clean/ich9deblob b/resources/scripts/helpers/build/clean/ich9deblob
index cfca981d..2c952ac9 100755
--- a/resources/scripts/helpers/build/clean/ich9deblob
+++ b/resources/scripts/helpers/build/clean/ich9deblob
@@ -32,5 +32,3 @@ cd "resources/utilities/ich9deblob/"
make clean
cd "../../../"
printf "\n\n"
-
-# ------------------- DONE ----------------------
diff --git a/resources/scripts/helpers/build/clean/memtest86plus b/resources/scripts/helpers/build/clean/memtest86plus
index 6f3db447..e6a92180 100755
--- a/resources/scripts/helpers/build/clean/memtest86plus
+++ b/resources/scripts/helpers/build/clean/memtest86plus
@@ -37,5 +37,3 @@ make clean
cd "../"
printf "\n\n"
-
-# ------------------- DONE ----------------------
diff --git a/resources/scripts/helpers/build/clean/rom_images b/resources/scripts/helpers/build/clean/rom_images
index e952d5c7..f0c342ab 100755
--- a/resources/scripts/helpers/build/clean/rom_images
+++ b/resources/scripts/helpers/build/clean/rom_images
@@ -31,5 +31,3 @@ set -u -e
rm -Rf "bin/"
printf "Deleted the bin/ directory containing the ROM images.\n\n"
-
-# ------------------- DONE ----------------------
diff --git a/resources/scripts/helpers/build/config/corebootmodify b/resources/scripts/helpers/build/config/corebootmodify
index 890426ea..6261d0b4 100755
--- a/resources/scripts/helpers/build/config/corebootmodify
+++ b/resources/scripts/helpers/build/config/corebootmodify
@@ -30,7 +30,7 @@ cd "resources/libreboot/config/grub/"
if [ $# -lt 1 ]; then
configs="$(for config in *; do printf "%s\n" "${config}"; done)"
else
- configs="$@"
+ configs="${*}"
fi
cd "../../../../coreboot/"
diff --git a/resources/scripts/helpers/build/config/corebootreplace b/resources/scripts/helpers/build/config/corebootreplace
index 140372d9..d5fdcb29 100755
--- a/resources/scripts/helpers/build/config/corebootreplace
+++ b/resources/scripts/helpers/build/config/corebootreplace
@@ -30,7 +30,7 @@ cd "resources/libreboot/config/grub/"
if [ $# -lt 1 ]; then
configs="$(for config in *; do printf "%s\n" "${config}"; done)"
else
- configs="$@"
+ configs="${*}"
fi
cd "../../../../coreboot/"
diff --git a/resources/scripts/helpers/build/config/corebootupdate b/resources/scripts/helpers/build/config/corebootupdate
index a53df795..64fcd753 100755
--- a/resources/scripts/helpers/build/config/corebootupdate
+++ b/resources/scripts/helpers/build/config/corebootupdate
@@ -30,7 +30,7 @@ cd "resources/libreboot/config/grub/"
if [ $# -lt 1 ]; then
configs="$(for i in *; do printf "%s\n" "${i}"; done)"
else
- configs="$@"
+ configs="${*}"
fi
cd "../../../../coreboot/"
diff --git a/resources/scripts/helpers/build/dependencies/parabola b/resources/scripts/helpers/build/dependencies/parabola
index 692fdf75..92a88be4 100755
--- a/resources/scripts/helpers/build/dependencies/parabola
+++ b/resources/scripts/helpers/build/dependencies/parabola
@@ -53,7 +53,7 @@ pacman -S arm-none-eabi-gcc
pacman -S --needed libpciaccess
# For cross-compiling i686 target on x86_64 host.
-if [ $(uname -i) = "x86_64" ] || [ $(uname -m) = "x86_64" ]
+if [ "$(uname -i)" = "x86_64" ] || [ "$(uname -m)" = "x86_64" ]
then
printf "Cross-Compiling: You are running on 64-bit architecture, however 32-bit libraries are needed\n"
pacman -Sl --needed multilib 1&>/dev/null || (printf "You must enable the multilib repository in /etc/pacman.conf first\n"; exit 1)
@@ -78,7 +78,7 @@ pacman -S ncurses doxygen iasl gdb flex bison
# pacman -S git base-devel
# For cross-compiling i686 target on x86_64 host.
-if [ $(uname -i) = "x86_64" ] || [ $(uname -m) = "x86_64" ]
+if [ "$(uname -i)" = "x86_64" ] || [ "$(uname -m)" = "x86_64" ]
then
printf "Cross-Compiling: You are running on 64-bit architecture, however 32-bit libraries are needed\n"
pacman -S --needed lib32-ncurses
@@ -104,6 +104,3 @@ pacman -S --needed bdf-unifont # trying this, otherwise there was an error. I'll
printf "Flashrom: Your external programmer will be most probably using PCI bus, FTDI chips need additional libraries\n"
pacman -S --needed pciutils zlib libftdi libftdi-compat
# pacman -S --needed base-devel subversion
-
-# ------------------- DONE ----------------------
-
diff --git a/resources/scripts/helpers/build/dependencies/trisquel7 b/resources/scripts/helpers/build/dependencies/trisquel7
index 0a3a2680..d3027f9c 100755
--- a/resources/scripts/helpers/build/dependencies/trisquel7
+++ b/resources/scripts/helpers/build/dependencies/trisquel7
@@ -47,7 +47,7 @@ apt-get -y install build-essential
apt-get -y install gcc-arm-linux-gnueabi
# For cross-compiling i686 target on x86_64 host.
-if [ $(uname -i) = "x86_64" ] || [ $(uname -m) = "x86_64" ]
+if [ "$(uname -i)" = "x86_64" ] || [ "$(uname -m)" = "x86_64" ]
then
apt-get -y install gcc-multilib libc6-i386 libc6-dev-i386
apt-get -y install lib32stdc++6 g++-multilib dh-autoreconf
@@ -71,7 +71,7 @@ apt-get -y install build-essential
apt-get -y install libncurses5-dev doxygen iasl gdb flex bison build-essential git
# For cross-compiling i686 target on x86_64 host.
-if [ $(uname -i) = "x86_64" ] || [ $(uname -m) = "x86_64" ]
+if [ "$(uname -i)" = "x86_64" ] || [ "$(uname -m)" = "x86_64" ]
then
apt-get -y install lib32ncurses5-dev
fi
@@ -92,10 +92,7 @@ apt-get -y install build-essential
apt-get -y install libpci-dev pciutils zlib1g-dev libftdi-dev build-essential subversion
# For cross-compiling i686 target on x86_64 host.
-if [ $(uname -i) = "x86_64" ] || [ $(uname -m) = "x86_64" ]
+if [ "$(uname -i)" = "x86_64" ] || [ "$(uname -m)" = "x86_64" ]
then
apt-get -y install lib32z1-dev
fi
-
-# ------------------- DONE ----------------------
-
diff --git a/resources/scripts/helpers/build/module/bucts b/resources/scripts/helpers/build/module/bucts
index 08ed9512..c142c76f 100755
--- a/resources/scripts/helpers/build/module/bucts
+++ b/resources/scripts/helpers/build/module/bucts
@@ -44,7 +44,7 @@ if [ "${buildtype}" = "static" ]; then
fi
make clean
-make -j$(nproc)
+make -j"$(nproc)"
if [ "${buildtype}" = "static" ]; then
patch "Makefile" -R < "../resources/bucts/patch/staticlink.diff"
@@ -54,5 +54,3 @@ fi
cd "../"
printf "\n\n"
-
-# ------------------- DONE ----------------------
diff --git a/resources/scripts/helpers/build/module/coreboot b/resources/scripts/helpers/build/module/coreboot
index c939068a..756ca1cc 100755
--- a/resources/scripts/helpers/build/module/coreboot
+++ b/resources/scripts/helpers/build/module/coreboot
@@ -38,7 +38,7 @@ cd "coreboot/"
# cbfstool
cd "util/cbfstool/"
-make -j$(nproc)
+make -j"$(nproc)"
# done. go back to coreboot dir
cd "../../"
@@ -47,5 +47,3 @@ cd "../../"
cd "../"
printf "\n\n"
-
-# ------------------- DONE ----------------------
diff --git a/resources/scripts/helpers/build/module/flashrom b/resources/scripts/helpers/build/module/flashrom
index b37299e1..c4cb3805 100755
--- a/resources/scripts/helpers/build/module/flashrom
+++ b/resources/scripts/helpers/build/module/flashrom
@@ -34,12 +34,12 @@ cd "flashrom/"
make clean
if (( $# != 1 )); then
- make -j$(nproc)
+ make -j"$(nproc)"
else
if [ "${1}" = "static" ]; then
- make SHARED=0 CC='gcc -static' -j$(nproc)
+ make SHARED=0 CC='gcc -static' -j"$(nproc)"
else
- make -j$(nproc)
+ make -j"$(nproc)"
fi
fi
@@ -60,12 +60,12 @@ do
make clean
if (( $# != 1 )); then
- make -j$(nproc)
+ make -j"$(nproc)"
else
if [ "${1}" = "static" ]; then
- make SHARED=0 CC='gcc -static' -j$(nproc)
+ make SHARED=0 CC='gcc -static' -j"$(nproc)"
else
- make -j$(nproc)
+ make -j"$(nproc)"
fi
fi
@@ -82,6 +82,3 @@ mv "flashrom_normal" "flashrom"
cd "../"
printf "\n\n"
-
-# ------------------- DONE ----------------------
-
diff --git a/resources/scripts/helpers/build/module/grub b/resources/scripts/helpers/build/module/grub
index fe073d62..0e424a4a 100755
--- a/resources/scripts/helpers/build/module/grub
+++ b/resources/scripts/helpers/build/module/grub
@@ -38,11 +38,9 @@ cd "grub/"
# build grub
./autogen.sh
./configure --with-platform=coreboot
-make -j$(nproc)
+make -j"$(nproc)"
printf "\n\n"
# done. go back to main directory
cd "../"
-
-# ------------------- DONE ----------------------
diff --git a/resources/scripts/helpers/build/module/i945pwm b/resources/scripts/helpers/build/module/i945pwm
index c263b259..0db8270f 100755
--- a/resources/scripts/helpers/build/module/i945pwm
+++ b/resources/scripts/helpers/build/module/i945pwm
@@ -34,11 +34,9 @@ cd "resources/utilities/i945-pwm/"
make clean
# build it
-make -j$(nproc)
+make -j"$(nproc)"
# done. go back to main directory
cd "../../../"
printf "\n\n"
-
-# ------------------- DONE ----------------------
diff --git a/resources/scripts/helpers/build/module/ich9deblob b/resources/scripts/helpers/build/module/ich9deblob
index 7622b87a..2ca54c7f 100755
--- a/resources/scripts/helpers/build/module/ich9deblob
+++ b/resources/scripts/helpers/build/module/ich9deblob
@@ -36,11 +36,9 @@ cd "resources/utilities/ich9deblob/"
make clean
# build ich9deblob
-make -j$(nproc)
+make -j"$(nproc)"
# done. go back to main directory
cd "../../../"
printf "\n\n"
-
-# ------------------- DONE ----------------------
diff --git a/resources/scripts/helpers/build/module/memtest86plus b/resources/scripts/helpers/build/module/memtest86plus
index 3e9feb17..772acf18 100755
--- a/resources/scripts/helpers/build/module/memtest86plus
+++ b/resources/scripts/helpers/build/module/memtest86plus
@@ -36,11 +36,9 @@ cd "memtest86plus/"
make clean
# build memtest86+
-make -j$(nproc)
+make -j"$(nproc)"
# done. go back to main directory
cd "../"
printf "\n\n"
-
-# ------------------- DONE ----------------------
diff --git a/resources/scripts/helpers/build/release/docs b/resources/scripts/helpers/build/release/docs
index 38a09993..54faac53 100755
--- a/resources/scripts/helpers/build/release/docs
+++ b/resources/scripts/helpers/build/release/docs
@@ -40,7 +40,7 @@ distdir="${versiondir}/${distname}"
printf 'Deleting old documentation release archives\n'
rm -f "${distdir}.tar.xz"
-rm -Rf "${distdir}/"
+rm -Rf "${distdir:?}/"
mkdir -p "${distdir}/"
cp -r docs/* "${distdir}/"
@@ -50,6 +50,6 @@ printf '%s\n' "${version}" >"${distdir}/version"
printf 'Creating compressed documentation archive at %s\n' "${distdir}.tar.xz"
(cd "${versiondir}/" && tar -c "${distname}/" | xz -9e >"${distname}.tar.xz")
-rm -Rf "${distdir}/"
+rm -Rf "${distdir:?}/"
printf 'Documentation release archive is stored in %s/\n' "${versiondir}"
diff --git a/resources/scripts/helpers/build/release/roms b/resources/scripts/helpers/build/release/roms
index 14c05ada..c6c5c5c4 100755
--- a/resources/scripts/helpers/build/release/roms
+++ b/resources/scripts/helpers/build/release/roms
@@ -66,7 +66,7 @@ for payload in *; do
# Create the compressed archive.
tar -c "${archivename}/" | xz -9e >"../../${romdir}/${payload}/${archivename}.tar.xz"
- rm -Rf "${archivename}/"
+ rm -Rf "${archivename:?}/"
printf ' OK\n'
diff --git a/resources/scripts/helpers/build/release/sha512sums b/resources/scripts/helpers/build/release/sha512sums
index ab14ca4a..456764b5 100755
--- a/resources/scripts/helpers/build/release/sha512sums
+++ b/resources/scripts/helpers/build/release/sha512sums
@@ -45,7 +45,7 @@ rm -f "${sha512filepath}"
# create sha512sum file
printf "Creating list of SHA512 sums in %s...\n" "${sha512filepath}"
-(cd "${versiondir}/" && for file in $(find -type f); do sha512sum $file >> "${sha512filename}"; done)
+(cd "${versiondir}/" && for file in $(find -type f); do sha512sum "${file}" >> "${sha512filename}"; done)
printf "...done.\n"
printf "\n"
diff --git a/resources/scripts/helpers/build/release/src b/resources/scripts/helpers/build/release/src
index 60356e8d..6d9f666c 100755
--- a/resources/scripts/helpers/build/release/src
+++ b/resources/scripts/helpers/build/release/src
@@ -38,7 +38,7 @@ distdir="${versiondir}/${distname}"
printf 'Deleting old source release archives\n'
rm -f "${distdir}.tar.xz"
-rm -Rf "${distdir}/"
+rm -Rf "${distdir:?}/"
mkdir -p "${distdir}/"
@@ -77,7 +77,6 @@ rm -Rf "${distdir}/resources/utilities/coreboot-libre/"
# in the src release archive
rm -f "${distdir}/download"
rm -Rf "${distdir}/resources/scripts/helpers/download/"
-rm -Rf "${distdir}/resources/scripts/helpers/sha512sums/"
# The release archive for _src does not include docs, so it
# is nonsense to include the script for it there
@@ -102,6 +101,6 @@ rm -f "${distdir}/resources/utilities/grub-assemble/grub_vesafb.elf"
printf 'Creating %s.tar.xz\n' "${distdir}"
(cd "${versiondir}/" && tar -c "${distname}/" | xz -9e >"${distname}.tar.xz")
-rm -Rf "${distdir}/"
+rm -Rf "${distdir:?}/"
printf 'Source release archive is stored in %s/\n' "${versiondir}"
diff --git a/resources/scripts/helpers/build/release/tobuild b/resources/scripts/helpers/build/release/tobuild
index 7360fb1c..ad8bac93 100755
--- a/resources/scripts/helpers/build/release/tobuild
+++ b/resources/scripts/helpers/build/release/tobuild
@@ -37,7 +37,7 @@ distdir="${versiondir}/${distname}"
printf "Creating source archive for flashrom and bucts\n"
# delete the old data
-rm -Rf "${distdir}/"
+rm -Rf "${distdir:?}/"
rm -f "${distdir}.tar.xz"
# this is where they will go
@@ -75,7 +75,7 @@ printf '%s\n' "${version}" >"${distdir}/version"
(cd "${versiondir}/" && tar -c "${distname}/" | xz -9e >"${distname}.tar.xz")
# and delete the directory
-rm -Rf "${distdir}/"
+rm -Rf "${distdir:?}/"
printf "\n"
printf "Tar archive created: %s\n" "${distdir}.tar.xz"
diff --git a/resources/scripts/helpers/build/release/util b/resources/scripts/helpers/build/release/util
index 5ef733e4..95bc234d 100755
--- a/resources/scripts/helpers/build/release/util
+++ b/resources/scripts/helpers/build/release/util
@@ -26,12 +26,12 @@
set -u -e
arch="unknown"
-if [ $(uname -i) = "i686" ] || [ $(uname -m) = "i686" ]
+if [ "$(uname -i)" = "i686" ] || [ "$(uname -m)" = "i686" ]
then
arch="i686"
echo "Running on i686. ok."
sleep 2
-elif [ $(uname -i) = "x86_64" ] || [ $(uname -m) = "x86_64" ]
+elif [ "$(uname -i)" = "x86_64" ] || [ "$(uname -m)" = "x86_64" ]
then
arch="x86_64"
echo "Running on x86_64. ok."
@@ -55,7 +55,7 @@ distdir="${versiondir}/${distname}"
printf "Creating utility archive (static executables)\n"
# delete the old data
-rm -Rf "${distdir}/"
+rm -Rf "${distdir:?}/"
rm -f "${distdir}.tar.xz"
# this is where they will go
@@ -221,6 +221,4 @@ printf "done\n\n"
# ----------------------------------------------------------------------------------------------------------------------------
# The uncompressed archives are no longer needed
-rm -Rf "${distdir}/"
-
-# ------------------- DONE ----------------------
+rm -Rf "${distdir:?}/"
diff --git a/resources/scripts/helpers/build/roms/withgrub b/resources/scripts/helpers/build/roms/withgrub
index 5d2f31b6..de70b245 100755
--- a/resources/scripts/helpers/build/roms/withgrub
+++ b/resources/scripts/helpers/build/roms/withgrub
@@ -35,7 +35,7 @@ fi
boards="unknown"
if [ $# -gt 0 ]; then
# build only the ROM images that were requested
- boards="$@"
+ boards="${*}"
else
# build all ROM images
boards="$(for board in resources/libreboot/config/grub/*; do printf "%s\n" "${board##*/}"; done)"
@@ -71,7 +71,7 @@ cd ../
for board in ${boards}
do
if [ -f "resources/libreboot/config/grub/${board}/config" ]; then
- ./build roms withgrub_helper ${board}
+ ./build roms withgrub_helper "${board}"
fi
done
@@ -122,6 +122,3 @@ rm -f "coreboot/grub_txtmode.elf"
rm -f coreboot/grub*cfg
printf "\n\n"
-
-# ------------------- DONE ----------------------
-
diff --git a/resources/scripts/helpers/build/roms/withgrub_helper b/resources/scripts/helpers/build/roms/withgrub_helper
index 15b127a1..7dbd9f6b 100755
--- a/resources/scripts/helpers/build/roms/withgrub_helper
+++ b/resources/scripts/helpers/build/roms/withgrub_helper
@@ -32,7 +32,9 @@ if (( $# != 1 )); then
exit 1
fi
-printf "GRUB Helper script: build ROM images for '%s'\n" "${1}"
+boardtarget="${1}"
+
+printf "GRUB Helper script: build ROM images for '%s'\n" "${boardtarget}"
cd "coreboot/"
@@ -48,21 +50,21 @@ printf '%s\n' "${version}" >"lbversion"
# Build ROM images with text-mode and corebootfb modes.
# ---------------------------------------------------------------------------------------------------------------
-if [ "${1}" = "qemu_i440fx_piix4" ] || [ "${1}" = "qemu_q35_ich9" ]
+if [ "${boardtarget}" = "qemu_i440fx_piix4" ] || [ "${boardtarget}" = "qemu_q35_ich9" ]
then
# assume that the default config enable framebuffer mode, duplicate and patch for text-mode
# necessary, otherwise it will ask you to enter the Y/X resolution of the framebuffer at build time
- cp "../resources/libreboot/config/grub/${1}/config" "config_vesafb"
+ cp "../resources/libreboot/config/grub/${boardtarget}/config" "config_vesafb"
sed 's/CONFIG_FRAMEBUFFER_KEEP_VESA_MODE=y/# CONFIG_FRAMEBUFFER_KEEP_VESA_MODE is not set/' < "config_vesafb" > "config_txtmode"
else
# assume that the default config enables text-mode, duplicate and patch for framebuffer mode
- cp "../resources/libreboot/config/grub/${1}/config" "config_txtmode"
+ cp "../resources/libreboot/config/grub/${boardtarget}/config" "config_txtmode"
sed 's/# CONFIG_FRAMEBUFFER_KEEP_VESA_MODE is not set/CONFIG_FRAMEBUFFER_KEEP_VESA_MODE=y/' < "config_txtmode" > "config_vesafb"
fi
for romtype in txtmode vesafb
do
- if [ "${1}" = "x200_8mb" ] || [ "${1}" = "x200_4mb" ] || [ "${1}" = "r400_8mb" ] || [ "${1}" = "r400_4mb" ] || [ "${1}" = "t400_8mb" ] || [ "${1}" = "t400_4mb" ] || [ "${1}" = "t500_8mb" ] || [ "${1}" = "t500_4mb" ]
+ if [ "${boardtarget}" = "x200_8mb" ] || [ "${boardtarget}" = "x200_4mb" ] || [ "${boardtarget}" = "r400_8mb" ] || [ "${boardtarget}" = "r400_4mb" ] || [ "${boardtarget}" = "t400_8mb" ] || [ "${boardtarget}" = "t400_4mb" ] || [ "${boardtarget}" = "t500_8mb" ] || [ "${boardtarget}" = "t500_4mb" ]
then
if [ "${romtype}" = "txtmode" ]
then
@@ -76,23 +78,23 @@ do
make clean
mv "config_${romtype}" ".config"
mv "grub_${romtype}.elf" "grub.elf"
- make -j$(nproc)
+ make -j"$(nproc)"
mv "grub.elf" "grub_${romtype}.elf"
- mv "build/coreboot.rom" "${1}_${romtype}.rom"
+ mv "build/coreboot.rom" "${boardtarget}_${romtype}.rom"
# .config no longer needed
rm -f ".config"
# Add version information to this image
- ./util/cbfstool/cbfstool ${1}_${romtype}.rom add -f lbversion -n lbversion -t raw
+ ./util/cbfstool/cbfstool "${boardtarget}_${romtype}.rom" add -f lbversion -n lbversion -t raw
# Add the background image
if [ "$romtype" = "vesafb" ]
then
if [ "$1" = "macbook21" ] || [ "$1" = "x200_4mb" ] || [ "$1" = "x200_8mb" ] || [ "$1" = "r400_4mb" ] || [ "$1" = "r400_8mb" ] || [ "$1" = "t400_4mb" ] || [ "$1" = "t400_8mb" ] || [ "$1" = "t500_4mb" ] || [ "$1" = "t500_8mb" ]
then
- ./util/cbfstool/cbfstool ${1}_${romtype}.rom add -f ../resources/grub/background/background1280x800.png -n background.png -t raw
+ ./util/cbfstool/cbfstool "${boardtarget}_${romtype}.rom" add -f ../resources/grub/background/background1280x800.png -n background.png -t raw
else
- ./util/cbfstool/cbfstool ${1}_${romtype}.rom add -f ../resources/grub/background/background1024x768.png -n background.png -t raw
+ ./util/cbfstool/cbfstool "${boardtarget}_${romtype}.rom" add -f ../resources/grub/background/background1024x768.png -n background.png -t raw
fi
fi
@@ -100,32 +102,32 @@ do
for keymap in $(for keylayout in ../resources/utilities/grub-assemble/keymap/original/*; do printf "%s\n" "${keylayout##*/}"; done)
do
# copy the images based on the keymap
- cp "${1}_${romtype}.rom" "${1}_${keymap}_${romtype}.rom"
+ cp "${boardtarget}_${romtype}.rom" "${boardtarget}_${keymap}_${romtype}.rom"
# Insert grub config into the image
- ./util/cbfstool/cbfstool ${1}_${keymap}_${romtype}.rom add -f grub_${keymap}_${romtype}.cfg -n grub.cfg -t raw
+ ./util/cbfstool/cbfstool "${boardtarget}_${keymap}_${romtype}.rom" add -f "grub_${keymap}_${romtype}.cfg" -n grub.cfg -t raw
# Insert grub test config into the image (for the user to test modifications to before modifying the main one)
- ./util/cbfstool/cbfstool ${1}_${keymap}_${romtype}.rom add -f grub_${keymap}_${romtype}_test.cfg -n grubtest.cfg -t raw
+ ./util/cbfstool/cbfstool "${boardtarget}_${keymap}_${romtype}.rom" add -f "grub_${keymap}_${romtype}_test.cfg" -n grubtest.cfg -t raw
done
# This config-less ROM is no longer needed
- rm -f "${1}_${romtype}.rom"
+ rm -f "${boardtarget}_${romtype}.rom"
done
# Now we clean up and prepare the bin directory containing all the images
# ----------------------------------------------------------------------------------------------------------------------------
# prepare directory for new ROM images
-rm -Rf "${1}/"
-mkdir "${1}/"
+rm -Rf "${boardtarget:?}/"
+mkdir "${boardtarget}/"
# move the ROM's into the newly created directory
-mv "${1}"*.rom "${1}/"
+mv "${boardtarget}"*.rom "${boardtarget}/"
# delete the old ROM's from ../bin
-rm -Rf "../bin/grub/${1}/"
+rm -Rf "../bin/grub/${boardtarget}/"
# now put the new ROM's in ./bin/grub/
[ ! -d "../bin/grub/" ] && mkdir -p "../bin/grub/"
-mv "${1}/" "../bin/grub/"
+mv "${boardtarget}/" "../bin/grub/"
# libreboot version file no longer needed
rm -f "lbversion"
@@ -134,4 +136,3 @@ rm -f "lbversion"
cd "../"
printf "\n\n"
-
diff --git a/resources/scripts/helpers/download/bucts b/resources/scripts/helpers/download/bucts
index ae58b938..6e615d79 100755
--- a/resources/scripts/helpers/download/bucts
+++ b/resources/scripts/helpers/download/bucts
@@ -57,6 +57,3 @@ git am "../resources/bucts/patch/0001-Makefile-don-t-use-git.patch"
cd "../"
printf "\n\n"
-
-# ------------------- DONE ----------------------
-
diff --git a/resources/scripts/helpers/download/coreboot b/resources/scripts/helpers/download/coreboot
index 337cdad1..2a10236f 100755
--- a/resources/scripts/helpers/download/coreboot
+++ b/resources/scripts/helpers/download/coreboot
@@ -152,6 +152,3 @@ printf "Deblobbing coreboot\n"
./resources/utilities/coreboot-libre/deblob
printf "\n\n"
-
-# ------------------- DONE ----------------------
-
diff --git a/resources/scripts/helpers/download/flashrom b/resources/scripts/helpers/download/flashrom
index bbe844b3..edf363a3 100755
--- a/resources/scripts/helpers/download/flashrom
+++ b/resources/scripts/helpers/download/flashrom
@@ -62,6 +62,3 @@ patch "flashchips.c" < "../resources/flashrom/patch/purged_chips.diff"
cd "../"
printf "\n\n"
-
-# ------------------- DONE ----------------------
-
diff --git a/resources/scripts/helpers/download/grub b/resources/scripts/helpers/download/grub
index c10ad433..229b8cef 100755
--- a/resources/scripts/helpers/download/grub
+++ b/resources/scripts/helpers/download/grub
@@ -50,6 +50,3 @@ git am "../resources/grub/patch/0001-grub-core-normal-main.c-Display-FREE-AS-IN-
cd "../"
printf "\n\n"
-
-# ------------------- DONE ----------------------
-
diff --git a/resources/scripts/helpers/download/memtest86plus b/resources/scripts/helpers/download/memtest86plus
index 950607c1..88ba8558 100755
--- a/resources/scripts/helpers/download/memtest86plus
+++ b/resources/scripts/helpers/download/memtest86plus
@@ -78,6 +78,3 @@ cp "../resources/memtest86plus/patch/Makefile" .
cd "../"
printf "\n\n"
-
-# ------------------- DONE ----------------------
-
diff --git a/resources/scripts/misc/powertop.trisquel7 b/resources/scripts/misc/powertop.trisquel7
index 25bb5976..215ae03c 100755
--- a/resources/scripts/misc/powertop.trisquel7
+++ b/resources/scripts/misc/powertop.trisquel7
@@ -48,4 +48,3 @@ update-rc.d powertop defaults
# Run powertop now and tell the user
powertop --auto-tune
printf "Done. Run 'powertop --auto-tune' now. This will also run automatically at boot time. Run it again at any time, if needed. This has also been done for you just now.\n"
-
diff --git a/resources/utilities/grub-assemble/gen.sh b/resources/utilities/grub-assemble/gen.sh
index 95a4ce02..e044efdf 100755
--- a/resources/utilities/grub-assemble/gen.sh
+++ b/resources/utilities/grub-assemble/gen.sh
@@ -23,7 +23,7 @@ grubdir="../../../grub"
source "modules.conf"
-printf "Creating GRUB ELF executable for configuration '$1'\n"
+printf "Creating GRUB ELF executable for configuration '%s'\n" "${1}"
if [ "${1}" = "vesafb" ]
then
# Generate the grub.elf (vesafb)