Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 493178 - net-misc/openntpd-20080406-r6: Invalid cross-device link
Summary: net-misc/openntpd-20080406-r6: Invalid cross-device link
Status: RESOLVED FIXED
Alias: None
Product: Gentoo Linux
Classification: Unclassified
Component: [OLD] Server (show other bugs)
Hardware: All Linux
: Normal normal (vote)
Assignee: Christoph Junghans (RETIRED)
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2013-12-02 23:01 UTC by Lars Wendler (Polynomial-C) (RETIRED)
Modified: 2013-12-05 00:24 UTC (History)
0 users

See Also:
Package list:
Runtime testing required: ---


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Lars Wendler (Polynomial-C) (RETIRED) gentoo-dev 2013-12-02 23:01:46 UTC
Hardlinks cannot be established over device/partition boundaries:

>>> Original instance of package unmerged safely.
ln: failed to create hard link ‘/var/lib/openntpd/chroot/etc/localtime’ => ‘/etc/localtime’: Invalid cross-device link
 * ERROR: net-misc/openntpd-20080406-r6::gentoo failed (postinst phase):
 *   (no error message)
 * 
 * Call stack:
 *     ebuild.sh, line  93:  Called pkg_postinst
 *   environment, line 2864:  Called die
 * The specific snippet of code:
 *       ln /etc/localtime "${NTP_HOME}"/etc/localtime || die;
 * 
 * If you need support, post the output of `emerge --info '=net-misc/openntpd-20080406-r6::gentoo'`,
 * the complete build log and the output of `emerge -pqv '=net-misc/openntpd-20080406-r6::gentoo'`.
 * The complete build log is located at '/var/tmp/portage/net-misc/openntpd-20080406-r6/temp/build.log'.
 * The ebuild environment file is located at '/var/tmp/portage/net-misc/openntpd-20080406-r6/temp/environment'.
 * Working directory: '/usr/lib64/portage/pym'
 * S: '/var/tmp/portage/net-misc/openntpd-20080406-r6/work/openntpd-20080406p'
!!! FAILED postinst: 1



In this case /var is a separate partition.
Comment 1 Christoph Junghans (RETIRED) gentoo-dev 2013-12-03 10:45:21 UTC
How do you like something like this?

--- /var/lib/overlays/gentoo-x86/net-misc/openntpd/openntpd-20080406-r6.ebuild	2013-12-03 03:05:01.457058687 -0700
+++ openntpd-20080406-r6.ebuild	2013-12-03 03:05:00.577494086 -0700
@@ -74,11 +74,20 @@
 	systemd_newunit "${FILESDIR}/${PN}.service-${PV}-r3" ntpd.service
 }
 
+pkg_config() {
+	if ! ln /etc/localtime "${EROOT}${NTP_HOME}"/etc/localtime ; then
+		cp /etc/localtime "${EROOT}${NTP_HOME}"/etc/localtime || die
+		einfo "We could not create a hardlink from /etc/localtime to ${NTP_HOME}/etc/localtime,"
+		einfo "so please run 'emerge --config =${CATEGORY}/${PF}' whenever you changed"
+		einfo "your timezone."
+	fi
+}
+
 pkg_postinst() {
 	# remove localtime file from previous installations
 	rm -f "${EROOT}${NTP_HOME}"/etc/localtime
-	mkdir -p "${NTP_HOME}"/etc
-	ln /etc/localtime "${NTP_HOME}"/etc/localtime || die
+	mkdir -p "${EROOT}${NTP_HOME}"/etc
+	pkg_config
 	chown -R root:root "${EROOT}${NTP_HOME}" || die
 
 	use syslog && [[ -f ${EROOT}/var/log/ntpd.log ]] && \
Comment 2 Lars Wendler (Polynomial-C) (RETIRED) gentoo-dev 2013-12-04 06:42:40 UTC
Looks good.
Comment 3 Christoph Junghans (RETIRED) gentoo-dev 2013-12-05 00:24:40 UTC
+  05 Dec 2013; Christoph Junghans <ottxor@gentoo.org>
+  openntpd-20080406-r6.ebuild:
+  fixed cross-device link issue (bug #493178)
+