You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

bootstrap-fixup.in 1.8KB

123456789101112131415161718192021222324252627282930313233343536373839
  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. apt-get purge -y grub-legacy bcron-run &> /dev/null
  17. fi
  18. echo '127.0.1.1 gitian' >> /etc/hosts
  19. # If LXC
  20. if grep /lxc/gitian /proc/1/cgroup > /dev/null; then
  21. adduser --disabled-password --gecos ubuntu --quiet ubuntu || true
  22. apt-get remove -y rsyslog || true
  23. dpkg-divert --local --rename --add /sbin/initctl
  24. ln -sf /bin/true /sbin/initctl
  25. dpkg-divert --local --rename --add /usr/bin/ischroot
  26. ln -sf /bin/true /usr/bin/ischroot
  27. # Prevent interaction with init during upgrades
  28. dpkg-divert --local --rename --add /usr/sbin/policy-rc.d
  29. echo 'exit 101' > /usr/sbin/policy-rc.d
  30. chmod +x /usr/sbin/policy-rc.d
  31. ## These are superceded by the policy-rc.d fix above
  32. # for pkg in lxc cgmanager udev plymouth dmsetup upstart; do
  33. # echo $pkg hold | dpkg --set-selections || true
  34. # done
  35. fi