diff options
| author | Jason Wu <huanyu@xilinx.com> | 2012-10-10 10:32:00 +1000 |
|---|---|---|
| committer | Jason Wu <huanyu@xilinx.com> | 2012-10-10 12:14:27 +1000 |
| commit | 2a6400a0d76e22fe706c8adddb1821ca56688ac0 (patch) | |
| tree | 6646a5558b7a4a579749552d42ebc6828dbffd8e | |
| parent | 446215bed626c32bcf26b91bd2fd712f45f14b54 (diff) | |
| download | meta-xilinx-2a6400a0d76e22fe706c8adddb1821ca56688ac0.tar.gz | |
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 <huanyu@xilinx.com>
| -rw-r--r-- | recipes-append/sysvinit/sysvinit-inittab_2.88dsf.bbappend | 21 |
1 files changed, 21 insertions, 0 deletions
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 @@ | |||
| 1 | |||
| 2 | pkg_postinst_${PN} () { | ||
| 3 | #!/bin/sh | ||
| 4 | # run this on the target | ||
| 5 | if [ "x$D" == "x" ]; then | ||
| 6 | tmp="${SERIAL_CONSOLES_CHECK}" | ||
| 7 | for i in $tmp | ||
| 8 | do | ||
| 9 | j=`echo ${i} | sed s/^.*\;//g` | ||
| 10 | if [ -z "`cat /proc/consoles | grep ${j}`" ]; then | ||
| 11 | sed -i /^.*${j}$/d /etc/inittab | ||
| 12 | fi | ||
| 13 | done | ||
| 14 | kill -HUP 1 | ||
| 15 | elif [ -d "$D" ]; then | ||
| 16 | exit 0 | ||
| 17 | else | ||
| 18 | exit 1 | ||
| 19 | fi | ||
| 20 | } | ||
| 21 | |||
