Changeset 2465

Show
Ignore:
Timestamp:
01/20/07 18:31:44 (2 years ago)
Author:
hollow
Message:

fix runlevel scripts for older baselayouts too; set hostname inside the guest

Files:

Legend:

Unmodified
Added
Removed
Modified
Copied
Moved
  • trunk/distrib/gentoo/initpost

    r2366 r2465  
    1818## Called as: initpost <cfgdir> <path of util-vserver-vars> 
    1919 
    20 vdir="$1"/vdir 
     20cfgdir="$1" 
     21vdir="$cfgdir"/vdir 
    2122. "$2" 
    2223 
     
    3031# gentoo initstyle magic 
    3132initstyle=sysv 
    32 test -e "$1"/apps/init/style && initstyle=$(<"$1"/apps/init/style) 
     33test -e "$cfgdir"/apps/init/style && initstyle=$(<"$cfgdir"/apps/init/style) 
    3334 
    3435if test "$initstyle" == "gentoo"; then 
     
    5253        echo "!!!" 
    5354fi 
     55 
     56 
     57# unneeded runlevel scripts 
     58pushd "$vdir" &>/dev/null 
     59echo ">>> Fixing default runlevel scripts ... " 
     60$_CHROOT_SH rm /etc/runlevels/boot/{clock,consolefont,keymaps,modules,net.lo} 2>/dev/null || : 
     61$_CHROOT_SH rm /etc/runlevels/default/{hdparm,netmount} 2>/dev/null || : 
     62popd &>/dev/null 
     63 
     64 
     65# setting hostname 
     66pushd "$vdir" &>/dev/null 
     67 
     68if test -r "$cfgdir"/uts/nodename && $_CHROOT_SH testfile /etc/conf.d/hostname; then 
     69        echo ">>> Setting hostname ... " 
     70        hostnametmp=$($_MKTEMP hostname.XXXXXX) 
     71 
     72        $_CHROOT_SH cat /etc/conf.d/hostname | \ 
     73        $_SED "s:HOSTNAME=\"\(.*\)\":HOSTNAME=\"$(< "$cfgdir"/uts/nodename)\":" > $hostnametmp 
     74        $_CHROOT_SH truncate /etc/conf.d/hostname  < $hostnametmp 
     75 
     76        $_RM -f $hostnametmp 
     77fi 
     78 
     79popd &>/dev/null 
    5480 
    5581 
     
    89115 
    90116 
    91 # unneeded runlevel scripts 
    92 pushd "$vdir" &>/dev/null 
    93 echo ">>> Fixing default runlevel scripts ... " 
    94 $_CHROOT_SH rm /etc/runlevels/boot/{clock,consolefont,keymaps,modules,net.lo} 2>/dev/null || : 
    95 $_CHROOT_SH rm /etc/runlevels/default/{hdparm,netmount} 2>/dev/null || : 
    96 popd &>/dev/null 
    97  
    98  
    99117# fix fstab for checkfs/localmount 
    100118pushd "$vdir" &>/dev/null