Skip to contentSkip to conversation

Pending O.S. Systems' tree patches

PATCH In review Otavio Salvador 3 participants 15 messages Feb 17, 2012 – Feb 24, 2012

lore
Share & tools
lore
#0 lore raw

cover Pending O.S. Systems' tree patches

The following changes since commit e5ad03093dfc4364d1407183f458df79f347c7a1:

guile: fix cross configure failure (2012-02-10 13:38:16 +0000)

are available in the git repository at:
git://github.com/OSSystems/oe-core master
https://github.com/OSSystems/oe-core/tree/HEAD

Otavio Salvador (3):
update-rc.d.bbclass: do nothing for extended cross packages rootfs_ipk.bbclass: fix status file location in rootfs rootfs_ipk.bbclass: fix unpacked postinst support if no package
management

 meta/classes/rootfs_ipk.bbclass  |   21 ++++++++++++++++++---
 meta/classes/update-rc.d.bbclass |    1 +
 2 files changed, 19 insertions(+), 3 deletions(-)
Signature · 1 line
1.7.2.5
#1 lore raw

PATCH 1/3 update-rc.d.bbclass: do nothing for extended cross packages

---
 meta/classes/update-rc.d.bbclass |    1 +
 1 files changed, 1 insertions(+), 0 deletions(-)
meta/classes/update-rc.d.bbclass +1 -0
index e72cf78..db88a8e 100644
@@ -2,6 +2,7 @@ UPDATERCPN ?= "${PN}"
 
 DEPENDS_append = " update-rc.d-native"
 UPDATERCD = "update-rc.d"
+UPDATERCD_virtclass-cross = ""
 UPDATERCD_virtclass-native = ""
 UPDATERCD_virtclass-nativesdk = ""
 
Signature · 1 line
1.7.2.5
#2 lore raw

PATCH 2/3 rootfs_ipk.bbclass: fix status file location in rootfs

In reply to Otavio Salvador

This fixes runtime requirement checking and read-only-fs checking.

---
 meta/classes/rootfs_ipk.bbclass |    5 ++---
 1 files changed, 2 insertions(+), 3 deletions(-)
