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
60 if [ "$1" = "--uboot-env" ]; then
65 if [ "$1" = "--no-kernel" ]; then
70 if [ ! "$kernel" -a ! "$nokernel" ]; then
71 [ "${1:0:1}" = "-" ] && break
76 if [ ! "$rootfs" ]; then
77 [ "${1:0:1}" = "-" ] && break
82 if [ ! "$outfile" ]; then
83 [ "${1:0:1}" = "-" ] && break
92 if [ ! -r "$rootfs" -o ! -r "$kernel" -a ! "$nokernel" -o ! "$outfile" ]; then
93 echo "syntax: $0 [--no-kernel] [--uboot-env] rootfs [kernel] out [ubinize opts]"
97 ubinize
="$( which ubinize )"
98 if [ ! -x "$ubinize" ]; then
99 echo "ubinize tool not found or not usable"
103 ubinizecfg
="$( mktemp )"
104 ubilayout
"$ubootenv" "$rootfs" "$kernel" > "$ubinizecfg"
107 ubinize
-o "$outfile" $ubinize_param "$ubinizecfg"
109 [ ! -e "$outfile" ] && err
=2