summaryrefslogtreecommitdiffstats
path: root/base/aaabasicfs/Pkgfile
blob: 960d1a5e506b7a1ce42341d8a08efb61e6c5d59a (plain)
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
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
# Description: Système de base de NuTyX, contient les répertoires et scripts de demarrage.
# URL: http://www.nutyx.org/
# Maintainer: NuTyX core team
# Packager: thierryn1 at hispeed dot ch
# Depends on:

name=aaabasicfs
version=2009.1
release=beta2
scriptsversion=lfs-bootscripts-20090817
source=(  http://www.linuxfromscratch.org/lfs/downloads/development/$scriptsversion.tar.bz2\
 hosts clock console fstab inittab message inputrc network xorg.conf \
 profile dircolors.sh extrapaths.sh bash_profile bashrc bashrc.etc lfs-bootscripts-01.patch \
 blfs-bootscripts nu readline.sh unmask.sh X.sh i18n.sh bashrc sysklogd cleanfs)


build() {
       # Creating Directories
       
	mkdir -pv $PKG/{dev,proc,sys,bin,boot,etc/{profile.d,opt,skel,default},home,lib,mnt,opt,srv/sources}
	chmod 1777 $PKG/srv/sources
	mkdir -pv $PKG/{media/{floppy,cdrom,key,dvd},sbin,var}
	install -dv -m 0750 $PKG/root	
	install -dv -m 1777 $PKG/tmp 
	install -dv -m 1777 $PKG/var/tmp
	mkdir -pv $PKG/usr/{,local/}{bin,include,lib,sbin,src}
	mkdir -pv $PKG/usr/{,local/}share/{doc,info,locale,man}
	mkdir -v  $PKG/usr/{,local/}share/{misc,terminfo,zoneinfo}
	mkdir -pv $PKG/usr/{,local/}share/man/man{1..8}
	mkdir -p $PKG/usr/ports
	install -dv  $PKG/lib/{firmware,udev/devices/{pts,shm}}
	mknod -m 600 $PKG/lib/udev/devices/console c 5 1
	mknod -m 666 $PKG/lib/udev/devices/null c 1 3
	mknod -m 666 $PKG/lib/udev/devices/zero c 1 5
	mknod -m 666 $PKG/dev/null c 1 3
	mknod -m 600 $PKG/dev/console c 5 1
	for dir in $PKG/usr $PKG/usr/local; do
		ln -sv share/{man,doc,info} $dir
	done
	mkdir -v $PKG/var/{lock,log,mail,run,spool}
	mkdir -pv $PKG/var/{opt,cache,lib/{misc,locate},local}
	touch $PKG/var/log/{kern.log,auth.log,mail.log,user.log,sys.log,daemon.log,wtmp,btmp}
	chmod 640 $PKG/var/log/{kern.log,auth.log,mail.log,user.log,sys.log,daemon.log}
	chmod 0600 $PKG/var/log/btmp
	# Creating essential Files and Symlinks
	touch $PKG/etc/mtab
	ln -sv bash $PKG/bin/sh
	echo "$version-$release" > $PKG/etc/nutyx-version
	cat > $PKG/etc/shells << "EOF"
/bin/sh
/bin/bash
EOF
       cat > $PKG/etc/passwd << "EOF"
root:x:0:0:root:/root:/bin/bash
messagebus:x:18:18:D-BUS Message Daemon User:/dev/null:/bin/false
haldaemon:x:19:19:HAL Daemon User:/dev/null:/bin/false
gdm:x:21:21:GDM Daemon User:/dev/null:/bin/bash
fcron:x:22:22:Fcron User:/dev/null:/bin/false
apache:x:25:25:Apache Server:/dev/null:/bin/false
mysql:x:40:40:MySQL Server":/dev/null/:bin/false
policykit:x:62:62:PolicyKit:/:/sbin/nologin
clamav:x:98:98:Clam AntiVirus:/dev/null:/bin/false
nobody:x:99:99:Unprivileged User:/dev/null:/bin/false
EOF
       cat > $PKG/etc/group << "EOF"
root:x:0:
bin:x:1:
sys:x:2:
kmem:x:3:
tty:x:4:
tape:x:5:
daemon:x:6:
floppy:x:7:
disk:x:8:
lp:x:9:
uucp:x:10:
audio:x:11:
video:x:12:
utmp:x:13:
usb:x:14:
cdrom:x:15:
dialout:x:16:
network:x:17:
messagebus:x:18:
haldaemon:x:19:
named:x:20:
gdm:x:21:
fcron:x:22:
apache:x:25:
mail:x:34:
mysql:x:40:
rsyncd:x:48:
halusers:x:61:
policykit:x:62:
fuse:x:65:
scanner:x:70:
vboxusers:x:80:
clamav:x:98:
nogroup:x:99:
users:x:100:
EOF
       cat > $PKG/usr/bin/which << "EOF"
#!/bin/bash
type -pa "$@" | head -n 1 ; exit ${PIPESTATUS[0]}
EOF
	chmod -v 755 $PKG/usr/bin/which
	chown 0:0 $PKG/usr/bin/which
	cat > $PKG/etc/default/useradd << "EOF"
# Begin /etc/default/useradd

GROUP=100
HOME=/home
INACTIVE=-1
EXPIRE=
SHELL=/bin/bash
SKEL=/etc/skel

# End /etc/default/useradd
EOF
	touch $PKG/var/run/utmp $PKG/var/log/{btmp,lastlog,wtmp}
	chgrp -v 13 $PKG/var/run/utmp $PKG/var/log/lastlog
	chmod -v 664 $PKG/var/run/utmp $PKG/var/log/lastlog
	# Bootscripts
	cd $scriptsversion
	patch -Np1 -i ../lfs-bootscripts-01.patch
	make DESTDIR=$PKG install
	# We want to start the network when init 2
	mv $PKG/etc/rc.d/rc2.d/{K80,S20}network
	cd ..	
	# Remove files which will be installed by xorg7
	rm $PKG/etc/sysconfig/createfiles

	# Configuration files
	cp -v {hosts,fstab,inittab,profile,inputrc,bashrc.etc} $PKG/etc/
	mv $PKG/etc/bashrc.etc $PKG/etc/bashrc
	cp -v {dircolors.sh,extrapaths.sh,readline.sh,unmask.sh,X.sh,i18n.sh}\
	$PKG/etc/profile.d/
	cp -v {clock,console,network} $PKG/etc/sysconfig/
	cp -v bash_profile $PKG/etc/skel/.bash_profile
	cp -v bashrc $PKG/etc/skel/.bashrc
	ln -s /etc/slim.xinitrc $PKG/etc/skel/.xinitrc
	cp -v bash_profile $PKG/root/.bash_profile
	cp -v bashrc $PKG/root/.bashrc
	mkdir -p $PKG/root/bin
	cp -v nu $PKG/root/bin
       # Customise startup scripts
	cp blfs-bootscripts $PKG/etc/
	cp sysklogd $PKG/etc/rc.d/init.d/
	cp cleanfs $PKG/etc/rc.d/init.d/

	cp -v message $PKG/boot/

	cat > $PKG/etc/skel/.dmrc << "EOF"
[Desktop]
Session=
EOF
	mkdir -v $PKG/etc/X11
	cp -v xorg.conf $PKG/etc/X11/
	cd $PKG/root/
	ln -s ../etc/fstab
	ln -s ../etc/hosts
	ln -s ../boot/grub/menu.lst
	ln -s ../etc/inittab 
	ln -s ../etc/profile 
	ln -s ../etc/inputrc
	ln -s ../etc/bashrc
	ln -s ../etc/hosts.allow
	ln -s ../etc/hosts.deny
	ln -s ../etc/resolv.conf
	ln -s ../etc/modprobe.conf
	ln -s ../etc/shells
	ln -s ../etc/profile.d/dircolors.sh
	ln -s ../etc/profile.d/extrapaths.sh
	ln -s ../etc/profile.d/readline.sh
	ln -s ../etc/profile.d/unmask.sh
	ln -s ../etc/profile.d/X.sh
	ln -s ../etc/profile.d/i18n.sh
	ln -s ../etc/skel/.xinitrc
	ln -s ../etc/profile.d/jdk.sh
	ln -s ../etc/sysconfig/clock
	ln -s ../etc/sysconfig/console
	ln -s ../etc/sysconfig/network
	ln -s ../etc/sysconfig/modules
	ln -s ../etc/X11/xorg.conf
	ln -s ../etc/default/useradd
	ln -s ../etc/prt-get.conf
	ln -s ../etc/pkg-get.conf
	ln -s ../etc/pkgadd.conf
	ln -s ../etc/pkgmk.conf
	for i in rc0.d rc6.d
		do
			mv $PKG/etc/rc.d/$i/S{80,70}swap
			mv $PKG/etc/rc.d/$i/S{70,80}mountfs
	done
	ln -s ../init.d/setclock $PKG/etc/rc.d/rcsysinit.d/S15setclock
	mv $PKG/etc/rc.d/rcsysinit.d/S{20,40}swap
	mv $PKG/etc/rc.d/rcsysinit.d/S{30,20}checkfs
	mv $PKG/etc/rc.d/rcsysinit.d/S{40,30}mountfs
}