12 dd if=$1 bs=2 count=1 2>/dev/null | hexdump -v -n 2 -e '1/1 "%02x"'
16 if [ "$( get_magic_word $1 )" = "3118" ]; then
30 echo "vol_type=dynamic"
34 [ -n "$size" ] && echo "vol_size=${size}MiB"
38 if [ "$autoresize" ]; then
39 echo "vol_flags=autoresize"
45 local root_is_ubifs="$( is_ubifs "$2" )"
46 if [ "$1" = "ubootenv" ]; then
47 ubivol $vol_id ubootenv
48 vol_id=$(( $vol_id + 1 ))
49 ubivol $vol_id ubootenv2
50 vol_id=$(( $vol_id + 1 ))
52 for part in $parts; do
56 [ "$prev" = "$part" ] && part=
61 [ "$prev" = "$part" ] && part=
65 ubivol $vol_id "$name" "$image" "" "$size"
66 vol_id=$(( $vol_id + 1 ))
69 ubivol $vol_id kernel "$3"
70 vol_id=$(( $vol_id + 1 ))
72 ubivol $vol_id rootfs "$2" $root_is_ubifs
73 vol_id=$(( $vol_id + 1 ))
74 [ "$root_is_ubifs" ] || ubivol $vol_id rootfs_data "" 1
101 if [ ! "$rootfs" ]; then
106 if [ ! "$outfile" ]; then
115 if [ ! -r "$rootfs" -o ! -r "$kernel" -a ! "$outfile" ]; then
116 echo "syntax: $0 [--uboot-env] [--part <name>=<file>] [--kernel kernelimage] rootfs out [ubinize opts]"
120 ubinize="$( which ubinize )"
121 if [ ! -x "$ubinize" ]; then
122 echo "ubinize tool not found or not usable"
126 ubinizecfg="$( mktemp 2> /dev/null )"
127 if [ -z "$ubinizecfg" ]; then
129 ubinizecfg="$( mktemp -t 'ubitmp' )"
131 ubilayout "$ubootenv" "$rootfs" "$kernel" > "$ubinizecfg"
134 ubinize -o "$outfile" $ubinize_param "$ubinizecfg"
136 [ ! -e "$outfile" ] && err=2