From 6d7ebbd5260b239893ebb48611215c96d6e68f3a Mon Sep 17 00:00:00 2001 From: Joshua Kwan Date: Tue, 30 Dec 2003 21:32:15 +0000 Subject: [PATCH] initial commit git-svn-id: svn://katsu.triplehelix.org/dgamelaunch/trunk@2 db0b04b0-f4d1-0310-9a6d-de3e77497b0e --- dgl-create-chroot | 53 +++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 53 insertions(+) create mode 100755 dgl-create-chroot diff --git a/dgl-create-chroot b/dgl-create-chroot new file mode 100755 index 0000000..bb4e20b --- /dev/null +++ b/dgl-create-chroot @@ -0,0 +1,53 @@ +#!/bin/sh + +set -e + +CHROOT_PATH=/var/lib/dgamelaunch + +# Only in the chroot +CHROOT_UID=1031 +CHROOT_GID=1031 + +echo "Setting up the chroot in: $CHROOT_PATH" + +mkdir -p $CHROOT_PATH/lib $CHROOT_PATH/bin $CHROOT_PATH/etc $CHROOT_PATH/var/mail + +# Required libraries +cp -L /lib/libc.so.6 $CHROOT_PATH/lib +cp -L /lib/libncurses.so.5 $CHROOT_PATH/lib +cp -L /lib/ld-linux.so.2 $CHROOT_PATH/lib + +# Passwd file +echo "nethack:!:1031:1031::/nonexistent:/bin/sh" > $CHROOT_PATH/etc/passwd +echo "nethack:x:1031:" > $CHROOT_PATH/etc/group + +# Dungeon directory setup +mkdir -p $CHROOT_PATH/dgldir/inprogress +mkdir -p $CHROOT_PATH/dgldir/rcfiles +mkdir -p $CHROOT_PATH/dgldir/ttyrec +chown -R $CHROOT_UID:$CHROOT_GID $CHROOT_PATH/dgldir + +touch $CHROOT_PATH/dgl-login +touch $CHROOT_PATH/dgl-lock +chown $CHROOT_UID:$CHROOT_GID $CHROOT_PATH/dgl-* + +# Needs gzip to compress +cp /bin/gzip $CHROOT_PATH/bin + +# Copy the nethack binary over (Debian specific for now) +cp /usr/lib/games/nethack/nethack-console $CHROOT_PATH/bin/nethack + +# ...and all the data it needs +mkdir -p $CHROOT_PATH/var/games/nethack/save +mkdir -p $CHROOT_PATH/usr/lib/games/nethack +touch $CHROOT_PATH/var/games/nethack/record +touch $CHROOT_PATH/var/games/nethack/perm +touch $CHROOT_PATH/var/games/nethack/logfile + +chown -R $CHROOT_UID:$CHROOT_GID $CHROOT_PATH/var/games/nethack +cp -L /usr/lib/games/nethack/license $CHROOT_PATH/usr/lib/games/nethack +cp -L /usr/lib/games/nethack/nhdat $CHROOT_PATH/usr/lib/games/nethack + +# Curses junk +mkdir -p $CHROOT_PATH/usr/share +cp -r /usr/share/terminfo $CHROOT_PATH/usr/share