* [PATCH 0/5] Change the way RPM handles pre/post scripts
@ 2011-11-10 18:30 Mark Hatle
2011-11-10 18:30 ` [PATCH 1/5] rootfs_rpm.bbclass: Enable pre and post install scripts Mark Hatle
` (5 more replies)
0 siblings, 6 replies; 7+ messages in thread
From: Mark Hatle @ 2011-11-10 18:30 UTC (permalink / raw)
To: openembedded-core
We change the way rootfs_rpm handles pre / post scripts in order to
enable preinst scripts and better handling of post scripts.
The following changes since commit 379c77d1516fe8fdbd1cd7063f709b5266872b03:
populate_*.bbclass: Correct INSTALL variable name after recent multilib changes (2011-11-10 18:05:06 +0000)
are available in the git repository at:
git://git.pokylinux.org/poky-contrib mhatle/rpm
http://git.pokylinux.org/cgit.cgi/poky-contrib/log/?h=mhatle/rpm
Mark Hatle (5):
rootfs_rpm.bbclass: Enable pre and post install scripts
rootfs_rpm.bbclass: Turn off script debugging
wpa-supplicant: Avoid blocking the post install script at cross
rootfs time.
shadow: Generate the shadow files at rootfs construction
sudo: Avoid post install scripts
meta/classes/package_rpm.bbclass | 33 ++++-
meta/classes/rootfs_rpm.bbclass | 27 +---
.../wpa-supplicant/wpa-supplicant-0.7.inc | 4 +-
.../wpa-supplicant/wpa-supplicant_0.7.3.bb | 2 +-
.../rpm/rpm/rpm-scriptletexechelper.patch | 159 ++++++++++++++++++++
meta/recipes-devtools/rpm/rpm_5.4.0.bb | 3 +-
meta/recipes-extended/shadow/shadow_4.1.4.3.bb | 12 +-
meta/recipes-extended/sudo/sudo.inc | 8 -
meta/recipes-extended/sudo/sudo_1.8.3.bb | 5 +-
9 files changed, 214 insertions(+), 39 deletions(-)
create mode 100644 meta/recipes-devtools/rpm/rpm/rpm-scriptletexechelper.patch
--
1.7.3.4
^ permalink raw reply [flat|nested] 7+ messages in thread* [PATCH 1/5] rootfs_rpm.bbclass: Enable pre and post install scripts 2011-11-10 18:30 [PATCH 0/5] Change the way RPM handles pre/post scripts Mark Hatle @ 2011-11-10 18:30 ` Mark Hatle 2011-11-10 18:30 ` [PATCH 2/5] rootfs_rpm.bbclass: Turn off script debugging Mark Hatle ` (4 subsequent siblings) 5 siblings, 0 replies; 7+ messages in thread From: Mark Hatle @ 2011-11-10 18:30 UTC (permalink / raw) To: openembedded-core [YOCTO #1755] We change the want the RPM rootfs install works to install pre and post install scripts. The new method uses a script helper that is invoked by RPM outside of the normal chroot. The wrapper is dynamically generated prior to the install starting. It will check the return code of the script. If the script fails, it will store a copy to be executed on the first system boot. This is similar to the previous mechanism. In addition, a line of debug was added to the scripts as written by package_rpm to list which package and which script for later debugging, if necessary. Signed-off-by: Mark Hatle <mark.hatle@windriver.com> --- meta/classes/package_rpm.bbclass | 33 ++++- meta/classes/rootfs_rpm.bbclass | 25 +--- .../rpm/rpm/rpm-scriptletexechelper.patch | 159 ++++++++++++++++++++ meta/recipes-devtools/rpm/rpm_5.4.0.bb | 3 +- 4 files changed, 199 insertions(+), 21 deletions(-) create mode 100644 meta/recipes-devtools/rpm/rpm/rpm-scriptletexechelper.patch diff --git a/meta/classes/package_rpm.bbclass b/meta/classes/package_rpm.bbclass index 2c5545c..2ace053 100644 --- a/meta/classes/package_rpm.bbclass +++ b/meta/classes/package_rpm.bbclass @@ -382,13 +382,39 @@ package_install_internal_rpm () { cat ${target_rootfs}/install/install_solution.manifest > ${target_rootfs}/install/total_solution.manifest cat ${target_rootfs}/install/install_multilib_solution.manifest >> ${target_rootfs}/install/total_solution.manifest + # Construct install scriptlet wrapper + cat << EOF > ${WORKDIR}/scriptlet_wrapper +#!/bin/bash + +export PATH="${PATH}" +export D="${target_rootfs}" +export OFFLINE_ROOT="\$D" +export IPKG_OFFLINE_ROOT="\$D" +export OPKG_OFFLINE_ROOT="\$D" + +\$2 \$1/\$3 \$4 +if [ \$? -ne 0 ]; then + mkdir -p \$1/etc/rpm-postinsts + num=100 + while [ -e \$1/etc/rpm-postinsts/\${num} ]; do num=\$((num + 1)); done + echo "#!\$2" > \$1/etc/rpm-postinsts/\${num} + echo "# Arg: \$4" >> \$1/etc/rpm-postinsts/\${num} + cat \$1/\$3 >> \$1/etc/rpm-postinsts/\${num} + chmod +x \$1/etc/rpm-postinsts/\${num} +fi +EOF + + chmod 0755 ${WORKDIR}/scriptlet_wrapper + # Attempt install ${RPM} --root ${target_rootfs} \ --predefine "_rpmds_sysinfo_path ${target_rootfs}/etc/rpm/sysinfo" \ --predefine "_rpmrc_platform_path ${target_rootfs}/etc/rpm/platform" \ + -D "_var ${localstatedir}" \ -D "_dbpath ${rpmlibdir}" \ - --noscripts --notriggers --noparentdirs --nolinktos --replacepkgs \ + --noparentdirs --nolinktos --replacepkgs \ -D "__dbi_txn create nofsync private" \ + -D "_cross_scriptlet_wrapper ${WORKDIR}/scriptlet_wrapper" \ -Uhv ${target_rootfs}/install/total_solution.manifest } @@ -685,6 +711,7 @@ python write_specfile () { elif script == 'postrm': spec_scriptlets_bottom.append('%%postun -n %s' % splitname) scriptvar = wrap_uninstall(scriptvar) + spec_scriptlets_bottom.append('# %s - %s' % (splitname, script)) spec_scriptlets_bottom.append(scriptvar) spec_scriptlets_bottom.append('') @@ -762,19 +789,23 @@ python write_specfile () { if srcpreinst: spec_scriptlets_top.append('%pre') + spec_scriptlets_top.append('# %s - preinst' % srcname) spec_scriptlets_top.append(srcpreinst) spec_scriptlets_top.append('') if srcpostinst: spec_scriptlets_top.append('%post') + spec_scriptlets_top.append('# %s - postinst' % srcname) spec_scriptlets_top.append(srcpostinst) spec_scriptlets_top.append('') if srcprerm: spec_scriptlets_top.append('%preun') + spec_scriptlets_top.append('# %s - prerm' % srcname) scriptvar = wrap_uninstall(srcprerm) spec_scriptlets_top.append(scriptvar) spec_scriptlets_top.append('') if srcpostrm: spec_scriptlets_top.append('%postun') + spec_scriptlets_top.append('# %s - postrm' % srcname) scriptvar = wrap_uninstall(srcpostrm) spec_scriptlets_top.append(scriptvar) spec_scriptlets_top.append('') diff --git a/meta/classes/rootfs_rpm.bbclass b/meta/classes/rootfs_rpm.bbclass index 95e9455..b3875a4 100644 --- a/meta/classes/rootfs_rpm.bbclass +++ b/meta/classes/rootfs_rpm.bbclass @@ -20,8 +20,6 @@ do_rootfs[depends] += "opkg-native:do_populate_sysroot" do_rootfs[recrdeptask] += "do_package_write_rpm" -AWKPOSTINSTSCRIPT = "${COREBASE}/scripts/rootfs_rpm-extract-postinst.awk" - RPM_PREPROCESS_COMMANDS = "package_update_index_rpm; package_generate_rpm_conf; " RPM_POSTPROCESS_COMMANDS = "" @@ -108,19 +106,9 @@ EOF ${ROOTFS_POSTINSTALL_COMMAND} - mkdir -p ${IMAGE_ROOTFS}/etc/rpm-postinsts/ - ${RPM} --root ${IMAGE_ROOTFS} -D '_dbpath ${rpmlibdir}' -qa \ - -D "__dbi_txn create nofsync private" \ - --qf 'Name: %{NAME}\n%|POSTIN?{postinstall scriptlet%|POSTINPROG?{ (using %{POSTINPROG})}|:\n%{POSTIN}\n}:{%|POSTINPROG?{postinstall program: %{POSTINPROG}\n}|}|' \ - > ${IMAGE_ROOTFS}/etc/rpm-postinsts/combined - awk -f ${AWKPOSTINSTSCRIPT} < ${IMAGE_ROOTFS}/etc/rpm-postinsts/combined - rm ${IMAGE_ROOTFS}/etc/rpm-postinsts/combined - - for i in ${IMAGE_ROOTFS}/etc/rpm-postinsts/*.sh; do - if [ -f $i ] && sh $i; then - # rm $i - mv $i $i.done - fi + # Report delayed package scriptlets + for i in ${IMAGE_ROOTFS}/etc/rpm-postinsts/*; do + echo "Delayed package scriptlet: `head -n 3 $i | tail -n 1`" done install -d ${IMAGE_ROOTFS}/${sysconfdir}/rcS.d @@ -128,11 +116,10 @@ EOF i=\$i cat > ${IMAGE_ROOTFS}${sysconfdir}/rcS.d/S${POSTINSTALL_INITPOSITION}configure << EOF #!/bin/sh -for i in /etc/rpm-postinsts/*.sh; do +for i in /etc/rpm-postinsts/*; do echo "Running postinst $i..." - if [ -f $i ] && sh $i; then - # rm $i - mv $i $i.done + if [ -f $i ] && $i; then + rm $i else echo "ERROR: postinst $i failed." fi diff --git a/meta/recipes-devtools/rpm/rpm/rpm-scriptletexechelper.patch b/meta/recipes-devtools/rpm/rpm/rpm-scriptletexechelper.patch new file mode 100644 index 0000000..e4db0e4 --- /dev/null +++ b/meta/recipes-devtools/rpm/rpm/rpm-scriptletexechelper.patch @@ -0,0 +1,159 @@ +Enable a cross-install scriptlet helper. + +The helper is called from outside of the chroot with the arguments: + +<root> <prog> <script> <arg1> [<arg2> ... <argN>] + +The helper script is used by oe-core to facilitate shell script actions that +can not be run from within a chroot on a foreign target system during a +cross install. + +Upstream-Status: Pending + +Signed-off-by: Mark Hatle <mark.hatle@windriver.com> + +diff -ur rpm-5.4.0.orig/lib/psm.c rpm-5.4.0/lib/psm.c +--- rpm-5.4.0.orig/lib/psm.c 2010-12-29 07:42:11.000000000 -0600 ++++ rpm-5.4.0/lib/psm.c 2011-11-08 13:38:48.132791154 -0600 +@@ -792,6 +792,10 @@ + int xx; + int i; + ++#ifdef RPM_VENDOR_POKY ++ const char * scriptletWrapper = rpmExpand("%{?_cross_scriptlet_wrapper}", NULL); ++#endif ++ + if (psm->sstates != NULL && ix >= 0 && ix < RPMSCRIPT_MAX) + ssp = psm->sstates + ix; + if (ssp != NULL) +@@ -858,14 +862,29 @@ + (F_ISSET(psm, UNORDERED) ? "a" : "")); + + if (Phe->p.argv == NULL) { +- argv = alloca(5 * sizeof(*argv)); +- argv[0] = "/bin/sh"; +- argc = 1; ++ argv = alloca(7 * sizeof(*argv)); ++ argc = 0; ++ } else { ++ argv = alloca((Phe->c + 6) * sizeof(*argv)); ++ argc = 0; ++ } ++ ++#ifdef RPM_VENDOR_POKY ++ if (scriptletWrapper && *scriptletWrapper) { ++ argv[argc++] = scriptletWrapper; ++ argv[argc] = rpmtsRootDir(ts); ++ if (!argv[argc] || !*argv[argc]) ++ argv[argc] = "/"; ++ argc++; ++ } ++#endif ++ ++ if (Phe->p.argv == NULL) { ++ argv[argc++] = "/bin/sh"; + ldconfig_done = 0; + } else { +- argv = alloca((Phe->c + 4) * sizeof(*argv)); +- memcpy(argv, Phe->p.argv, Phe->c * sizeof(*argv)); +- argc = Phe->c; ++ memcpy((argv + argc), Phe->p.argv, Phe->c * sizeof(*argv)); ++ argc += Phe->c; + ldconfig_done = (ldconfig_path && !strcmp(argv[0], ldconfig_path) + ? 1 : 0); + } +@@ -916,7 +935,12 @@ + goto exit; + + if (rpmIsDebug() && +- (!strcmp(argv[0], "/bin/sh") || !strcmp(argv[0], "/bin/bash"))) ++ (!strcmp(argv[0], "/bin/sh") || !strcmp(argv[0], "/bin/bash")) ++#ifdef RPM_VENDOR_POKY ++ || (scriptletWrapper && *scriptletWrapper && !strcmp(argv[1], "/bin/sh")) ++ || (scriptletWrapper && *scriptletWrapper && !strcmp(argv[1], "/bin/bash")) ++#endif ++ ) + { + static const char set_x[] = "set -x\n"; + nw = Fwrite(set_x, sizeof(set_x[0]), sizeof(set_x)-1, fd); +@@ -1051,12 +1075,22 @@ + + { const char * rootDir = rpmtsRootDir(ts); + if (!rpmtsChrootDone(ts) && rootDir != NULL && ++#ifdef RPM_VENDOR_POKY ++ !(scriptletWrapper && *scriptletWrapper) && ++#endif + !(rootDir[0] == '/' && rootDir[1] == '\0')) + { + /*@-modobserver@*/ + xx = Chroot(rootDir); + /*@=modobserver@*/ + } ++#ifdef RPM_VENDOR_POKY ++ if (!rpmtsChrootDone(ts) && rootDir != NULL && ++ (scriptletWrapper && *scriptletWrapper) && ++ !(rootDir[0] == '/' && rootDir[1] == '\0')) ++ xx = Chdir(rootDir); ++ else ++#endif + xx = Chdir("/"); + rpmlog(RPMLOG_DEBUG, D_("%s: %s(%s)\texecv(%s) pid %d\n"), + psm->stepName, sln, NVRA, +@@ -2961,6 +2995,13 @@ + case PSM_SCRIPT: /* Run current package scriptlets. */ + /* XXX running %verifyscript/%sanitycheck doesn't have psm->te */ + { rpmtxn _parent = (psm && psm->te ? psm->te->txn : NULL); ++ ++#ifdef RPM_VENDOR_POKY ++ const char * scriptletWrapper = rpmExpand("%{?_cross_scriptlet_wrapper}", NULL); ++ if (scriptletWrapper && *scriptletWrapper) ++ rc = rpmpsmNext(psm, PSM_CHROOT_OUT); ++#endif ++ + xx = rpmtxnBegin(rpmtsGetRdb(ts), _parent, NULL); + rc = runInstScript(psm); + if (rc) +@@ -2968,11 +3009,24 @@ + else + xx = rpmtxnCommit(rpmtsGetRdb(ts)->db_txn); + rpmtsGetRdb(ts)->db_txn = NULL; ++#ifdef RPM_VENDOR_POKY ++ if (scriptletWrapper && *scriptletWrapper) ++ rc = rpmpsmNext(psm, PSM_CHROOT_IN); ++#endif + } break; + case PSM_TRIGGERS: + /* Run triggers in other package(s) this package sets off. */ + if (rpmtsFlags(ts) & RPMTRANS_FLAG_TEST) break; ++#ifdef RPM_VENDOR_POKY ++ const char * scriptletWrapper = rpmExpand("%{?_cross_scriptlet_wrapper}", NULL); ++ if (scriptletWrapper && *scriptletWrapper) ++ rc = rpmpsmNext(psm, PSM_CHROOT_OUT); ++#endif + rc = runTriggers(psm); ++#ifdef RPM_VENDOR_POKY ++ if (scriptletWrapper && *scriptletWrapper) ++ rc = rpmpsmNext(psm, PSM_CHROOT_IN); ++#endif + break; + case PSM_IMMED_TRIGGERS: + /* Run triggers in this package other package(s) set off. */ +@@ -2982,7 +3036,18 @@ + F_SET(psm, GOTTRIGGERS); + } + if (psm->triggers != NULL) ++#ifdef RPM_VENDOR_POKY ++ { ++ const char * scriptletWrapper = rpmExpand("%{?_cross_scriptlet_wrapper}", NULL); ++ if (scriptletWrapper && *scriptletWrapper) ++ rc = rpmpsmNext(psm, PSM_CHROOT_OUT); ++#endif + rc = runImmedTriggers(psm); ++#ifdef RPM_VENDOR_POKY ++ if (scriptletWrapper && *scriptletWrapper) ++ rc = rpmpsmNext(psm, PSM_CHROOT_IN); ++ } ++#endif + break; + + case PSM_RPMIO_FLAGS: diff --git a/meta/recipes-devtools/rpm/rpm_5.4.0.bb b/meta/recipes-devtools/rpm/rpm_5.4.0.bb index bbef0be..f8fe836 100644 --- a/meta/recipes-devtools/rpm/rpm_5.4.0.bb +++ b/meta/recipes-devtools/rpm/rpm_5.4.0.bb @@ -45,7 +45,7 @@ LIC_FILES_CHKSUM = "file://COPYING.LIB;md5=2d5025d4aa3495befef8f17206a5b0a1" DEPENDS = "bzip2 zlib db openssl elfutils expat libpcre attr acl popt ${extrarpmdeps}" extrarpmdeps = "python perl" extrarpmdeps_virtclass-native = "file-native" -PR = "r22" +PR = "r23" # rpm2cpio is a shell script, which is part of the rpm src.rpm. It is needed # in order to extract the distribution SRPM into a format we can extract... @@ -63,6 +63,7 @@ SRC_URI = "http://www.rpm5.org/files/rpm/rpm-5.4/rpm-5.4.0-0.20101229.src.rpm;ex file://rpm-fileclass.patch \ file://rpm-canonarch.patch \ file://rpm-no-loopmsg.patch \ + file://rpm-scriptletexechelper.patch \ file://pythondeps.sh \ " -- 1.7.3.4 ^ permalink raw reply related [flat|nested] 7+ messages in thread
* [PATCH 2/5] rootfs_rpm.bbclass: Turn off script debugging 2011-11-10 18:30 [PATCH 0/5] Change the way RPM handles pre/post scripts Mark Hatle 2011-11-10 18:30 ` [PATCH 1/5] rootfs_rpm.bbclass: Enable pre and post install scripts Mark Hatle @ 2011-11-10 18:30 ` Mark Hatle 2011-11-10 18:30 ` [PATCH 3/5] wpa-supplicant: Avoid blocking the post install script at cross rootfs time Mark Hatle ` (3 subsequent siblings) 5 siblings, 0 replies; 7+ messages in thread From: Mark Hatle @ 2011-11-10 18:30 UTC (permalink / raw) To: openembedded-core Disable script debugging, as the log files become huge and take a long time to process during the log check step. This results in a performance improvement. Signed-off-by: Mark Hatle <mark.hatle@windriver.com> --- meta/classes/rootfs_rpm.bbclass | 2 +- 1 files changed, 1 insertions(+), 1 deletions(-) diff --git a/meta/classes/rootfs_rpm.bbclass b/meta/classes/rootfs_rpm.bbclass index b3875a4..6973008 100644 --- a/meta/classes/rootfs_rpm.bbclass +++ b/meta/classes/rootfs_rpm.bbclass @@ -44,7 +44,7 @@ RPM="rpm ${RPMOPTS}" do_rootfs[lockfiles] += "${DEPLOY_DIR_RPM}/rpm.lock" fakeroot rootfs_rpm_do_rootfs () { - #set +x + set +x ${RPM_PREPROCESS_COMMANDS} -- 1.7.3.4 ^ permalink raw reply related [flat|nested] 7+ messages in thread
* [PATCH 3/5] wpa-supplicant: Avoid blocking the post install script at cross rootfs time. 2011-11-10 18:30 [PATCH 0/5] Change the way RPM handles pre/post scripts Mark Hatle 2011-11-10 18:30 ` [PATCH 1/5] rootfs_rpm.bbclass: Enable pre and post install scripts Mark Hatle 2011-11-10 18:30 ` [PATCH 2/5] rootfs_rpm.bbclass: Turn off script debugging Mark Hatle @ 2011-11-10 18:30 ` Mark Hatle 2011-11-10 18:30 ` [PATCH 4/5] shadow: Generate the shadow files at rootfs construction Mark Hatle ` (2 subsequent siblings) 5 siblings, 0 replies; 7+ messages in thread From: Mark Hatle @ 2011-11-10 18:30 UTC (permalink / raw) To: openembedded-core We only want to reload dbus, if we're install on the target -- not on the host. Signed-off-by: Mark Hatle <mark.hatle@windriver.com> --- .../wpa-supplicant/wpa-supplicant-0.7.inc | 4 ++-- .../wpa-supplicant/wpa-supplicant_0.7.3.bb | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/meta/recipes-connectivity/wpa-supplicant/wpa-supplicant-0.7.inc b/meta/recipes-connectivity/wpa-supplicant/wpa-supplicant-0.7.inc index cd62d8f..ccdc4c3 100644 --- a/meta/recipes-connectivity/wpa-supplicant/wpa-supplicant-0.7.inc +++ b/meta/recipes-connectivity/wpa-supplicant/wpa-supplicant-0.7.inc @@ -66,9 +66,9 @@ do_install () { } pkg_postinst_wpa-supplicant () { - # can't do this offline + # If we're offline, we don't need to do this. if [ "x$D" != "x" ]; then - exit 1 + exit 0 fi DBUSPID=`pidof dbus-daemon` diff --git a/meta/recipes-connectivity/wpa-supplicant/wpa-supplicant_0.7.3.bb b/meta/recipes-connectivity/wpa-supplicant/wpa-supplicant_0.7.3.bb index 03bd937..98eba77 100644 --- a/meta/recipes-connectivity/wpa-supplicant/wpa-supplicant_0.7.3.bb +++ b/meta/recipes-connectivity/wpa-supplicant/wpa-supplicant_0.7.3.bb @@ -1,6 +1,6 @@ require wpa-supplicant-0.7.inc -PR = "r4" +PR = "r5" SRC_URI[md5sum] = "f516f191384a9a546e3f5145c08addda" SRC_URI[sha256sum] = "d0cd50caa85346ccc376dcda5ed3c258eef19a93b3cade39d25760118ad59443" -- 1.7.3.4 ^ permalink raw reply related [flat|nested] 7+ messages in thread
* [PATCH 4/5] shadow: Generate the shadow files at rootfs construction 2011-11-10 18:30 [PATCH 0/5] Change the way RPM handles pre/post scripts Mark Hatle ` (2 preceding siblings ...) 2011-11-10 18:30 ` [PATCH 3/5] wpa-supplicant: Avoid blocking the post install script at cross rootfs time Mark Hatle @ 2011-11-10 18:30 ` Mark Hatle 2011-11-10 18:30 ` [PATCH 5/5] sudo: Avoid post install scripts Mark Hatle 2011-11-12 0:13 ` [PATCH 0/5] Change the way RPM handles pre/post scripts Saul Wold 5 siblings, 0 replies; 7+ messages in thread From: Mark Hatle @ 2011-11-10 18:30 UTC (permalink / raw) To: openembedded-core With the recent changes to the shadow-native package support "--root", we can now convert the passwd/group files to their shadow forms while doing the rootfs install, instead of waiting to run on the target. Signed-off-by: Mark Hatle <mark.hatle@windriver.com> --- meta/recipes-extended/shadow/shadow_4.1.4.3.bb | 12 +++++++----- 1 files changed, 7 insertions(+), 5 deletions(-) diff --git a/meta/recipes-extended/shadow/shadow_4.1.4.3.bb b/meta/recipes-extended/shadow/shadow_4.1.4.3.bb index 5bc4a61..25330a4 100644 --- a/meta/recipes-extended/shadow/shadow_4.1.4.3.bb +++ b/meta/recipes-extended/shadow/shadow_4.1.4.3.bb @@ -9,7 +9,7 @@ LIC_FILES_CHKSUM = "file://COPYING;md5=08c553a87d4e51bbed50b20e0adcaede \ DEPENDS = "${@base_contains('DISTRO_FEATURES', 'pam', 'libpam', '', d)}" RDEPENDS_${PN} = "${@base_contains('DISTRO_FEATURES', 'pam', '${PAM_PLUGINS}', '', d)}" -PR = "r4" +PR = "r5" SRC_URI = "http://pkg-shadow.alioth.debian.org/releases/${BPN}-${PV}.tar.bz2 \ file://login_defs_pam.sed \ @@ -128,11 +128,13 @@ pkg_postinst_${PN} () { update-alternatives --install ${base_sbindir}/vigr vigr vigr.${PN} 200 if [ "x$D" != "x" ]; then - exit 1 - fi + rootarg="--root=$D" + else + rootarg="" + fi - pwconv - grpconv + pwconv $rootarg + grpconv $rootarg } pkg_prerm_${PN} () { -- 1.7.3.4 ^ permalink raw reply related [flat|nested] 7+ messages in thread
* [PATCH 5/5] sudo: Avoid post install scripts 2011-11-10 18:30 [PATCH 0/5] Change the way RPM handles pre/post scripts Mark Hatle ` (3 preceding siblings ...) 2011-11-10 18:30 ` [PATCH 4/5] shadow: Generate the shadow files at rootfs construction Mark Hatle @ 2011-11-10 18:30 ` Mark Hatle 2011-11-12 0:13 ` [PATCH 0/5] Change the way RPM handles pre/post scripts Saul Wold 5 siblings, 0 replies; 7+ messages in thread From: Mark Hatle @ 2011-11-10 18:30 UTC (permalink / raw) To: openembedded-core The post install script was removed, and the install_append updated to ensure the permissions are set correctly. Signed-off-by: Mark Hatle <mark.hatle@windriver.com> --- meta/recipes-extended/sudo/sudo.inc | 8 -------- meta/recipes-extended/sudo/sudo_1.8.3.bb | 5 ++++- 2 files changed, 4 insertions(+), 9 deletions(-) diff --git a/meta/recipes-extended/sudo/sudo.inc b/meta/recipes-extended/sudo/sudo.inc index 72a7c16..83dd209 100644 --- a/meta/recipes-extended/sudo/sudo.inc +++ b/meta/recipes-extended/sudo/sudo.inc @@ -29,11 +29,3 @@ do_install_prepend (){ mkdir -p ${D}/${localstatedir}/lib } -pkg_postinst_${PN} () { - if [ "x$D" != "x" ]; then - exit 1 - fi - - chmod 4111 /usr/bin/sudo - chmod 0440 /etc/sudoers -} diff --git a/meta/recipes-extended/sudo/sudo_1.8.3.bb b/meta/recipes-extended/sudo/sudo_1.8.3.bb index 0ac0851..99fe5b9 100644 --- a/meta/recipes-extended/sudo/sudo_1.8.3.bb +++ b/meta/recipes-extended/sudo/sudo_1.8.3.bb @@ -1,6 +1,6 @@ require sudo.inc -PR = "r0" +PR = "r1" SRC_URI = "http://ftp.sudo.ws/sudo/dist/sudo-${PV}.tar.gz \ file://libtool.patch \ @@ -23,4 +23,7 @@ do_install_append () { break fi done + + chmod 4111 $D/usr/bin/sudo + chmod 0440 $D/etc/sudoers } -- 1.7.3.4 ^ permalink raw reply related [flat|nested] 7+ messages in thread
* Re: [PATCH 0/5] Change the way RPM handles pre/post scripts 2011-11-10 18:30 [PATCH 0/5] Change the way RPM handles pre/post scripts Mark Hatle ` (4 preceding siblings ...) 2011-11-10 18:30 ` [PATCH 5/5] sudo: Avoid post install scripts Mark Hatle @ 2011-11-12 0:13 ` Saul Wold 5 siblings, 0 replies; 7+ messages in thread From: Saul Wold @ 2011-11-12 0:13 UTC (permalink / raw) To: Patches and discussions about the oe-core layer On 11/10/2011 10:30 AM, Mark Hatle wrote: > We change the way rootfs_rpm handles pre / post scripts in order to > enable preinst scripts and better handling of post scripts. > > The following changes since commit 379c77d1516fe8fdbd1cd7063f709b5266872b03: > > populate_*.bbclass: Correct INSTALL variable name after recent multilib changes (2011-11-10 18:05:06 +0000) > > are available in the git repository at: > git://git.pokylinux.org/poky-contrib mhatle/rpm > http://git.pokylinux.org/cgit.cgi/poky-contrib/log/?h=mhatle/rpm > > Mark Hatle (5): > rootfs_rpm.bbclass: Enable pre and post install scripts > rootfs_rpm.bbclass: Turn off script debugging > wpa-supplicant: Avoid blocking the post install script at cross > rootfs time. > shadow: Generate the shadow files at rootfs construction > sudo: Avoid post install scripts > > meta/classes/package_rpm.bbclass | 33 ++++- > meta/classes/rootfs_rpm.bbclass | 27 +--- > .../wpa-supplicant/wpa-supplicant-0.7.inc | 4 +- > .../wpa-supplicant/wpa-supplicant_0.7.3.bb | 2 +- > .../rpm/rpm/rpm-scriptletexechelper.patch | 159 ++++++++++++++++++++ > meta/recipes-devtools/rpm/rpm_5.4.0.bb | 3 +- > meta/recipes-extended/shadow/shadow_4.1.4.3.bb | 12 +- > meta/recipes-extended/sudo/sudo.inc | 8 - > meta/recipes-extended/sudo/sudo_1.8.3.bb | 5 +- > 9 files changed, 214 insertions(+), 39 deletions(-) > create mode 100644 meta/recipes-devtools/rpm/rpm/rpm-scriptletexechelper.patch > Merged into OE-Core Thanks Sau! ^ permalink raw reply [flat|nested] 7+ messages in thread
end of thread, other threads:[~2011-11-12 0:19 UTC | newest] Thread overview: 7+ messages (download: mbox.gz follow: Atom feed -- links below jump to the message on this page -- 2011-11-10 18:30 [PATCH 0/5] Change the way RPM handles pre/post scripts Mark Hatle 2011-11-10 18:30 ` [PATCH 1/5] rootfs_rpm.bbclass: Enable pre and post install scripts Mark Hatle 2011-11-10 18:30 ` [PATCH 2/5] rootfs_rpm.bbclass: Turn off script debugging Mark Hatle 2011-11-10 18:30 ` [PATCH 3/5] wpa-supplicant: Avoid blocking the post install script at cross rootfs time Mark Hatle 2011-11-10 18:30 ` [PATCH 4/5] shadow: Generate the shadow files at rootfs construction Mark Hatle 2011-11-10 18:30 ` [PATCH 5/5] sudo: Avoid post install scripts Mark Hatle 2011-11-12 0:13 ` [PATCH 0/5] Change the way RPM handles pre/post scripts Saul Wold
This is a public inbox, see mirroring instructions for how to clone and mirror all data and code used for this inbox