mkinitfs: print error when failure to rm tmp dir, and make it non-fatal (MR 40)

This prints the error when the work dir can't be removed. This also
changes mkinitfs so that it does't fail in this situation.

The reasoning for this change in behavior is that mkinitfs returning
non-zero will signal to the caller that there's potentially a problem
with configuring boot-related stuff on their system, and a failure to rm
the work dir is just noise. If the cause of that failure is a deeper
problem, the log message should help figure it out.

fixes #35
This commit is contained in:
Clayton Craft
2023-08-18 17:17:28 -07:00
parent fedf55b573
commit 2ec78bfcfc

View File

@@ -80,8 +80,8 @@ func main() {
defer func() {
e := os.RemoveAll(workDir)
if e != nil && err == nil {
err = e
retCode = 1
log.Println(e)
log.Println("unable to remove temporary work directory")
}
}()