From 2a6400a0d76e22fe706c8adddb1821ca56688ac0 Mon Sep 17 00:00:00 2001 From: Jason Wu Date: Wed, 10 Oct 2012 10:32:00 +1000 Subject: recipes:sysinit: update pkg_postinst function to work on host Currently the postinst script exit 1 when try to run from host as $D is defined. This hack adds $D host directory detection. If a directory is detected, it exit 0. Signed-off-by: Jason Wu --- .../sysvinit/sysvinit-inittab_2.88dsf.bbappend | 21 +++++++++++++++++++++ 1 file changed, 21 insertions(+) create mode 100644 recipes-append/sysvinit/sysvinit-inittab_2.88dsf.bbappend diff --git a/recipes-append/sysvinit/sysvinit-inittab_2.88dsf.bbappend b/recipes-append/sysvinit/sysvinit-inittab_2.88dsf.bbappend new file mode 100644 index 00000000..a14f28b4 --- /dev/null +++ b/recipes-append/sysvinit/sysvinit-inittab_2.88dsf.bbappend @@ -0,0 +1,21 @@ + +pkg_postinst_${PN} () { +#!/bin/sh +# run this on the target +if [ "x$D" == "x" ]; then + tmp="${SERIAL_CONSOLES_CHECK}" + for i in $tmp + do + j=`echo ${i} | sed s/^.*\;//g` + if [ -z "`cat /proc/consoles | grep ${j}`" ]; then + sed -i /^.*${j}$/d /etc/inittab + fi + done + kill -HUP 1 +elif [ -d "$D" ]; then + exit 0 +else + exit 1 +fi +} + -- cgit v1.2.3-54-g00ecf