diff options
author | Richard Purdie <richard@openedhand.com> | 2008-01-30 16:20:55 +0000 |
---|---|---|
committer | Richard Purdie <richard@openedhand.com> | 2008-01-30 16:20:55 +0000 |
commit | d9630462e35b81ad22044668d19dd9ea40644bc7 (patch) | |
tree | f0ce92793d7def514ec9543ff853bcee0f18fd92 | |
parent | 8656619817b8f0b2076e0464e23a642bb84afb87 (diff) | |
download | openembedded-core-d9630462e35b81ad22044668d19dd9ea40644bc7.tar.gz openembedded-core-d9630462e35b81ad22044668d19dd9ea40644bc7.tar.bz2 openembedded-core-d9630462e35b81ad22044668d19dd9ea40644bc7.zip |
scripts/poky-chroot-run: Make sure Xephyr and chrootuid are installed
git-svn-id: https://svn.o-hand.com/repos/poky/trunk@3630 311d38ba-8fff-0310-9ca6-ca027cbcb966
-rwxr-xr-x | scripts/poky-chroot-run | 21 |
1 files changed, 17 insertions, 4 deletions
diff --git a/scripts/poky-chroot-run b/scripts/poky-chroot-run index 6b78e3c60b..f1f4dec6a4 100755 --- a/scripts/poky-chroot-run +++ b/scripts/poky-chroot-run @@ -3,7 +3,18 @@ # Runs a command within a Poky chroot # -set -e +XEPHYR=`which Xephyr` +if [ ! -n "$XEPHYR" -o ! -x "$XEPHYR" ]; then + echo "You need to install Xephyr to use $0" + exit 1 +fi + +CHROOTUID=`which chrootuid` +if [ ! -n "$CHROOTUID" -o ! -x "$CHROOTUID" ]; then + echo "You need to install Xephyr to use $0" + exit 1 +fi + case $# in 0) @@ -26,6 +37,8 @@ esac test -f "$ROOTFS/.pokychroot" || { echo "$ROOTFS is not setup for use as a Poky chroot." ; exit 1 ;} +set -e + # chrootuid doesn't handle relative paths, so ensure that the rootfs path is # absolute if test ${ROOTFS:0:1} != /; then @@ -53,14 +66,14 @@ export PATH=/bin:/usr/bin:/sbin:/usr/sbin export HOME=/home/$USER if [ ! -f "$ROOTFS/.pokychroot.init" ]; then - sudo chrootuid -i "$ROOTFS" $USER /bin/sh -c "/usr/bin/poky-chroot-init" + sudo $CHROOTUID -i "$ROOTFS" $USER /bin/sh -c "/usr/bin/poky-chroot-init" touch "$ROOTFS/.pokychroot.init" fi -Xephyr :1 -ac -screen 640x480x16 & +$XEPHYR :1 -ac -screen 640x480x16 & # Go go go! -sudo chrootuid -i "$ROOTFS" $USER "$@" || /bin/true +sudo $CHROOTUID -i "$ROOTFS" $USER "$@" || /bin/true # Trap term signals so we don't kill ourselves trap true TERM |