make shellcheck happy and randomise mac address
This commit is contained in:
parent
4b93866392
commit
3b68da77aa
2 changed files with 23 additions and 7 deletions
12
mk_pbp_img
12
mk_pbp_img
|
@ -28,7 +28,7 @@ cleanup_mounts() {
|
|||
}
|
||||
|
||||
check_tools() {
|
||||
for tool in ${TOOLS[@]}; do
|
||||
for tool in "${TOOLS[@]}"; do
|
||||
if ! command -v "$tool" &> /dev/null
|
||||
then
|
||||
echo "$tool could not be found"
|
||||
|
@ -65,8 +65,12 @@ build_img() {
|
|||
sudo ./mkplatformfs.sh -p "dracut lvm2 cryptsetup" -o "$platformfs_file" pinebookpro "$rootfs_file"
|
||||
sudo ./mkimage.sh -B 256MiB -o "$img" "$platformfs_file"
|
||||
|
||||
# shellcheck disable=SC2024
|
||||
# it is correct that the decompressed image is written as the unprivileged user
|
||||
sudo xz --decompress --stdout "$img.xz" > "$img"
|
||||
local loop_dev="$(sudo losetup --show -f -P "$img")"
|
||||
|
||||
local loop_dev
|
||||
loop_dev="$(sudo losetup --show -f -P "$img")"
|
||||
|
||||
sudo mount "$loop_dev"p2 "$TMP_DIR_MOUNT"
|
||||
sudo mount "$loop_dev"p1 "$TMP_DIR_MOUNT"/boot
|
||||
|
@ -84,9 +88,9 @@ EOT
|
|||
cleanup_mounts
|
||||
|
||||
mkdir -p "$OUT_DIR"
|
||||
xz --threads=0 --compress --stdout "$img" > "$OUT_DIR/$(basename $img.xz)"
|
||||
xz --threads=0 --compress --stdout "$img" > "$OUT_DIR/$(basename "$img.xz")"
|
||||
|
||||
echo "built pinebookpro image: $OUT_DIR/$(basename $img.xz)"
|
||||
echo "built pinebookpro image: $OUT_DIR/$(basename "$img.xz")"
|
||||
}
|
||||
|
||||
trap cleanup 0 SIGHUP SIGINT SIGQUIT SIGABRT SIGTERM
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue