From: olafmersmann <olafmersmann@users.noreply.github.com>
To: ml@inbox.vuxu.org
Subject: Re: [PR PATCH] [Updated] shutils/chroot.sh: create symlink for /etc/localtime
Date: Fri, 15 Jan 2021 00:00:25 +0100 [thread overview]
Message-ID: <20210114230025.SpJQwciHpOVaTfnloRaqUv8F0hunJDrNE0bReHix4is@z> (raw)
In-Reply-To: <gh-mailinglist-notifications-41a7ca26-5023-4802-975b-f1789d68868e-void-packages-27803@inbox.vuxu.org>
[-- Attachment #1: Type: text/plain, Size: 751 bytes --]
There is an updated pull request by olafmersmann against master on the void-packages repository
https://github.com/olafmersmann/void-packages feat_localtime
https://github.com/void-linux/void-packages/pull/27803
shutils/chroot.sh: create symlink for /etc/localtime
Currently /etc/localtime is copied from the host to the chroot.
According to [1] /etc/localtime should be a symlink and some R checks
fail because it is not. Instead of copying, this commit resolves the
symlink, creates the required file below /usr/share/zoneinfo and then
symlinks it to /etc/localtime inside the chroot.
[1]: https://www.freedesktop.org/software/systemd/man/localtime.html
A patch file from https://github.com/void-linux/void-packages/pull/27803.patch is attached
[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #2: github-pr-feat_localtime-27803.patch --]
[-- Type: text/x-diff, Size: 1733 bytes --]
From 3b39825a13dc6909200ff0d27096c60b3760c067 Mon Sep 17 00:00:00 2001
From: Olaf Mersmann <olafm@p-value.net>
Date: Sun, 10 Jan 2021 09:24:40 +0100
Subject: [PATCH] shutils/chroot.sh: create symlink for /etc/localtime
Currently /etc/localtime is copied from the host to the chroot. Some
software expects /etc/localtime to be a symbolic link it can read to
determine the name of the time zone, so set up the expected link
structure.
---
common/xbps-src/shutils/chroot.sh | 16 +++++++++++-----
1 file changed, 11 insertions(+), 5 deletions(-)
diff --git a/common/xbps-src/shutils/chroot.sh b/common/xbps-src/shutils/chroot.sh
index 8646d758549..73b98bc7200 100644
--- a/common/xbps-src/shutils/chroot.sh
+++ b/common/xbps-src/shutils/chroot.sh
@@ -106,11 +106,17 @@ chroot_prepare() {
msg_error "Bootstrap not installed in $XBPS_MASTERDIR, can't continue.\n"
fi
- # Create some required files.
- if [ -f /etc/localtime ]; then
- cp -f /etc/localtime $XBPS_MASTERDIR/etc
- elif [ -f /usr/share/zoneinfo/UTC ]; then
- cp -f /usr/share/zoneinfo/UTC $XBPS_MASTERDIR/etc/localtime
+ # Some software expects /etc/localtime to be a symbolic link it can read to
+ # determine the name of the time zone, so set up the expected link
+ # structure.
+ if [ -f /usr/share/zoneinfo/UTC ]; then
+ tzfile=/usr/share/zoneinfo/UTC
+ mkdir -p $XBPS_MASTERDIR/usr/share/zoneinfo
+ cp /usr/share/zoneinfo/UTC $XBPS_MASTERDIR/usr/share/zoneinfo/UTC
+ ln -sf ../usr/share/zoneinfo/UTC $XBPS_MASTERDIR/etc/localtime
+ else
+ # Should never happen.
+ msg_warn "No local timezone configuration file created."
fi
for f in dev sys proc host boot; do
next prev parent reply other threads:[~2021-01-14 23:00 UTC|newest]
Thread overview: 11+ messages / expand[flat|nested] mbox.gz Atom feed top
2021-01-10 8:37 [PR PATCH] " olafmersmann
2021-01-10 11:29 ` [PR REVIEW] " sgn
2021-01-10 15:15 ` olafmersmann
2021-01-10 15:35 ` [PR PATCH] [Updated] " olafmersmann
2021-01-14 13:50 ` ahesford
2021-01-14 14:06 ` [PR REVIEW] " ahesford
2021-01-14 22:51 ` olafmersmann
2021-01-14 22:59 ` olafmersmann
2021-01-14 23:00 ` olafmersmann [this message]
2021-01-14 23:03 ` olafmersmann
2021-01-20 1:13 ` [PR PATCH] [Merged]: " ericonr
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20210114230025.SpJQwciHpOVaTfnloRaqUv8F0hunJDrNE0bReHix4is@z \
--to=olafmersmann@users.noreply.github.com \
--cc=ml@inbox.vuxu.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).