meta/classes/rootfs_ipk.bbclass +2 -3
index 5342035..2df8ca4 100644
@@ -76,7 +76,7 @@ fakeroot rootfs_ipk_do_rootfs () {
 	${ROOTFS_POSTINSTALL_COMMAND}
 	
 	if ${@base_contains("IMAGE_FEATURES", "read-only-rootfs", "true", "false" ,d)}; then
-		if grep Status:.install.ok.unpacked ${IMAGE_ROOTFS}${opkglibdir}status; then
+		if grep Status:.install.ok.unpacked ${STATUS}; then
 			echo "Some packages could not be configured offline and rootfs is read-only."
 			exit 1
 		fi
@@ -88,9 +88,8 @@ fakeroot rootfs_ipk_do_rootfs () {
 	${ROOTFS_POSTPROCESS_COMMAND}
 	
 	rm -f ${IMAGE_ROOTFS}${opkglibdir}/lists/*
-
 	if ${@base_contains("IMAGE_FEATURES", "package-management", "false", "true", d)}; then
-		if ! grep Status:.install.ok.unpacked ${IMAGE_ROOTFS}${opkglibdir}status; then
+		if ! grep Status:.install.ok.unpacked ${STATUS}; then
 			# All packages were successfully configured.
 			# update-rc.d, base-passwd are no further use, remove them now
 			opkg-cl ${IPKG_ARGS} --force-depends remove update-rc.d base-passwd || true
Signature · 1 line
1.7.2.5
#3 lore raw

PATCH 3/3 rootfs_ipk.bbclass: fix unpacked postinst support if no package management

In reply to Otavio Salvador

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.

---
 meta/classes/rootfs_ipk.bbclass |   16 ++++++++++++++++
 1 files changed, 16 insertions(+), 0 deletions(-)
meta/classes/rootfs_ipk.bbclass +16 -0
index 2df8ca4..11ab8a1 100644
@@ -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
Signature · 1 line
1.7.2.5
#4 lore raw

Re: [PATCH 3/3] rootfs_ipk.bbclass: fix unpacked postinst support if no package management

Quoted 4 lines · Otavio Salvador

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.

#5 lore raw

Re: [PATCH 3/3] rootfs_ipk.bbclass: fix unpacked postinst support if no package management

Quoted 8 lines · Phil Blundell
Quoted 4 lines · Otavio Salvador

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.

Signature · 3 lines
Otavio Salvador                             O.S. Systems
E-mail: [email protected]  http://www.ossystems.com.br
Mobile: +55 53 9981-7854              http://projetos.ossystems.com.br
#6 lore raw

Re: [PATCH 3/3] rootfs_ipk.bbclass: fix unpacked postinst support if no package management

Quoted 11 lines · Otavio Salvador

On Fri, Feb 17, 2012 at 15:51, Phil Blundell <[email protected]> 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.

Quoted 5 lines

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.

#7 lore raw

Re: [PATCH 3/3] rootfs_ipk.bbclass: fix unpacked postinst support if no package management

Quoted 7 lines · Phil Blundell

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
...

Signature · 3 lines
Otavio Salvador                             O.S. Systems
E-mail: [email protected]  http://www.ossystems.com.br
Mobile: +55 53 9981-7854              http://projetos.ossystems.com.br
#8 lore raw

Re: [PATCH 3/3] rootfs_ipk.bbclass: fix unpacked postinst support if no package management

Quoted 11 lines · Otavio Salvador

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.

#9 lore raw

Re: [PATCH 3/3] rootfs_ipk.bbclass: fix unpacked postinst support if no package management

Quoted 3 lines · Phil Blundell

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.

Signature · 3 lines
Otavio Salvador                             O.S. Systems
E-mail: [email protected]  http://www.ossystems.com.br
Mobile: +55 53 9981-7854              http://projetos.ossystems.com.br
#10 lore raw

Re: [PATCH 3/3] rootfs_ipk.bbclass: fix unpacked postinst support if no package management

Quoted 9 lines · Otavio Salvador

On Fri, Feb 17, 2012 at 17:59, Phil Blundell <[email protected]> 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.

#11 lore raw

Re: [PATCH 3/3] rootfs_ipk.bbclass: fix unpacked postinst support if no package management

Quoted 3 lines · Phil Blundell

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.

Signature · 3 lines
Otavio Salvador                             O.S. Systems
E-mail: [email protected]  http://www.ossystems.com.br
Mobile: +55 53 9981-7854              http://projetos.ossystems.com.br
#12 lore raw

Re: [PATCH 3/3] rootfs_ipk.bbclass: fix unpacked postinst support if no package management

Quoted 10 lines · Otavio Salvador

On Fri, Feb 17, 2012 at 18:11, Phil Blundell <[email protected]> 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.

#13 lore raw

Re: [PATCH 3/3] rootfs_ipk.bbclass: fix unpacked postinst support if no package management

Quoted 12 lines · Phil Blundell
Quoted 10 lines · Otavio Salvador

On Fri, Feb 17, 2012 at 18:11, Phil Blundell <[email protected]> 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.

Quoted 6 lines

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.

Signature · 3 lines
Otavio Salvador                             O.S. Systems
E-mail: [email protected]  http://www.ossystems.com.br
Mobile: +55 53 9981-7854              http://projetos.ossystems.com.br
#14 lore raw
In reply to Otavio Salvador
Quoted 11 lines · Otavio Salvador

The following changes since commit e5ad03093dfc4364d1407183f458df79f347c7a1:

guile: fix cross configure failure (2012-02-10 13:38:16 +0000)

are available in the git repository at:
git://github.com/OSSystems/oe-core master
https://github.com/OSSystems/oe-core/tree/HEAD

Otavio Salvador (3):
update-rc.d.bbclass: do nothing for extended cross packages rootfs_ipk.bbclass: fix status file location in rootfs

Merged these first 2 into OE-core

Quoted 3 lines

rootfs_ipk.bbclass: fix unpacked postinst support if no package
management

Not sure where this one stand with your discussion with Phil

Thanks
Sau!

Quoted 4 lines
  meta/classes/rootfs_ipk.bbclass  |   21 ++++++++++++++++++---
  meta/classes/update-rc.d.bbclass |    1 +
  2 files changed, 19 insertions(+), 3 deletions(-)