[oe-commits] Kang Kai : package_rpm.bbclass: name postinst files with package name

git at git.openembedded.org git at git.openembedded.org
Fri Mar 1 13:12:45 UTC 2013


Module: openembedded-core.git
Branch: master
Commit: 9b2a008c25a7a3152ae2d8c64ae8de2534471d47
URL:    http://git.openembedded.org/?p=openembedded-core.git&a=commit;h=9b2a008c25a7a3152ae2d8c64ae8de2534471d47

Author: Kang Kai <kai.kang at windriver.com>
Date:   Fri Mar  1 18:02:14 2013 +0800

package_rpm.bbclass: name postinst files with package name

When create rootfs, some post install scripts need be run on device.
They are saved under directory /etc/rpm-postinst and named with numbers
such as 100, 101 etc.

Update to name the postinst script file with its package name instead of
just number. That may be more easy to debug when there is a error.

[YOCTO #3218]

Signed-off-by: Kang Kai <kai.kang at windriver.com>
Signed-off-by: Richard Purdie <richard.purdie at linuxfoundation.org>

---

 meta/classes/package_rpm.bbclass |   11 +++++------
 1 files changed, 5 insertions(+), 6 deletions(-)

diff --git a/meta/classes/package_rpm.bbclass b/meta/classes/package_rpm.bbclass
index 7a1da33..225fc70 100644
--- a/meta/classes/package_rpm.bbclass
+++ b/meta/classes/package_rpm.bbclass
@@ -383,12 +383,11 @@ export NATIVE_ROOT=${STAGING_DIR_NATIVE}
 \$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}
+  name=\`head -1 \$1/\$3 | cut -d' ' -f 2\`
+  echo "#!\$2" > \$1/etc/rpm-postinsts/\${name}
+  echo "# Arg: \$4" >> \$1/etc/rpm-postinsts/\${name}
+  cat \$1/\$3 >> \$1/etc/rpm-postinsts/\${name}
+  chmod +x \$1/etc/rpm-postinsts/\${name}
 fi
 EOF
 





More information about the Openembedded-commits mailing list