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 <profile>
           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.
```
This commit is contained in:
zciendor
2020-05-28 08:52:54 +00:00
committed by GitHub
parent a5815c6350
commit a0d6f21ac7
2 changed files with 3 additions and 3 deletions

View File

@@ -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

View File

@@ -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