diff mbox

[v3,01/11] package/mke2img: specifying zero inodes means auto

Message ID 20170703225106.1492-2-s.martin49@gmail.com
State Accepted
Headers show

Commit Message

Samuel Martin July 3, 2017, 10:50 p.m. UTC
From: "Yann E. MORIN" <yann.morin.1998@free.fr>

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@free.fr>
Signed-off-by: Samuel Martin <s.martin49@gmail.com>

---
changes v2->v3:
- reintroduce this change from Yann' series
---
 package/mke2img/mke2img | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

Comments

Thomas Petazzoni July 4, 2017, 6:48 a.m. UTC | #1
Hello,

On Tue,  4 Jul 2017 00:50:56 +0200, Samuel Martin wrote:
> From: "Yann E. MORIN" <yann.morin.1998@free.fr>
> 
> 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@free.fr>
> Signed-off-by: Samuel Martin <s.martin49@gmail.com>
> 
> ---
> changes v2->v3:
> - reintroduce this change from Yann' series
> ---
>  package/mke2img/mke2img | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)

Applied to master, thanks.

Thomas
diff mbox

Patch

diff --git a/package/mke2img/mke2img b/package/mke2img/mke2img
index 758b6dee68..266df483aa 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