summaryrefslogtreecommitdiffstats
path: root/meta
diff options
context:
space:
mode:
authorMark Hatle <mark.hatle@windriver.com>2012-05-21 12:42:34 -0500
committerRichard Purdie <richard.purdie@linuxfoundation.org>2012-05-30 12:04:42 +0100
commitcb2a93ee321a277beacc8e9df97a5dc85f66d221 (patch)
tree7e81fc93cdfd999855bcaf5afdf8f5a4f1883a73 /meta
parent18b6e5ff59b70a659697c0791c177921b71d731c (diff)
downloadpoky-cb2a93ee321a277beacc8e9df97a5dc85f66d221.tar.gz
util-linux: use new update-alternatives
In addition to switching to the new update-alternatives, it was discovered that the sln, shutdown, halt, reboot and related commands were never generated. Remove these from the list. (These appear to have been removed from util-linux some time ago.) (From OE-Core rev: 55c01de28a28a4cfe16d36663c190a874ef2e85d) Signed-off-by: Mark Hatle <mark.hatle@windriver.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
Diffstat (limited to 'meta')
-rw-r--r--meta/recipes-core/util-linux/util-linux.inc212
-rw-r--r--meta/recipes-core/util-linux/util-linux_2.21.1.bb2
2 files changed, 45 insertions, 169 deletions
diff --git a/meta/recipes-core/util-linux/util-linux.inc b/meta/recipes-core/util-linux/util-linux.inc
index 024b55cf85..688a5be2ce 100644
--- a/meta/recipes-core/util-linux/util-linux.inc
+++ b/meta/recipes-core/util-linux/util-linux.inc
@@ -43,15 +43,15 @@ EXTRA_OECONF = "--libdir=${base_libdir} --disable-use-tty-group \
43FILES_${PN}-doc += "${datadir}/getopt/getopt-*.*" 43FILES_${PN}-doc += "${datadir}/getopt/getopt-*.*"
44 44
45FILES_util-linux-agetty = "${base_sbindir}/agetty" 45FILES_util-linux-agetty = "${base_sbindir}/agetty"
46FILES_util-linux-fdisk = "${base_sbindir}/fdisk.${PN}" 46FILES_util-linux-fdisk = "${base_sbindir}/fdisk.${BPN}"
47FILES_util-linux-cfdisk = "${base_sbindir}/cfdisk" 47FILES_util-linux-cfdisk = "${base_sbindir}/cfdisk"
48FILES_util-linux-sfdisk = "${sbindir}/sfdisk" 48FILES_util-linux-sfdisk = "${sbindir}/sfdisk"
49FILES_util-linux-swaponoff = "${base_sbindir}/swapon.${PN} ${sbindir}/swapoff.${PN}" 49FILES_util-linux-swaponoff = "${base_sbindir}/swapon.${BPN} ${sbindir}/swapoff.${BPN}"
50FILES_util-linux-losetup = "${base_sbindir}/losetup.${PN}" 50FILES_util-linux-losetup = "${base_sbindir}/losetup.${BPN}"
51FILES_util-linux-mount = "${base_bindir}/mount.${PN}" 51FILES_util-linux-mount = "${base_bindir}/mount.${BPN}"
52FILES_util-linux-mcookie = "${bindir}/mcookie" 52FILES_util-linux-mcookie = "${bindir}/mcookie"
53FILES_util-linux-umount = "${base_bindir}/umount.${PN}" 53FILES_util-linux-umount = "${base_bindir}/umount.${BPN}"
54FILES_util-linux-readprofile = "${base_sbindir}/readprofile.${PN}" 54FILES_util-linux-readprofile = "${base_sbindir}/readprofile.${BPN}"
55FILES_util-linux-uuidgen = "${bindir}/uuidgen" 55FILES_util-linux-uuidgen = "${bindir}/uuidgen"
56 56
57FILES_util-linux-libblkid = "${base_libdir}/libblkid.so.*" 57FILES_util-linux-libblkid = "${base_libdir}/libblkid.so.*"
@@ -85,29 +85,6 @@ do_compile () {
85 oe_runmake ARCH=${TARGET_ARCH} CPU= CPUOPT= 'OPT=${CFLAGS}' 85 oe_runmake ARCH=${TARGET_ARCH} CPU= CPUOPT= 'OPT=${CFLAGS}'
86} 86}
87 87
88checklink() {
89 local targ link value
90 targ="$1"
91 link="$2"
92 ext="$3"
93 if test -h "$link"
94 then
95 value="$(readlink "$link")"
96 if test "$value" = "$targ"
97 then
98 rm "$link"
99 ln -s "$targ"."${PN}" "$link$ext"
100 return 0
101 else
102 echo "$link: '$value' found '$targ' expected" >&2
103 return 1
104 fi
105 else
106 echo "$link: not a symbolic link" >&2
107 return 1
108 fi
109}
110
111do_install () { 88do_install () {
112 # with ccache the timestamps on compiled files may 89 # with ccache the timestamps on compiled files may
113 # end up earlier than on their inputs, this allows 90 # end up earlier than on their inputs, this allows
@@ -119,7 +96,7 @@ do_install () {
119 mkdir -p ${D}${base_bindir} 96 mkdir -p ${D}${base_bindir}
120 97
121 sbinprogs="agetty ctrlaltdel cfdisk vipw vigr" 98 sbinprogs="agetty ctrlaltdel cfdisk vipw vigr"
122 sbinprogs_a="pivot_root hwclock mkswap shutdown mkfs.minix fsck.minix losetup swapon fdisk readprofile fsck blkid sln blockdev" 99 sbinprogs_a="pivot_root hwclock mkswap mkfs.minix fsck.minix losetup swapon fdisk readprofile fsck blkid blockdev"
123 usrbinprogs_a="chfn chsh hexdump last logger mesg newgrp renice wall setsid chrt flock" 100 usrbinprogs_a="chfn chsh hexdump last logger mesg newgrp renice wall setsid chrt flock"
124 binprogs_a="dmesg kill more umount mount login reset" 101 binprogs_a="dmesg kill more umount mount login reset"
125 102
@@ -141,161 +118,60 @@ do_install () {
141 done 118 done
142 fi 119 fi
143 120
144 for p in $usrbinprogs_a; do
145 if [ -f "${D}${bindir}/$p" ]; then
146 mv "${D}${bindir}/$p" "${D}${bindir}/$p.${PN}"
147 fi
148 done
149
150 for p in $binprogs_a; do
151 if [ -f "${D}${base_bindir}/$p" ]; then
152 mv "${D}${base_bindir}/$p" "${D}${base_bindir}/$p.${PN}"
153 fi
154 done
155
156 for p in $sbinprogs_a; do
157 if [ -f "${D}${base_sbindir}/$p" ]; then
158 mv "${D}${base_sbindir}/$p" "${D}${base_sbindir}/$p.${PN}"
159 fi
160 done
161
162 install -d ${D}${sysconfdir}/default/ 121 install -d ${D}${sysconfdir}/default/
163 echo 'MOUNTALL="-t nonfs,nosmbfs,noncpfs"' > ${D}${sysconfdir}/default/mountall 122 echo 'MOUNTALL="-t nonfs,nosmbfs,noncpfs"' > ${D}${sysconfdir}/default/mountall
164 123
165 # note ${PN} in swapon.${PN}, swapon is an alternative link that is 124 ln -sf swapon ${D}${base_sbindir}/swapoff
166 # not guaranteed to provide multiple functions, similar for shutdown
167 ln -sf swapon.${PN} ${D}${base_sbindir}/swapoff.${PN}
168 ln -sf shutdown.${PN} ${D}${base_sbindir}/reboot.${PN}
169 ln -sf shutdown.${PN} ${D}${base_sbindir}/halt.${PN}
170 ln -sf shutdown.${PN} ${D}${base_sbindir}/fastboot
171 ln -sf shutdown.${PN} ${D}${base_sbindir}/fasthalt
172
173 rm -f ${D}${sbindir}/halt
174 rm -f ${D}${sbindir}/reboot
175 rm -f ${D}${sbindir}/fastboot
176 rm -f ${D}${sbindir}/fasthalt
177 rm -f ${D}${sbindir}/swapoff 125 rm -f ${D}${sbindir}/swapoff
178} 126}
179 127
180pkg_postinst_${PN} () { 128inherit update-alternatives
181 update-alternatives --install ${base_bindir}/dmesg dmesg dmesg.${PN} 100
182 update-alternatives --install ${base_bindir}/kill kill kill.${PN} 100
183 update-alternatives --install ${base_bindir}/more more more.${PN} 100
184 update-alternatives --install ${base_sbindir}/mkswap mkswap mkswap.${PN} 100
185 update-alternatives --install ${base_sbindir}/blockdev blockdev blockdev.${PN} 100
186 test -x ${base_sbindir}/pivot_root.${PN} && \
187 update-alternatives --install ${base_sbindir}/pivot_root pivot_root pivot_root.${PN} 100
188# update-alternatives --install ${base_sbindir}/sln sln sln.${PN} 100
189 update-alternatives --install ${base_sbindir}/mkfs.minix mkfs.minix mkfs.minix.${PN} 100
190 update-alternatives --install ${bindir}/hexdump hexdump hexdump.${PN} 100
191 update-alternatives --install ${bindir}/last last last.${PN} 100
192 update-alternatives --install ${bindir}/logger logger logger.${PN} 100
193 update-alternatives --install ${bindir}/mesg mesg mesg.${PN} 100
194 update-alternatives --install ${bindir}/renice renice renice.${PN} 100
195 update-alternatives --install ${bindir}/wall wall wall.${PN} 100
196 update-alternatives --install ${bindir}/setsid setsid setsid.${PN} 100
197 update-alternatives --install ${bindir}/chrt chrt chrt.${PN} 100
198 update-alternatives --install ${bindir}/flock flock flock.${PN} 100
199
200 # There seems to be problem, atleast on nslu2, with these, untill they are
201 # fixed the busybox ones have higher priority
202 update-alternatives --install ${base_sbindir}/hwclock hwclock hwclock.${PN} 10
203 update-alternatives --install ${base_sbindir}/shutdown shutdown shutdown.${PN} 10
204 update-alternatives --install ${base_sbindir}/reboot reboot reboot.${PN} 10
205 update-alternatives --install ${base_sbindir}/halt halt halt.${PN} 10
206}
207 129
208pkg_prerm_${PN} () { 130ALTERNATIVE_PRIORITY = "100"
209 test -x ${base_sbindir}/pivot_root.${PN} && \
210 update-alternatives --remove pivot_root pivot_root.${PN}
211 update-alternatives --remove dmesg dmesg.${PN}
212 update-alternatives --remove kill kill.${PN}
213 update-alternatives --remove more more.${PN}
214 update-alternatives --remove halt halt.${PN}
215 update-alternatives --remove hwclock hwclock.${PN}
216 update-alternatives --remove mkswap mkswap.${PN}
217 update-alternatives --remove blockdev blockdev.${PN}
218 update-alternatives --remove reboot reboot.${PN}
219 update-alternatives --remove shutdown shutdown.${PN}
220# update-alternatives --remove sln sln.${PN}
221 update-alternatives --remove mkfs.minix mkfs.minix.${PN}
222 update-alternatives --remove hexdump hexdump.${PN}
223 update-alternatives --remove last last.${PN}
224 update-alternatives --remove logger logger.${PN}
225 update-alternatives --remove mesg mesg.${PN}
226 update-alternatives --remove renice renice.${PN}
227 update-alternatives --remove wall wall.${PN}
228 update-alternatives --remove setsid setsid.${PN}
229 update-alternatives --remove chrt chrt.${PN}
230 update-alternatives --remove flock flock.${PN}
231}
232 131
233pkg_postinst_util-linux-fdisk () { 132ALTERNATIVE_${PN} = "dmesg kill more reset mkswap blockdev pivot_root"
234 update-alternatives --install ${base_sbindir}/fdisk fdisk fdisk.${PN} 100 133ALTERNATIVE_${PN} += "mkfs.minix hexdump last logger mesg renice wall"
235} 134ALTERNATIVE_${PN} += "setsid chrt flock hwclock"
236 135
237pkg_prerm_util-linux-fdisk () { 136ALTERNATIVE_LINK_NAME[dmesg] = "${base_bindir}/dmesg"
238 update-alternatives --remove fdisk fdisk.${PN} 137ALTERNATIVE_LINK_NAME[kill] = "${base_bindir}/kill"
239} 138ALTERNATIVE_LINK_NAME[more] = "${base_bindir}/more"
139ALTERNATIVE_LINK_NAME[reset] = "${base_bindir}/reset"
140ALTERNATIVE_LINK_NAME[mkswap] = "${base_sbindir}/mkswap"
141ALTERNATIVE_LINK_NAME[blockdev] = "${base_sbindir}/blockdev"
142ALTERNATIVE_LINK_NAME[pivot_root] = "${base_sbindir}/pivot_root"
143ALTERNATIVE_LINK_NAME[mkfs.minix] = "${base_sbindir}/mkfs.minix"
240 144
241pkg_postinst_util-linux-agetty () { 145# There seems to be problem, atleast on nslu2, with these, untill they are
242 update-alternatives --install ${base_sbindir}/getty getty agetty 100 146# fixed the busybox ones have higher priority
243} 147ALTERNATIVE_PRIORITY[hwclock] = "10"
148ALTERNATIVE_LINK_NAME[hwclock] = "${base_sbindir}/hwclock"
244 149
245pkg_prerm_util-linux-agetty () { 150ALTERNATIVE_util-linux-fdisk = "fdisk"
246 update-alternatives --remove getty agetty 151ALTERNATIVE_LINK_NAME[fdisk] = "${base_sbindir}/fdisk"
247}
248 152
249pkg_postinst_util-linux-mount () { 153ALTERNATIVE_util-linux-agetty = "getty"
250 update-alternatives --install ${base_bindir}/mount mount mount.${PN} 100 154ALTERNATIVE_LINK_NAME[getty] = "${base_sbindir}/getty"
251} 155ALTERNATIVE_TARGET[getty] = "${base_sbindir}/agetty"
252 156
253pkg_prerm_util-linux-mount () { 157ALTERNATIVE_util-linux-mount = "mount"
254 update-alternatives --remove mount mount.${PN} 158ALTERNATIVE_LINK_NAME[mount] = "${base_bindir}/mount"
255}
256 159
257pkg_postinst_util-linux-umount () { 160ALTERNATIVE_util-linux-umount = "umount"
258 update-alternatives --install ${base_bindir}/umount umount umount.${PN} 100 161ALTERNATIVE_LINK_NAME[umount] = "${base_bindir}/umount"
259}
260 162
261pkg_prerm_util-linux-umount () { 163ALTERNATIVE_util-linux-losetup = "losetup"
262 update-alternatives --remove umount umount.${PN} 164ALTERNATIVE_LINK_NAME[losetup] = "${base_sbindir}/losetup"
263}
264 165
265pkg_postinst_util-linux-losetup () { 166ALTERNATIVE_util-linux-swaponoff = "swapoff swapon"
266 update-alternatives --install ${base_sbindir}/losetup losetup losetup.${PN} 100 167ALTERNATIVE_LINK_NAME[swapoff] = "${base_sbindir}/swapoff"
267} 168ALTERNATIVE_LINK_NAME[swapon] = "${base_sbindir}/swapon"
268 169
269pkg_prerm_util-linux-losetup () { 170ALTERNATIVE_util-linux-fsck = "fsck.minix fsck"
270 update-alternatives --remove losetup losetup.${PN} 171ALTERNATIVE_LINK_NAME[fsck.minix] = "${base_sbindir}/fsck.minix"
271} 172ALTERNATIVE_LINK_NAME[fsck] = "${base_sbindir}/fsck"
272
273pkg_postinst_util-linux-swaponoff () {
274 update-alternatives --install ${base_sbindir}/swapoff swapoff swapoff.${PN} 100
275 update-alternatives --install ${base_sbindir}/swapon swapon swapon.${PN} 100
276}
277
278pkg_prerm_util-linux-swaponoff () {
279 update-alternatives --remove swapoff swapoff.${PN}
280 update-alternatives --remove swapon swapon.${PN}
281}
282
283pkg_postinst_util-linux-fsck () {
284 update-alternatives --install ${base_sbindir}/fsck.minix fsck.minix fsck.minix.${PN} 100
285 update-alternatives --install ${base_sbindir}/fsck fsck fsck.${PN} 100
286}
287
288pkg_prerm_util-linux-fsck () {
289 update-alternatives --remove fsck.minix fsck.minix.${PN}
290 update-alternatives --remove fsck fsck.${PN}
291}
292 173
293pkg_postinst_util-linux-blkid () { 174ALTERNATIVE_util-linux-blkid = "blkid"
294 update-alternatives --install ${base_sbindir}/blkid blkid blkid.${PN} 100 175ALTERNATIVE_LINK_NAME[blkid] = "${base_sbindir}/blkid"
295}
296
297pkg_prerm_util-linux-blkid () {
298 update-alternatives --remove blkid blkid.${PN}
299}
300 176
301BBCLASSEXTEND = "native" 177BBCLASSEXTEND = "native"
diff --git a/meta/recipes-core/util-linux/util-linux_2.21.1.bb b/meta/recipes-core/util-linux/util-linux_2.21.1.bb
index 12faba00bd..8492cdf8e7 100644
--- a/meta/recipes-core/util-linux/util-linux_2.21.1.bb
+++ b/meta/recipes-core/util-linux/util-linux_2.21.1.bb
@@ -1,5 +1,5 @@
1MAJOR_VERSION = "2.21" 1MAJOR_VERSION = "2.21"
2PR = "r0" 2PR = "r1"
3require util-linux.inc 3require util-linux.inc
4 4
5# note that `lscpu' is under GPLv3+ 5# note that `lscpu' is under GPLv3+