Message ID | 1493481682-128366-1-git-send-email-g4@novadsp.com |
---|---|
State | Rejected |
Headers | show |
Hello, On Sat, 29 Apr 2017 17:01:21 +0100, J Evans wrote: > -ifneq ($(strip $(BR2_TARGET_ROOTFS_EXT2_BLOCKS)),0) > +ifeq ($(strip $(BR2_TARGET_ROOTFS_EXT2_BLOCKS)),0) > +$(error BR2_TARGET_ROOTFS_EXT2_BLOCKS cannot be zero (0)) > +else > EXT2_OPTS += -b $(BR2_TARGET_ROOTFS_EXT2_BLOCKS) > endif What is the motivation for checking that the size is not zero? Zero is like any other size too small to contain the target directory contents, so I don't see why we would add a specific check for it. Your commit log unfortunately only explains *what* the commit is doing (which is obvious by reading the code) but not *why* this change is necessary. Thanks! Thomas
J, Thomas, All, On 2017-04-29 21:03 +0200, Thomas Petazzoni spake thusly: > On Sat, 29 Apr 2017 17:01:21 +0100, J Evans wrote: > > > -ifneq ($(strip $(BR2_TARGET_ROOTFS_EXT2_BLOCKS)),0) > > +ifeq ($(strip $(BR2_TARGET_ROOTFS_EXT2_BLOCKS)),0) > > +$(error BR2_TARGET_ROOTFS_EXT2_BLOCKS cannot be zero (0)) > > +else > > EXT2_OPTS += -b $(BR2_TARGET_ROOTFS_EXT2_BLOCKS) > > endif > > What is the motivation for checking that the size is not zero? Zero is > like any other size too small to contain the target directory contents, > so I don't see why we would add a specific check for it. I agree, and that's exactly what I said in my review to the previous iteration of the patch. Just remove the check and keep the line: EXT2_OPTS += -b $(BR2_TARGET_ROOTFS_EXT2_BLOCKS) Regards, Yann E. MORIN.
Yann, all > > Just remove the check and keep the line: > > EXT2_OPTS += -b $(BR2_TARGET_ROOTFS_EXT2_BLOCKS) Yes, ideal. That will satisfy us both and (most importantly) make sure the user cannot get this otherwise hard to debug error: "genext2fs: Too many arguments. Try --help or else see the man page." BTW many thanks for patience etc. with this shower of patches. BR, Jerry.
diff --git a/fs/ext2/ext2.mk b/fs/ext2/ext2.mk index 30f1d17..3a0c764 100644 --- a/fs/ext2/ext2.mk +++ b/fs/ext2/ext2.mk @@ -6,7 +6,9 @@ EXT2_OPTS = -G $(BR2_TARGET_ROOTFS_EXT2_GEN) -R $(BR2_TARGET_ROOTFS_EXT2_REV) -ifneq ($(strip $(BR2_TARGET_ROOTFS_EXT2_BLOCKS)),0) +ifeq ($(strip $(BR2_TARGET_ROOTFS_EXT2_BLOCKS)),0) +$(error BR2_TARGET_ROOTFS_EXT2_BLOCKS cannot be zero (0)) +else EXT2_OPTS += -b $(BR2_TARGET_ROOTFS_EXT2_BLOCKS) endif
Signed-off-by: J Evans <g4@novadsp.com> --- fs/ext2/ext2.mk | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-)