| Submitter | Otavio Salvador |
|---|---|
| Date | Feb. 17, 2012, 5:47 p.m. |
| Message ID | <a186127453b155d8f35a32fac48a56dad98aad7f.1329500798.git.otavio@ossystems.com.br> |
| Download | mbox | patch |
| Permalink | /patch/21377/ |
| State | New |
| Headers | show |
Comments
On Fri, 2012-02-17 at 17:47 +0000, Otavio Salvador wrote: > When building without package management we can end with a system > without opkg and thus without support for running unfinished postinsts > on first boot, we fix this providing a S98configure script for this > use case. Isn't this what run-postinsts is meant to be doing? p.
On Fri, Feb 17, 2012 at 15:51, Phil Blundell <philb@gnu.org> wrote: > On Fri, 2012-02-17 at 17:47 +0000, Otavio Salvador wrote: > > When building without package management we can end with a system > > without opkg and thus without support for running unfinished postinsts > > on first boot, we fix this providing a S98configure script for this > > use case. > > Isn't this what run-postinsts is meant to be doing? > Except it calls opkg-cl configure; that's why I check if opkg-cl is not available.
On Fri, 2012-02-17 at 17:06 -0200, Otavio Salvador wrote: > On Fri, Feb 17, 2012 at 15:51, Phil Blundell <philb@gnu.org> wrote: > On Fri, 2012-02-17 at 17:47 +0000, Otavio Salvador wrote: > > When building without package management we can end with a > system > > without opkg and thus without support for running unfinished > postinsts > > on first boot, we fix this providing a S98configure script > for this > > use case. > > > Isn't this what run-postinsts is meant to be doing? > > > Except it calls opkg-cl configure; that's why I check if opkg-cl is > not available. Er, does it? My copy doesn't seem to. pb@x121e:~/oe/oe-core$ grep opkg-cl meta/recipes-devtools/dpkg/run-postinsts/* pb@x121e:~/oe/oe-core$ Where are you seeing the call to opkg-cl? p.
On Fri, Feb 17, 2012 at 17:25, Phil Blundell <philb@gnu.org> wrote: > Er, does it? My copy doesn't seem to. > > pb@x121e:~/oe/oe-core$ grep opkg-cl > meta/recipes-devtools/dpkg/run-postinsts/* > pb@x121e:~/oe/oe-core$ > > Where are you seeing the call to opkg-cl? I don't use dpkg but opkg. So, looking at opkg.inc we find out: ... pkg_postinst_${PN} () { #!/bin/sh if [ "x$D" != "x" ]; then install -d $D${sysconfdir}/rcS.d # this happens at S98 where our good 'ole packages script used to run echo "#!/bin/sh opkg-cl configure rm -f /${sysconfdir}/rcS.d/S${POSTINSTALL_INITPOSITION}configure " > $D${sysconfdir}/rcS.d/S${POSTINSTALL_INITPOSITION}configure chmod 0755 $D${sysconfdir}/rcS.d/S${POSTINSTALL_INITPOSITION}configure fi ...
On Fri, 2012-02-17 at 17:30 -0200, Otavio Salvador wrote: > I don't use dpkg but opkg. > > > So, looking at opkg.inc we find out: > > > ... > pkg_postinst_${PN} () { > #!/bin/sh > if [ "x$D" != "x" ]; then > install -d $D${sysconfdir}/rcS.d Well, right, but that's not the run-postinsts package. You mentioned that opkg-cl wasn't installed so its own postinst is probably irrelevant here. p.
On Fri, Feb 17, 2012 at 17:59, Phil Blundell <philb@gnu.org> wrote: > Well, right, but that's not the run-postinsts package. You mentioned > that opkg-cl wasn't installed so its own postinst is probably irrelevant > here. That's why I added this.
On Fri, 2012-02-17 at 18:03 -0200, Otavio Salvador wrote: > On Fri, Feb 17, 2012 at 17:59, Phil Blundell <philb@gnu.org> wrote: > Well, right, but that's not the run-postinsts package. You > mentioned > that opkg-cl wasn't installed so its own postinst is probably > irrelevant > here. > > > That's why I added this. We seem to be going in circles here but, to go back to what I said at the beginning, why can't you use the existing run-postinsts recipe rather than adding a new script? p.
On Fri, Feb 17, 2012 at 18:11, Phil Blundell <philb@gnu.org> wrote: > We seem to be going in circles here but, to go back to what I said at > the beginning, why can't you use the existing run-postinsts recipe > rather than adding a new script? My image didn't end with it installed. I did a very small image and I expect that independently of what I choose, rootfs behave right. I think we can check for 98configure and 98run-postinsts, instead of opkg-cl, but something as I added is still useful as a safe route.
On Fri, 2012-02-17 at 18:14 -0200, Otavio Salvador wrote: > On Fri, Feb 17, 2012 at 18:11, Phil Blundell <philb@gnu.org> wrote: > We seem to be going in circles here but, to go back to what I > said at > the beginning, why can't you use the existing run-postinsts > recipe > rather than adding a new script? > > > My image didn't end with it installed. I did a very small image and I > expect that independently of what I choose, rootfs behave right. Ah, I see. Yes, that's a fair point. Maybe rootfs_ipk itself should inject ${ROOTFS_PKGMANAGE_BOOTSTRAP} into the image if it notices that there are postinsts which require running and no other package manager is installed. I think it would be better not to have multiple scripts doing the same thing if we can avoid it, otherwise you end up having to fix things like ordering issues in all of them independently. p.
On Fri, Feb 17, 2012 at 18:29, Phil Blundell <philb@gnu.org> wrote: > On Fri, 2012-02-17 at 18:14 -0200, Otavio Salvador wrote: > > On Fri, Feb 17, 2012 at 18:11, Phil Blundell <philb@gnu.org> wrote: > > We seem to be going in circles here but, to go back to what I > > said at > > the beginning, why can't you use the existing run-postinsts > > recipe > > rather than adding a new script? > > > > > > My image didn't end with it installed. I did a very small image and I > > expect that independently of what I choose, rootfs behave right. > > Ah, I see. Yes, that's a fair point. Maybe rootfs_ipk itself should > inject ${ROOTFS_PKGMANAGE_BOOTSTRAP} into the image if it notices that > there are postinsts which require running and no other package manager > is installed. I think it would be better not to have multiple scripts > doing the same thing if we can avoid it, otherwise you end up having to > fix things like ordering issues in all of them independently. Not easy to do because it might not have been built before.
Patch
diff --git a/meta/classes/rootfs_ipk.bbclass b/meta/classes/rootfs_ipk.bbclass index 2df8ca4..11ab8a1 100644 --- a/meta/classes/rootfs_ipk.bbclass +++ b/meta/classes/rootfs_ipk.bbclass @@ -96,6 +96,22 @@ fakeroot rootfs_ipk_do_rootfs () { # Also delete the status files rm -rf ${IMAGE_ROOTFS}${opkglibdir} + else + if [ ! -e ${IMAGE_ROOTFS}${bindir}/opkg-cl ]; then + # We need to run postinsts but lack opkg, do it byhand + cat > ${IMAGE_ROOTFS}/${sysconfdir}/rcS.d/S98configure <<EOF +#!/bin/sh + +for pkg in \`grep -B4 Status:.install.ok.unpacked ${opkglibdir}/status | awk '/^Package: / { print \$2 }'\`; do + ${opkglibdir}/info/\$pkg.postinst configure +done + +rm -rf ${opkglibdir} + +rm ${sysconfdir}/rcS.d/S98configure +EOF + chmod a+x ${IMAGE_ROOTFS}/${sysconfdir}/rcS.d/S98configure + fi fi fi set +x
When building without package management we can end with a system without opkg and thus without support for running unfinished postinsts on first boot, we fix this providing a S98configure script for this use case. Signed-off-by: Otavio Salvador <otavio@ossystems.com.br> --- meta/classes/rootfs_ipk.bbclass | 16 ++++++++++++++++ 1 files changed, 16 insertions(+), 0 deletions(-)