diff options
Diffstat (limited to 'src/initramfs/distro-specs/rhel/functions-default')
-rw-r--r-- | src/initramfs/distro-specs/rhel/functions-default | 35 |
1 files changed, 29 insertions, 6 deletions
diff --git a/src/initramfs/distro-specs/rhel/functions-default b/src/initramfs/distro-specs/rhel/functions-default index 51e45af6..570c63f1 100644 --- a/src/initramfs/distro-specs/rhel/functions-default +++ b/src/initramfs/distro-specs/rhel/functions-default @@ -26,7 +26,8 @@ D_RODIRSINRW="/etc/bootsplash /etc/gconf /var/adm /var/lib/texmf /var/lib/rpm \ /var/cache/fontconfig" D_DIRINDXS="/var/lib/rpm /var/lib/nobody /var/lib/alternatives/ /var/db/nscd \ /var/lib/bluetooth /var/lib/scrollkeeper /var/lib/nfs/sm /var/lib/nfs/sm.bak \ -/var/lib/misc /var/spool/cron" +/var/lib/nfs/rpc_pipefs /mnt/var/lib/nfs/statd /var/run/netreport /var/lib/misc \ +/var/spool/cron" # empty functions are defined at the beginning of /etc/functions @@ -46,13 +47,36 @@ config_distro () { -e "s/kernel.sysrq =.*/kernel.sysrq = 1/" -i /mnt/etc/sysctl.conf # set some networking stuff if needed [ -e /mnt/etc/sysconfig/network ] && \ - sed -e "s/HOSTNAME=.*/HOSTNAME=$host_name/" \ + sed -e "s/HOSTNAME=.*/HOSTNAME=$host_name.$domain/" \ -e "s/GATEWAY=.*/GATEWAY=$gateway/" -i /mnt/etc/sysconfig/network + [ -e /mnt/etc/init.d/functions ] && \ + sed -i "s,\(^__sed_discard_ignored_files.*\.rpmsave\)\(.*\),\1\\\|-eth0\2,"\ + /mnt/etc/init.d/functions + testmkd /var/lib/nfs/rpc_pipefs + /mnt/var/lib/nfs/statd 700 rpcuser:rpcuser + /var/run/netreport +# Create IP configurations + ## no grep -B 1 in busybox + #IFACES=$(ip a \ + # | grep -B 1 "/ether" \ + # | sed -r '/^--$/d;$!N;s#^[0-9]+: ([a-z0-9\.:]+): .*?/ether ([0-9a-fA-F:]+) .*$#\1=\2#') + IFS=$(ip a \ + | awk '/^[0-9]+: /,/ brd /' \ + | sed -r '$!N;s,\n,,' \ + | grep -o '.*/ether .*' \ + | sed -r 's#^[0-9]+: ([a-z0-9\.:]+): .*?/ether ([0-9a-fA-F:]+) .*$#\1=\2#') + for line in $IFS; do + IF=$(echo $line | cut -d= -f1) + IFMAC=$(echo $line | cut -d= -f2) + cat << EOF > "/mnt/etc/sysconfig/network-scripts/ifcfg-$IFACE" +DEVICE=$IF +HWADDR=$IFMAC +BOOTPROTO=dhcp +ONBOOT=no +EOF +done # check for inittab file #test -f /mnt/etc/inittab || error "$df_erritab" - -# for screen sessions -testmkd /mnt/var/run/uscreens 4777 } # initial (boot time) runlevel scripts @@ -313,4 +337,3 @@ rerun\n# the mkdxsinitrd script to get them applied\n\ esac } - |