diff options
author | John Bowler <jbowler@nslu2-linux.org> | 2006-01-27 08:35:49 +0000 |
---|---|---|
committer | OpenEmbedded Project <openembedded-devel@lists.openembedded.org> | 2006-01-27 08:35:49 +0000 |
commit | 0b568d6b027b97ee39f105fafd213a5660937481 (patch) | |
tree | 1c813001f7c4da9d33694ad1a1c4d269bc492742 | |
parent | 22e79a194485ecef5e5a7f6032e4debd94fffaa0 (diff) |
util-linux: split out umount/swap/losetup commands in all
- There already was a separate package for 'mount', there are now
packages for umount, swaponoff and losetup - i.e. all the 'mount'
tools except pivot_root. To ensure backward compatibility
util-linux (the main package) RDEPENDS on the new packages.
-rw-r--r-- | packages/util-linux/util-linux.inc | 82 | ||||
-rw-r--r-- | packages/util-linux/util-linux_2.12.bb | 2 | ||||
-rw-r--r-- | packages/util-linux/util-linux_2.12o.bb | 2 | ||||
-rw-r--r-- | packages/util-linux/util-linux_2.12q.bb | 2 | ||||
-rw-r--r-- | packages/util-linux/util-linux_2.12r.bb | 2 |
5 files changed, 70 insertions, 20 deletions
diff --git a/packages/util-linux/util-linux.inc b/packages/util-linux/util-linux.inc index 28e726bddc..21af53cab6 100644 --- a/packages/util-linux/util-linux.inc +++ b/packages/util-linux/util-linux.inc @@ -13,15 +13,21 @@ SRC_URI = "ftp://ftp.kernel.org/pub/linux/utils/util-linux/util-linux-${PV}.tar. file://fdiskbsdlabel_thumb.diff;patch=1 \ file://defines.h" -PACKAGES_prepend = "util-linux-fdisk util-linux-cfdisk util-linux-sfdisk util-linux-mount util-linux-readprofile " +PACKAGES_prepend = "util-linux-fdisk util-linux-cfdisk util-linux-sfdisk util-linux-swaponoff util-linux-losetup util-linux-umount util-linux-mount util-linux-readprofile " + +FILES_${PN}-doc += "/usr/share/misc/getopt/getopt-*.*" FILES_util-linux-fdisk = "/sbin/fdisk.${PN}" FILES_util-linux-cfdisk = "/sbin/cfdisk" FILES_util-linux-sfdisk = "/sbin/sfdisk" +FILES_util-linux-swaponoff = "/sbin/swapon.${PN} /sbin/swapoff.${PN}" +FILES_util-linux-losetup = "/sbin/losetup.${PN}" FILES_util-linux-mount = "/bin/mount.${PN}" +FILES_util-linux-umount = "/bin/umount.${PN}" FILES_util-linux-readprofile = "/usr/sbin/readprofile" RRECOMMENDS_${PN} = "util-linux-fdisk util-linux-cfdisk util-linux-sfdisk util-linux-mount util-linux-readprofile " +RDEPENDS_${PN} = "util-linux-umount util-linux-swaponoff util-linux-losetup" do_compile () { set -e @@ -34,6 +40,29 @@ do_compile () { 'LDFLAGS=${LDFLAGS}' } +checklink() { + local targ link value + targ="$1" + link="$2" + ext="$3" + if test -h "$link" + then + value="$(readlink "$link")" + if test "$value" = "$targ" + then + rm "$link" + ln -s "$targ"."${PN}" "$link$ext" + return 0 + else + echo "$link: '$value' found '$targ' expected" >&2 + return 1 + fi + else + echo "$link: not a symbolic link" >&2 + return 1 + fi +} + do_install () { # with ccache the timestamps on compiled files may # end up earlier than on their inputs, this allows @@ -45,17 +74,11 @@ do_install () { mv ${D}${base_bindir}/dmesg ${D}${base_bindir}/dmesg.${PN} mv ${D}${base_bindir}/kill ${D}${base_bindir}/kill.${PN} mv ${D}${base_bindir}/more ${D}${base_bindir}/more.${PN} - mv ${D}${base_bindir}/umount ${D}${base_bindir}/umount.${PN} - mv ${D}${base_sbindir}/halt ${D}${base_sbindir}/halt.${PN} mv ${D}${base_sbindir}/hwclock ${D}${base_sbindir}/hwclock.${PN} - mv ${D}${base_sbindir}/losetup ${D}${base_sbindir}/losetup.${PN} mv ${D}${base_sbindir}/mkswap ${D}${base_sbindir}/mkswap.${PN} mv ${D}${base_sbindir}/pivot_root ${D}${base_sbindir}/pivot_root.${PN} - mv ${D}${base_sbindir}/reboot ${D}${base_sbindir}/reboot.${PN} mv ${D}${base_sbindir}/shutdown ${D}${base_sbindir}/shutdown.${PN} mv ${D}${base_sbindir}/sln ${D}${base_sbindir}/sln.${PN} - mv ${D}${base_sbindir}/swapoff ${D}${base_sbindir}/swapoff.${PN} - mv ${D}${base_sbindir}/swapon ${D}${base_sbindir}/swapon.${PN} mv ${D}${bindir}/hexdump ${D}${bindir}/hexdump.${PN} mv ${D}${bindir}/last ${D}${bindir}/last.${PN} mv ${D}${bindir}/logger ${D}${bindir}/logger.${PN} @@ -63,21 +86,26 @@ do_install () { mv ${D}${bindir}/renice ${D}${bindir}/renice.${PN} mv ${D}${bindir}/wall ${D}${bindir}/wall.${PN} + mv ${D}${base_sbindir}/losetup ${D}${base_sbindir}/losetup.${PN} + mv ${D}${base_sbindir}/swapon ${D}${base_sbindir}/swapon.${PN} + mv ${D}${base_bindir}/umount ${D}${base_bindir}/umount.${PN} mv ${D}${base_bindir}/mount ${D}${base_bindir}/mount.${PN} mv ${D}${base_sbindir}/fdisk ${D}${base_sbindir}/fdisk.${PN} + + checklink swapon ${D}${base_sbindir}/swapoff ".${PN}" + checklink shutdown ${D}${base_sbindir}/reboot ".${PN}" + checklink shutdown ${D}${base_sbindir}/halt ".${PN}" + checklink shutdown ${D}${base_sbindir}/fastboot "" + checklink shutdown ${D}${base_sbindir}/fasthalt "" } pkg_postinst_${PN} () { update-alternatives --install ${base_bindir}/dmesg dmesg dmesg.${PN} 100 update-alternatives --install ${base_bindir}/kill kill kill.${PN} 100 update-alternatives --install ${base_bindir}/more more more.${PN} 100 - update-alternatives --install ${base_bindir}/umount umount umount.${PN} 100 - update-alternatives --install ${base_sbindir}/losetup losetup losetup.${PN} 100 update-alternatives --install ${base_sbindir}/mkswap mkswap mkswap.${PN} 100 update-alternatives --install ${base_sbindir}/pivot_root pivot_root pivot_root.${PN} 100 update-alternatives --install ${base_sbindir}/sln sln sln.${PN} 100 - update-alternatives --install ${base_sbindir}/swapoff swapoff swapoff.${PN} 100 - update-alternatives --install ${base_sbindir}/swapon swapon swapon.${PN} 100 update-alternatives --install ${bindir}/hexdump hexdump hexdump.${PN} 100 update-alternatives --install ${bindir}/last last last.${PN} 100 update-alternatives --install ${bindir}/logger logger logger.${PN} 100 @@ -97,17 +125,13 @@ pkg_prerm_${PN} () { update-alternatives --remove dmesg dmesg.${PN} update-alternatives --remove kill kill.${PN} update-alternatives --remove more more.${PN} - update-alternatives --remove umount umount.${PN} update-alternatives --remove halt halt.${PN} update-alternatives --remove hwclock hwclock.${PN} - update-alternatives --remove losetup losetup.${PN} update-alternatives --remove mkswap mkswap.${PN} update-alternatives --remove pivot_root pivot_root.${PN} update-alternatives --remove reboot reboot.${PN} update-alternatives --remove shutdown shutdown.${PN} update-alternatives --remove sln sln.${PN} - update-alternatives --remove swapoff swapoff.${PN} - update-alternatives --remove swapon swapon.${PN} update-alternatives --remove hexdump hexdump.${PN} update-alternatives --remove last last.${PN} update-alternatives --remove logger logger.${PN} @@ -130,4 +154,30 @@ pkg_postinst_util-linux-mount () { pkg_prerm_util-linux-mount () { update-alternatives --remove mount mount.${PN} -}
\ No newline at end of file +} + +pkg_postinst_util-linux-umount () { + update-alternatives --install ${base_bindir}/umount umount umount.${PN} 100 +} + +pkg_prerm_util-linux-umount () { + update-alternatives --remove umount umount.${PN} +} + +pkg_postinst_util-linux-losetup () { + update-alternatives --install ${base_sbindir}/losetup losetup losetup.${PN} 100 +} + +pkg_prerm_util-linux-losetup () { + update-alternatives --remove losetup losetup.${PN} +} + +pkg_postinst_util-linux-swaponoff () { + update-alternatives --install ${base_sbindir}/swapoff swapoff swapoff.${PN} 100 + update-alternatives --install ${base_sbindir}/swapon swapon swapon.${PN} 100 +} + +pkg_prerm_util-linux-swaponoff () { + update-alternatives --remove swapoff swapoff.${PN} + update-alternatives --remove swapon swapon.${PN} +} diff --git a/packages/util-linux/util-linux_2.12.bb b/packages/util-linux/util-linux_2.12.bb index 2f3aea33cf..77323de5b8 100644 --- a/packages/util-linux/util-linux_2.12.bb +++ b/packages/util-linux/util-linux_2.12.bb @@ -1,4 +1,4 @@ -PR = "r1" +PR = "r2" include util-linux.inc diff --git a/packages/util-linux/util-linux_2.12o.bb b/packages/util-linux/util-linux_2.12o.bb index 9c28d316f8..7a27192f90 100644 --- a/packages/util-linux/util-linux_2.12o.bb +++ b/packages/util-linux/util-linux_2.12o.bb @@ -1,3 +1,3 @@ include util-linux.inc -PR = "r4" +PR = "r5" diff --git a/packages/util-linux/util-linux_2.12q.bb b/packages/util-linux/util-linux_2.12q.bb index 0d05b8b4ca..0603b993ce 100644 --- a/packages/util-linux/util-linux_2.12q.bb +++ b/packages/util-linux/util-linux_2.12q.bb @@ -4,4 +4,4 @@ ARM_INSTRUCTION_SET = "arm" include util-linux.inc -PR = "r3" +PR = "r4" diff --git a/packages/util-linux/util-linux_2.12r.bb b/packages/util-linux/util-linux_2.12r.bb index 9c28d316f8..7a27192f90 100644 --- a/packages/util-linux/util-linux_2.12r.bb +++ b/packages/util-linux/util-linux_2.12r.bb @@ -1,3 +1,3 @@ include util-linux.inc -PR = "r4" +PR = "r5" |