]> git.ipfire.org Git - thirdparty/dracut.git/commitdiff
Get rid of hostname utility
authorPhilippe Seewer <philippe.seewer@bfh.ch>
Thu, 17 Sep 2009 15:16:44 +0000 (17:16 +0200)
committerHarald Hoyer <harald@redhat.com>
Tue, 6 Oct 2009 13:14:04 +0000 (15:14 +0200)
dracut doesn't really need a utility to set the hostname. It only
saves a few ks of space, but every bit is good.

modules.d/40network/dhclient-script
modules.d/40network/ifup
modules.d/40network/install

index f739d8d8a20a2b1e1f98bfd418a5d6f139099b3a..54ec2f568b3a7a95b07ab0eeaa8090ef9b4c9c08 100755 (executable)
@@ -39,7 +39,7 @@ setup_interface() {
        done
     fi >> /tmp/resolv.conf
 
-    [ -n "$hostname" ] && echo hostname $hostname > /tmp/net.$netif.hostname
+    [ -n "$hostname" ] && echo "echo $hostname > /proc/sys/kernel/hostname" > /tmp/net.$netif.hostname
 }
 
 PATH=$PATH:/sbin:/usr/sbin
index dd45800d760bc15584544e51503a35eaffd4760d..419c2ca61fef9a9d05e095040a765ccc7a3de740 100755 (executable)
@@ -40,7 +40,7 @@ do_static() {
     } > /tmp/net.$netif.up
 
     [ -n "$gw" ] && echo ip route add default via $gw dev $netif > /tmp/net.$netif.gw
-    [ -n "$hostname" ] && echo hostname $hostname > /tmp/net.$netif.hostname
+    [ -n "$hostname" ] && echo "echo $hostname > /proc/sys/kernel/hostname" > /tmp/net.$netif.hostname
 
     echo online > /sys/class/net/$netif/uevent
     /sbin/initqueue --onetime --name netroot-$netif  /sbin/netroot $netif 
index 91288a9cdd280798ec459316508625485d877e14..c16848d09beee92bd0f9a34b8f3a9430ad8d91fc 100755 (executable)
@@ -1,5 +1,5 @@
 #!/bin/bash
-dracut_install ip dhclient hostname brctl
+dracut_install ip dhclient brctl
 inst "$moddir/ifup" "/sbin/ifup"
 inst "$moddir/netroot" "/sbin/netroot"
 inst "$moddir/dhclient-script" "/sbin/dhclient-script"