-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathos_pre-cache
executable file
·101 lines (87 loc) · 1.99 KB
/
os_pre-cache
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
#!/bin/bash
#sanify check
if [ $# -lt 1 ] ; then
echo "usage $0 ROOTDIR"
exit 1
fi
rootdir=$1
if [ -z "$rootdir" ]; then
echo "ROOTDIR is not set."
exit 1
fi
# Check root directory
if [ ! -d $rootdir ]; then
echo "$rootdir: should be a directory."
exit 1
fi
pushd $rootdir > /dev/null
mkdir etc
ln -sf /usr/share/zoneinfo/UTC etc/localtime
echo "proc /proc proc defaults 0 0" >> etc/fstab
echo "none /dev/pts devpts rw,gid=5,mode=620 0 0" >> etc/fstab
echo "none /run/shm tmpfs defaults 0 0" >> etc/fstab
mkdir -p etc/init.d
echo "#!/bin/sh
exit 0
" > etc/init.d/wide-dhcpv6-client
chmod 0755 etc/init.d/wide-dhcpv6-client
# add some basic groups and users, provides by base-passwd
# some debs (base-files,..) use it before base-passwd installation
echo "root:*:0:
daemon:*:1:
bin:*:2:
sys:*:3:
adm:*:4:
tty:*:5:
disk:*:6:
lp:*:7:
mail:*:8:
news:*:9:
uucp:*:10:
man:*:12:
proxy:*:13:
kmem:*:15:
dialout:*:20:
fax:*:21:
voice:*:22:
cdrom:*:24:
floppy:*:25:
tape:*:26:
sudo:*:27:
audio:*:29:
dip:*:30:
www-data:*:33:
backup:*:34:
operator:*:37:
list:*:38:
irc:*:39:
src:*:40:
gnats:*:41:
shadow:*:42:
utmp:*:43:
video:*:44:
sasl:*:45:
plugdev:*:46:
staff:*:50:
games:*:60:
users:*:100:
nogroup:*:65534:" > etc/group
echo "root:*:0:0:root:/root:/bin/bash
daemon:*:1:1:daemon:/usr/sbin:/bin/sh
bin:*:2:2:bin:/bin:/bin/sh
sys:*:3:3:sys:/dev:/bin/sh
sync:*:4:65534:sync:/bin:/bin/sync
games:*:5:60:games:/usr/games:/bin/sh
man:*:6:12:man:/var/cache/man:/bin/sh
lp:*:7:7:lp:/var/spool/lpd:/bin/sh
mail:*:8:8:mail:/var/mail:/bin/sh
news:*:9:9:news:/var/spool/news:/bin/sh
uucp:*:10:10:uucp:/var/spool/uucp:/bin/sh
proxy:*:13:13:proxy:/bin:/bin/sh
www-data:*:33:33:www-data:/var/www:/bin/sh
backup:*:34:34:backup:/var/backups:/bin/sh
list:*:38:38:Mailing List Manager:/var/list:/bin/sh
irc:*:39:39:ircd:/var/run/ircd:/bin/sh
gnats:*:41:41:Gnats Bug-Reporting System (admin):/var/lib/gnats:/bin/sh
nobody:*:65534:65534:nobody:/nonexistent:/bin/sh" > etc/passwd
popd > /dev/null