summaryrefslogtreecommitdiffstats
path: root/package
diff options
context:
space:
mode:
Diffstat (limited to 'package')
-rwxr-xr-xpackage/mke2img/mke2img10
1 files changed, 8 insertions, 2 deletions
diff --git a/package/mke2img/mke2img b/package/mke2img/mke2img
index 266df483aa..399012a2be 100755
--- a/package/mke2img/mke2img
+++ b/package/mke2img/mke2img
@@ -19,9 +19,10 @@ main() {
rev=1
nb_extra_inodes=0
- while getopts :hb:i:I:r:d:o:G:R:l:u: OPT; do
+ while getopts :hB:b:i:I:r:d:o:G:R:l:u: OPT; do
case "${OPT}" in
h) help; exit 0;;
+ B) block_size="${OPTARG}";;
b) nb_blocks=${OPTARG};;
i) nb_inodes=${OPTARG};;
I) nb_extra_inodes=${OPTARG};;
@@ -47,6 +48,11 @@ main() {
if [ -z "${nb_blocks}" ]; then
error "you must specify the size of the output image with '-b'\n"
fi
+ case "${block_size}" in
+ 1024|2048|4096) ;; # Sole valid values
+ '') error "you must specify the size of a block with -B\n";;
+ *) error "invalid block size '%s' (valid: 1024. 2048, 4096)\n" "${block_size}";;
+ esac
case "${gen}:${rev}" in
2:0|2:1|3:1|4:1)
;;
@@ -91,7 +97,7 @@ main() {
fi
# Generate the filesystem
- genext2fs_opts=( -z -b ${nb_blocks} -N ${nb_inodes} -d "${root_dir}" )
+ genext2fs_opts=( -z -B ${block_size} -b ${nb_blocks} -N ${nb_inodes} -d "${root_dir}" )
if [ -n "${nb_res_blocks}" ]; then
genext2fs_opts+=( -m ${nb_res_blocks} )
fi
OpenPOWER on IntegriCloud