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
29 echo "vol_type=dynamic"
36 if [ "$autoresize" ]; then
37 echo "vol_flags=autoresize"
43 local root_is_ubifs="$( is_ubifs "$2" )"
44 if [ "$1" = "ubootenv" ]; then
45 ubivol $vol_id ubootenv
46 vol_id=$(( $vol_id + 1 ))
47 ubivol $vol_id ubootenv2
48 vol_id=$(( $vol_id + 1 ))
51 ubivol $vol_id kernel "$3"
52 vol_id=$(( $vol_id + 1 ))
54 ubivol $vol_id rootfs "$2" $root_is_ubifs
55 vol_id=$(( $vol_id + 1 ))
56 [ "$root_is_ubifs" ] || ubivol $vol_id rootfs_data "" 1
76 if [ ! "$kernel" -a ! "$nokernel" ]; then
81 if [ ! "$rootfs" ]; then
86 if [ ! "$outfile" ]; then
95 if [ ! -r "$rootfs" -o ! -r "$kernel" -a ! "$nokernel" -o ! "$outfile" ]; then
96 echo "syntax: $0 [--no-kernel] [--uboot-env] rootfs [kernel] out [ubinize opts]"
100 ubinize="$( which ubinize )"
101 if [ ! -x "$ubinize" ]; then
102 echo "ubinize tool not found or not usable"
106 ubinizecfg="$( mktemp )"
107 ubilayout "$ubootenv" "$rootfs" "$kernel" > "$ubinizecfg"
110 ubinize -o "$outfile" $ubinize_param "$ubinizecfg"
112 [ ! -e "$outfile" ] && err=2