Bug 6257 - read-only-rootfs and run-postinsts conflict
Summary: read-only-rootfs and run-postinsts conflict
Status: RESOLVED FIXED
Alias: None
Product: Other YP Layers
Classification: Build System, Metadata & Runtime
Component: layers (show other bugs)
Version: 1.5.1
Hardware: x86 Multiple
: Medium normal
Target Milestone: 1.7 M1
Assignee: Chen Qi
QA Contact:
URL:
Whiteboard:
Depends on:
Blocks:
 
Reported: 2014-04-30 20:30 UTC by Volker
Modified: 2014-07-02 03:09 UTC (History)
3 users (show)

See Also:
OS type for building Yocto: ---
Type of Regression: ---
Verified:
Documentation change: Don't know


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Volker 2014-04-30 20:30:27 UTC
The image feature read-only-rootfs conflicts with the run-postinsts from meta/recipes-devtools/run-postinst

The run-postinsts script is installed to init.d and does basically do two things:
1. executes scripts that are stored in /etc/<packagekind>-postinsts/
2. removes itself from the runlevels to prevent these scripts to be executed all over again.

The 2nd step does not work when using the read-only-rootfs.

There might not be a good solution for it. ro-rootfs is per definition not persistent. So closing this ticket as "WONTFIX" or "WORKSFORME" which should be fine.


An alternative solution would be to modify run-postinsts script to do something like (pseudocode)
---
if [ allow_rootfs_run_postinsts in /etc/default/ro-rootfs ]; then
   mount -o rw,remount /
   <run scripts>
   mount -o ro,remount /
fi
---
While allow_rootfs_run_postinsts has to be set by an extra IMAGE_FEATURE or as additional, by default disabled, option to the existing read-only-rootfs feature.
Comment 1 Saul Wold 2014-05-01 14:47:48 UTC
Can you please let us know which version of oe-core/bitbake/Poky you are using?  There have been various patches for this, if you are 1.5.x based there might be fixes in 1.6, if your in 1.6 then we need to fix it.
Comment 2 Volker 2014-05-02 22:45:53 UTC
I run into in the poky git repository, HEAD of the dora branch.
Comment 3 Volker 2014-06-09 18:20:17 UTC
I still have the same problem in the tar.gz from 1.6.

On boot the following accures (please excuse typos):
----
update-rc.d: /etc/init.d/run-postinst exists during rc.d purge (continuing)
 Removing any system startup links for run-postinsts ...
   /etc/rcS.d/S99run-postinsts
rm: can't remove '/etc/rcS.d/S99run-postinsts': Read-only file system
----
Comment 4 Chen Qi 2014-06-11 09:26:28 UTC
The same problem occurred on master.

I think it's necessary to make patches for dora, daisy and master separately.

//Chen Qi
Comment 5 Chen Qi 2014-06-17 06:14:44 UTC
I've sent out patches for daisy and master.
I've also tested it on dora branch. There's no such problem as the codes in run-postinsts are different.

//Chen Qi