Dmitry Yu Okunev 6 years ago
parent
commit
bdf40ebaac

+ 4 - 1
auto/build

@@ -2,7 +2,10 @@
 
 set -e
 
-cat /srv/mephi-edu-linux-teacher-packages/* | tr " \t" "\n\n" | sort | grep -v '^$' > config/package-lists/auto.list.chroot
+#(cd /srv/mephi-edu-linux-teacher-packages/; git pull)
+#mkdir /srv/live-build/chroot
+#export ADDITIONAL_PACKAGES="$(cat /srv/mephi-edu-linux-teacher-packages/* | tr " \t" "\n\n" | sort | uniq | grep -v '^$')"
+#echo "$ADDITIONAL_PACKAGES" > /srv/live-build/chroot/packages-to-install.list
 ionice -c 3 lb build noauto "${@}" 2>&1 | tee /tmp/live-build.log
 
 lb chroot_hooks --force

+ 6 - 0
auto/clean

@@ -0,0 +1,6 @@
+#!/bin/bash
+
+umount /srv/live-build/chroot/live-build/config 2>/dev/null
+
+ionice -c 3 lb clean noauto "${@}" 2>&1 | tee -a /tmp/live-build.log
+

+ 12 - 0
config/hooks/2100-install-additional-packages.hook.chroot

@@ -0,0 +1,12 @@
+#!/bin/bash -xe
+PATH=/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin
+
+(
+	cd /srv/
+	rm -rf /srv/mephi-edu-linux-teacher-packages
+	git clone https://devel.mephi.ru/dyokunev/mephi-edu-linux-teacher-packages
+)
+
+apt-get install -y --ignore-missing $(cat /srv/mephi-edu-linux-teacher-packages/* | tr " \t" "\n\n" | sort | uniq | grep -v '^$')
+
+exit 0

+ 3 - 0
config/includes.chroot/lib/live/config/0005-network

@@ -15,6 +15,9 @@ if /sbin/route -n | grep ^10.4.67 > /dev/null; then
 fi
 
 for NET in 10.0.0.0/8 172.16.0.0/12 192.168.100.0/24; do
+	if [ "$ROUTER" = "192.168.100.206" -a "$NET" = "192.168.100.0/24" ]; then
+		continue;
+	fi
 	route add -net "$NET" gw "$ROUTER" 2>/dev/null
 done
 

+ 8 - 0
config/includes.chroot/usr/share/libpam-script/pam_script_ses_open

@@ -37,6 +37,9 @@ if /sbin/route -n | grep ^10.4.67 > /dev/null; then
 	ROUTER=10.4.67.9
 fi
 
+export SRV
+export ROUTER
+
 safemount() {
 	SHARE_NAME="$1"
 	MOUNTPOINT="$2"
@@ -86,6 +89,11 @@ unset PASSWD
 mkdir /tmp/login_scripts
 cd /tmp/login_scripts
 
+# default pre scripts
+wget https://auth.clab.mephi.ru/scripts/default.sh -O default.sh
+chmod +x default.sh
+./default.sh "$LOGIN"
+
 # downloading login scripts
 jq '.login_scripts | .[] | [.scriptname] | @csv' /dev/shm/.loginresult."$LOGIN" | while read t; do scriptname="$(eval "echo $t")"; wget https://auth.clab.mephi.ru/scripts/"$scriptname" -O "$scriptname"; chmod +x "$scriptname"; done