# Filename: /etc/debootstrap/chroot-script
# Purpose: script executed in chroot when installing Debian via grml-debootstrap
# Authors: grml-team (grml.org), (c) Michael Prokop <mika@grml.org>
-# Bug-Reports: see http://grml.org/bugs/
+# Bug-Reports: see https://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
# add security.debian.org:
case "$RELEASE" in
unstable|sid|lenny) ;; # no security pool available
- *)
+ squeeze|wheezy|jessie|stretch|buster)
echo "Adding security.debian.org to sources.list."
echo "deb http://security.debian.org ${RELEASE}/updates $COMPONENTS" >> /etc/apt/sources.list
;;
+ *)
+ # bullseye and newer releases use a different repository layout, see
+ # https://lists.debian.org/debian-devel-announce/2019/07/msg00004.html
+ echo "Adding security.debian.org/debian-security to sources.list."
+ echo "deb http://security.debian.org/debian-security ${RELEASE}-security $COMPONENTS" >> /etc/apt/sources.list
+ ;;
esac
}
# }}}
}
# }}}
-# check available backports release version {{{
-checkbackports() {
- wget -q -O/dev/null "http://backports.debian.org/debian-backports/dists/${1}-backports/Release"
-}
-# }}}
-
# feature to provide Debian backports repos {{{
backportrepos() {
- if [ -n "$BACKPORTREPOS" ] ; then
- if ! checkbackports "$RELEASE" ; then
- echo "Backports for ${RELEASE} are not available." >&2
- exit 1
- else
- # user might have provided their own apt sources.list
- if ! grep -q backports /etc/apt/sources.list.d/backports.list 2>/dev/null ; then
- cat >> /etc/apt/sources.list.d/backports.list << EOF
+ if [ -n "$BACKPORTREPOS" ] ; 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 ${MIRROR} ${RELEASE}-backports main
+deb-src ${MIRROR} ${RELEASE}-backports main
EOF
- fi
- fi
- fi
+ fi
}
# }}}
# set default locales {{{
default_locales() {
- if [ -n "$DEFAULT_LOCALES" ] ; then
- if ! [ -x /usr/sbin/update-locale ] ; then
- echo "Warning: update-locale executable not available (no locales package installed?)"
- echo "Ignoring request to run update-locale for $DEFAULT_LOCALES therefore"
- return 0
- fi
-
- /usr/sbin/update-locale LANGUAGE="$DEFAULT_LANGUAGE" LANG="$DEFAULT_LOCALES"
+ if ! [ -x "$(command -v update-locale)" ] ; then
+ echo "Warning: update-locale executable not available (no locales package installed?)"
+ echo "Ignoring request to run update-locale for C.UTF-8 therefore"
+ return 0
fi
+
+ echo "Setting C.UTF-8 as default LANG"
+ /usr/sbin/update-locale LANG='C.UTF-8'
+ echo 'locales locales/default_environment_locale select C.UTF-8' | debconf-set-selections
}
# }}}