Debian Codegraph @

debian/example/setup-chrootdir-template.sh

raw symbols SCIP
1 #!/bin/shscip-shell filesystem . . `/bin/sh`.
2
3 # Copyright (C) 2002 Andres Salomon <[email protected]>
4 #
5 # Template for setup-chrootdir-XX.sh scripts
6
7 PATH="/usr/local/sbin:/usr/sbin:/sbin:/usr/local/bin:/bin:/usr/binscip-shell filesystem . . `/usr/local/sbin:/usr/sbin:/sbin:/usr/local/bin:/bin:/usr/bin`."
8 # Directories to include in the chroot go here
9 DIRECTORIES="bin dev "
10 # Files to copy over to the chroot are included here
11 FILES="bin/false lib/libc.so.6 lib/ld-linux.so.2"
12
13 if testscip-shell system . . test. -z "$1"; then
14 echoscip-shell system . . echo. "Usage: $0 <directory>" 1>&2
15 exit 1
16 fi
17
18 id=`idscip-shell system . . id. -u`
19 if testscip-shell system . . test. "$id" -gt 0; then
20 echoscip-shell system . . echo. "Error: this script requires root (for mknod)!" 1>&2
21 exit 1
22 fi
23
24 dir=$1
25 curdir=`pwdscip-shell system . . pwd.`
26
27 # Create directory structure
28 mkdirscip-shell system . . mkdir. -p $dir
29 cd $dir
30 for d in $DIRECTORIES; do
31 mkdirscip-shell system . . mkdir. -p $d
32 done
33
34 # Add files
35 for f in $FILES; do
36 cpscip-shell system . . cp. /$f $f
37 done
38
39 # And devices..
40 if testscip-shell system . . test. -d dev; then
41 cpscip-shell system . . cp. /dev/MAKEDEVscip-shell filesystem . . `/dev/MAKEDEV`. dev
42 cd dev && ./MAKEDEV std && rmscip-shell system . . rm. -f MAKEDEV
43 fi
44
45
46 cd $curdir
47
48 exit 0