Changeset 2699

Show
Ignore:
Timestamp:
03/05/08 16:46:31 (9 months ago)
Author:
hollow
Message:

add openrc support to gentoo/initpost

Files:

Legend:

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

    r2674 r2699  
    5252 
    5353 
     54# check if we have openrc 
     55have_openrc=0 
     56$_CHROOT_SH testfile /lib/rc/bin/is_older_than && have_openrc=1 
     57 
     58 
    5459# gentoo initstyle magic 
    5560initstyle=sysv 
     
    6065 
    6166        $_CAT "$__DISTRIBDIR"/gentoo/init-vserver.sh | \ 
    62         $_CHROOT_SH truncate   /lib/rcscripts/sh/init-vserver.sh 
    63         $_CHROOT_SH chmod 0755 /lib/rcscripts/sh/init-vserver.sh 
     67        $_CHROOT_SH truncate   /lib/rc/sh/init-vserver.sh 
     68        $_CHROOT_SH chmod 0755 /lib/rc/sh/init-vserver.sh 
    6469 
    6570        $_CAT "$__DISTRIBDIR"/gentoo/reboot.sh | \ 
     
    8489# unneeded runlevel scripts 
    8590echo ">>> Fixing default runlevel scripts ... " 
    86 $_CHROOT_SH rm /etc/runlevels/boot/{clock,consolefont,keymaps,modules,net.lo} 2>/dev/null || : 
    87 $_CHROOT_SH rm /etc/runlevels/default/{hdparm,netmount} 2>/dev/null || : 
     91if test $have_openrc -ne 1; then 
     92        $_CHROOT_SH rm /etc/runlevels/boot/{clock,consolefont,keymaps,modules,net.lo} 2>/dev/null || : 
     93        $_CHROOT_SH rm /etc/runlevels/default/{hdparm,netmount} 2>/dev/null || : 
     94fi 
    8895 
    8996 
     
    9299        echo ">>> Setting hostname ... " 
    93100        chrootsed /etc/conf.d/hostname \ 
    94                 -e "s:HOSTNAME=\"\(.*\)\":HOSTNAME=\"$(< "$cfgdir"/uts/nodename)\":
     101                -e "s:\(HOSTNAME\)=\"\(.*\)\":\1=\"$(< "$cfgdir"/uts/nodename)\":i
    95102fi 
    96103 
     
    115122# fix fstab for checkfs/localmount in baselayout-2 
    116123# (does not affect any previous versions) 
    117 echo ">>> Fixing fstab ... " 
    118 echo "/dev/hdv1 / ufs defaults 0 0" | $_CHROOT_SH truncate /etc/fstab 
    119  
     124if test $have_openrc -ne 1; then 
     125        echo ">>> Fixing fstab ... " 
     126        echo "/dev/hdv1 / ufs defaults 0 0" | $_CHROOT_SH truncate /etc/fstab 
     127fi 
    120128 
    121129# always satisfy net dependency in baselayout-2 
    122130# (does not affect any previous versions) 
    123 echo ">>> Providing dummy net dependency ... " 
    124 $_CAT "$__DISTRIBDIR"/gentoo/net.vserver | \ 
    125 $_CHROOT_SH truncate /etc/init.d/net.vserver 
    126 $_CHROOT_SH chmod 0755 /etc/init.d/net.vserver 
    127 $_CHROOT_SH link /etc/init.d/net.vserver /etc/runlevels/boot/net.vserver 
     131if test $have_openrc -ne 1; then 
     132        echo ">>> Providing dummy net dependency ... " 
     133        $_CAT "$__DISTRIBDIR"/gentoo/net.vserver | \ 
     134        $_CHROOT_SH truncate /etc/init.d/net.vserver 
     135        $_CHROOT_SH chmod 0755 /etc/init.d/net.vserver 
     136        $_CHROOT_SH link /etc/init.d/net.vserver /etc/runlevels/boot/net.vserver 
     137fi 
    128138 
    129139popd &>/dev/null