summaryrefslogtreecommitdiff
path: root/data/live-build-config/includes.chroot
diff options
context:
space:
mode:
Diffstat (limited to 'data/live-build-config/includes.chroot')
-rw-r--r--data/live-build-config/includes.chroot/etc/systemd/journald.conf43
-rw-r--r--data/live-build-config/includes.chroot/etc/systemd/system.conf55
-rw-r--r--data/live-build-config/includes.chroot/etc/systemd/system/getty@.service.d/aftervyos.conf2
-rw-r--r--data/live-build-config/includes.chroot/etc/systemd/system/getty@tty1.service.d/noclear.conf2
-rw-r--r--data/live-build-config/includes.chroot/lib/systemd/system/ssh-session-cleanup.service13
-rw-r--r--data/live-build-config/includes.chroot/opt/vyatta/etc/config.boot.default40
-rw-r--r--data/live-build-config/includes.chroot/opt/vyatta/etc/grub/default-union-grub-entry20
-rwxr-xr-xdata/live-build-config/includes.chroot/opt/vyatta/etc/install-image/postinst17
-rwxr-xr-xdata/live-build-config/includes.chroot/usr/lib/openssh/ssh-session-cleanup11
9 files changed, 203 insertions, 0 deletions
diff --git a/data/live-build-config/includes.chroot/etc/systemd/journald.conf b/data/live-build-config/includes.chroot/etc/systemd/journald.conf
new file mode 100644
index 00000000..5aecf4f8
--- /dev/null
+++ b/data/live-build-config/includes.chroot/etc/systemd/journald.conf
@@ -0,0 +1,43 @@
+# This file is managed in vyos-build
+#
+# This file is part of systemd.
+#
+# systemd is free software; you can redistribute it and/or modify it
+# under the terms of the GNU Lesser General Public License as published by
+# the Free Software Foundation; either version 2.1 of the License, or
+# (at your option) any later version.
+#
+# Entries in this file show the compile time defaults.
+# You can change settings by editing this file.
+# Defaults can be restored by simply deleting this file.
+#
+# See journald.conf(5) for details.
+
+[Journal]
+#Storage=persistent
+#Compress=yes
+#Seal=yes
+#SplitMode=uid
+#SyncIntervalSec=5m
+#RateLimitIntervalSec=30s
+#RateLimitBurst=1000
+#SystemMaxUse=
+#SystemKeepFree=
+#SystemMaxFileSize=
+#SystemMaxFiles=100
+#RuntimeMaxUse=
+#RuntimeKeepFree=
+#RuntimeMaxFileSize=
+#RuntimeMaxFiles=100
+#MaxRetentionSec=
+#MaxFileSec=1month
+ForwardToSyslog=yes
+#ForwardToKMsg=no
+#ForwardToConsole=no
+#ForwardToWall=yes
+#TTYPath=/dev/console
+#MaxLevelStore=debug
+MaxLevelSyslog=debug
+#MaxLevelKMsg=notice
+#MaxLevelConsole=info
+#MaxLevelWall=emerg
diff --git a/data/live-build-config/includes.chroot/etc/systemd/system.conf b/data/live-build-config/includes.chroot/etc/systemd/system.conf
new file mode 100644
index 00000000..91af4090
--- /dev/null
+++ b/data/live-build-config/includes.chroot/etc/systemd/system.conf
@@ -0,0 +1,55 @@
+# This file is managed in vyos-build
+#
+# This file is part of systemd.
+#
+# systemd is free software; you can redistribute it and/or modify it
+# under the terms of the GNU Lesser General Public License as published by
+# the Free Software Foundation; either version 2.1 of the License, or
+# (at your option) any later version.
+#
+# See systemd-system.conf(5) for details
+
+[Manager]
+#LogLevel=info
+#LogTarget=journal-or-kmsg
+#LogColor=yes
+#LogLocation=no
+#DumpCore=yes
+#CrashShell=no
+ShowStatus=yes
+#CrashChVT=1
+#CPUAffinity=1 2
+#JoinControllers=cpu,cpuacct net_cls,net_prio
+#RuntimeWatchdogSec=0
+#ShutdownWatchdogSec=10min
+#CapabilityBoundingSet=
+#SystemCallArchitectures=
+#TimerSlackNSec=
+#DefaultTimerAccuracySec=1min
+#DefaultStandardOutput=journal
+#DefaultStandardError=inherit
+#DefaultTimeoutStartSec=90s
+#DefaultTimeoutStopSec=90s
+#DefaultRestartSec=100ms
+#DefaultStartLimitInterval=10s
+#DefaultStartLimitBurst=5
+#DefaultEnvironment=
+#DefaultCPUAccounting=no
+#DefaultBlockIOAccounting=no
+#DefaultMemoryAccounting=no
+#DefaultLimitCPU=
+#DefaultLimitFSIZE=
+#DefaultLimitDATA=
+#DefaultLimitSTACK=
+#DefaultLimitCORE=
+#DefaultLimitRSS=
+#DefaultLimitNOFILE=
+#DefaultLimitAS=
+#DefaultLimitNPROC=
+#DefaultLimitMEMLOCK=
+#DefaultLimitLOCKS=
+#DefaultLimitSIGPENDING=
+#DefaultLimitMSGQUEUE=
+#DefaultLimitNICE=
+#DefaultLimitRTPRIO=
+#DefaultLimitRTTIME=
diff --git a/data/live-build-config/includes.chroot/etc/systemd/system/getty@.service.d/aftervyos.conf b/data/live-build-config/includes.chroot/etc/systemd/system/getty@.service.d/aftervyos.conf
new file mode 100644
index 00000000..7eee7bd3
--- /dev/null
+++ b/data/live-build-config/includes.chroot/etc/systemd/system/getty@.service.d/aftervyos.conf
@@ -0,0 +1,2 @@
+[Unit]
+After=vyatta-router.service
diff --git a/data/live-build-config/includes.chroot/etc/systemd/system/getty@tty1.service.d/noclear.conf b/data/live-build-config/includes.chroot/etc/systemd/system/getty@tty1.service.d/noclear.conf
new file mode 100644
index 00000000..52671c75
--- /dev/null
+++ b/data/live-build-config/includes.chroot/etc/systemd/system/getty@tty1.service.d/noclear.conf
@@ -0,0 +1,2 @@
+[Service]
+TTYVTDisallocate=no
diff --git a/data/live-build-config/includes.chroot/lib/systemd/system/ssh-session-cleanup.service b/data/live-build-config/includes.chroot/lib/systemd/system/ssh-session-cleanup.service
new file mode 100644
index 00000000..b8672722
--- /dev/null
+++ b/data/live-build-config/includes.chroot/lib/systemd/system/ssh-session-cleanup.service
@@ -0,0 +1,13 @@
+[Unit]
+Description=OpenBSD Secure Shell session cleanup
+Wants=network.target
+After=network.target
+
+[Service]
+ExecStart=/bin/true
+ExecStop=/usr/lib/openssh/ssh-session-cleanup
+RemainAfterExit=yes
+Type=oneshot
+
+[Install]
+WantedBy=multi-user.target
diff --git a/data/live-build-config/includes.chroot/opt/vyatta/etc/config.boot.default b/data/live-build-config/includes.chroot/opt/vyatta/etc/config.boot.default
new file mode 100644
index 00000000..0a75716b
--- /dev/null
+++ b/data/live-build-config/includes.chroot/opt/vyatta/etc/config.boot.default
@@ -0,0 +1,40 @@
+system {
+ host-name vyos
+ login {
+ user vyos {
+ authentication {
+ encrypted-password $6$QxPS.uk6mfo$9QBSo8u1FkH16gMyAVhus6fU3LOzvLR9Z9.82m3tiHFAxTtIkhaZSWssSgzt4v4dGAL8rhVQxTg0oAG9/q11h/
+ plaintext-password ""
+ }
+ level admin
+ }
+ }
+ syslog {
+ global {
+ facility all {
+ level notice
+ }
+ facility protocols {
+ level debug
+ }
+ }
+ }
+ ntp {
+ server "0.pool.ntp.org"
+ server "1.pool.ntp.org"
+ server "2.pool.ntp.org"
+ }
+ console {
+ device ttyS0 {
+ speed 9600
+ }
+ }
+ config-management {
+ commit-revisions 100
+ }
+}
+
+interfaces {
+ loopback lo {
+ }
+}
diff --git a/data/live-build-config/includes.chroot/opt/vyatta/etc/grub/default-union-grub-entry b/data/live-build-config/includes.chroot/opt/vyatta/etc/grub/default-union-grub-entry
new file mode 100644
index 00000000..4107e459
--- /dev/null
+++ b/data/live-build-config/includes.chroot/opt/vyatta/etc/grub/default-union-grub-entry
@@ -0,0 +1,20 @@
+menuentry "VyOS (KVM console)" {
+ linux /boot//vmlinuz boot=live quiet vyos-union=/boot/ console=ttyS0,9600 console=tty0
+ initrd /boot//initrd.img
+}
+
+menuentry "VyOS (Serial console)" {
+ linux /boot//vmlinuz boot=live quiet vyos-union=/boot/ console=tty0 console=ttyS0,9600
+ initrd /boot//initrd.img
+}
+
+menuentry "Lost password change (KVM console)" {
+ linux /boot//vmlinuz boot=live quiet vyos-union=/boot/ console=ttyS0,9600 console=tty0 init=/opt/vyatta/sbin/standalone_root_pw_reset
+ initrd /boot//initrd.img
+}
+
+menuentry "Lost password change (Serial console)" {
+ linux /boot//vmlinuz boot=live quiet vyos-union=/boot/ console=tty0 console=ttyS0,9600 init=/opt/vyatta/sbin/standalone_root_pw_reset
+ initrd /boot//initrd.img
+}
+
diff --git a/data/live-build-config/includes.chroot/opt/vyatta/etc/install-image/postinst b/data/live-build-config/includes.chroot/opt/vyatta/etc/install-image/postinst
new file mode 100755
index 00000000..d807fa9b
--- /dev/null
+++ b/data/live-build-config/includes.chroot/opt/vyatta/etc/install-image/postinst
@@ -0,0 +1,17 @@
+#!/bin/bash
+
+source /opt/vyatta/sbin/install-functions
+
+NEWVER=`mount | grep /mnt/inst_root`
+NEWVER=${NEWVER#*upperdir=/live/image/boot/}
+NEWVER=${NEWVER%/live-rw*}
+DISK_LABEL=`mount | grep /live/image | awk '{print $1}' | grep dev`
+
+if [ -d "/live/image" ]; then
+ e2label "${DISK_LABEL}" persistence
+ if [ ! -f /live/image/persistence.conf ]; then
+ echo "/ union" > /live/image/persistence.conf
+ fi
+ rm -f /live/image/boot/"${NEWVER}"/live-rw/etc/fstab
+ mv /live/image/boot/"${NEWVER}"/live-rw /live/image/boot/"${NEWVER}"/rw
+fi
diff --git a/data/live-build-config/includes.chroot/usr/lib/openssh/ssh-session-cleanup b/data/live-build-config/includes.chroot/usr/lib/openssh/ssh-session-cleanup
new file mode 100755
index 00000000..f283cc96
--- /dev/null
+++ b/data/live-build-config/includes.chroot/usr/lib/openssh/ssh-session-cleanup
@@ -0,0 +1,11 @@
+#! /bin/sh
+
+ssh_session_pattern='sshd: \S.*@pts/[0-9]+'
+
+IFS="$IFS@"
+pgrep -a -f "$ssh_session_pattern" | while read pid daemon user pty; do
+ echo "Found ${daemon%:} session $pid on $pty; sending SIGTERM"
+ kill "$pid" || true
+done
+
+exit 0