Du kan inte välja fler än 25 ämnen Ämnen måste starta med en bokstav eller siffra, kan innehålla bindestreck ('-') och vara max 35 tecken långa.

bootstrap-fixup.in 1.9KB

12345678910111213141516171819202122232425262728293031323334353637383940
  1. #!/bin/sh
  2. set -e
  3. DISTRIB_NAME=`lsb_release -is`
  4. DISTRIB_CODENAME=`lsb_release -cs`
  5. if [ $DISTRIB_NAME = "Ubuntu" ]; then
  6. echo "deb http://HOSTIP:3142/archive.ubuntu.com/ubuntu $DISTRIB_CODENAME main universe" > $1/etc/apt/sources.list
  7. echo "deb http://HOSTIP:3142/security.ubuntu.com/ubuntu $DISTRIB_CODENAME-security main universe" >> $1/etc/apt/sources.list
  8. echo "deb http://HOSTIP:3142/archive.ubuntu.com/ubuntu $DISTRIB_CODENAME-updates main universe" >> $1/etc/apt/sources.list
  9. elif [ $DISTRIB_NAME = "Debian" ]; then
  10. echo "deb http://HOSTIP:3142/ftp.debian.org/debian $DISTRIB_CODENAME main" > $1/etc/apt/sources.list
  11. echo "deb http://HOSTIP:3142/security.debian.org/ $DISTRIB_CODENAME/updates main" >> $1/etc/apt/sources.list
  12. echo "deb http://HOSTIP:3142/ftp.debian.org/debian $DISTRIB_CODENAME-updates main" >> $1/etc/apt/sources.list
  13. # grub-legacy conflicts grub-pc dependencies
  14. # No grub-legacy on Ubuntu, just on Debian
  15. # Work around bcron-run conflict due to cron being removed
  16. # Needed for KVM, but apparently errors out for LXC, so the true ignores the error
  17. apt-get purge -y grub-legacy bcron-run &> /dev/null || true
  18. fi
  19. echo '127.0.1.1 gitian' >> /etc/hosts
  20. # If LXC
  21. if grep /lxc/gitian /proc/1/cgroup > /dev/null || grep container=lxc /proc/1/environ > /dev/null; then
  22. adduser --disabled-password --gecos ${DISTRIB_NAME,,} --quiet ${DISTRIB_NAME,,} || true
  23. apt-get purge -y rsyslog || true
  24. dpkg-divert --local --rename --add /sbin/initctl
  25. ln -sf /bin/true /sbin/initctl
  26. dpkg-divert --local --rename --add /usr/bin/ischroot
  27. ln -sf /bin/true /usr/bin/ischroot
  28. # Prevent interaction with init during upgrades
  29. dpkg-divert --local --rename --add /usr/sbin/policy-rc.d
  30. echo 'exit 101' > /usr/sbin/policy-rc.d
  31. chmod +x /usr/sbin/policy-rc.d
  32. ## These are superceded by the policy-rc.d fix above
  33. # for pkg in lxc cgmanager udev plymouth dmsetup upstart; do
  34. # echo $pkg hold | dpkg --set-selections || true
  35. # done
  36. fi