diff --git a/scripts/InstallScripts/InstallPackages.sh b/scripts/InstallScripts/InstallPackages.sh
index 48bd931..db4a903 100755
--- a/scripts/InstallScripts/InstallPackages.sh
+++ b/scripts/InstallScripts/InstallPackages.sh
@@ -24,7 +24,7 @@ cat $DIR/icons/ascii-icon.txt
echo ""
while true; do
- read -p "Install (X)fce4, (L)xqt or (G)nome, if unsure choose (X)fce: " XL
+ read -r -p "Install (X)fce4, (L)xqt or (G)nome, if unsure choose (X)fce: " XL
case $XL in
[Gg]* ) DE=gnome; break;;
[Xx]* ) DE=xfce; break;;
@@ -175,7 +175,7 @@ done
#Force a safe username
while true; do
echo "-----Enter new username:-----"
- read username
+ read -r username
#ensure no whitespace
case $username in *\ *) echo usernames may not contain whitespace;; *) break;; esac
done
@@ -183,7 +183,7 @@ until adduser $username --gecos ""
do
while true; do
echo "-----Enter new username:-----"
- read username
+ read -r username
#ensure no whitespace
case $username in *\ *) echo usernames may not contain whitespace;; *) break;; esac
done
diff --git a/scripts/InstallScripts/InstallPrawnOS.sh b/scripts/InstallScripts/InstallPrawnOS.sh
index d6e14ec..4a0ab88 100755
--- a/scripts/InstallScripts/InstallPrawnOS.sh
+++ b/scripts/InstallScripts/InstallPrawnOS.sh
@@ -37,7 +37,7 @@ main() {
echo "Expand or Install?: "
echo "The currently booted device is ${BOOT_DEVICE}"
while true; do
- read -p "[I]nstall or [E]xpand?" IE
+ read -r -p "[I]nstall or [E]xpand?" IE
case $IE in
[Ii]* ) install; break;;
[Ee]* ) expand; break;;
@@ -54,7 +54,7 @@ install() {
echo "Please ensure you have only have the booted device and the desired target device inserted."
echo "The currently booted device is ${BOOT_DEVICE}"
while true; do
- read -p "[I]nternal Emmc, [S]D card, or [U]SB device?: " ISU
+ read -r -p "[I]nternal Emmc, [S]D card, or [U]SB device?: " ISU
case $ISU in
[Ii]* ) TARGET=/dev/mmcblk2p; break;;
[Ss]* ) TARGET=/dev/mmcblk0p; break;;
@@ -71,7 +71,7 @@ install() {
TARGET=/dev/sda
fi
fi
- if [[ $TARGET == $BOOT_DEVICE ]]
+ if [[ "$TARGET" == "$BOOT_DEVICE" ]]
then
echo "Can't install to booted device, please ensure you have *only* the booted device and target device inserted"
exit
@@ -87,7 +87,7 @@ install() {
#Now on to the installation, basically copy InstallToInternal.sh
while true; do
- read -p "This will ERASE ALL DATA ON ${TARGET_NO_P} and reboot when finished, do you want to continue? [y/N]" yn
+ read -r -p "This will ERASE ALL DATA ON ${TARGET_NO_P} and reboot when finished, do you want to continue? [y/N]" yn
case $yn in
[Yy]* ) break;;
[Nn]* ) exit;;
@@ -160,7 +160,7 @@ install() {
echo "${ROOT_PARTITION} / ext4 defaults,noatime 0 1" > $INSTALL_MOUNT/etc/fstab
while true; do
- read -p "Install a desktop environment and the supporting packages? [Y/n]" ins
+ read -r -p "Install a desktop environment and the supporting packages? [Y/n]" ins
case $ins in
[Yy]* ) install_packages $INSTALL_MOUNT; break;;
[Nn]* ) break;;
@@ -179,7 +179,7 @@ install() {
fi
echo "Please remove the booted device after power off is complete"
while true; do
- read -p "Reboot? [y/N]" re
+ read -r -p "Reboot? [y/N]" re
case $re in
[Yy]* ) reboot;;
[Nn]* ) exit;;
@@ -273,7 +273,7 @@ expand() {
resize2fs -f ${BOOT_DEVICE}2
echo "/dev/${BOOT_DEVICE}2 / ext4 defaults,noatime 0 1" > /etc/fstab
while true; do
- read -p "Install a desktop environment and the supporting packages? [Y/n]" ins
+ read -r -p "Install a desktop environment and the supporting packages? [Y/n]" ins
case $ins in
[Yy]* ) /InstallResources/InstallPackages.sh; reboot;;
[Nn]* ) exit;;
diff --git a/scripts/InstallScripts/UpgradeKernel.sh b/scripts/InstallScripts/UpgradeKernel.sh
index 540adba..3759583 100755
--- a/scripts/InstallScripts/UpgradeKernel.sh
+++ b/scripts/InstallScripts/UpgradeKernel.sh
@@ -1,4 +1,3 @@
-
#!/bin/bash
#Replace the PrawnOS linux kernel that is installed on the internal emmc storage with
@@ -20,7 +19,6 @@
# You should have received a copy of the GNU General Public License
# along with PrawnOS. If not, see .
-RESOURCES=/InstallResources
# Grab the boot device, which is either /dev/sda for usb or /dev/mmcblk0 for an sd card
BOOT_DEVICE=$(mount | head -n 1 | cut -d '2' -f 1)
diff --git a/scripts/buildFilesystem.sh b/scripts/buildFilesystem.sh
index bbebc67..f7b0996 100755
--- a/scripts/buildFilesystem.sh
+++ b/scripts/buildFilesystem.sh
@@ -56,7 +56,7 @@ DEBIAN_SUITE=$2
BASE=$3
PRAWNOS_ROOT=$4
-outmnt=$(mktemp -d -p `pwd`)
+outmnt=$(mktemp -d -p "$(pwd)")
outdev=/dev/loop5
diff --git a/scripts/buildInitramFs.sh b/scripts/buildInitramFs.sh
index 14d6c6e..474428e 100755
--- a/scripts/buildInitramFs.sh
+++ b/scripts/buildInitramFs.sh
@@ -22,7 +22,7 @@ set -e
# along with PrawnOS. If not, see .
-outmnt=$(mktemp -d -p `pwd`)
+outmnt=$(mktemp -d -p "$(pwd)")
outdev=/dev/loop7
if [ -z "$1" ]
then
@@ -30,7 +30,7 @@ then
exit 1
fi
BASE=$1
-ROOT_DIR=`pwd`
+ROOT_DIR="$(pwd)"
build_resources=$ROOT_DIR/resources/BuildResources
if [ ! -f $ROOT_DIR/$BASE ]
diff --git a/scripts/buildKernel.sh b/scripts/buildKernel.sh
index f192076..dcf205b 100755
--- a/scripts/buildKernel.sh
+++ b/scripts/buildKernel.sh
@@ -28,7 +28,7 @@ then
fi
KVER=$1
-ROOT_DIR=`pwd`
+ROOT_DIR="$(pwd)"
RESOURCES=$ROOT_DIR/resources/BuildResources
[ ! -d build ] && mkdir build
@@ -59,14 +59,14 @@ cd linux-$KVER
make clean
make mrproper
#Apply the usb and mmc patches if unapplied
-[ "$FRESH" = true ] && for i in $RESOURCES/patches-tested/kernel/5.x-dwc2/*.patch; do echo $i; patch -p1 < $i; done
-[ "$FRESH" = true ] && for i in $RESOURCES/patches-tested/DTS/*.patch; do echo $i; patch -p1 < $i; done
-[ "$FRESH" = true ] && for i in $RESOURCES/patches-tested/kernel/*.patch; do echo $i; patch -p1 < $i; done
+[ "$FRESH" = true ] && for i in "$RESOURCES"/patches-tested/kernel/5.x-dwc2/*.patch; do echo $i; patch -p1 < $i; done
+[ "$FRESH" = true ] && for i in "$RESOURCES"/patches-tested/DTS/*.patch; do echo $i; patch -p1 < $i; done
+[ "$FRESH" = true ] && for i in "$RESOURCES"/patches-tested/kernel/*.patch; do echo $i; patch -p1 < $i; done
#copy in the initramfs and kernel config
cp $ROOT_DIR/build/PrawnOS-initramfs.cpio.gz .
cp $RESOURCES/config .config
-make -j $((`nproc` +1)) CROSS_COMPILE=arm-none-eabi- ARCH=arm zImage modules dtbs
+make -j $(($(nproc) +1)) CROSS_COMPILE=arm-none-eabi- ARCH=arm zImage modules dtbs
[ ! -h kernel.its ] && ln -s $RESOURCES/kernel.its .
mkimage -D "-I dts -O dtb -p 2048" -f kernel.its vmlinux.uimg
dd if=/dev/zero of=bootloader.bin bs=512 count=1
diff --git a/scripts/crossmenuconfig.sh b/scripts/crossmenuconfig.sh
index 3f4e56f..33eb62d 100755
--- a/scripts/crossmenuconfig.sh
+++ b/scripts/crossmenuconfig.sh
@@ -30,7 +30,7 @@ fi
KVER=$1
-ROOT_DIR=`pwd`
+ROOT_DIR="$(pwd)"
RESOURCES=$ROOT_DIR/resources/BuildResources
[ ! -d build ] && mkdir build
@@ -42,9 +42,9 @@ cd linux-$KVER
make clean
make mrproper
#Apply the usb and mmc patches if unapplied
-[ "$FRESH" = true ] && for i in $RESOURCES/patches-tested/kernel/5.x-dwc2/*.patch; do echo $i; patch -p1 < $i; done
-[ "$FRESH" = true ] && for i in $RESOURCES/patches-tested/DTS/*.patch; do echo $i; patch -p1 < $i; done
-[ "$FRESH" = true ] && for i in $RESOURCES/patches-tested/kernel/*.patch; do echo $i; patch -p1 < $i; done
+[ "$FRESH" = true ] && for i in "$RESOURCES"/patches-tested/kernel/5.x-dwc2/*.patch; do echo $i; patch -p1 < $i; done
+[ "$FRESH" = true ] && for i in "$RESOURCES"/patches-tested/DTS/*.patch; do echo $i; patch -p1 < $i; done
+[ "$FRESH" = true ] && for i in "$RESOURCES"/patches-tested/kernel/*.patch; do echo $i; patch -p1 < $i; done
cp $RESOURCES/config .config
make menuconfig ARCH=arm CROSS_COMPILE=arm-none-eabi- .config
diff --git a/scripts/injectKernelIntoFS.sh b/scripts/injectKernelIntoFS.sh
index d98ac38..e090452 100755
--- a/scripts/injectKernelIntoFS.sh
+++ b/scripts/injectKernelIntoFS.sh
@@ -32,7 +32,7 @@ fi
KVER=$1
OUTNAME=$2
-outmnt=$(mktemp -d -p `pwd`)
+outmnt=$(mktemp -d -p "$(pwd)")
outdev=/dev/loop7
build_resources=resources/BuildResources
diff --git a/scripts/patchKernel.sh b/scripts/patchKernel.sh
index 8850daa..1ce09ce 100755
--- a/scripts/patchKernel.sh
+++ b/scripts/patchKernel.sh
@@ -10,7 +10,7 @@ then
fi
KVER=$1
-ROOT_DIR=`pwd`
+ROOT_DIR="$(pwd)"
RESOURCES=$ROOT_DIR/resources/BuildResources
@@ -20,8 +20,8 @@ cd build
cd linux-$KVER
make clean
make mrproper
-#Apply the usb and mmc patches if unapplie
-for i in $RESOURCES/patches-tested/DTS/*.patch; do patch -p1 < $i; done
-for i in $RESOURCES/patches-tested/kernel/*.patch; do patch -p1 < $i; done
+#Apply the usb and mmc patches if unapplied
+for i in "$RESOURCES"/patches-tested/DTS/*.patch; do patch -p1 < $i; done
+for i in "$RESOURCES"/patches-tested/kernel/*.patch; do patch -p1 < $i; done
cd $ROOT_DIR