Message ID | 20190531112735.15985-1-dannym@scratchpost.org |
---|---|
State | Accepted |
Headers | show |
Series | [bug#36023] linux-boot: Fix e2fsck warning. | expand |
Context | Check | Description |
---|---|---|
cbaines/applying patch | fail | Apply failed |
Danny Milosavljevic <dannym@scratchpost.org> skribis:
> * gnu/build/linux-boot.scm (boot-system): Fix e2fsck warning.
Oooh, thanks for fixing this one. LGTM!
Ludo’.
Thanks for the review! Pushed it to guix master as commit aa901521e4e5625dd8a63e67a64be2f562ca61c7.
On 5/31/19 1:27 PM, Danny Milosavljevic wrote: > + (setenv "EXT2FS_NO_MTAB_OK" "1") > + [...] > + (setenv "EXT2FS_NO_MTAB_OK" #f) > + Maybe it would be nice to have them constintly using either "0" and "1" or #t and #f :)
Hi Jonathan, On Mon, 3 Jun 2019 18:17:14 +0200 Jonathan Brielmaier <jonathan.brielmaier@web.de> wrote: > On 5/31/19 1:27 PM, Danny Milosavljevic wrote: > > + (setenv "EXT2FS_NO_MTAB_OK" "1") > > + > [...] > > + (setenv "EXT2FS_NO_MTAB_OK" #f) > > + > > Maybe it would be nice to have them constintly using either "0" and "1" > or #t and #f :) Well, the UNIX environment interface and/or Guile's interface to it doesn't work that way. The UNIX environment is a string array. e2fsck uses if(getenv("EXT2FS_NO_MTAB_OK")) to read the value of the entry with the key "EXT2FS_NO_MTAB_OK". So we can set the environment entry to any value we want and e2fsck's "if" condition will evaluate to true. And in order to remove it from the environment again, we call setenv with #f. We could also call unsetenv instead, I guess. Should we?
On 6/3/19 6:53 PM, Danny Milosavljevic wrote: > Hi Jonathan, > > On Mon, 3 Jun 2019 18:17:14 +0200 > Jonathan Brielmaier <jonathan.brielmaier@web.de> wrote: > >> On 5/31/19 1:27 PM, Danny Milosavljevic wrote: >>> + (setenv "EXT2FS_NO_MTAB_OK" "1") >>> + >> [...] >>> + (setenv "EXT2FS_NO_MTAB_OK" #f) >>> + >> >> Maybe it would be nice to have them constintly using either "0" and "1" >> or #t and #f :) > > Well, the UNIX environment interface and/or Guile's interface to it doesn't > work that way. The UNIX environment is a string array. > > e2fsck uses if(getenv("EXT2FS_NO_MTAB_OK")) to read the value of the entry > with the key "EXT2FS_NO_MTAB_OK". > > So we can set the environment entry to any value we want and e2fsck's "if" > condition will evaluate to true. > > And in order to remove it from the environment again, we call setenv with > #f. > > We could also call unsetenv instead, I guess. Should we? Ah, oke. Thanks for the explanation. I think we can leave it as it is...
diff --git a/gnu/build/linux-boot.scm b/gnu/build/linux-boot.scm index a35d18ad7c..03f2ea245c 100644 --- a/gnu/build/linux-boot.scm +++ b/gnu/build/linux-boot.scm @@ -517,6 +517,8 @@ upon error." (unless (pre-mount) (error "pre-mount actions failed"))) + (setenv "EXT2FS_NO_MTAB_OK" "1") + (if root ;; The "--root=SPEC" kernel command-line option always provides a ;; string, but the string can represent a device, a UUID, or a @@ -533,6 +535,8 @@ upon error." (for-each mount-file-system (remove root-mount-point? mounts)) + (setenv "EXT2FS_NO_MTAB_OK" #f) + (if to-load (begin (switch-root "/root")