[Buildroot] [git commit] package/mke2img: specifying zero inodes means auto

Thomas Petazzoni thomas.petazzoni at free-electrons.com
Tue Jul 4 06:46:18 UTC 2017


commit: https://git.buildroot.net/buildroot/commit/?id=9b5df8f2c3c4e0aa4bca8af0cb05594063725d46
branch: https://git.buildroot.net/buildroot/commit/?id=refs/heads/master

Currently, leaving the number of inodes to be autocalculated requires
the user to not specify the -i option at all.

Also accept zero as meaning auto; this will help simplify the ext2.mk
code a little bit.

Signed-off-by: "Yann E. MORIN" <yann.morin.1998 at free.fr>
Signed-off-by: Samuel Martin <s.martin49 at gmail.com>
Signed-off-by: Thomas Petazzoni <thomas.petazzoni at free-electrons.com>
---
 package/mke2img/mke2img | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/package/mke2img/mke2img b/package/mke2img/mke2img
index 758b6de..266df48 100755
--- a/package/mke2img/mke2img
+++ b/package/mke2img/mke2img
@@ -59,7 +59,7 @@ main() {
     esac
 
     # calculate needed inodes
-    if [ -z "${nb_inodes}" ]; then
+    if [ ${nb_inodes:-0} -eq 0 ]; then
         nb_inodes=$(find "${root_dir}" | wc -l)
         nb_inodes=$((nb_inodes+400))
     fi


More information about the buildroot mailing list