Bug 4484 - Postinstalls don't run for ipk if package-management is disabled
Summary: Postinstalls don't run for ipk if package-management is disabled
Status: VERIFIED FIXED
Alias: None
Product: OE-Core
Classification: Build System, Metadata & Runtime
Component: core (show other bugs)
Version: 1.5
Hardware: All Multiple
: Medium+ major
Target Milestone: 1.5
Assignee: Laurentiu Palcu
QA Contact:
URL:
Whiteboard:
Depends on:
Blocks: 4423
  Show dependency tree
 
Reported: 2013-05-10 15:03 UTC by Paul Eggleton
Modified: 2013-10-08 10:33 UTC (History)
4 users (show)

See Also:
OS type for building Yocto: ---
Type of Regression: Regression (Used to work)
Verified:
Documentation change: No (bug/feature does not impact docs)


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Paul Eggleton 2013-05-10 15:03:59 UTC
When building core-image-minimal, with an additional package added that has a first-boot postinstall (mysql in this case), the postinstall scripts do not get run because the script does not find /var/lib/opkg/status (which was deleted because package-management is not enabled for this image).
Comment 1 Laurentiu Palcu 2013-05-13 10:57:11 UTC
This doesn't look like a bug... core-image-minimal does not have the package manager installed by default. However, in order to have opkg/dpkg postinstalls run at first boot, the package manger has to be installed on target.

This is marked as a regression. I don't think this used to work, unless a solution similar to rpm's is used. I think this is an enhancement, not a bug.

Changing status to NEEDINFO till I have the necessary info.
Comment 2 Laurentiu Palcu 2013-06-06 08:53:37 UTC
Patches sent on the ML for review.
Comment 3 Tom Zanussi 2013-06-10 19:37:34 UTC
I discovered that this is also a problem for the kernel labs, which use danny, so I think this patchset should also be pushed to danny.

This is the bug affected:

Bug 4423 - module autoload fails on danny when ipk is used

