summaryrefslogtreecommitdiff
path: root/data/live-build-config/hooks/08-sysconf.chroot
diff options
context:
space:
mode:
authorDaniil Baturin <daniil@baturin.org>2016-02-03 10:22:22 -0500
committerDaniil Baturin <daniil@baturin.org>2016-02-03 10:22:22 -0500
commit9e49a104fdebf1778acda324d036aa9a70e3793f (patch)
treee99d7976762f7b8feebe57b3364f01262c7789c1 /data/live-build-config/hooks/08-sysconf.chroot
parent2b7a2bff886626e9a34966dec07b7010a97a76ba (diff)
parentab3d92de1b23654730c8d317a376bfc6301e92c7 (diff)
downloadvyos-build-9e49a104fdebf1778acda324d036aa9a70e3793f.tar.gz
vyos-build-9e49a104fdebf1778acda324d036aa9a70e3793f.zip
Merge branch 'current' of github.com:vyos/vyos-build into current
Diffstat (limited to 'data/live-build-config/hooks/08-sysconf.chroot')
-rwxr-xr-xdata/live-build-config/hooks/08-sysconf.chroot47
1 files changed, 47 insertions, 0 deletions
diff --git a/data/live-build-config/hooks/08-sysconf.chroot b/data/live-build-config/hooks/08-sysconf.chroot
new file mode 100755
index 00000000..b0399027
--- /dev/null
+++ b/data/live-build-config/hooks/08-sysconf.chroot
@@ -0,0 +1,47 @@
+#!/bin/sh
+
+for conf in motd.tail syslog.conf; do
+ cp -f /opt/vyatta/etc/$conf /etc/$conf
+done
+
+cp -f /opt/vyatta/etc/default_ssh /etc/default/ssh
+>/etc/pam_radius_auth.conf
+
+update_sysctl_conf ()
+{
+ var=$1
+ val=$2
+ comment=$3
+ sysctl_conf=/etc/sysctl.conf
+
+ if grep -q "^${var}[[:space:]]*=" $sysctl_conf ; then
+ sed -i "/^${var}[[:space:]]*=/ s,=.*,= ${val}," $sysctl_conf
+ elif grep -q "^#[[:space:]]*${var}[[:space:]]*=" $sysctl_conf ; then
+ sed -i "/^#[[:space:]]*${var}[[:space:]]*=/ { s,^#[[:space:]]*,, ; s,[[:space:]]*=.*, = ${val},} " $sysctl_conf
+ else
+ cat <<-EOF >> $sysctl_conf
+
+ # $comment
+ $var = $val
+ EOF
+ fi
+}
+
+update_sysctl_conf kernel.printk "4 4 1 7" \
+ "the following stops low-level messages on console"
+update_sysctl_conf net.ipv4.conf.default.arp_filter 1 \
+ "reset promiscous arp response"
+update_sysctl_conf net.ipv4.conf.all.promote_secondaries 1 \
+ "promote secondaries with removal of primary address"
+update_sysctl_conf net.ipv4.ip_forward 1 \
+ "enable ipv4 forwarding"
+# FIXME! need to load or staticly link ipv6 module before adding this.
+# update_sysctl_conf net.ipv6.conf.all.forwarding 1 \
+# "enable ipv6 forwarding"
+update_sysctl_conf net.core.rmem_max 223232 \
+ "maximize netlink buffers"
+
+# Local Variables:
+# mode: shell-script
+# sh-indentation: 4
+# End: