vol_id=$(( $vol_id + 1 ))
fi
- case "$rootfs_type" in
- "ubifs")
- autoresize=1
- ;;
- "squashfs")
- # squashfs uses 1k block size, ensure we do not
- # violate that
- rootsize="$( round_up "$( stat -c%s "$2" )" 1024 )"
- ;;
- esac
- ubivol $vol_id rootfs "$2" "$autoresize" "$rootsize"
+ if [ "$2" ]; then
+ case "$rootfs_type" in
+ "ubifs")
+ autoresize=1
+ ;;
+ "squashfs")
+ # squashfs uses 1k block size, ensure we do not
+ # violate that
+ rootsize="$( round_up "$( stat -c%s "$2" )" 1024 )"
+ ;;
+ esac
+ ubivol $vol_id rootfs "$2" "$autoresize" "$rootsize"
- vol_id=$(( $vol_id + 1 ))
- [ "$rootfs_type" = "ubifs" ] || ubivol $vol_id rootfs_data "" 1
+ vol_id=$(( $vol_id + 1 ))
+ [ "$rootfs_type" = "ubifs" ] || ubivol $vol_id rootfs_data "" 1
+ fi
}
set_ubinize_seq() {
shift
continue
;;
+ "--rootfs")
+ rootfs="$2"
+ shift
+ shift
+ continue
+ ;;
"--part")
parts="$parts $2"
shift
break
;;
*)
- if [ ! "$rootfs" ]; then
- rootfs=$1
- shift
- continue
- fi
if [ ! "$outfile" ]; then
outfile=$1
shift
esac
done
-if [ ! -r "$rootfs" -o ! -r "$kernel" -a ! "$outfile" ]; then
- echo "syntax: $0 [--uboot-env] [--part <name>=<file>] [--kernel kernelimage] rootfs out [ubinize opts]"
+if [ ! -r "$rootfs" -a ! -r "$kernel" -a ! "$outfile" ]; then
+ echo "syntax: $0 [--uboot-env] [--part <name>=<file>] [--kernel kernelimage] [--rootfs rootfsimage] out [ubinize opts]"
exit 1
fi