version 1.1, 2021/03/09 14:36:01 |
version 1.5, 2021/03/31 12:23:08 |
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) |
|
|
findlibs() |
findlibs() |
{ |
{ |
for i in "$@"; do |
for i in "$@"; do |
if [ -z "`ldd "$i" | grep 'not a dynamic executable'`" ]; then |
if [ -z "`ldd "$i" | grep 'not a'`" ]; then |
echo $(ldd "$i" | awk '{ print $3 }' | egrep -v ^'\(') |
if test $(uname -s) == OpenBSD; then |
|
echo $(ldd "$i" | awk '{ print $7 }' | egrep -v ^'\(') | cut -d ' ' -f 3- |
|
else |
|
echo $(ldd "$i" | awk '{ print $3 }' | egrep -v ^'\(') |
echo $(ldd "$i" | grep 'ld-linux' | awk '{ print $1 }') |
echo $(ldd "$i" | grep 'ld-linux' | awk '{ print $1 }') |
|
fi |
fi |
fi |
done |
done |
} |
} |
|
|
|
|
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 106 if [ -n "$SQLITE_DBFILE" ]; then |
|
Line 110 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 |
|
|
|
|
|
|
mkdir -p dev |
mkdir -p dev |
cd dev |
cd dev |
mknod urandom c 1 9 |
if test $(uname -s) == OpenBSD; then |
|
mknod urandom c 45 0 |
|
else |
|
mknod urandom c 1 9 |
|
fi |
cd .. |
cd .. |
|
|
|
|