base-files: remove unneeded /media/hdd from dreambox packages (new e2 creates a symlink)
[openembedded.git] / recipes / base-files / base-files_3.0.14.bb
1 DESCRIPTION = "Miscellaneous files for the base system."
2 SECTION = "base"
3 PRIORITY = "required"
4 PR = "r93"
5 LICENSE = "GPL"
6
7 FSTAB_dm7025 = "${@base_contains('PREFERRED_VERSION_linux-dm7025', '2.6.12.6', 'fstab_old', 'fstab', d)}"
8 FSTAB ?= "fstab"
9
10 SRC_URI = " \
11            file://nsswitch.conf \
12            file://motd \
13            file://inputrc \
14            file://host.conf \
15            file://profile \
16            file://${FSTAB} \
17            file://filesystems \
18            file://issue.net \
19            file://issue \
20            file://usbd \
21            file://share/dot.bashrc \
22            file://share/dot.profile \
23            file://licenses/BSD \
24            file://licenses/GPL-2 \
25            file://licenses/GPL-3 \
26            file://licenses/LGPL-2 \
27            file://licenses/LGPL-2.1 \
28            file://licenses/LGPL-3 \
29            file://licenses/GFDL-1.2 \
30            file://licenses/Artistic "
31 S = "${WORKDIR}"
32
33 docdir_append = "/${P}"
34 dirs1777 = "/tmp ${localstatedir}/volatile/lock ${localstatedir}/volatile/tmp"
35 dirs2775 = "/home ${prefix}/src ${localstatedir}/local"
36 dirs755 = "/bin /boot /dev ${sysconfdir} ${sysconfdir}/default \
37            ${sysconfdir}/skel /lib /mnt /proc /home/root /sbin \
38            ${prefix} ${bindir} ${docdir} /usr/games ${includedir} \
39            ${libdir} ${sbindir} ${datadir} \
40            ${datadir}/common-licenses ${datadir}/dict ${infodir} \
41            ${mandir} ${datadir}/misc ${localstatedir} \
42            ${localstatedir}/backups ${localstatedir}/lib \
43            /sys ${localstatedir}/lib/misc ${localstatedir}/spool \
44            ${localstatedir}/volatile ${localstatedir}/volatile/cache \
45            ${localstatedir}/volatile/lock/subsys \
46            ${localstatedir}/volatile/log \
47            ${localstatedir}/volatile/run \
48            /mnt /media /media/card /media/cf /media/net /media/ram \
49            /media/union /media/realroot /media/hdd \
50            /media/mmc1"
51
52 dirs755_micro = "/dev /proc /sys ${sysconfdir}"
53 dirs2775_micro = ""
54 dirs1777_micro = "/tmp"
55
56 media = "card cf net ram"
57 media_micro = ""
58
59 volatiles = "cache run log lock tmp"
60 conffiles = "${sysconfdir}/debian_version ${sysconfdir}/host.conf \
61              ${sysconfdir}/inputrc ${sysconfdir}/issue /${sysconfdir}/issue.net \
62              ${sysconfdir}/nsswitch.conf ${sysconfdir}/profile \
63              ${sysconfdir}/default"
64
65 #
66 # set standard hostname, might be a candidate for a DISTRO variable? :M:
67 #
68 hostname = "openembedded"
69 hostname_slugos = "nslu2"
70 hostname_mnci = "MNCI"
71 hostname_rt3000 = "MNRT"
72 hostname_jlime = "JLime"
73
74 do_install () {
75         for d in ${dirs755}; do
76                 install -m 0755 -d ${D}$d
77         done
78         for d in ${dirs1777}; do
79                 install -m 1777 -d ${D}$d
80         done
81         for d in ${dirs2775}; do
82                 install -m 2755 -d ${D}$d
83         done
84         for d in ${volatiles}; do
85                 if [ -d ${D}${localstatedir}/volatile/$d ]; then
86                         ln -sf volatile/$d ${D}/${localstatedir}/$d
87                 fi
88         done
89         for d in ${media}; do
90                 ln -sf /media/$d ${D}/mnt/$d
91         done
92
93         if [ -n "${MACHINE}" -a "${hostname}" = "openembedded" ]; then
94                 echo ${MACHINE} > ${D}${sysconfdir}/hostname
95         else
96                 echo ${hostname} > ${D}${sysconfdir}/hostname
97         fi
98
99         if [ "${DISTRO}" != "micro" -a "${DISTRO}" != "micro-uclibc" ]; then
100                 install -m 644 ${WORKDIR}/issue*  ${D}${sysconfdir}  
101
102                 if [ -n "${DISTRO_NAME}" ]; then
103                         echo -n "${DISTRO_NAME} " >> ${D}${sysconfdir}/issue
104                         echo -n "${DISTRO_NAME} " >> ${D}${sysconfdir}/issue.net
105                         if [ -n "${DISTRO_VERSION}" ]; then
106                                 echo -n "${DISTRO_VERSION} " >> ${D}${sysconfdir}/issue
107                                 echo -n "${DISTRO_VERSION} " >> ${D}${sysconfdir}/issue.net
108                         fi
109                         echo "\n \l" >> ${D}${sysconfdir}/issue
110                         echo >> ${D}${sysconfdir}/issue
111                         echo "%h"    >> ${D}${sysconfdir}/issue.net
112                         echo >> ${D}${sysconfdir}/issue.net
113                 else
114                         install -m 0644 ${WORKDIR}/issue ${D}${sysconfdir}/issue
115                         install -m 0644 ${WORKDIR}/issue.net ${D}${sysconfdir}/issue.net
116                 fi
117
118                 install -m 0644 ${WORKDIR}/${FSTAB} ${D}${sysconfdir}/fstab
119                 install -m 0644 ${WORKDIR}/filesystems ${D}${sysconfdir}/filesystems
120                 install -m 0644 ${WORKDIR}/usbd ${D}${sysconfdir}/default/usbd
121                 install -m 0644 ${WORKDIR}/profile ${D}${sysconfdir}/profile
122                 install -m 0755 ${WORKDIR}/share/dot.profile ${D}${sysconfdir}/skel/.profile
123                 install -m 0755 ${WORKDIR}/share/dot.bashrc ${D}${sysconfdir}/skel/.bashrc
124                 install -m 0644 ${WORKDIR}/inputrc ${D}${sysconfdir}/inputrc
125                 install -m 0644 ${WORKDIR}/motd ${D}${sysconfdir}/motd
126                 for license in BSD GPL-2 LGPL-2 LGPL-2.1 Artistic GPL-3 LGPL-3 GFDL-1.2; do
127                         install -m 0644 ${WORKDIR}/licenses/$license ${D}${datadir}/common-licenses/
128                 done
129
130                 ln -sf /proc/mounts ${D}${sysconfdir}/mtab
131                 install -m 0644 ${WORKDIR}/host.conf ${D}${sysconfdir}/host.conf
132         fi
133
134         install -m 0644 ${WORKDIR}/nsswitch.conf ${D}${sysconfdir}/nsswitch.conf
135 }
136
137
138 do_install_append_mnci () {
139         rmdir ${D}/tmp
140         ln -s var/tmp ${D}/tmp
141 }
142
143 do_install_append_nylon() {
144         printf "" "" >${D}${sysconfdir}/resolv.conf
145         rm -r ${D}/mnt/*
146         rm -r ${D}/media
147         rm -rf ${D}/tmp
148         ln -sf /var/tmp ${D}/tmp
149 }
150
151 do_install_append_slugos() {
152         printf "" "" >${D}${sysconfdir}/resolv.conf
153         rm -r ${D}/mnt/*
154         rmdir ${D}/home/root
155         install -m 0755 -d ${D}/root
156         ln -s ../root ${D}/home/root
157 }
158
159 do_install_append_netbook-pro () {
160         mkdir -p ${D}/initrd
161 }
162
163 REMOVE_MEDIA_HDD = "${@base_contains('MACHINE', 'dm7025', '', 'rm -rf ${D}/media/hdd', d)}"
164 do_install_append_opendreambox() {
165         rm -rf ${D}/mnt
166         rm -rf ${D}/hdd
167         ln -sf /media/hdd ${D}/hdd
168         ln -sf /media ${D}/mnt
169         ${REMOVE_MEDIA_HDD}
170 }
171
172 PACKAGES = "${PN}-dbg ${PN}-doc ${PN}"
173 FILES_${PN} = "/*"
174 FILES_${PN}-doc = "${docdir} ${datadir}/common-licenses"
175
176 # M&N specific packaging
177 PACKAGE_ARCH_mnci = "mnci"
178 PACKAGE_ARCH_rt3000 = "rt3000"
179
180 PACKAGE_ARCH = "${MACHINE_ARCH}"
181
182 CONFFILES_${PN} = "${sysconfdir}/fstab ${sysconfdir}/hostname"
183 CONFFILES_${PN}_micro = ""
184 CONFFILES_${PN}_nylon = "${sysconfdir}/resolv.conf ${sysconfdir}/fstab ${sysconfdir}/hostname"
185 CONFFILES_${PN}_slugos = "${sysconfdir}/resolv.conf ${sysconfdir}/fstab ${sysconfdir}/hostname"
186