Browse Source

Update 2016-03-28

Dmitry Yu Okunev 4 years ago
parent
commit
ab1d29c0d5

+ 1 - 0
auto/build

@@ -8,6 +8,7 @@ set -e
 #echo "$ADDITIONAL_PACKAGES" > /srv/live-build/chroot/packages-to-install.list
 ionice -c 3 lb build noauto "${@}" 2>&1 | tee /tmp/live-build.log
 umount /srv/live-build/chroot/mnt/chroots 2>/dev/null || true
+rsync --delete -a chroot/ chroot-root/
 
 lb chroot_hooks --force
 

+ 6 - 0
config/hooks/2600-require-password-for-su-even-for-root.hook.chroot

@@ -0,0 +1,6 @@
+#!/bin/bash -xe
+PATH=/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin
+
+sed -e 's/^auth/#auth/g' -i /etc/pam.d/su
+
+exit 0

+ 1 - 1
config/includes.chroot/etc/bash.bashrc

@@ -65,7 +65,7 @@ PS1='\[\e[1;37m\]d\[\e[0m\][\t] [${debian_chroot:+($debian_chroot)}\u@\h \w]\$ '
 # Selecting the latest ruby in opt
 chruby $(chruby | head -1 | tr -d '*') 2>/dev/null
 
-export LD_LIBRARY_PATH='/mnt/chroots/texlive/srv/current/jessie/lib:.'
+#export LD_LIBRARY_PATH='/mnt/chroots/texlive/srv/current/jessie/lib:.'
 export PATH="/mnt/chroots/texlive/srv/current/jessie/bin:$PATH"
 export PERL5LIB=/mnt/chroots/texlive/usr/share/texlive/texmf-dist/scripts/texlive
 

+ 16 - 11
config/includes.chroot/etc/rc.local

@@ -3,24 +3,29 @@
 if [ "$(cat /sys/class/net/eth1/address)" = "52:54:00:31:14:02" ]; then
 	ifconfig eth1 192.168.0.2/24
 fi
+if [ "$(cat /sys/class/net/eth1/address)" = "52:54:01:31:14:02" ]; then
+	ifconfig eth1 192.168.0.3/24
+fi
+
+ETH2MAC="$(cat /sys/class/net/eth2/address)"
 
-if [ "$(cat /sys/class/net/eth2/address)" = "52:54:00:31:14:03" ]; then
+if [ "$ETH2MAC" = "52:54:00:31:14:03" -o "$ETH2MAC" = "52:54:01:31:14:03" ]; then
 	rm -f /etc/resolv.conf.eth0
 	cp /etc/resolv.conf /etc/resolv.conf.eth0
 	dhclient eth2
+	killall dhclient
 	cp /etc/resolv.conf.eth0 /etc/resolv.conf
+	sleep 60 && cp /etc/resolv.conf.eth0 /etc/resolv.conf &
 fi
 
-if false; then
-(
-	dd if=/dev/zero of=/var/cache/fscache/image bs=1M count=512
-	losetup /dev/loop1 /var/cache/fscache/image
-	mkfs.ext4 /dev/loop1
-	mount /dev/loop1 /var/cache/fscache
-	sed -e 's/^#RUN/RUN/' -i /etc/default/cachefilesd
-	/etc/init.d/cachefilesd start
-)&
-fi
+#(
+#	dd if=/dev/zero of=/var/cache/fscache/image bs=1M count=512
+#	losetup /dev/loop1 /var/cache/fscache/image
+#	mkfs.ext4 /dev/loop1
+#	mount /dev/loop1 /var/cache/fscache
+#	sed -e 's/^#RUN/RUN/' -i /etc/default/cachefilesd
+#	/etc/init.d/cachefilesd start
+#)&
 
 #fmtutil-sys --all &
 

+ 7 - 1
config/includes.chroot/usr/local/sbin/wrapper-update-texdeps

@@ -1,7 +1,13 @@
-#!/bin/bash -e
+#!/bin/bash -xe
 
 mount 127.0.0.1:/srv/share/nfs/chroots /mnt/chroots
+
+#export LD_LIBRARY_PATH='/mnt/chroots/texlive/srv/current/jessie/lib:.'
+export PATH="/mnt/chroots/texlive/srv/current/jessie/bin:$PATH"
+export PERL5LIB=/mnt/chroots/texlive/usr/share/texlive/texmf-dist/scripts/texlive
+
 update-texdeps
+which xelatex
 ldconfig -v
 fmtutil-sys --all
 umount /mnt/chroots || true

+ 2 - 0
config/includes.chroot/usr/share/libpam-script/pam_script_auth

@@ -10,6 +10,8 @@ fi
 LOGIN="${PAM_USER,,}"
 PASSWORD="$PAM_AUTHTOK"
 
+#export LOGIN
+
 touch /dev/shm/.loginresult."$LOGIN"
 chmod 600 /dev/shm/.loginresult."$LOGIN"
 

+ 11 - 5
config/includes.chroot/usr/share/libpam-script/pam_script_ses_open

@@ -15,16 +15,22 @@ PASSWORD="$PAM_AUTHTOK"
 USER_UID="$(getent passwd "$LOGIN" | awk -F ':' '{print $3}')"
 
 if [ "$PASSWORD" = "" ]; then
-	PASSWORD="$(cat /dev/shm/.~pamgate."$LOGIN")"
+	PASSWORD="$(cat /dev/shm/.~pamgate."$LOGIN" 2>/dev/null)"
 fi
 rm -f /dev/shm/.~pamgate."$LOGIN"
 
 PASSWD="$PASSWORD"	# for mount.cifs
+
+if [ "$PASSWD" = "" ]; then
+	exit 0
+fi
+
+export LOGIN
 export PASSWD
 
 SRV=172.16.0.3
 ROUTER=172.16.0.1
-if [ "$(cat /sys/class/net/eth1/address 2>/dev/null)" != "52:54:00:31:14:02" ]; then
+if [ "$(cat /sys/class/net/eth1/address 2>/dev/null)" != "52:54:00:31:14:02" -a "$(cat /sys/class/net/eth1/address 2>/dev/null)" != "52:54:01:31:14:02" ]; then
 	if /sbin/route -n | grep ^192.168.100 > /dev/null; then
 		SRV=192.168.100.206
 		ROUTER=192.168.100.206
@@ -88,8 +94,8 @@ sudo /lib/live/config/0007-time >/dev/null 2>/dev/null &
 
 unset PASSWD
 
-mkdir /tmp/login_scripts-"$LOGIN"
-cd /tmp/login_scripts-"$LOGIN"
+mkdir /tmp/.login_scripts-"$LOGIN"
+cd /tmp/.login_scripts-"$LOGIN"
 
 # default pre scripts
 wget https://auth.clab.mephi.ru/scripts/default.sh -O default.sh -o /dev/null
@@ -102,7 +108,7 @@ jq '.login_scripts | .[] | [.scriptname] | @csv' /dev/shm/.loginresult."$LOGIN"
 # running login scripts
 PATH="/tmp/login_scripts-$LOGIN:$PATH" jq '.login_scripts | .[] | [.scriptname, .arguments] | @sh' /dev/shm/.loginresult."$LOGIN" | while read t; do eval "eval \"./$t\""; done
 
-rm -rf /tmp/login_scripts-"$LOGIN"
+rm -rf /tmp/.login_scripts-"$LOGIN"
 cd /
 
 rm -f /dev/shm/.loginresult."$LOGIN"