Bug 14351 - needs to mount sysfs before mount -a
Summary: needs to mount sysfs before mount -a
Status: RESOLVED FIXED
Alias: None
Product: buildroot
Classification: Unclassified
Component: Other (show other bugs)
Version: unspecified
Hardware: All Linux
: P5 normal
Target Milestone: ---
Assignee: unassigned
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2021-11-16 10:17 UTC by stsp
Modified: 2021-12-13 10:57 UTC (History)
1 user (show)

See Also:
Host:
Target:
Build:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description stsp 2021-11-16 10:17:34 UTC
Currently inittab does this:
::sysinit:/bin/mount -t proc proc /proc
::sysinit:/bin/mount -o remount,rw /
::sysinit:/bin/mkdir -p /dev/pts /dev/shm
::sysinit:/bin/mount -a

But before "mount -a" can be used,
you also need to do
mount -t sysfs sysfs /sys
Just mounting proc is not enough,
or UUIDs in fstab will not work.
Comment 1 stsp 2021-11-20 11:29:50 UTC
This was fixed in util-linux:
https://github.com/util-linux/util-linux/issues/1492
Please consider updating, or adding
an explicit /sys mount before "mount -a".
Comment 2 Fabrice Fontaine 2021-11-21 10:34:58 UTC
Can you confirm that the following patch fix your issue:
https://patchwork.ozlabs.org/project/buildroot/patch/20211121094254.3425966-1-fontaine.fabrice@gmail.com/
Comment 3 stsp 2021-11-21 11:08:56 UTC
(In reply to Fabrice Fontaine from comment #2)

Applying 0002-libblkid-don-t-mark-cache-as-probed-if-sys-not-available.patch using patch: 
patching file libblkid/src/devname.c
Hunk #1 succeeded at 456 (offset 27 lines).
Hunk #2 succeeded at 562 with fuzz 1 (offset 27 lines).
Hunk #3 succeeded at 583 (offset 29 lines).
Hunk #4 succeeded at 608 (offset 29 lines).
Hunk #5 succeeded at 626 (offset 29 lines).

... is what I see when rebuilding util-linux.
I would rather suggest to update
entire util-linux from git, or, better yet,
just mount /sys by hands, the same
way you already do for /proc.

But other than that - yes, the patched
buildroot works as expected, thanks!
Comment 4 Fabrice Fontaine 2021-11-21 17:52:23 UTC
Thanks for confirming that the patch works.

We can't bump util-linux as we're too close to the release of 2021.11. Indeed, a bump to the latest git commit could add its own build or runtime issues.

Mounting /sys does not seem to be an option for 2021.11 either, see initial comments here: https://patchwork.ozlabs.org/project/buildroot/patch/20211120222857.3110528-1-fontaine.fabrice@gmail.com/
Comment 5 Arnout Vandecappelle 2021-12-05 15:41:05 UTC
Fixed by https://git.buildroot.org/buildroot/commit/?id=2f50686401
Comment 6 Peter Korsgaard 2021-12-12 22:52:16 UTC
(In reply to stsp from comment #1)

Do you know if this is a regression in 2.37.x? We use 2.36.2 on the 2021.02.x branch, and the patch doesn't directly apply there.
Comment 7 stsp 2021-12-12 22:59:28 UTC
(In reply to Peter Korsgaard from comment #6)

I am quite sure it is a
regression. I hit it only
after the buildroot update
I did in my project:

diff --git a/buildroot b/buildroot
index b928074..76c7fed 160000
--- a/buildroot
+++ b/buildroot
@@ -1 +1 @@
-Subproject commit b928074e2d83f5b873bf1ba381b212dfad9bf207
+Subproject commit 76c7fed85f7a822663cf0c8828e7d282198d0803


Unfortunately this is all I know.
Comment 8 Peter Korsgaard 2021-12-13 10:57:04 UTC
(In reply to stsp from comment #7)
Ok, thanks - then it most likely came from:

commit 27a46793b1a0c6c13c00b07d07bd5743e2c9c7b6
Author: Adam Duskett <aduskett@gmail.com>
Date:   Thu Oct 14 15:58:39 2021 -0700

    package/util-linux: bump to version 2.37.2