So marking this as blocking that bug.
Comment 5 Tom Zanussi 2013-06-13 14:30:50 UTC
(In reply to comment #4)
> Patches merged to master:
> 
> http://git.yoctoproject.org/cgit.cgi/poky/commit/
> ?id=b11f8183074857be5a5920f093b4298884eec805
> http://git.yoctoproject.org/cgit.cgi/poky/commit/
> ?id=1ce182e79e6c588de4ca372587c0797bc0cb7e80
> http://git.yoctoproject.org/cgit.cgi/poky/commit/
> ?id=98ce0b727baa359a1e6388dd570186099df3983a
> http://git.yoctoproject.org/cgit.cgi/poky/commit/
> ?id=76cd8a776b02385945ad13ce79bbe1c33d8bad9b
> http://git.yoctoproject.org/cgit.cgi/poky/commit/
> ?id=e4a136a6bd0a850284a3ab74e513c936c1641e78
> http://git.yoctoproject.org/cgit.cgi/poky/commit/
> ?id=75070d70320dc6516acf53e4bb36e7a091459138
> http://git.yoctoproject.org/cgit.cgi/poky/commit/
> ?id=d5f593c25f2a831fbdc97a0b864525e7409b587f

Are these planned for a danny merge as well?  Or do we need to open a separate bug for danny?
Comment 6 Paul Eggleton 2013-06-13 22:37:01 UTC
Tom, are you sure this is the same bug? As far as I can tell the specific issue I reported is due to the postinstall rework that was done in the 1.4 cycle.
Comment 7 Tom Zanussi 2013-06-14 13:54:09 UTC
(In reply to comment #6)
> Tom, are you sure this is the same bug? As far as I can tell the specific
> issue I reported is due to the postinstall rework that was done in the 1.4
> cycle.

Yeah, I hadn't noticed the details that this fix only applied to the reworked postinstall.  Though the posted fix may or may not be the appropriate fix for the nonreworked postinstall, the problem seems to be the same e.g. a build of core-image-sato using the same metadata shows the postinstalls working fine and consequently the test module of 4423 being autoloaded as expected.
Comment 8 Tom Zanussi 2013-07-02 22:51:48 UTC
Reopening this because it's still a problem in danny and the same problem described here is blocking 4423.

Rather than open a new bug with exactly the same description but with danny prepended, I just reopened this one and prepended danny instead.

It seems that if there's already a patchset in master for this problem it should be applied to danny as well rather than wasting time on a different fix for danny.

Comment 2 here seems to suggest that fixing this was an enhancement, since it wasn't a regression, so another alternative could be to just close 4423 as 'wontfix'.
Comment 9 Paul Eggleton 2013-07-02 23:04:03 UTC
The patchset for master is huge and highly dependent on other work that was done to refactor postinstalls, and could not be applied as-is to danny. This is why I think the danny issue is not the same one as this bug.
Comment 10 Tom Zanussi 2013-07-02 23:12:37 UTC
OK, fair enough.  Do you have a sense of whether fixing this in danny would require a similar effort and do we care enough about it to spend the effort to fix it?

If it's not fixing a regression, and is really therefore an enhancement, and we don't typically add enhancements to point releases, the question may answer itself, but I don't want to dispense with it that way if it's really an important thing to fix in danny.
Comment 11 Laurentiu Palcu 2013-07-03 08:43:52 UTC
Unfortunately, there's no easy fix for danny when ipk/dpkg package management is used. The rework I've done is necessary. The old run-postinsts package was useless because it was expecting that /var/lib/*pkg/ directory existed on the target. However, if the package manager is not deployed to target, this directory is removed at do_rootfs time. Hence, no delayed postinstalls will have a chance to run at first boot.

So, this is not a fix for a problem introduced by the postinstall work in 1.4. ipk/dpkg had this problem and it was introduced a long time ago, when ROOTFS_POSTPROCESS_COMMAND += "remove_packaging_data_files ; " was put in core-image-minimal recipe. Without the metadata, the delayed postinstalls cannot run on target.

So, one quick workaround for danny would be to remove this line from core-image-minimal recipe.
Comment 12 Tom Zanussi 2013-07-03 13:20:57 UTC
(In reply to comment #11)
> Unfortunately, there's no easy fix for danny when ipk/dpkg package
> management is used. The rework I've done is necessary. The old run-postinsts
> package was useless because it was expecting that /var/lib/*pkg/ directory
> existed on the target. However, if the package manager is not deployed to
> target, this directory is removed at do_rootfs time. Hence, no delayed
> postinstalls will have a chance to run at first boot.
> 
> So, this is not a fix for a problem introduced by the postinstall work in
> 1.4. ipk/dpkg had this problem and it was introduced a long time ago, when
> ROOTFS_POSTPROCESS_COMMAND += "remove_packaging_data_files ; " was put in
> core-image-minimal recipe. Without the metadata, the delayed postinstalls
> cannot run on target.
> 
> So, one quick workaround for danny would be to remove this line from
> core-image-minimal recipe.

OK, thanks for that info and your idea for a quick workaround.

However, it sounds like a hack, and I already had a more direct hack to fix the original problem (changing modutils.sh to read /etc/modules-load.d).  Neither sounds like something that would be accepted as a patch to danny, so I'm returning this bug to its original state.

Since it seems this was never a problem for anyone until someone decided to run the kernel labs with ipk, it's probably not a priority to fix it in danny, especially as it's been fixed in master.

If it really is a problem for anyone, we'll open a new bug specifically for danny with the same subject as this one.
Comment 13 Paul Eggleton 2013-07-03 13:24:11 UTC
OK, that sounds like the reasonable course for the moment. It's pretty surprising that this apparently went unnoticed for such a long time; FWIW I confirmed this morning that denzil suffered from the same problem.
Comment 14 Paul Eggleton 2013-08-26 17:00:57 UTC
This is still broken if opkg is installed into the image but package-management is disabled (not a particularly valid situation, but one that's easy to stumble into, and it seems to me it ought not to break running of postinstalls).
Comment 15 Laurentiu Palcu 2013-09-09 06:18:56 UTC
Fix for the 'package-management' disabled and opkg manually installed issue merged:

http://git.yoctoproject.org/cgit.cgi/poky/commit/?id=75a14923da1ba91eddde47f0907345c19c82d6f0
Comment 16 Alexandru Palalau 2013-10-08 10:33:00 UTC
Switching to verified.
Master branch.
Commit ID: 5416b958be27fce1211af2e968df2779e730078d