Skip to contentSkip to conversation

Postinst trigger improvements for images

PATCH Superseded Otavio Salvador 2 participants 8 messages Mar 3, 2012 – Mar 5, 2012

v1 of 2 Superseded Latest is v2 →

lore
Share & tools
lore
#0 lore raw

cover Postinst trigger improvements for images

This patchset make consistent the name used as postinst trigger in rootfs.

The following changes since commit 857840472705af1c0fbb8db917b4bb6809b929a6:

wpa-supplicant: fix breakage during rebuild (2012-03-02 22:35:03 +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 (4):
run-postinsts: fix opkg data path
image.bbclass: fix rootfs generation without package management tools rootfs_rpm.bbclass: rename postinst trigger script
opkg: rename postinst trigger script

 meta/classes/core-image.bbclass                    |    2 --
 meta/classes/image.bbclass                         |    7 +++++--
 meta/classes/rootfs_rpm.bbclass                    |    6 +++---
 .../dpkg/run-postinsts/run-postinsts               |    4 ++--
 .../dpkg/run-postinsts/run-postinsts.awk           |    2 +-
 meta/recipes-devtools/dpkg/run-postinsts_1.0.bb    |    2 +-
 meta/recipes-devtools/opkg/opkg.inc                |    8 ++++----
 7 files changed, 16 insertions(+), 15 deletions(-)
Signature · 1 line
1.7.2.5
#1 lore raw

PATCH 1/4 run-postinsts: fix opkg data path

---
 .../dpkg/run-postinsts/run-postinsts               |    4 ++--
 .../dpkg/run-postinsts/run-postinsts.awk           |    2 +-
 meta/recipes-devtools/dpkg/run-postinsts_1.0.bb    |    2 +-
 3 files changed, 4 insertions(+), 4 deletions(-)
meta/recipes-devtools/dpkg/run-postinsts/run-postinsts +2 -2
index 584a92e..5f6442c 100755
@@ -8,8 +8,8 @@
 PKGSYSTEM=/var/lib/dpkg
 
 if [ ! -e $PKGSYSTEM/status ]; then
-  if [ -e /usr/lib/opkg/status ]; then
-    PKGSYSTEM=/usr/lib/opkg
+  if [ -e /var/lib/opkg/status ]; then
+    PKGSYSTEM=/var/lib/opkg
   else
     echo "No package system found"
     exit 1
meta/recipes-devtools/dpkg/run-postinsts/run-postinsts.awk +1 -1
index d92200b..18a0492 100644
@@ -11,7 +11,7 @@ BEGIN {
   if (rc==0)
     pkgdir="/var/lib/dpkg/info"
   else
-    pkgdir="/usr/lib/opkg/info"
+    pkgdir="/var/lib/opkg/info"
   package=""
 }
 /Package:.*/ {
meta/recipes-devtools/dpkg/run-postinsts_1.0.bb +1 -1
index f8f3368..7438a10 100644
@@ -1,6 +1,6 @@
 DESCRIPTION = "Run postinstall scripts on device using awk"
 SECTION = "devel"
-PR = "r7"
+PR = "r8"
 LICENSE = "MIT"
 LIC_FILES_CHKSUM = "file://${COREBASE}/LICENSE;md5=3f40d7994397109285ec7b81fdeb3b58 \
                     file://${COREBASE}/meta/COPYING.MIT;md5=3da9cfbcb788c80a0384361b4de20420"
Signature · 1 line
1.7.2.5
#2 lore raw

PATCH 2/4 image.bbclass: fix rootfs generation without package management tools

In reply to Otavio Salvador

When building without package management tools the ROOTFS_BOOTSTRAP_INSTALL packages need to be available to provide the bare minimal for rootfs unconfigure postinsts to be on first boot.

Those packages where being include in core-image.bbclass' based images however every image needs those available for proper rootfs generation.

---
 meta/classes/core-image.bbclass |    2 --
 meta/classes/image.bbclass      |    7 +++++--
 2 files changed, 5 insertions(+), 4 deletions(-)
meta/classes/core-image.bbclass +0 -2
index 668297b..e2ad0fc 100644
@@ -51,8 +51,6 @@ CORE_IMAGE_BASE_INSTALL = '\
     task-core-boot \
     task-base-extended \
     \
-    ${@base_contains("IMAGE_FEATURES", "package-management", "", "${ROOTFS_PKGMANAGE_BOOTSTRAP}",d)} \
-    \
     ${CORE_IMAGE_EXTRA_INSTALL} \
     '
 
meta/classes/image.bbclass +5 -2
index dfce381..8e9da99 100644
@@ -5,7 +5,7 @@ inherit imagetest-${IMAGETEST}
 
 LICENSE = "MIT"
 PACKAGES = ""
-RDEPENDS += "${IMAGE_INSTALL} ${LINGUAS_INSTALL} ${NORMAL_FEATURE_INSTALL}"
+RDEPENDS += "${IMAGE_INSTALL} ${LINGUAS_INSTALL} ${NORMAL_FEATURE_INSTALL} ${ROOTFS_BOOTSTRAP_INSTALL}"
 RRECOMMENDS += "${NORMAL_FEATURE_INSTALL_OPTIONAL}"
 
 INHIBIT_DEFAULT_DEPS = "1"
@@ -14,6 +14,9 @@ INHIBIT_DEFAULT_DEPS = "1"
 IMAGE_FEATURES ?= ""
 IMAGE_FEATURES[type] = "list"
 
+# rootfs bootstrap install
+ROOTFS_BOOTSTRAP_INSTALL = "${@base_contains("IMAGE_FEATURES", "package-management", "", "${ROOTFS_PKGMANAGE_BOOTSTRAP}",d)}"
+
 # packages to install from features
 FEATURE_INSTALL = "${@' '.join(oe.packagegroup.required_packages(oe.data.typed_value('IMAGE_FEATURES', d), d))}"
 FEATURE_INSTALL_OPTIONAL = "${@' '.join(oe.packagegroup.optional_packages(oe.data.typed_value('IMAGE_FEATURES', d), d))}"
@@ -52,7 +55,7 @@ PACKAGE_GROUP_doc-pkgs[optional] = "1"
 IMAGE_INSTALL ?= ""
 IMAGE_INSTALL[type] = "list"
 IMAGE_BASENAME[export] = "1"
-export PACKAGE_INSTALL ?= "${IMAGE_INSTALL} ${FEATURE_INSTALL}"
+export PACKAGE_INSTALL ?= "${IMAGE_INSTALL} ${ROOTFS_BOOTSTRAP_INSTALL} ${FEATURE_INSTALL}"
 PACKAGE_INSTALL_ATTEMPTONLY ?= "${FEATURE_INSTALL_OPTIONAL}"
 
 # Images are generally built explicitly, do not need to be part of world.
Signature · 1 line
1.7.2.5
#3 lore raw

PATCH 3/4 rootfs_rpm.bbclass: rename postinst trigger script

In reply to Otavio Salvador

Use 'run-postinsts' as trigger script name for consistency against package managers.

---
 meta/classes/rootfs_rpm.bbclass |    6 +++---
 1 files changed, 3 insertions(+), 3 deletions(-)
meta/classes/rootfs_rpm.bbclass +3 -3
index 48133f0..9039b21 100644
@@ -112,7 +112,7 @@ EOF
 	install -d ${IMAGE_ROOTFS}/${sysconfdir}/rcS.d
 	# Stop $i getting expanded below...
 	i=\$i
-	cat > ${IMAGE_ROOTFS}${sysconfdir}/rcS.d/S${POSTINSTALL_INITPOSITION}configure << EOF
+	cat > ${IMAGE_ROOTFS}${sysconfdir}/rcS.d/S${POSTINSTALL_INITPOSITION}run-postinsts << EOF
 #!/bin/sh
 for i in /etc/rpm-postinsts/*; do
 	echo "Running postinst $i..."
@@ -122,9 +122,9 @@ for i in /etc/rpm-postinsts/*; do
 		echo "ERROR: postinst $i failed."
 	fi
 done
-rm -f ${sysconfdir}/rcS.d/S${POSTINSTALL_INITPOSITION}configure
+rm -f ${sysconfdir}/rcS.d/S${POSTINSTALL_INITPOSITION}run-postinsts
 EOF
-	chmod 0755 ${IMAGE_ROOTFS}${sysconfdir}/rcS.d/S${POSTINSTALL_INITPOSITION}configure
+	chmod 0755 ${IMAGE_ROOTFS}${sysconfdir}/rcS.d/S${POSTINSTALL_INITPOSITION}run-postinsts
 
 	install -d ${IMAGE_ROOTFS}/${sysconfdir}
 	echo ${BUILDNAME} > ${IMAGE_ROOTFS}/${sysconfdir}/version
Signature · 1 line
1.7.2.5
#4 lore raw

Re: [PATCH 3/4] rootfs_rpm.bbclass: rename postinst trigger script

Quoted 7 lines · Otavio Salvador

Use 'run-postinsts' as trigger script name for consistency against package managers.

---
 meta/classes/rootfs_rpm.bbclass |    6 +++---
 1 files changed, 3 insertions(+), 3 deletions(-)

I find the consistency argument a little confusing when you had to rename this for all of the packaging backends from the same thing?

I understand you want a less confusing name though as configure is an overloaded word.

Also, please do post the deb patch too. Saying you've just pushed an extra patch somewhere doesn't really work...

Cheers,

Richard

#5 lore raw

Re: [PATCH 3/4] rootfs_rpm.bbclass: rename postinst trigger script

Quoted 2 lines · Richard Purdie

I find the consistency argument a little confusing when you had to rename this for all of the packaging backends from the same thing?

I did it because I used run-postinsts package for bootstrap in ipk.

Quoted 2 lines

I understand you want a less confusing name though as configure is an overloaded word.

If you prefer I can change this; doesn't matter for me.

Quoted 2 lines

Also, please do post the deb patch too. Saying you've just pushed an extra patch somewhere doesn't really work...

Right; once you reply if you want me to change wording I do.

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

PATCH 4/4 opkg: rename postinst trigger script

In reply to Otavio Salvador

Use 'run-postinsts' as trigger script name for consistency against package managers.

---
 meta/recipes-devtools/opkg/opkg.inc |    8 ++++----
 1 files changed, 4 insertions(+), 4 deletions(-)
meta/recipes-devtools/opkg/opkg.inc +4 -4
index a67066f..689bd4a 100644
@@ -11,7 +11,7 @@ DEPENDS_virtclass-native = "curl-native"
 DEPENDS_virtclass-nativesdk = "curl-nativesdk"
 
 PE = "1"
-INC_PR = "r7"
+INC_PR = "r8"
 
 FILESDIR = "${@os.path.dirname(d.getVar('FILE',1))}/opkg"
 
@@ -60,9 +60,9 @@ if [ "x$D" != "x" ]; then
 	# 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
+rm -f /${sysconfdir}/rcS.d/S${POSTINSTALL_INITPOSITION}run-postinsts
+" > $D${sysconfdir}/rcS.d/S${POSTINSTALL_INITPOSITION}run-postinsts
+	chmod 0755 $D${sysconfdir}/rcS.d/S${POSTINSTALL_INITPOSITION}run-postinsts
 fi
 
 update-alternatives --install ${bindir}/opkg opkg ${bindir}/opkg-cl 100
Signature · 1 line
1.7.2.5
#7 lore raw
In reply to Otavio Salvador
Quoted 5 lines · Otavio Salvador

Otavio Salvador (4):
 run-postinsts: fix opkg data path
 image.bbclass: fix rootfs generation without package management tools rootfs_rpm.bbclass: rename postinst trigger script
 opkg: rename postinst trigger script

I pushed the dpkg patch for my branch doing the same as opkg. I forgot pushing it before doing the pull request.

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