Debian ISOs do not contain signed Release files
[grml-debootstrap.git] / chroot-script
index 4f10c54..98e7b14 100755 (executable)
@@ -5,6 +5,9 @@
 # Bug-Reports:   see http://grml.org/bugs/
 # License:       This file is licensed under the GPL v2.
 ################################################################################
+# GRML_CHROOT_SCRIPT_MARKER - do not remove this line unless you want to keep
+# this script as /bin/chroot-script on your new installed system
+################################################################################
 
 . /etc/debootstrap/config    || exit 1
 . /etc/debootstrap/variables || exit 1
 
 # use aptitude only if it's available
 if [ -x /usr/bin/aptitude ] ; then
-   APTINSTALL="aptitude -y --without-recommends install $DPKG_OPTIONS"
    APTUPDATE='aptitude update'
-   APTUPGRADE='aptitude -y safe-upgrade'
+   # Debian ISOs do not contain signed Release files
+   if [ -n "$ISO" ] ; then
+      APTINSTALL="aptitude -y --allow-untrusted --without-recommends install $DPKG_OPTIONS"
+      APTUPGRADE='aptitude -y --allow-untrusted safe-upgrade'
+   else
+      APTINSTALL="aptitude -y --without-recommends install $DPKG_OPTIONS"
+      APTUPGRADE='aptitude -y safe-upgrade'
+   fi
 else
    APTINSTALL="apt-get --force-yes -y --no-install-recommends install $DPKG_OPTIONS"
    APTUPDATE='apt-get update'
@@ -362,7 +371,6 @@ fi
 
 cat >> /etc/fstab << EOF
 proc           /proc        proc    defaults                      0   0
-/sys           /sys         sysfs   noauto,rw,nosuid,nodev,noexec 0   0
 /dev/cdrom     /mnt/cdrom0  iso9660 ro,user,noauto                0   0
 # some other examples:
 # /dev/sda2       none         swap    sw,pri=0             0   0