All of lore.kernel.org
 help / color / mirror / Atom feed
From: g4 at novadsp.com <g4@novadsp.com>
To: buildroot@busybox.net
Subject: [Buildroot] [PATCH 1/1] mke2img: Sanity check block size and fail if zero or missing.
Date: Sat, 29 Apr 2017 18:08:06 +0100	[thread overview]
Message-ID: <11d301d2c10b$2cb73190$862594b0$@novadsp.com> (raw)
In-Reply-To: <20170429160215.GA19584@scaer>

Hello Yann,

> 
> >      # Sanity checks
> >      if [ -z "${root_dir}" ]; then
> > -        error "you must specify a root directory with '-d'\n"
> > +        error "Error: you must specify a root directory with '-d'\n"
> >      fi
> >      if [ -z "${image}" ]; then
> > -        error "you must specify an output image file with '-o'\n"
> > +        error "Error: you must specify an output image file with '-o'\n"
> 
> Is that really necessary?

The original justification was for any user calling the script directly. Now I think no, it is not.
 
> 
> There is an obvious error here: there is a missing space between '0' and the
> closing bracket ']'.

Indeed. <facepalm>
 
> However, I wonder why we should check for a zero size. The filesystem will
> be non-creatable (is that a word?) because the requested size is too low,
> similar to what a user would get by settign the nb_blocks to
> (e.g.) 1024 (i.e. 1MiB) but have a target/ that is 2MiB: that won't fit.
> 
> So, I would just keep the check to being set, whatever the value (but I would
> not oppose the check against 0 either.)

My revised version applies a check in the ext2.mk file itself. I think this is much cleaner.

Best,

Jerry.

      reply	other threads:[~2017-04-29 17:08 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-04-29 14:58 [Buildroot] [PATCH 1/1] mke2img: Sanity check block size and fail if zero or missing J Evans
2017-04-29 16:02 ` Yann E. MORIN
2017-04-29 17:08   ` g4 at novadsp.com [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to='11d301d2c10b$2cb73190$862594b0$@novadsp.com' \
    --to=g4@novadsp.com \
    --cc=buildroot@busybox.net \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.