From a0d6f21ac75a18715a58a42830370e72e3e513e3 Mon Sep 17 00:00:00 2001 From: zciendor <37557036+zciendor@users.noreply.github.com> Date: Thu, 28 May 2020 08:52:54 +0000 Subject: [PATCH] various minor fixes (#1993) * fix permisson denied error happening in line 79 `mktemp` creates files with `-rw-------` (on Ubuntu bionic at least), which causes `line 79` to throw a permission denied error if the file isn't world readable. * fixes umount error caused by single quotes * force metadata duplication for btrfs root Without this change metadata duplication is automatically turned off for `mkfs.btrfs` when the **build system** has a SSD drive. However, since Armbian image is most likely flashed to a SD card afterwards, the drive type of the build host system should not be the deciding factor. Metadata duplication is a good idea (better reliability) to have on a SD card. From `man mkfs.btrfs`: ``` -m|--metadata Specify the profile for the metadata block groups. Valid values are raid0, raid1, raid5, raid6, raid10, single or dup, (case does not matter). A single device filesystem will default to DUP, unless a SSD is detected. Then it will default to single. ``` --- compile.sh | 2 +- lib/debootstrap.sh | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/compile.sh b/compile.sh index b392b651b..dac713a33 100755 --- a/compile.sh +++ b/compile.sh @@ -66,7 +66,7 @@ update_src() { fi } -TMPFILE=`mktemp` +TMPFILE=`mktemp` && chmod 644 $TMPFILE echo SRC=$SRC > $TMPFILE echo LIB_TAG=$LIB_TAG >> $TMPFILE declare -f update_src >> $TMPFILE diff --git a/lib/debootstrap.sh b/lib/debootstrap.sh index 461ce5d83..9a2edad09 100644 --- a/lib/debootstrap.sh +++ b/lib/debootstrap.sh @@ -81,7 +81,7 @@ debootstrap_ng() # stage: unmount tmpfs umount $SDCARD 2>&1 if [[ $use_tmpfs = yes ]]; then - while grep -qs '$SDCARD' /proc/mounts + while grep -qs "$SDCARD" /proc/mounts do umount $SDCARD sleep 5 @@ -324,7 +324,7 @@ prepare_partitions() mkopts[fat]='-n BOOT' mkopts[ext2]='-q' # mkopts[f2fs] is empty - # mkopts[btrfs] is empty + mkopts[btrfs]='-m dup' # mkopts[nfs] is empty mkfs[ext4]=ext4