sh $(TOPDIR)/scripts/ubinize-image.sh \
$(if $(UBOOTENV_IN_UBI),--uboot-env) \
$(if $(KERNEL_IN_UBI),--kernel $(IMAGE_KERNEL)) \
+ $(foreach part,$(UBINIZE_PARTS),--part $(part)) \
$(IMAGE_ROOTFS) \
$@.tmp \
-p $(BLOCKSIZE) -m $(PAGESIZE) \
SUBPAGESIZE :=
VID_HDR_OFFSET :=
UBINIZE_OPTS := -E 5
+ UBINIZE_PARTS :=
MKUBIFS_OPTS :=
FS_OPTIONS/ubifs = $$(MKUBIFS_OPTS)
DEVICE_DTS DEVICE_DTS_DIR BOARD_NAME CMDLINE \
UBOOTENV_IN_UBI KERNEL_IN_UBI \
BLOCKSIZE PAGESIZE SUBPAGESIZE VID_HDR_OFFSET \
- UBINIZE_OPTS UIMAGE_NAME
+ UBINIZE_OPTS UIMAGE_NAME UBINIZE_PARTS
define Device/ExportVar
$(1) : $(2):=$$($(2))
#!/bin/sh
+part=""
ubootenv=""
ubinize_param=""
kernel=""
name=$2
image=$3
autoresize=$4
+ size="$5"
echo "[$name]"
echo "mode=ubi"
echo "vol_id=$volid"
echo "vol_name=$name"
if [ "$image" ]; then
echo "image=$image"
+ [ -n "$size" ] && echo "vol_size=${size}MiB"
else
echo "vol_size=1MiB"
fi
ubivol $vol_id ubootenv2
vol_id=$(( $vol_id + 1 ))
fi
+ for part in $parts; do
+ name="${part%%=*}"
+ prev="$part"
+ part="${part#*=}"
+ [ "$prev" = "$part" ] && part=
+
+ image="${part%%=*}"
+ prev="$part"
+ part="${part#*=}"
+ [ "$prev" = "$part" ] && part=
+
+ size="$part"
+
+ ubivol $vol_id "$name" "$image" "" "$size"
+ vol_id=$(( $vol_id + 1 ))
+ done
if [ "$3" ]; then
ubivol $vol_id kernel "$3"
vol_id=$(( $vol_id + 1 ))
shift
continue
;;
+ "--part")
+ parts="$parts $2"
+ shift
+ shift
+ continue
+ ;;
"-"*)
ubinize_param="$@"
break
done
if [ ! -r "$rootfs" -o ! -r "$kernel" -a ! "$outfile" ]; then
- echo "syntax: $0 [--uboot-env] [--kernel kernelimage] rootfs out [ubinize opts]"
+ echo "syntax: $0 [--uboot-env] [--part <name>=<file>] [--kernel kernelimage] rootfs out [ubinize opts]"
exit 1
fi