summaryrefslogtreecommitdiffstats
path: root/scripts/poky-chroot-run
diff options
context:
space:
mode:
authorRichard Purdie <richard@openedhand.com>2008-01-30 16:20:55 +0000
committerRichard Purdie <richard@openedhand.com>2008-01-30 16:20:55 +0000
commitd9630462e35b81ad22044668d19dd9ea40644bc7 (patch)
treef0ce92793d7def514ec9543ff853bcee0f18fd92 /scripts/poky-chroot-run
parent8656619817b8f0b2076e0464e23a642bb84afb87 (diff)
downloadpoky-d9630462e35b81ad22044668d19dd9ea40644bc7.tar.gz
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
Diffstat (limited to 'scripts/poky-chroot-run')
-rwxr-xr-xscripts/poky-chroot-run21
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 @@
3# Runs a command within a Poky chroot 3# Runs a command within a Poky chroot
4# 4#
5 5
6set -e 6XEPHYR=`which Xephyr`
7if [ ! -n "$XEPHYR" -o ! -x "$XEPHYR" ]; then
8 echo "You need to install Xephyr to use $0"
9 exit 1
10fi
11
12CHROOTUID=`which chrootuid`
13if [ ! -n "$CHROOTUID" -o ! -x "$CHROOTUID" ]; then
14 echo "You need to install Xephyr to use $0"
15 exit 1
16fi
17
7 18
8case $# in 19case $# in
9 0) 20 0)
@@ -26,6 +37,8 @@ esac
26 37
27test -f "$ROOTFS/.pokychroot" || { echo "$ROOTFS is not setup for use as a Poky chroot." ; exit 1 ;} 38test -f "$ROOTFS/.pokychroot" || { echo "$ROOTFS is not setup for use as a Poky chroot." ; exit 1 ;}
28 39
40set -e
41
29# chrootuid doesn't handle relative paths, so ensure that the rootfs path is 42# chrootuid doesn't handle relative paths, so ensure that the rootfs path is
30# absolute 43# absolute
31if test ${ROOTFS:0:1} != /; then 44if test ${ROOTFS:0:1} != /; then
@@ -53,14 +66,14 @@ export PATH=/bin:/usr/bin:/sbin:/usr/sbin
53export HOME=/home/$USER 66export HOME=/home/$USER
54 67
55if [ ! -f "$ROOTFS/.pokychroot.init" ]; then 68if [ ! -f "$ROOTFS/.pokychroot.init" ]; then
56 sudo chrootuid -i "$ROOTFS" $USER /bin/sh -c "/usr/bin/poky-chroot-init" 69 sudo $CHROOTUID -i "$ROOTFS" $USER /bin/sh -c "/usr/bin/poky-chroot-init"
57 touch "$ROOTFS/.pokychroot.init" 70 touch "$ROOTFS/.pokychroot.init"
58fi 71fi
59 72
60Xephyr :1 -ac -screen 640x480x16 & 73$XEPHYR :1 -ac -screen 640x480x16 &
61 74
62# Go go go! 75# Go go go!
63sudo chrootuid -i "$ROOTFS" $USER "$@" || /bin/true 76sudo $CHROOTUID -i "$ROOTFS" $USER "$@" || /bin/true
64 77
65# Trap term signals so we don't kill ourselves 78# Trap term signals so we don't kill ourselves
66trap true TERM 79trap true TERM