diff --git a/common.d/build_functions.sh b/common.d/build_functions.sh index cdec159..55c6b70 100644 --- a/common.d/build_functions.sh +++ b/common.d/build_functions.sh @@ -21,6 +21,7 @@ setup_inet() echo "xiaomi-nabu" > "$rootdir/etc/hostname" echo "127.0.0.1 localhost 127.0.1.1 xiaomi-nabu" > "$rootdir/etc/hosts" + return 0 } create_image() @@ -53,6 +54,7 @@ trim_image() log "Failed to trim image" ierror return 1 } + return 0 } # shellcheck disable=SC2155 @@ -74,6 +76,7 @@ mount_image() sed "s|{cmdline}|$SIMPLEINIT_CMDLINE|g" < ./drop/simpleinit.uefi.cfg > "$mountdir/boot/simpleinit/simpleinit.uefi.cfg" printf "%s" "$mountdir" + return 0 } gen_fstab() @@ -88,6 +91,7 @@ gen_fstab() [ -f "$rootdir/etc/fstab" ] && rm "$rootdir/etc/fstab" cp ./drop/fstab "$rootdir/etc/fstab" fi + return 0 } umount_image() @@ -104,10 +108,11 @@ umount_image() cp ./drop/postinstall "$rootdir/opt/nabu/postinstall" chmod +x "$rootdir/opt/nabu/postinstall" - umount "$rootdir/boot/efi" > /dev/null 2>&1 - umount "$rootdir/boot/simpleinit" > /dev/null 2>&1 - umount "$rootdir" > /dev/null 2>&1 - rm -d "$rootdir" > /dev/null 2>&1 + umount "$rootdir/boot/efi" + umount "$rootdir/boot/simpleinit" + umount "$rootdir" + rm -d "$rootdir" + return 0 } prepare_chroot() @@ -121,11 +126,11 @@ prepare_chroot() export PATH=/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:\$PATH rootdir="$(realpath "$1")" - mount -t proc proc "$rootdir/proc" > /dev/null 2>&1 - mount -t sysfs sysfs "$rootdir/sys" > /dev/null 2>&1 - mount -t devtmpfs devtmpfs "$rootdir/dev" > /dev/null 2>&1 - mount -t devpts devpts "$rootdir/dev/pts" > /dev/null 2>&1 - mount -t tmpfs devshm "$rootdir/dev/shm" > /dev/null 2>&1 + mount -t proc proc "$rootdir/proc" + mount -t sysfs sysfs "$rootdir/sys" + mount -t devtmpfs devtmpfs "$rootdir/dev" + mount -t devpts devpts "$rootdir/dev/pts" + mount -t tmpfs devshm "$rootdir/dev/shm" return 0 }