diff options
| author | Mark Hatle <mark.hatle@windriver.com> | 2012-05-21 12:42:34 -0500 |
|---|---|---|
| committer | Richard Purdie <richard.purdie@linuxfoundation.org> | 2012-05-30 12:04:42 +0100 |
| commit | cb2a93ee321a277beacc8e9df97a5dc85f66d221 (patch) | |
| tree | 7e81fc93cdfd999855bcaf5afdf8f5a4f1883a73 | |
| parent | 18b6e5ff59b70a659697c0791c177921b71d731c (diff) | |
| download | poky-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>
| -rw-r--r-- | meta/recipes-core/util-linux/util-linux.inc | 212 | ||||
| -rw-r--r-- | meta/recipes-core/util-linux/util-linux_2.21.1.bb | 2 |
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 \ | |||
| 43 | FILES_${PN}-doc += "${datadir}/getopt/getopt-*.*" | 43 | FILES_${PN}-doc += "${datadir}/getopt/getopt-*.*" |
| 44 | 44 | ||
| 45 | FILES_util-linux-agetty = "${base_sbindir}/agetty" | 45 | FILES_util-linux-agetty = "${base_sbindir}/agetty" |
| 46 | FILES_util-linux-fdisk = "${base_sbindir}/fdisk.${PN}" | 46 | FILES_util-linux-fdisk = "${base_sbindir}/fdisk.${BPN}" |
| 47 | FILES_util-linux-cfdisk = "${base_sbindir}/cfdisk" | 47 | FILES_util-linux-cfdisk = "${base_sbindir}/cfdisk" |
| 48 | FILES_util-linux-sfdisk = "${sbindir}/sfdisk" | 48 | FILES_util-linux-sfdisk = "${sbindir}/sfdisk" |
| 49 | FILES_util-linux-swaponoff = "${base_sbindir}/swapon.${PN} ${sbindir}/swapoff.${PN}" | 49 | FILES_util-linux-swaponoff = "${base_sbindir}/swapon.${BPN} ${sbindir}/swapoff.${BPN}" |
| 50 | FILES_util-linux-losetup = "${base_sbindir}/losetup.${PN}" | 50 | FILES_util-linux-losetup = "${base_sbindir}/losetup.${BPN}" |
| 51 | FILES_util-linux-mount = "${base_bindir}/mount.${PN}" | 51 | FILES_util-linux-mount = "${base_bindir}/mount.${BPN}" |
| 52 | FILES_util-linux-mcookie = "${bindir}/mcookie" | 52 | FILES_util-linux-mcookie = "${bindir}/mcookie" |
| 53 | FILES_util-linux-umount = "${base_bindir}/umount.${PN}" | 53 | FILES_util-linux-umount = "${base_bindir}/umount.${BPN}" |
| 54 | FILES_util-linux-readprofile = "${base_sbindir}/readprofile.${PN}" | 54 | FILES_util-linux-readprofile = "${base_sbindir}/readprofile.${BPN}" |
| 55 | FILES_util-linux-uuidgen = "${bindir}/uuidgen" | 55 | FILES_util-linux-uuidgen = "${bindir}/uuidgen" |
| 56 | 56 | ||
| 57 | FILES_util-linux-libblkid = "${base_libdir}/libblkid.so.*" | 57 | FILES_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 | ||
| 88 | checklink() { | ||
| 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 | |||
| 111 | do_install () { | 88 | do_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 | ||
| 180 | pkg_postinst_${PN} () { | 128 | inherit 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 | ||
| 208 | pkg_prerm_${PN} () { | 130 | ALTERNATIVE_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 | ||
| 233 | pkg_postinst_util-linux-fdisk () { | 132 | ALTERNATIVE_${PN} = "dmesg kill more reset mkswap blockdev pivot_root" |
| 234 | update-alternatives --install ${base_sbindir}/fdisk fdisk fdisk.${PN} 100 | 133 | ALTERNATIVE_${PN} += "mkfs.minix hexdump last logger mesg renice wall" |
| 235 | } | 134 | ALTERNATIVE_${PN} += "setsid chrt flock hwclock" |
| 236 | 135 | ||
| 237 | pkg_prerm_util-linux-fdisk () { | 136 | ALTERNATIVE_LINK_NAME[dmesg] = "${base_bindir}/dmesg" |
| 238 | update-alternatives --remove fdisk fdisk.${PN} | 137 | ALTERNATIVE_LINK_NAME[kill] = "${base_bindir}/kill" |
| 239 | } | 138 | ALTERNATIVE_LINK_NAME[more] = "${base_bindir}/more" |
| 139 | ALTERNATIVE_LINK_NAME[reset] = "${base_bindir}/reset" | ||
| 140 | ALTERNATIVE_LINK_NAME[mkswap] = "${base_sbindir}/mkswap" | ||
| 141 | ALTERNATIVE_LINK_NAME[blockdev] = "${base_sbindir}/blockdev" | ||
| 142 | ALTERNATIVE_LINK_NAME[pivot_root] = "${base_sbindir}/pivot_root" | ||
| 143 | ALTERNATIVE_LINK_NAME[mkfs.minix] = "${base_sbindir}/mkfs.minix" | ||
| 240 | 144 | ||
| 241 | pkg_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 | } | 147 | ALTERNATIVE_PRIORITY[hwclock] = "10" |
| 148 | ALTERNATIVE_LINK_NAME[hwclock] = "${base_sbindir}/hwclock" | ||
| 244 | 149 | ||
| 245 | pkg_prerm_util-linux-agetty () { | 150 | ALTERNATIVE_util-linux-fdisk = "fdisk" |
| 246 | update-alternatives --remove getty agetty | 151 | ALTERNATIVE_LINK_NAME[fdisk] = "${base_sbindir}/fdisk" |
| 247 | } | ||
| 248 | 152 | ||
| 249 | pkg_postinst_util-linux-mount () { | 153 | ALTERNATIVE_util-linux-agetty = "getty" |
| 250 | update-alternatives --install ${base_bindir}/mount mount mount.${PN} 100 | 154 | ALTERNATIVE_LINK_NAME[getty] = "${base_sbindir}/getty" |
| 251 | } | 155 | ALTERNATIVE_TARGET[getty] = "${base_sbindir}/agetty" |
| 252 | 156 | ||
| 253 | pkg_prerm_util-linux-mount () { | 157 | ALTERNATIVE_util-linux-mount = "mount" |
| 254 | update-alternatives --remove mount mount.${PN} | 158 | ALTERNATIVE_LINK_NAME[mount] = "${base_bindir}/mount" |
| 255 | } | ||
| 256 | 159 | ||
| 257 | pkg_postinst_util-linux-umount () { | 160 | ALTERNATIVE_util-linux-umount = "umount" |
| 258 | update-alternatives --install ${base_bindir}/umount umount umount.${PN} 100 | 161 | ALTERNATIVE_LINK_NAME[umount] = "${base_bindir}/umount" |
| 259 | } | ||
| 260 | 162 | ||
| 261 | pkg_prerm_util-linux-umount () { | 163 | ALTERNATIVE_util-linux-losetup = "losetup" |
| 262 | update-alternatives --remove umount umount.${PN} | 164 | ALTERNATIVE_LINK_NAME[losetup] = "${base_sbindir}/losetup" |
| 263 | } | ||
| 264 | 165 | ||
| 265 | pkg_postinst_util-linux-losetup () { | 166 | ALTERNATIVE_util-linux-swaponoff = "swapoff swapon" |
| 266 | update-alternatives --install ${base_sbindir}/losetup losetup losetup.${PN} 100 | 167 | ALTERNATIVE_LINK_NAME[swapoff] = "${base_sbindir}/swapoff" |
| 267 | } | 168 | ALTERNATIVE_LINK_NAME[swapon] = "${base_sbindir}/swapon" |
| 268 | 169 | ||
| 269 | pkg_prerm_util-linux-losetup () { | 170 | ALTERNATIVE_util-linux-fsck = "fsck.minix fsck" |
| 270 | update-alternatives --remove losetup losetup.${PN} | 171 | ALTERNATIVE_LINK_NAME[fsck.minix] = "${base_sbindir}/fsck.minix" |
| 271 | } | 172 | ALTERNATIVE_LINK_NAME[fsck] = "${base_sbindir}/fsck" |
| 272 | |||
| 273 | pkg_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 | |||
| 278 | pkg_prerm_util-linux-swaponoff () { | ||
| 279 | update-alternatives --remove swapoff swapoff.${PN} | ||
| 280 | update-alternatives --remove swapon swapon.${PN} | ||
| 281 | } | ||
| 282 | |||
| 283 | pkg_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 | |||
| 288 | pkg_prerm_util-linux-fsck () { | ||
| 289 | update-alternatives --remove fsck.minix fsck.minix.${PN} | ||
| 290 | update-alternatives --remove fsck fsck.${PN} | ||
| 291 | } | ||
| 292 | 173 | ||
| 293 | pkg_postinst_util-linux-blkid () { | 174 | ALTERNATIVE_util-linux-blkid = "blkid" |
| 294 | update-alternatives --install ${base_sbindir}/blkid blkid blkid.${PN} 100 | 175 | ALTERNATIVE_LINK_NAME[blkid] = "${base_sbindir}/blkid" |
| 295 | } | ||
| 296 | |||
| 297 | pkg_prerm_util-linux-blkid () { | ||
| 298 | update-alternatives --remove blkid blkid.${PN} | ||
| 299 | } | ||
| 300 | 176 | ||
| 301 | BBCLASSEXTEND = "native" | 177 | BBCLASSEXTEND = "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 @@ | |||
| 1 | MAJOR_VERSION = "2.21" | 1 | MAJOR_VERSION = "2.21" |
| 2 | PR = "r0" | 2 | PR = "r1" |
| 3 | require util-linux.inc | 3 | require util-linux.inc |
| 4 | 4 | ||
| 5 | # note that `lscpu' is under GPLv3+ | 5 | # note that `lscpu' is under GPLv3+ |
