summaryrefslogtreecommitdiff
path: root/packages/base-files/base-files_3.0.14.bb
blob: 1f06cc103669bf1387b3e0d9fdd2a0097c7f4f00 (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
DESCRIPTION = "Miscellaneous files for the base system."
SECTION = "base"
PRIORITY = "required"
PR = "r46"
LICENSE = "GPL"

SRC_URI = " \
           file://nsswitch.conf \
           file://motd \
           file://inputrc \
           file://host.conf \
           file://profile \
           file://fstab \
	   file://filesystems \
           file://issue.net \
           file://issue \
           file://usbd \
           file://share/dot.bashrc \
           file://share/dot.profile \
           file://licenses/BSD \
           file://licenses/GPL-2 \
           file://licenses/LGPL-2 \
           file://licenses/LGPL-2.1 \
           file://licenses/Artistic "
S = "${WORKDIR}"

docdir_append = "/${P}"
dirs1777 = "/tmp ${localstatedir}/lock ${localstatedir}/tmp"
dirs2775 = "/home ${prefix}/src ${localstatedir}/local"
dirs755 = "/bin /boot /dev ${sysconfdir} ${sysconfdir}/default \
	   ${sysconfdir}/skel /lib /mnt /proc /home/root /sbin \
	   ${prefix} ${bindir} ${docdir} /usr/games ${includedir} \
	   ${libdir} ${sbindir} ${datadir} \
	   ${datadir}/common-licenses ${datadir}/dict ${infodir} \
	   ${mandir} ${datadir}/misc ${localstatedir} \
	   ${localstatedir}/backups ${localstatedir}/cache \
	   ${localstatedir}/lib /sys ${localstatedir}/lib/misc \
	   ${localstatedir}/lock/subsys ${localstatedir}/log \
	   ${localstatedir}/run ${localstatedir}/spool \
	   /mnt /media /media/card /media/cf /media/net /media/ram \
	   /media/union /media/realroot /media/hdd \
           /media/mmc1"
conffiles = "${sysconfdir}/debian_version ${sysconfdir}/host.conf \
	     ${sysconfdir}/inputrc ${sysconfdir}/issue /${sysconfdir}/issue.net \
	     ${sysconfdir}/nsswitch.conf ${sysconfdir}/profile \
	     ${sysconfdir}/default"

hostname = "openembedded"
hostname_slugos = "nslu2"
hostname_mnci = "MNCI"
PACKAGE_ARCH_mnci = "mnci"
hostname_rt3000 = "MNRT"
PACKAGE_ARCH_rt3000 = "rt3000"

do_install () {
	for d in ${dirs755}; do
		install -m 0755 -d ${D}$d
	done
	for d in ${dirs1777}; do
		install -m 1777 -d ${D}$d
	done
	for d in ${dirs2775}; do
		install -m 2755 -d ${D}$d
	done
	for d in card cf net ram; do
		ln -sf /media/$d ${D}/mnt/$d
	done

	if [ -n "${MACHINE}" -a "${hostname}" = "openembedded" ]; then
		echo ${MACHINE} > ${D}${sysconfdir}/hostname
	else
		echo ${hostname} > ${D}${sysconfdir}/hostname
	fi

        if [ -n "${DISTRO_NAME}" ]; then
		echo -n "${DISTRO_NAME} " > ${D}${sysconfdir}/issue
		echo -n "${DISTRO_NAME} " > ${D}${sysconfdir}/issue.net
		if [ -n "${DISTRO_VERSION}" ]; then
			echo -n "${DISTRO_VERSION} " >> ${D}${sysconfdir}/issue
			echo -n "${DISTRO_VERSION} " >> ${D}${sysconfdir}/issue.net
		fi
		echo "\n \l" >> ${D}${sysconfdir}/issue
		echo >> ${D}${sysconfdir}/issue
		echo "%h"    >> ${D}${sysconfdir}/issue.net
		echo >> ${D}${sysconfdir}/issue.net
	else
 	       install -m 0644 ${WORKDIR}/issue ${D}${sysconfdir}/issue
 	       install -m 0644 ${WORKDIR}/issue.net ${D}${sysconfdir}/issue.net
 	fi

	install -m 0644 ${WORKDIR}/fstab ${D}${sysconfdir}/fstab
	install -m 0644 ${WORKDIR}/filesystems ${D}${sysconfdir}/filesystems
	install -m 0644 ${WORKDIR}/usbd ${D}${sysconfdir}/default/usbd
	install -m 0644 ${WORKDIR}/profile ${D}${sysconfdir}/profile
	install -m 0755 ${WORKDIR}/share/dot.profile ${D}${sysconfdir}/skel/.profile
	install -m 0755 ${WORKDIR}/share/dot.bashrc ${D}${sysconfdir}/skel/.bashrc
	install -m 0644 ${WORKDIR}/inputrc ${D}${sysconfdir}/inputrc
	install -m 0644 ${WORKDIR}/nsswitch.conf ${D}${sysconfdir}/nsswitch.conf
	install -m 0644 ${WORKDIR}/host.conf ${D}${sysconfdir}/host.conf
	install -m 0644 ${WORKDIR}/motd ${D}${sysconfdir}/motd

	for license in BSD GPL-2 LGPL-2 LGPL-2.1 Artistic; do
		install -m 0644 ${WORKDIR}/licenses/$license ${D}${datadir}/common-licenses/
	done

	ln -sf /proc/mounts ${D}${sysconfdir}/mtab
}


do_install_append_mnci () {
	rmdir ${D}/tmp
	mkdir -p ${D}${localstatedir}/tmp
	ln -s var/tmp ${D}/tmp
}

do_install_append_nylon() {
	printf "" "" >${D}${sysconfdir}/resolv.conf
	rm -r ${D}/mnt/*
	rm -r ${D}/media
	rm -rf ${D}/tmp
	ln -sf /var/tmp ${D}/tmp
}

do_install_append_slugos() {
	printf "" "" >${D}${sysconfdir}/resolv.conf
	rm -r ${D}/mnt/*
	rmdir ${D}/home/root
	install -m 0755 -d ${D}/root
	ln -s ../root ${D}/home/root
}

PACKAGES = "${PN}-doc ${PN}"
FILES_${PN} = "/"
FILES_${PN}-doc = "${docdir} ${datadir}/common-licenses"


# Unslung distribution specific packages follow ...

PACKAGES_unslung = "${PN}-unslung"
PACKAGE_ARCH_${PN}-unslung = "nslu2"
MAINTAINER_${PN}-unslung = "NSLU2 Linux <www.nslu2-linux.org>"
RDEPENDS_${PN}-unslung = "nslu2-linksys-ramdisk"
RPROVIDES_${PN}-unslung = "${PN}"

FILES_${PN}-unslung = ""

CONFFILES_${PN} = "${sysconfdir}/fstab ${sysconfdir}/hostname"
CONFFILES_${PN}_nylon = "${sysconfdir}/resolv.conf ${sysconfdir}/fstab ${sysconfdir}/hostname"
CONFFILES_${PN}_slugos = "${sysconfdir}/resolv.conf ${sysconfdir}/fstab ${sysconfdir}/hostname"