refresh-image.sh 1.2 KB

12345678910111213141516171819202122232425262728
  1. #!/bin/bash
  2. PATH=/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin
  3. umount /srv/live-build/chroot/live-build/config 2>/dev/null
  4. cd /srv/live-build
  5. lb clean
  6. lb build
  7. if ! [ -f /srv/live-build/binary/live/filesystem.squashfs ]; then
  8. echo 'build failed' >&2
  9. exit -1
  10. fi
  11. cp /srv/live-build/tftpboot/live/{vmlinuz,initrd.img} /srv/share/tftp/distr/liveos/mephi-edu/8/amd64/
  12. rm -f /srv/share/nfs/mephi-edu/live/filesystem.squashfs-backup
  13. mv /srv/share/nfs/mephi-edu/live/filesystem.squashfs /srv/share/nfs/mephi-edu/live/filesystem.squashfs-backup
  14. mv /srv/live-build/binary/live/filesystem.squashfs /srv/share/nfs/mephi-edu/live/filesystem.squashfs
  15. rm -f /srv/share/nfs/mephi-edu/live/filesystem.squashfs-noroot-backup
  16. mv /srv/share/nfs/mephi-edu/live/filesystem.squashfs-noroot /srv/share/nfs/mephi-edu/live/filesystem.squashfs-noroot-backup
  17. mv /srv/share/nfs/mephi-edu/live/filesystem.squashfs-noroot-new /srv/share/nfs/mephi-edu/live/filesystem.squashfs-noroot
  18. rm -f /srv/share/nfs/mephi-edu-noroot/live/{filesystem.squashfs,config.conf}
  19. ln /srv/share/nfs/mephi-edu/live/filesystem.squashfs-noroot /srv/share/nfs/mephi-edu-noroot/live/filesystem.squashfs
  20. ln /srv/share/nfs/mephi-edu/live/config.conf /srv/share/nfs/mephi-edu-noroot/live/config.conf