Merge branch 'upstream'
[automated-distro-installer] / fai / config / hooks / repository.ROCKY
diff --git a/fai/config/hooks/repository.ROCKY b/fai/config/hooks/repository.ROCKY
new file mode 100755 (executable)
index 0000000..32e53c3
--- /dev/null
@@ -0,0 +1,27 @@
+#! /bin/bash
+
+# (c) Michael Goetze, 2010-2011, mgoetze@mgoetze.net
+
+error=0; trap 'error=$(($?>$error?$?:$error))' ERR # save maximum error code
+
+if [ $FAI_ACTION = "install" ]; then
+    ctam
+    [ -L $target/etc/mtab ] || cp /etc/mtab $target/etc/mtab
+
+    cat > $target/etc/sysconfig/network <<-EOF
+               NETWORKING=yes
+               HOSTNAME=$HOSTNAME.$DOMAIN
+               EOF
+    echo "127.0.0.1 localhost" > $target/etc/hosts
+    ifclass DHCPC || ainsl -s /etc/hosts "$IPADDR $HOSTNAME.$DOMAIN $HOSTNAME"
+    cp /etc/resolv.conf $target/etc
+fi
+
+fcopy -riv /etc/yum.repos.d/
+
+# disable the fastestmirror plugin
+#fai-sed 's/enabled=1/enabled=0/' /etc/yum/pluginconf.d/fastestmirror.conf
+
+skiptask repository
+
+exit $error