Lines Matching +full:ext +full:- +full:32 +full:k

4 if [ -n "$RK_BUILDROOT_CFG" ]; then
9 "$(dirname "$(realpath "$0")")/check-mkimage.sh"
14 echo -e "FATAL: " $@
21 fatal "Usage: $0 <src_dir> <target_image> <fs_type> <size(M|K)|auto(0)> [label]"
24 [ ! $# -lt 4 ] || usage "Not enough args${@+: $0 $@}"
36 *K)
37 SIZE_KB=$(( ${SIZE%K} ))
44 echo $SIZE_KB | grep -vq [^0-9] || usage "Invalid size: $SIZE_KB"
46 TEMP=$(mktemp -u)
48 [ -d "$SRC_DIR" ] || usage "No such src dir: $SRC_DIR"
54 find $SRC_DIR -maxdepth $DEPTH -mindepth $DEPTH -type d|grep -q "" \
56 find $SRC_DIR -maxdepth $DEPTH -mindepth $DEPTH -type d \
57 -exec sh -c 'ntfscp $TARGET "$1" "${1#$SRC_DIR}"' sh {} \; || \
58 fatal "Detected non-buildroot ntfscp(doesn't support dir copy)"
62 find $SRC_DIR -type f \
63 -exec sh -c 'ntfscp $TARGET "$1" "${1#$SRC_DIR}"' sh {} \; || \
72 mkdir -p $TEMP || return 1
75 cp -rp $SRC_DIR/* $TEMP
79 rm -rf $TEMP
86 which $1|grep -wq buildroot
92 rm -rf $TARGET
93 dd of=$TARGET bs=1K seek=$SIZE_KB count=0 &>/dev/null || \
96 ext[234])
97 if mke2fs -h 2>&1 | grep -wq "\-d"; then
98 mke2fs -t $FS_TYPE $TARGET -d $SRC_DIR \
101 echo "Detected old mke2fs(doesn't support '-d' option)!"
102 mke2fs -t $FS_TYPE $TARGET || return 1
105 # Set max-mount-counts to 0, and disable the time-dependent checking.
106 tune2fs -c 0 -i 0 $TARGET ${LABEL:+-L $LABEL}
110 mkfs.vfat -F 32 $TARGET ${LABEL:+-n $LABEL} && \
112 mcopy -bspmn -D s -i $TARGET $SRC_DIR/* ::/
116 mkntfs -FCQ $TARGET ${LABEL:+-L $LABEL}
132 SIZE_KB=$(du -k $TEMP|grep -o "^[0-9]*")
133 rm -rf $TEMP
145 [ $RETRY -gt $MAX_RETRY ] && fatal "Failed to make image!"
152 TARGET_DIR="${RK_OUTDIR:-$(dirname "$TARGET")}"
153 UBI_VOL_NAME=${LABEL:-ubi}
156 UBI_PAGE_SIZE=${RK_UBI_PAGE_SIZE:-2048}
158 UBI_BLOCK_SIZE=${RK_UBI_BLOCK_SIZE:-0x20000}
160 UBIFS_LEBSIZE=$(( $UBI_BLOCK_SIZE - 2 * $UBI_PAGE_SIZE ))
164 UBINIZE_CFG="$TARGET_DIR/${UBI_VOL_NAME}-ubinize.cfg"
168 mkfs.ubifs -x lzo -e $UBIFS_LEBSIZE -m $UBIFS_MINIOSIZE \
169 -c $UBIFS_MAXLEBCNT -d $SRC_DIR -F -v -o $UBIFS_IMAGE || return 1
180 ubinize -o $TARGET -m $UBIFS_MINIOSIZE -p $UBI_BLOCK_SIZE \
181 -v $UBINIZE_CFG
184 rm -rf $TARGET
186 ext[234]|msdos|fat|vfat|ntfs|ubi|ubifs)
187 if [ $SIZE_KB -eq 0 ]; then
194 [ $SIZE_KB -eq 0 ] || fatal "$FS_TYPE: fixed size not supported."
195 mksquashfs $SRC_DIR $TARGET -noappend -comp lz4
198 [ $SIZE_KB -eq 0 ] || fatal "$FS_TYPE: fixed size not supported."
199 mkfs.jffs2 -r $SRC_DIR -o $TARGET 0x10000 --pad=0x400000 -s 0x1000 -n