build_fn: add return 0

This commit is contained in:
timoxa0 2024-11-02 21:14:00 +05:00
parent cee1740d98
commit a54cbf27e6

View file

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