summaryrefslogtreecommitdiff
path: root/base-files/base-files_3.0.14.oe
blob: a98d50834d3dbecba76d69a38d5faf2a198b6efd (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
PR = "r2"
SRC_URI = "${DEBIAN_MIRROR}/main/b/base-files/base-files_${PV}.tar.gz"
DESCRIPTION = "Base system miscellaneous files."

docdir_append = "/${P}"
PACKAGES = "${PN}-doc ${PN}"
FILES_${PN} = "/"
FILES_${PN}-doc = "/usr/share/doc /usr/share/common-licenses"

do_install () {
	install -d ${D}/${docdir}
	install -d ${D}${datadir}/${PN}
	install -p -m 644 debian/changelog debian/FAQ \
		debian/README.FHS debian/README.base ${D}/${docdir}/
	cat debian/copyright.in | sed -e "s&#OSNAME#&${TARGET_OS}&g" \
		> ${D}/${docdir}/copyright
	install -m 755 debian/remove-base ${D}/${docdir}
#	cd debian && install -m 755 preinst postinst ${D}/DEBIAN
#	cd debian && install -m 644 conffiles ${D}/DEBIAN
	( cd ${D} && install -d `cat ${S}/debian/directory-list` )
	install -d ${D}/sys

	install -p -m 644 share/* ${D}${datadir}/base-files
	install -p -m 644 licenses/* ${D}${datadir}/common-licenses
	ln -s LGPL-2.1 ${D}${datadir}/common-licenses/LGPL
	ln -s GPL-2    ${D}${datadir}/common-licenses/GPL
	for i in `ls etc/|grep -v debian`; do install -p -m 644 etc/$i ${D}/etc; done
	rm -f ${D}/etc/motd
	cat etc/motd | sed -e "s&#OSNAME#&${TARGET_OS}&g" > ${D}${datadir}/base-files/motd
	cat share/info.dir | sed -e "s&#OSNAME#&${TARGET_OS}&g" > ${D}${datadir}/base-files/info.dir
	gzip -9 ${D}/${docdir}/changelog
#	chown -R root:root ${D}
#	cd ${D} && chown root:src     usr/src
#	cd ${D} && chown root:staff   var/local
#	cd ${D} && chown root:staff   home
	cd ${D} && chmod 755  `find . -type d`
	cd ${D} && chmod 1777 `cat ${S}/debian/1777-dirs`
	cd ${D} && chmod 2775 `cat ${S}/debian/2775-dirs`

	install -d ${D}/${sysconfdir}
	oe_machinstall -m 0644 ${FILESDIR}/fstab ${D}/${sysconfdir}/fstab
	oe_machinstall -m 0644 ${FILESDIR}/hostname ${D}/${sysconfdir}/hostname
	oe_machinstall -m 0644 ${FILESDIR}/profile ${D}/${sysconfdir}/profile

	install -m 0755 ${D}/usr/share/base-files/dot.profile ${D}/root/.profile

	# debian ships these, but they are useless to us
	rmdir ${D}/var/lib/dpkg ${D}/var/lib/misc ${D}/var/backups \
	      ${D}/usr/src ${D}/usr/info ${D}/usr/games ${D}/usr/doc \
	      ${D}/usr/include ${D}/usr/share/dict
	rm -r ${D}/usr/share/base-files

	if grep -q "^\(tmpfs\|ramfs\)\W\+/var" ${D}/etc/fstab; then
		# /var is in a ramdisk
		install -d ${D}/etc/init.d ${D}/etc/rcS.d
		cat <<EOF >${D}/etc/init.d/populate-var
#!/bin/sh

mount /var
EOF
		for d in `(cd ${D}/var; ls)`; do
			mode=`stat -c %a ${D}/var/$d`
			echo "mkdir -p /var/$d" >> ${D}/etc/init.d/populate-var
			echo "chmod $mode /var/$d" >> ${D}/etc/init.d/populate-var
		done
		rmdir ${D}/var/*
		chmod a+x ${D}/etc/init.d/populate-var
		ln -s ../init.d/populate-var ${D}/etc/rcS.d/S01populate-var
	fi
}