summaryrefslogtreecommitdiffstats
path: root/src/initramfs/distro-specs/scientific/functions-default
diff options
context:
space:
mode:
Diffstat (limited to 'src/initramfs/distro-specs/scientific/functions-default')
-rw-r--r--src/initramfs/distro-specs/scientific/functions-default32
1 files changed, 29 insertions, 3 deletions
diff --git a/src/initramfs/distro-specs/scientific/functions-default b/src/initramfs/distro-specs/scientific/functions-default
index 4f8aa7de..264c1778 100644
--- a/src/initramfs/distro-specs/scientific/functions-default
+++ b/src/initramfs/distro-specs/scientific/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,8 +47,34 @@ 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"
}
@@ -310,4 +337,3 @@ rerun\n# the mkdxsinitrd script to get them applied\n\
esac
}
-