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
76 if [ ! "$rootfs" ]; then
81 if [ ! "$outfile" ]; then
90 if [ ! -r "$rootfs" -o ! -r "$kernel" -a ! "$outfile" ]; then
91 echo "syntax: $0 [--uboot-env] [--kernel kernelimage] rootfs out [ubinize opts]"
95 ubinize
="$( which ubinize )"
96 if [ ! -x "$ubinize" ]; then
97 echo "ubinize tool not found or not usable"
101 ubinizecfg
="$( mktemp )"
102 ubilayout
"$ubootenv" "$rootfs" "$kernel" > "$ubinizecfg"
105 ubinize
-o "$outfile" $ubinize_param "$ubinizecfg"
107 [ ! -e "$outfile" ] && err
=2