build 2.0 KB

1234567891011121314151617181920212223242526272829303132333435363738
  1. #!/bin/bash
  2. set -e
  3. #(cd /srv/mephi-edu-linux-teacher-packages/; git pull)
  4. #mkdir /srv/live-build/chroot
  5. #export ADDITIONAL_PACKAGES="$(cat /srv/mephi-edu-linux-teacher-packages/* | tr " \t" "\n\n" | sort | uniq | grep -v '^$')"
  6. #echo "$ADDITIONAL_PACKAGES" > /srv/live-build/chroot/packages-to-install.list
  7. ionice -c 3 lb build noauto "${@}" 2>&1 | tee /tmp/live-build.log
  8. umount /srv/live-build/chroot/mnt/chroots 2>/dev/null || true
  9. rsync --delete -a chroot/ chroot-root/
  10. lb chroot_hooks --force
  11. rm -f $(grep -l sudo /srv/live-build/chroot/lib/live/config/* | tr -d " \t")
  12. sed -e 's/PasswordAuthentication/NonExistantOption/g' -i /srv/live-build/chroot/lib/live/config/1160-openssh-server
  13. sed -e 's/PasswordAuthentication no/PasswordAuthentication yes/g' -i /srv/live-build/chroot/etc/ssh/sshd_config
  14. sed -e 's/^ALL/#ALL/g' -i /srv/live-build/chroot/etc/sudoers
  15. sed -e 's/^6:/#6:/g' -i /srv/live-build/chroot/etc/inittab
  16. ionice -c 3 mksquashfs /srv/live-build/chroot /srv/share/nfs/mephi-edu/live/filesystem.squashfs-noroot-new -comp xz -Xdict-size 100% -Xbcj x86 -b 1048576
  17. ##mkdir /srv/live-build/chroot/mnt/chroots
  18. #mount --bind /srv/share/nfs/chroots /srv/live-build/chroot/mnt/chroots
  19. #chroot /srv/live-build/chroot update-texdeps
  20. exit 0
  21. grep eth0 /srv/live-build/chroot/etc/network/interfaces >/dev/null || sed -e "s%auto br0%auto eth0\niface eth0 inet dhcp\n\tup route add -net 10.0.0.0/24 gw 192.168.2.2\nauto br0%" -i /srv/live-build/chroot/etc/network/interfaces
  22. sed -e "s/192.168.100.206/192.168.2.2/g" -i /srv/live-build/chroot/etc/{resolv.conf,fstab,dhcp/dhcpd.conf}
  23. sed -e "s/10.20.47.6/192.168.2.2/g" -i /srv/live-build/chroot/etc/libnss-ldap.conf
  24. rm -f /srv/share/nfs/mephi-edu/live/filesystem.squashfs-k315
  25. ionice -c 3 mksquashfs /srv/live-build/chroot /srv/share/nfs/mephi-edu/live/filesystem.squashfs-k315 -comp xz -Xdict-size 100% -Xbcj x86 -b 1048576
  26. ionice -c 3 rsync -xp /srv/share/nfs/mephi-edu/live/filesystem.squashfs-k315 srv0@192.168.2.1:/srv/share/nfs/mephi-edu/live/filesystem.squashfs