version 1.3, 2021/03/09 15:39:32 |
version 1.9, 2021/04/02 11:51:07 |
|
|
#!/bin/sh |
#!/bin/sh |
|
|
# Ideas and some parts from the original dgl-create-chroot (by joshk@triplehelix.org, modifications by jilles@stack.nl) |
# Ideas and some parts from the original dgl-create-chroot (by joshk@triplehelix.org, modifications by jilles@stack.nl) |
# This one by paxed@alt.org |
# This one by paxed@alt.org, modified by porting@use.startmail.com |
|
|
|
|
# |
# |
Line 14 CHROOT="/opt/nethack/nethack.alt.org/" |
|
Line 14 CHROOT="/opt/nethack/nethack.alt.org/" |
|
# the user & group from dgamelaunch config file. |
# the user & group from dgamelaunch config file. |
USRGRP="games:games" |
USRGRP="games:games" |
# COMPRESS from include/config.h; the compression binary to copy. leave blank to skip. |
# COMPRESS from include/config.h; the compression binary to copy. leave blank to skip. |
COMPRESSBIN="/bin/gzip" |
COMPRESSBIN="/usr/bin/gzip" |
# nethack binary to copy into chroot (leave blank to skip) |
# nethack binary to copy into chroot (leave blank to skip) |
#NETHACKBIN="/home/paxed/hacking/coding/nethacksource/nethack-3.4.3-nao/nh343/nethack.343-nao" |
#NETHACKBIN="/home/paxed/hacking/coding/nethacksource/nethack-3.4.3-nao/nh343/nethack.343-nao" |
# fixed data to copy (leave blank to skip) |
# fixed data to copy (leave blank to skip) |
Line 27 NH_VAR_PLAYGROUND="/nh343/var/" |
|
Line 27 NH_VAR_PLAYGROUND="/nh343/var/" |
|
# only define this if dgl was configured with --enable-sqlite |
# only define this if dgl was configured with --enable-sqlite |
SQLITE_DBFILE="/dgldir/dgamelaunch.db" |
SQLITE_DBFILE="/dgldir/dgamelaunch.db" |
|
|
|
# only define this is dgl was configured without --enable-sqlite |
|
#PASSWD_FILE="/dgldir/dgl-login" |
|
#LOCK-FILE="/dgldir/dgl-lock" |
|
|
|
# only define this is dgl was configured without --enable-debugfile |
|
#DEBUGFILE="/dgldebug.log" |
|
|
# END OF CONFIG |
# END OF CONFIG |
############################################################################## |
############################################################################## |
|
|
|
|
|
|
CURDIR="`pwd`" |
CURDIR="`pwd`" |
|
|
if [ ! -e "$CURDIR/dgamelaunch" ]; then |
if [ ! -e "$CURDIR/dgamelaunch-openbsd" ]; then |
errorexit "Cannot find dgamelaunch in $CURDIR" |
errorexit "Cannot find dgamelaunch-openbsd in $CURDIR" |
fi |
fi |
|
|
DGLFILE="dgamelaunch.`date +%Y%m%d`" |
DGLFILE="dgamelaunch.`date +%Y%m%d`" |
|
|
echo "Setting up chroot in $CHROOT" |
echo "Setting up chroot in $CHROOT" |
|
|
LIBS="`findlibs dgamelaunch`" |
LIBS="`findlibs dgamelaunch-openbsd`" |
|
|
mkdir -p "$CHROOT" || errorexit "Cannot create chroot" |
mkdir -p "$CHROOT" || errorexit "Cannot create chroot" |
cd "$CHROOT" |
cd "$CHROOT" |
mkdir dgldir etc lib mail usr bin |
mkdir dgldir etc lib mail usr bin |
chown "$USRGRP" dgldir mail |
chown "$USRGRP" dgldir mail |
cp "$CURDIR/dgamelaunch" "$DGLFILE" |
cp "$CURDIR/dgamelaunch-openbsd" "$DGLFILE" |
ln -s "$DGLFILE" dgamelaunch |
ln -s "$DGLFILE" dgamelaunch |
|
|
mkdir -p "$CHROOT/dgldir/inprogress-nh343" |
mkdir -p "$CHROOT/dgldir/inprogress-nh343" |
Line 110 if [ -n "$SQLITE_DBFILE" ]; then |
|
Line 117 if [ -n "$SQLITE_DBFILE" ]; then |
|
SQLITE_DBFILE="`echo ${SQLITE_DBFILE#/}`" |
SQLITE_DBFILE="`echo ${SQLITE_DBFILE#/}`" |
sqlite3 "$CHROOT/$SQLITE_DBFILE" "create table dglusers (id integer primary key, username text, email text, env text, password text, flags integer);" |
sqlite3 "$CHROOT/$SQLITE_DBFILE" "create table dglusers (id integer primary key, username text, email text, env text, password text, flags integer);" |
chown "$USRGRP" "$CHROOT/$SQLITE_DBFILE" |
chown "$USRGRP" "$CHROOT/$SQLITE_DBFILE" |
|
chmod 0700 "$CHROOT/$SQLITE_DBFILE" |
fi |
fi |
fi |
fi |
|
|
|
if [ -n "$PASSWD_FILE" ]; then |
|
echo "Creating password file at $PASSWD_FILE" |
|
touch "$CHROOT/$PASSWD_FILE" |
|
chown "$USRGRP" "$CHROOT/$PASSWD_FILE" |
|
chmod 0700 "$CHROOT/$PASSWD_FILE" |
|
fi |
|
|
|
if [ -n "$LOCK_FILE" ]; then |
|
echo "Creating lockfile at $LOCK_FILE" |
|
touch "$CHROOT/$LOCK_FILE" |
|
chown "$USRGRP" "$CHROOT/$LOCK_FILE" |
|
chmod 0700 "$CHROOT/$LOCK_FILE" |
|
fi |
|
|
|
if [ -n "$DEBUGFILE" ]; then |
|
echo "Creating debugfile at $DEBUGFILE" |
|
touch "$CHROOT/$DEBUGFILE" |
|
chown "$USRGRP" "$CHROOT/$DEBUGFILE" |
|
chmod 0700 "$CHROOT/$DEBUGFILE" |
|
fi |
|
|
if [ -n "$COMPRESSBIN" -a -e "`which $COMPRESSBIN`" ]; then |
if [ -n "$COMPRESSBIN" -a -e "`which $COMPRESSBIN`" ]; then |
COMPRESSDIR="`dirname $COMPRESSBIN`" |
COMPRESSDIR="`dirname $COMPRESSBIN`" |