| Summary: | sys-apps/baselayout-1.12.11.1: checkroot doesn't check if there is a comment appended in the fstab line | ||
|---|---|---|---|
| Product: | Gentoo Linux | Reporter: | Robert <emmi3> |
| Component: | [OLD] baselayout | Assignee: | Gentoo's Team for Core System packages <base-system> |
| Status: | RESOLVED DUPLICATE | ||
| Severity: | normal | CC: | roy |
| Priority: | High | ||
| Version: | unspecified | ||
| Hardware: | x86 | ||
| OS: | Linux | ||
| Whiteboard: | |||
| Package list: | Runtime testing required: | --- | |
Interestingly enough what I can appear to find on both Linux and FreeBSD, # is only valid at the start of a line. It's not valid at any point in the middle of a line. Anyone else's opinion from base-layout on this? I'd be curious how the script from openrc/baselayout-2 handles this. OpenRC uses ships with an applet called fstabinfo, just for reasons like this. The ONLY way to reliably parse /etc/fstab is to use getfsent, getfsfile (or getmntent, getmntfile on some cranky Linux systems) And yes, according to the format, comments are only valid at the start of the line. *** This bug has been marked as a duplicate of bug 185063 *** |
/etc/init.d/checkroot does not check the filesystem if there is a comment at the end of the fstab line for the root-filesystem. Reproducible: Always Steps to Reproduce: 1. Append a comment to the entry for the root filesystem e.g: LABEL=Gentoo / ext3 noatime 0 1 # hde6 2. reboot & watch Actual Results: It says: "Skipping root filesystem check (fstab's passno == 0)" Expected Results: "Checking root filesystem" The problem is obviously due to the awk-command only checking for EXACTLY 6 fields in the fstab line: if [[ -n $(awk '($1 ~ /^(\/|UUID|LABEL)/ && $2 == "/" \ && NF == 6 && $6 != 0) { print }' /etc/fstab) ]] ^^^^^^^Here It should instead check that there are AT LEAST 6 fields: NF >= 6 ...Or maybe I should not put comments there?