From 31efa101cfdac30b74a47fa8250cd1d31ad92416 Mon Sep 17 00:00:00 2001 From: Tobias Powalowski Date: Fri, 21 Jan 2022 12:02:59 +0100 Subject: [PATCH] code cleanup --- usr/bin/archboot-x86_64-release.sh | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/usr/bin/archboot-x86_64-release.sh b/usr/bin/archboot-x86_64-release.sh index ae8b2176a..74e36d8b9 100755 --- a/usr/bin/archboot-x86_64-release.sh +++ b/usr/bin/archboot-x86_64-release.sh @@ -26,8 +26,8 @@ if ! [[ "$(uname -m)" == "x86_64" ]]; then exit 1 fi echo "Start release creation in $1 ..." -mkdir -p $1 -cd $1 +mkdir -p "$1" +cd "$1" || exit 1 # create container archboot-x86_64-create-container.sh "${_W_DIR}" -cc -cp || exit 1 # generate tarball in container, umount tmp it's a tmpfs and weird things could happen then @@ -40,7 +40,7 @@ systemd-nspawn -D "${_W_DIR}" /bin/bash -c "pacman -Rdd lvm2 openssh --noconfirm # generate latest tarball in container echo "Generate latest ISO ..." # generate latest iso in container -systemd-nspawn -q -D "${_W_DIR}" /bin/bash -c "umount /tmp;archboot-x86_64-iso.sh -g -p="${_PRESET_LATEST}" -r=$(date +%Y.%m.%d-%H.%M)-latest" +systemd-nspawn -q -D "${_W_DIR}" /bin/bash -c "umount /tmp;archboot-x86_64-iso.sh -g -p=${_PRESET_LATEST} -r=$(date +%Y.%m.%d-%H.%M)-latest" # create Release.txt with included main archlinux packages echo "Generate Release.txt ..." echo "Welcome to ARCHBOOT INSTALLATION / RESCUEBOOT SYSTEM" >>Release.txt @@ -61,7 +61,7 @@ rm -r "${_W_DIR}" echo "Create boot directory ..." mkdir -p boot/licenses/{amd-ucode,intel-ucode} for i in *.iso; do - if [[ ! "$(echo $i | grep latest)" ]]; then + if ! grep -q latest "${i}"; then isoinfo -R -i "${i}" -x /boot/amd-ucode.img > boot/amd-ucode.img 2>&1 isoinfo -R -i "${i}" -x /boot/intel-ucode.img > boot/intel-ucode.img 2>&1 isoinfo -R -i "${i}" -x /boot/initramfs_x86_64.img > boot/initramfs_archboot_x86_64.img 2>&1