Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 70044 - Option for pseudo filesystems mounted with acl flag
Summary: Option for pseudo filesystems mounted with acl flag
Status: RESOLVED FIXED
Alias: None
Product: Gentoo Linux
Classification: Unclassified
Component: [OLD] baselayout (show other bugs)
Hardware: All All
: High enhancement
Assignee: Gentoo's Team for Core System packages
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2004-11-04 05:57 UTC by Ervin Németh
Modified: 2004-12-11 09:23 UTC (History)
0 users

See Also:
Package list:
Runtime testing required: ---


Attachments
fix (is_in_fstab.patch,396 bytes, patch)
2004-12-06 03:44 UTC, Ervin Németh
Details | Diff
get-mount.patch (get-mount.patch,2.70 KB, patch)
2004-12-08 15:37 UTC, SpanKY
Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Ervin Németh 2004-11-04 05:57:44 UTC
/sbin/rc has hardcoded options for mounting /proc, /sys, /dev and /dev/pts.

For mount options it should consult fstab, or the parameters in "/etc/conf.d/rc".

I think listing the above filesystems in fstab would be the most flexible solution, and could also eliminate $RC_DEVICE_FS.
Comment 1 SpanKY gentoo-dev 2004-11-04 08:52:54 UTC
true ...

might be best to come up with a kind of wrapper that'll check /etc/fstab and if the mount point isnt found, use the default hardcoded options ...
Comment 2 Ervin Németh 2004-11-05 01:58:15 UTC
How about

 mount -n /proc 2>&1 >/dev/null || try mount -n -t proc none /proc

and

 mount -n /sys 2>&1 >/dev/null || mount -n -t sysfs none /sys

and so on?

I see only one drawback of the above: the user gets no warning if his fstab entry is syntactically incorrect.
Comment 3 SpanKY gentoo-dev 2004-11-30 20:53:48 UTC
ok, added a 'is_in_fstab()' function and updated /sbin/rc to use it ...

users can now override /proc /sys /dev /dev/pts ... the only one left would probably be ${svcdir}, but that's a *bit* more complicated so i'll ignore it for now :)
Comment 4 Ervin Németh 2004-12-06 03:41:49 UTC
baselayout just arrived. I've noticed that 'is_in_fstab()' doesn't ingore comment lines in fstab.
Comment 5 Ervin Németh 2004-12-06 03:44:04 UTC
Created attachment 45370 [details, diff]
fix

It is a fix to make 'is_in_fstab()' ignore comments.

I've also changed the regexp match with a simple string comparison.
Comment 6 SpanKY gentoo-dev 2004-12-08 15:37:10 UTC
Created attachment 45575 [details, diff]
get-mount.patch

try this please
Comment 7 Ervin Németh 2004-12-09 07:14:23 UTC
Good idea.

Also I was thinking about the impact of bad fstab files with multiple references to the same mountpoint. How about an extra "exit" like this:

awk '$1 ~ "^#" { next } $2 == "'$*'" { print "-t "$3,"-o "$4,$1,$2; exit }' /etc/fstab
Comment 8 SpanKY gentoo-dev 2004-12-09 07:44:59 UTC
i thought of that too but i dont want to just ignore it ...

perhaps we could print some errors ... that way boot would still work fine but we'd annoy the user enough to fix their fstab :)
Comment 9 Ervin Németh 2004-12-09 08:14:44 UTC
On the other hand. Do we really need to put all this into functions.sh and rc?

I mean get_mount_fstab will be called 4 times that is 4 forks to "awk" and 4 times going through the very same fstab file.
Comment 10 Ervin Németh 2004-12-10 02:00:46 UTC
My opinion is now that functions.sh will never correctly handle fstab without some complicated code.

I've started to rewrite get_mount_fstab() to pure bash code with caching fstab in a shell array. But I've just realized that we should correctly handle LABEL's, UUID's, "\040" to represent the space character in paths. Not to mention error handling.

What are the arguments against the solution in comment #2?
Comment 11 SpanKY gentoo-dev 2004-12-11 09:23:43 UTC
updated stable rc-scripts

we already have a few pure-bash implementations for parsing /etc/fstab, but we're going to use that in the next baselayout series rather than screw with our versions to be stable