[PATCH] linux-boot: Fix e2fsck warning.

  • Done
  • quality assurance status badge
Details
3 participants
  • Danny Milosavljevic
  • Jonathan Brielmaier
  • Ludovic Courtès
Owner
unassigned
Submitted by
Danny Milosavljevic
Severity
normal
D
D
Danny Milosavljevic wrote on 31 May 2019 13:27
(address . guix-patches@gnu.org)(name . Danny Milosavljevic)(address . dannym@scratchpost.org)
20190531112735.15985-1-dannym@scratchpost.org
* gnu/build/linux-boot.scm (boot-system): Fix e2fsck warning.
---
gnu/build/linux-boot.scm | 4 ++++
1 file changed, 4 insertions(+)

Toggle diff (22 lines)
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")
L
L
Ludovic Courtès wrote on 1 Jun 2019 15:13
(name . Danny Milosavljevic)(address . dannym@scratchpost.org)(address . 36023@debbugs.gnu.org)
87r28dfnxl.fsf@gnu.org
Danny Milosavljevic <dannym@scratchpost.org> skribis:

Toggle quote (2 lines)
> * gnu/build/linux-boot.scm (boot-system): Fix e2fsck warning.

Oooh, thanks for fixing this one. LGTM!

Ludo’.
D
D
Danny Milosavljevic wrote on 3 Jun 2019 18:09
(name . Ludovic Courtès)(address . ludo@gnu.org)(address . 36023-done@debbugs.gnu.org)
20190603180951.16c05fa3@scratchpost.org
Thanks for the review!

Pushed it to guix master as commit aa901521e4e5625dd8a63e67a64be2f562ca61c7.
-----BEGIN PGP SIGNATURE-----

iQEzBAEBCAAdFiEEds7GsXJ0tGXALbPZ5xo1VCwwuqUFAlz1Rk8ACgkQ5xo1VCww
uqWh8wf+M4odYGOpsVukSINWCuAi0CVRLz1+hJOmpDKylcl+g0wo3GLPkNj8Bnmu
S0e3B0ZRB3AoEgI6ZbTWFSJ9XMy0Nb18c1kCRwbVcrZFdjdWkV2Un8tQz2D2spAN
vmOD5WnNWteFAAZERMaoeRCsVS8causIctxF5p7NFoA1SLtVdE584TrdBOtdf0y1
deZurWA2xgc06aIv5gIYsEpf8aksKmG7qGsat5fGsqcZjSXYFFBxEhu/NZ0srX/c
mAXCTdRrmyloJq8MZZd9Al8k3crDHQ+uSHHeJeDE9IwECrhl4GOa7jmiIKn8MfWx
tfuVYgAis1UA/W1wuaQRTm0fqtTNig==
=zk1t
-----END PGP SIGNATURE-----


Closed
J
J
Jonathan Brielmaier wrote on 3 Jun 2019 18:17
0f5cda0e-cc9d-ee9a-bb15-86faaab0707c@web.de
On 5/31/19 1:27 PM, Danny Milosavljevic wrote:
Toggle quote (2 lines)
> + (setenv "EXT2FS_NO_MTAB_OK" "1")
> +
[...]
Toggle quote (3 lines)
> + (setenv "EXT2FS_NO_MTAB_OK" #f)
> +

Maybe it would be nice to have them constintly using either "0" and "1"
or #t and #f :)
D
D
Danny Milosavljevic wrote on 3 Jun 2019 18:53
(name . Jonathan Brielmaier)(address . jonathan.brielmaier@web.de)(address . 36023@debbugs.gnu.org)
20190603185201.0ed67e8c@scratchpost.org
Hi Jonathan,

On Mon, 3 Jun 2019 18:17:14 +0200
Jonathan Brielmaier <jonathan.brielmaier@web.de> wrote:

Toggle quote (10 lines)
> 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?
-----BEGIN PGP SIGNATURE-----

iQEzBAEBCAAdFiEEds7GsXJ0tGXALbPZ5xo1VCwwuqUFAlz1UJUACgkQ5xo1VCww
uqVXawf9GUr0L0M0cw4o6OJBLQ0T2FywsF8lAoFBBeEMjYlUliYfFA+hzi0RUVyd
AMoTBAClxFMvVkFZgCk9SxOSqSPiRJX7i1hpmx56fbJqSAjthPM0gjFQrth9WzDN
Y3h/2Hb/Sy53+l+Ae0aLJzKTJG5th3shOLv0qsHqGXUxxQDXi1/5CbltrkhO7VOm
1JxuTls0TSFDHShlsCWmGaJOCYrR+ddfbgm7MinQikeoMMrGW3AF79eRoMU28JC7
QJri+VvkvBVqCNAXWyVM4CbadbCFZoSn96CY01GkR8cSn0SRhraL2WmSwtcIncB1
lNMR/SvHccoRWj1vrTj6kM5UfeLzoQ==
=BAkb
-----END PGP SIGNATURE-----


J
J
Jonathan Brielmaier wrote on 3 Jun 2019 19:01
(name . Danny Milosavljevic)(address . dannym@scratchpost.org)(address . 36023@debbugs.gnu.org)
2acaba5c-c28c-5f17-c73c-c0ffdbccd186@web.de
On 6/3/19 6:53 PM, Danny Milosavljevic wrote:
Toggle quote (29 lines)
> 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...
?