Bug 4880

Summary: Use a uniform way to determine whether rootfs is read-only
Product: [Build System, Metadata & Runtime] OE-Core Reporter: Chen Qi <Qi.Chen>
Component: coreAssignee: Chen Qi <Qi.Chen>
Status: RESOLVED FIXED QA Contact:
Severity: normal    
Priority: Medium CC: liezhi.yang, mark.hatle, meta.mr.watcher, meta.watcher, sgw, yi.zhao
Version: 1.4   
Target Milestone: 1.5 M5   
Hardware: x86   
OS: Multiple   
Whiteboard:
OS type for building Yocto: --- Type of Regression: ---
Verified: Documentation change: Don't know

Description Chen Qi 2013-07-22 02:16:55 UTC
In some part of the system, we determine whether the rootfs is read-only by checking the fstab or /proc/mounts, in other part of the system, we use the value of ROOTFS_READ_ONLY in /etc/default/rcS as a criteria. This is confusing and makes system inconsistent.

We should drop the use of ROOTFS_READ_ONLY and use a uniform way to determine whether rootfs is read-only.

On target, we should use /proc/mounts to check whether / is read-only; on host, we should use $ROOT_DIR/etc/fstab to check whether the rootfs is going to be mounted as read-only or not.

//Chen Qi
Comment 1 Saul Wold 2013-07-22 20:57:09 UTC
A question is it important to know if the rootfs is READ-ONLY during build or install time?  If so, the rootfs and thus ${ROOT_DIR} will not be available yet.
Comment 2 Chen Qi 2013-07-23 01:39:22 UTC
(In reply to comment #1)
> A question is it important to know if the rootfs is READ-ONLY during build
> or install time?

The answer would be 'No' with current approach.

//Chen Qi
Comment 3 Chen Qi 2013-08-19 02:07:01 UTC
The first solution spawns too many processes at boot time.
We need a better solution.
Comment 4 Chen Qi 2013-08-26 06:32:04 UTC
Considering the overhead brought in by checking the /proc/mounts or /etc/fstab in each boot script, the READ_ONLY_ROOTFS value in /etc/default/rcS is still useful. However, we should at least add a check for conflicting configurations between /etc/fstab and /etc/default/rcS.

//Chen Qi
Comment 5 Chen Qi 2013-08-27 04:32:26 UTC
merged into poky/master: e6e44cf9c10116b9bd2260eb344031d9b897f669

http://git.openembedded.org/?p=openembedded-core.git&a=commit;h=1565a0c5a3f245703e280ca90cf11d3f9374788a