3 .
$TOPDIR/scripts
/functions.sh
23 echo "vol_type=dynamic"
27 [ -n "$size" ] && echo "vol_size=${size}"
31 if [ "$autoresize" ]; then
32 echo "vol_flags=autoresize"
40 local rootfs_type
="$( get_fs_type "$2" )"
42 if [ "$1" = "ubootenv" ]; then
43 ubivol
$vol_id ubootenv
44 vol_id
=$
(( $vol_id + 1 ))
45 ubivol
$vol_id ubootenv2
46 vol_id
=$
(( $vol_id + 1 ))
48 for part
in $parts; do
52 [ "$prev" = "$part" ] && part
=
57 [ "$prev" = "$part" ] && part
=
61 ubivol
$vol_id "$name" "$image" "" "${size}MiB"
62 vol_id
=$
(( $vol_id + 1 ))
65 ubivol
$vol_id kernel
"$3"
66 vol_id
=$
(( $vol_id + 1 ))
70 case "$rootfs_type" in
75 # squashfs uses 1k block size, ensure we do not
77 rootsize
="$( round_up "$
( stat
-c%s
"$2" )" 1024 )"
80 ubivol
$vol_id rootfs
"$2" "$autoresize" "$rootsize"
82 vol_id
=$
(( $vol_id + 1 ))
83 [ "$rootfs_type" = "ubifs" ] || ubivol
$vol_id rootfs_data
"" 1
88 if [ -n "$SOURCE_DATE_EPOCH" ] ; then
89 ubinize_seq
="-Q $SOURCE_DATE_EPOCH"
123 if [ ! "$outfile" ]; then
132 if [ ! -r "$rootfs" -a ! -r "$kernel" -a ! "$outfile" ]; then
133 echo "syntax: $0 [--uboot-env] [--part <name>=<file>] [--kernel kernelimage] [--rootfs rootfsimage] out [ubinize opts]"
137 ubinize
="$( command -v ubinize )"
138 if [ ! -x "$ubinize" ]; then
139 echo "ubinize tool not found or not usable"
143 ubinizecfg
="$( mktemp 2> /dev/null )"
144 if [ -z "$ubinizecfg" ]; then
146 ubinizecfg
="$( mktemp -t 'ubitmp' )"
148 ubilayout
"$ubootenv" "$rootfs" "$kernel" > "$ubinizecfg"
152 ubinize
$ubinize_seq -o "$outfile" $ubinize_param "$ubinizecfg"
154 [ ! -e "$outfile" ] && err
=2