From a9ffc483b60f481bf4a8ba858f1c18f7b64bd5ad Mon Sep 17 00:00:00 2001 From: Tom Gundersen Date: Thu, 27 Sep 2012 19:51:51 +0200 Subject: hostname: set very early Also properly check for the deprecated use of rc.conf for this purpose, as we were getting lots of false positives. Signed-off-by: Tom Gundersen --- rc.sysinit | 23 ++++++++++++----------- 1 file changed, 12 insertions(+), 11 deletions(-) diff --git a/rc.sysinit b/rc.sysinit index b285cc7..458bac6 100755 --- a/rc.sysinit +++ b/rc.sysinit @@ -3,9 +3,21 @@ # /etc/rc.sysinit # +unset HOSTNAME + . /etc/rc.conf . /etc/rc.d/functions +if [[ $HOSTNAME ]]; then + print_depr "HOSTNAME=" "rc.conf(5) and hostname(5)" +fi +if [[ -s /etc/hostname ]]; then + HOSTNAME=$(< /etc/hostname) +fi +if [[ $HOSTNAME ]]; then + echo "$HOSTNAME" >| /proc/sys/kernel/hostname +fi + # don't let all the systemd tools be too verbose export SYSTEMD_LOG_LEVEL="notice" @@ -137,17 +149,6 @@ status 'Initializing random seed' /usr/lib/systemd/systemd-random-seed load # Remove leftover files remove_leftover -if [[ $HOSTNAME ]]; then - print_depr "HOSTNAME=" "rc.conf(5) and hostname(5)" -fi -if [[ -s /etc/hostname ]]; then - HOSTNAME=$(< /etc/hostname) -fi -if [[ $HOSTNAME ]]; then - stat_busy "Setting hostname: $HOSTNAME" - echo "$HOSTNAME" >| /proc/sys/kernel/hostname && stat_done || stat_fail -fi - stat_busy "Saving dmesg log" if [[ -e /proc/sys/kernel/dmesg_restrict ]] && (( $(< /proc/sys/kernel/dmesg_restrict) == 1 )); then -- cgit v1.2.2 From 9ef15b0091e7869937f91c8d2ae5f9475fbe4d70 Mon Sep 17 00:00:00 2001 From: Tom Gundersen Date: Tue, 2 Oct 2012 23:17:09 +0200 Subject: hostname: don't try to set before /proc is mounted No idea how I did not spot this obvious bug. [tomegun: note to self, I didn't spot the bug because it is only a problem when not booting with an initramfs...] Fixes: FS#31765 Signed-off-by: Tom Gundersen --- rc.sysinit | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/rc.sysinit b/rc.sysinit index 458bac6..e18456e 100755 --- a/rc.sysinit +++ b/rc.sysinit @@ -14,9 +14,6 @@ fi if [[ -s /etc/hostname ]]; then HOSTNAME=$(< /etc/hostname) fi -if [[ $HOSTNAME ]]; then - echo "$HOSTNAME" >| /proc/sys/kernel/hostname -fi # don't let all the systemd tools be too verbose export SYSTEMD_LOG_LEVEL="notice" @@ -46,6 +43,11 @@ bootlogd -p /run/bootlogd.pid run_hook sysinit_start +if [[ $HOSTNAME ]]; then + stat_busy "Setting hostname: $HOSTNAME" + echo "$HOSTNAME" >| /proc/sys/kernel/hostname && stat_done || stat_fail +fi + HWCLOCK_PARAMS="--systz" if [[ $HARDWARECLOCK ]]; then -- cgit v1.2.2 From 1ef1701df3e156ac67af827ff9b5139c3b8512c3 Mon Sep 17 00:00:00 2001 From: Tom Gundersen Date: Thu, 4 Oct 2012 01:15:38 +0200 Subject: PKGBUILD: update dependencies This reflects the mainline PKGBUILD. Depend on systemd, rather than systemd-tools and only optdepend on sysvinit. --- PKGBUILD | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/PKGBUILD b/PKGBUILD index 7f0e845..7a11d4b 100644 --- a/PKGBUILD +++ b/PKGBUILD @@ -11,12 +11,13 @@ provides=('initscripts=9999') replaces=('initscripts-systemd') backup=(etc/inittab etc/rc.conf etc/rc.local etc/rc.local.shutdown) makedepends=('asciidoc') -depends=('glibc' 'bash' 'coreutils' 'systemd-tools' 'iproute2' - 'ncurses' 'kbd' 'findutils' 'sysvinit') +depends=('glibc' 'bash' 'coreutils' 'systemd' 'iproute2' + 'ncurses' 'kbd' 'findutils') optdepends=('net-tools: legacy networking support' 'bridge-utils: Network bridging support' 'dhcpcd: DHCP network configuration' - 'wireless_tools: Wireless networking') + 'wireless_tools: Wireless networking' + 'sysvinit: Legacy init support') source=() sha256sums=() -- cgit v1.2.2