We need return retval when "mke2fs -d" failed, otherwise the "$?" would be 0 which is misleading.
Merged into master: http://git.yoctoproject.org/cgit/cgit.cgi/poky/commit/?id=21a3ffb2dc305ab236a006e812007e6c8f665a0e
Hello, We just made some tests related to this issue. Our way of testing was like this: - inserted an USB device (/dev/sdb) having a partition /dev/sdb1 - created an empty directory (eg. teste) - ran against a non existent dir the command “mke2fs –d invalid_dir /dev/sdb1” and obtained the desired result as on bug fix: “ root@emenlow:/media/test/stick/teste# mke2fs -d invalid_dir /dev/sdb1 # invalid_dir is a non existent dir ... Allocating group tables: done Writing inode tables: done Copying files into the device: populate_fs: No such file or directory while changing working directory to "invalid_dir" Error while populating file system root@emenlow:/media/test/stick/teste# echo $? 2 “ However while performing our checks, I observed something that I don’t know if it’s right or wrong: - even if the directory is empty, the process of creating root fs is starting and completing without error (and exit code is 0): root@emenlow:/media/test/stick/teste# mke2fs -d . /dev/sdb1 ... root@emenlow:/media/test/stick/teste# echo $? 0 “ - both in the case of empty dir and in case of non existing dir the job of writing inode tables starts and completes successfully. This of course erases the content of inserted media. Shouldn’t be a check of content before? Meanwhile I will mark this bug as verified. Regards, Andra N.