11 dd if=$1 bs
=2 count
=1 2>/dev
/null |
hexdump -v -n 2 -e '1/1 "%02x"'
15 if [ "$( get_magic_word $1 )" = "3118" ]; then
28 echo "vol_type=dynamic"
35 if [ "$autoresize" ]; then
36 echo "vol_flags=autoresize"
42 local root_is_ubifs
="$( is_ubifs "$2" )"
43 if [ "$1" = "ubootenv" ]; then
44 ubivol
$vol_id ubootenv
45 vol_id
=$
(( $vol_id + 1 ))
46 ubivol
$vol_id ubootenv2
47 vol_id
=$
(( $vol_id + 1 ))
50 ubivol
$vol_id kernel
"$3"
51 vol_id
=$
(( $vol_id + 1 ))
53 ubivol
$vol_id rootfs
"$2" $root_is_ubifs
54 vol_id
=$
(( $vol_id + 1 ))
55 [ "$root_is_ubifs" ] || ubivol
$vol_id rootfs_data
"" 1
75 if [ ! "$rootfs" ]; then
80 if [ ! "$outfile" ]; then
89 if [ ! -r "$rootfs" -o ! -r "$kernel" -a ! "$outfile" ]; then
90 echo "syntax: $0 [--uboot-env] [--kernel kernelimage] rootfs out [ubinize opts]"
94 ubinize
="$( which ubinize )"
95 if [ ! -x "$ubinize" ]; then
96 echo "ubinize tool not found or not usable"
100 ubinizecfg
="$( mktemp )"
101 ubilayout
"$ubootenv" "$rootfs" "$kernel" > "$ubinizecfg"
104 ubinize
-o "$outfile" $ubinize_param "$ubinizecfg"
106 [ ! -e "$outfile" ] && err
=2