add hostname to rc.sysinit and add broadcast to rc.conf

This commit is contained in:
Tobias Powalowski 2011-06-10 14:42:03 +02:00
parent 480af43e64
commit 31d9310826
2 changed files with 17 additions and 1 deletions

View file

@ -53,12 +53,14 @@ HOSTNAME="archboot"
# - interface: name of device (required)
# - address: IP address (leave blank for DHCP)
# - netmask: subnet mask (ignored for DHCP)
# - broadcast: broadcast address (ignored for DHCP) (optional)
# - gateway: default route (ignored for DHCP)
#
# Static IP example
# interface=eth0
# address=192.168.0.2
# netmask=255.255.255.0
# broadcast=192.168.0.255
# gateway=192.168.0.1
#
# DHCP example
@ -70,6 +72,7 @@ HOSTNAME="archboot"
interface=
address=
netmask=
broadcast=
gateway=
# Setting this to "yes" will skip network shutdown.

View file

@ -21,7 +21,20 @@ run_hook sysinit_start
[[ -d /sys/class/net/lo ]] && \
status "Bringing up loopback interface" /sbin/ifconfig lo 127.0.0.1 up
/bin/dmesg >| /var/log/dmesg.log
if [[ $HOSTNAME ]]; then
stat_busy "Setting Hostname: $HOSTNAME"
echo $HOSTNAME > /proc/sys/kernel/hostname
stat_done
fi
if [[ -e /proc/sys/kernel/dmesg_restrict && $(< /proc/sys/kernel/dmesg_restrict) -eq 1 ]]; then
: >| /var/log/dmesg.log
chmod 600 /var/log/dmesg.log
else
: >| /var/log/dmesg.log
chmod 644 /var/log/dmesg.log
fi
dmesg >| /var/log/dmesg.log
# Load sysctl variables if sysctl.conf is present
[[ -r /etc/sysctl.conf ]] && /sbin/sysctl -q -p &>/dev/null