X-Git-Url: https://git.grml.org/?p=grml-debootstrap.git;a=blobdiff_plain;f=chroot-script;h=5b9e518aad631c4922bfcf13154cbcbf31599f91;hp=751eac3f714d0568c5b2ab6d88c126406fce12e6;hb=2215f28a2a2e3cd66aca58cd5ecf1f2eb25269a5;hpb=4f9ea9128412213f405416da7f15c3f329857f12 diff --git a/chroot-script b/chroot-script index 751eac3..5b9e518 100755 --- a/chroot-script +++ b/chroot-script @@ -167,14 +167,22 @@ EOF # check available backports release version {{{ checkbackports() { - wget -q -O/dev/null http://backports.debian.org/debian-backports/dists/${1}-backports/Release + wget -q -O/dev/null http://${BACKPORTSMIRROR}/dists/${RELEASE}-backports/Release } # }}} # feature to provide Debian backports repos {{{ backportrepos() { + case "$RELEASE" in + squeeze) + BACKPORTSMIRROR="backports.debian.org/debian-backports" + ;; + *) + BACKPORTSMIRROR="http.debian.net/debian" + ;; + esac if [ -n "$BACKPORTREPOS" ] ; then - if ! checkbackports $RELEASE ; then + if ! checkbackports ; then echo "Backports for ${RELEASE} are not available." >&2 exit 1 else @@ -182,8 +190,8 @@ backportrepos() { if ! grep -q backports /etc/apt/sources.list.d/backports.list 2>/dev/null ; then cat >> /etc/apt/sources.list.d/backports.list << EOF # debian backports: ${RELEASE}-backports repository: -deb http://backports.debian.org/debian-backports ${RELEASE}-backports main -deb-src http://backports.debian.org/debian-backports ${RELEASE}-backports main +deb http://${BACKPORTSMIRROR} ${RELEASE}-backports main +deb-src http://${BACKPORTSMIRROR} ${RELEASE}-backports main EOF fi fi @@ -292,7 +300,7 @@ get_kernel_version() { fi case $ARCH in - i386) KARCH=i686 ;; + i386) KARCH=686 ;; amd64) KARCH=amd64 ;; *) echo "Only i386 and amd64 are currently supported" >&2 @@ -317,6 +325,8 @@ kernel() { # note: install busybox to be able to debug initramfs KERNELPACKAGES="linux-image-$KVER linux-headers-$KVER busybox firmware-linux-free firmware-linux" DEBIAN_FRONTEND=$DEBIAN_FRONTEND $APTINSTALL $KERNELPACKAGES + else + echo "Warning: Could not find a kernel for your system. Your system won't be able to boot itself!" fi } # }}}