Skip to contentSkip to conversation

Postinst trigger improvements for images

PATCH Applied Otavio Salvador 2 participants 7 messages Mar 6, 2012 – Mar 13, 2012

lore
Share & tools
lore
#0 lore raw

v2 cover Postinst trigger improvements for images

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

The following changes since commit d7b8c247227f3cc82f92292407f548927e9fde78:

base.bbclass: Fix PACKAGECONFIG handling when no flags are set (2012-03-05 13:03:41 -0800)

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

Otavio Salvador (5):
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
dpkg: rename postinst trigger script

 meta/classes/core-image.bbclass                    |    2 --
 meta/classes/image.bbclass                         |    7 +++++--
 meta/classes/rootfs_rpm.bbclass                    |    6 +++---
 meta/recipes-devtools/dpkg/dpkg.inc                |    8 ++++----
 .../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 ++++----
 8 files changed, 20 insertions(+), 19 deletions(-)
Signature · 1 line
1.7.2.5
#1 lore raw

PATCH v2 1/5 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 v2 2/5 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 a62eb2c..533f53c 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 v2 3/5 rootfs_rpm.bbclass: rename postinst trigger script

In reply to Otavio Salvador

Use 'run-postinsts' as trigger script name as it describes better the intent of it.

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

PATCH v2 4/5 opkg: rename postinst trigger script

In reply to Otavio Salvador

Use 'run-postinsts' as trigger script name as it describes better the intent of it.

---
 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
#5 lore raw

PATCH v2 5/5 dpkg: rename postinst trigger script

In reply to Otavio Salvador

Use 'run-postinsts' as trigger script name as it describes better the intent of it.

---
 meta/recipes-devtools/dpkg/dpkg.inc |    8 ++++----
 1 files changed, 4 insertions(+), 4 deletions(-)
meta/recipes-devtools/dpkg/dpkg.inc +4 -4
index 1326994..09bfbbc 100644
@@ -2,7 +2,7 @@ DESCRIPTION = "Package maintenance system for Debian."
 LICENSE = "GPLv2.0+"
 SECTION = "base"
 
-INC_PR = "r15"
+INC_PR = "r16"
 
 SRC_URI = "${DEBIAN_MIRROR}/main/d/dpkg/dpkg_${PV}.tar.bz2 \
            file://ignore_extra_fields.patch"
@@ -42,9 +42,9 @@ do_install_prepend () {
 	# this happens at S98 where our good 'ole packages script used to run
 	printf "#!/bin/sh
 dpkg --configure -a
-rm -f ${sysconfdir}/rcS.d/S${DPKG_INIT_POSITION}configure
-" > ${D}/${sysconfdir}/rcS.d/S${DPKG_INIT_POSITION}configure
-	chmod 0755 ${D}/${sysconfdir}/rcS.d/S${DPKG_INIT_POSITION}configure
+rm -f ${sysconfdir}/rcS.d/S${DPKG_INIT_POSITION}run-postinsts
+" > ${D}/${sysconfdir}/rcS.d/S${DPKG_INIT_POSITION}run-postinsts
+	chmod 0755 ${D}/${sysconfdir}/rcS.d/S${DPKG_INIT_POSITION}run-postinsts
 }
 
 do_install_append () {
Signature · 1 line
1.7.2.5
Applied
#6 lore raw
In reply to Otavio Salvador
Quoted 18 lines · Otavio Salvador

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

The following changes since commit d7b8c247227f3cc82f92292407f548927e9fde78:

base.bbclass: Fix PACKAGECONFIG handling when no flags are set (2012-03-05 13:03:41 -0800)

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

Otavio Salvador (5):
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
dpkg: rename postinst trigger script

Quoted 10 lines
  meta/classes/core-image.bbclass                    |    2 --
  meta/classes/image.bbclass                         |    7 +++++--
  meta/classes/rootfs_rpm.bbclass                    |    6 +++---
  meta/recipes-devtools/dpkg/dpkg.inc                |    8 ++++----
  .../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 ++++----
  8 files changed, 20 insertions(+), 19 deletions(-)

Merged into OE-Core

Thanks
Sau!