2 # Filename: /etc/debootstrap/chroot-script
3 # Purpose: script executed in chroot when installing Debian via grml-debootstrap
4 # Authors: grml-team (grml.org), (c) Michael Prokop <mika@grml.org>
5 # Bug-Reports: see https://grml.org/bugs/
6 # License: This file is licensed under the GPL v2.
7 ################################################################################
8 # GRML_CHROOT_SCRIPT_MARKER - do not remove this line unless you want to keep
9 # this script as /bin/chroot-script on your new installed system
10 ################################################################################
13 if [ "$REPORT_TRAP_ERR" = "yes" ] || [ "$FAIL_TRAP_ERR" = "yes" ]; then
17 trap "error_handler" ERR
21 # shellcheck disable=SC1091
22 . /etc/debootstrap/config || exit 1
23 # shellcheck disable=SC1091
24 . /etc/debootstrap/variables || exit 1
26 [ -r /proc/1 ] || mount -t proc none /proc
27 [ -r /sys/kernel ] || mount -t sysfs none /sys
31 # use aptitude only if it's available
32 if [ -x /usr/bin/aptitude ] ; then
33 APTUPDATE="aptitude update $DPKG_OPTIONS"
34 # Debian ISOs do not contain signed Release files
35 if [ -n "$ISO" ] ; then
36 APTINSTALL="aptitude -y --allow-untrusted --without-recommends install $DPKG_OPTIONS"
37 APTUPGRADE="aptitude -y --allow-untrusted safe-upgrade $DPKG_OPTIONS"
39 APTINSTALL="aptitude -y --without-recommends install $DPKG_OPTIONS"
40 APTUPGRADE="aptitude -y safe-upgrade $DPKG_OPTIONS"
43 APTINSTALL="apt-get -y --no-install-recommends install $DPKG_OPTIONS"
44 APTUPDATE="apt-get update $DPKG_OPTIONS"
45 APTUPGRADE="apt-get -y upgrade $DPKG_OPTIONS"
48 if [ -z "$STAGES" ] ; then
49 STAGES='/etc/debootstrap/stages'
50 [ -d "$STAGES" ] || mkdir -p "$STAGES"
54 # helper functions {{{
57 echo "$2" > "$STAGES/$1"
59 elif grep -q 'done' "$STAGES/$1" 2>/dev/null ; then
60 echo " [*] Notice: stage $1 has been executed already, skipping execution therefore.">&2
63 echo " Executing stage ${1}"
68 # read -s emulation for dash. result is in $resp.
70 [ -t 0 ] && stty -echo
77 # define chroot mirror {{{
79 if [ "$KEEP_SRC_LIST" = "yes" ] ; then
80 echo "KEEP_SRC_LIST has been enabled, skipping chrootmirror stage."
84 if [ -z "$COMPONENTS" ] ; then
87 echo "Using repository components $COMPONENTS"
89 if [ -n "$ISO" ] ; then
90 echo "Adjusting sources.list for ISO (${ISO})."
91 echo "deb $ISO $RELEASE $COMPONENTS" > /etc/apt/sources.list
93 if [ -n "$MIRROR" ] ; then
94 echo "Adding mirror entry (${MIRROR}) to sources.list."
95 echo "deb $MIRROR $RELEASE $COMPONENTS" >> /etc/apt/sources.list
98 if [ -n "$MIRROR" ] ; then
99 echo "Adjusting sources.list for mirror (${MIRROR})."
100 echo "deb $MIRROR $RELEASE $COMPONENTS" > /etc/apt/sources.list
107 if [ -n "$MIRROR" ] ; then
108 echo "Release matching $RELEASE - enabling LTS support in sources.list"
109 echo "deb $MIRROR ${RELEASE}-lts $COMPONENTS" >> /etc/apt/sources.list
114 # add security.debian.org:
116 unstable|sid|lenny) ;; # no security pool available
117 squeeze|wheezy|jessie|stretch|buster)
118 echo "Adding security.debian.org to sources.list."
119 echo "deb http://security.debian.org ${RELEASE}/updates $COMPONENTS" >> /etc/apt/sources.list
122 # bullseye and newer releases use a different repository layout, see
123 # https://lists.debian.org/debian-devel-announce/2019/07/msg00004.html
124 echo "Adding security.debian.org/debian-security to sources.list."
125 echo "deb http://security.debian.org/debian-security ${RELEASE}-security $COMPONENTS" >> /etc/apt/sources.list
131 # remove local chroot mirror {{{
132 remove_chrootmirror() {
133 if [ "$KEEP_SRC_LIST" = "yes" ] ; then
134 echo "KEEP_SRC_LIST has been enabled, skipping remove_chrootmirror stage."
138 if [ -n "$ISO" ] ; then
139 echo "Removing ISO (${ISO}) from sources.list."
140 TMP_ISO="${ISO//\//\\\/}"
141 sed -i "/deb $TMP_ISO $RELEASE $COMPONENTS/ D" /etc/apt/sources.list
143 if [ -n "$MIRROR" ] && echo "$MIRROR" | grep -q 'file:' ; then
144 echo "Removing local mirror (${MIRROR}) from sources.list."
145 TMP_MIRROR="${MIRROR//\//\\\/}"
146 sed -i "/deb $TMP_MIRROR $RELEASE $COMPONENTS/ D" /etc/apt/sources.list
147 echo "Adding fallback mirror entry (${FALLBACK_MIRROR}) to sources.list instead."
148 echo "deb $FALLBACK_MIRROR $RELEASE $COMPONENTS" >> /etc/apt/sources.list
154 # set up grml repository {{{
156 if [ -z "$GRMLREPOS" ] ; then
160 # user might have provided their own apt sources configuration
161 if [ -r /etc/apt/sources.list.d/grml.list ] ; then
162 echo "File /etc/apt/sources.list.d/grml.list exists already, not modifying."
164 echo "Setting up /etc/apt/sources.list.d/grml.list."
165 cat > /etc/apt/sources.list.d/grml.list << EOF
166 # grml: stable repository:
167 deb [signed-by=/usr/share/keyrings/grml-archive-keyring.gpg] http://deb.grml.org/ grml-stable main
168 deb-src [signed-by=/usr/share/keyrings/grml-archive-keyring.gpg] http://deb.grml.org/ grml-stable main
170 # grml: testing/development repository:
171 deb [signed-by=/usr/share/keyrings/grml-archive-keyring.gpg] http://deb.grml.org/ grml-testing main
172 deb-src [signed-by=/usr/share/keyrings/grml-archive-keyring.gpg] http://deb.grml.org/ grml-testing main
176 # make sure we install packages from Grml's pool only if not available from Debian
177 if [ -r /etc/apt/preferences.d/grml.pref ] ; then
178 echo "File /etc/apt/preferences.d/grml.pref exists already, not modifying."
180 echo "Setting up /etc/apt/preferences.d/grml.pref."
181 cat > /etc/apt/preferences.d/grml.pref << EOF
182 Explanation: use Grml repository only after Debian ones
184 Pin: origin deb.grml.org
189 apt-get update -o Acquire::AllowInsecureRepositories=1
190 apt-get -y --allow-unauthenticated install grml-debian-keyring
193 if [ "$(dpkg-query -f "\${db:Status-Status} \${db:Status-Eflag}" -W grml-debian-keyring 2>/dev/null)" != 'installed ok' ]; then
194 echo "Error: installation of grml-debian-keyring failed." >&2
200 # feature to provide Debian backports repos {{{
202 if [ -n "$BACKPORTREPOS" ] ; then
203 cat >> /etc/apt/sources.list.d/backports.list << EOF
204 # debian backports: ${RELEASE}-backports repository:
205 deb ${MIRROR} ${RELEASE}-backports main
206 deb-src ${MIRROR} ${RELEASE}-backports main
212 # set up kernel-img.conf {{{
214 if ! [ -r /etc/kernel-img.conf ] ; then
215 echo "Setting up /etc/kernel-img.conf"
216 cat > /etc/kernel-img.conf << EOF
217 # Kernel Image management overrides
218 # See kernel-img.conf(5) for details
226 # make sure services do not start up {{{
227 install_policy_rcd() {
228 if ! [ -r /usr/sbin/policy-rc.d ] ; then
230 cat > /usr/sbin/policy-rc.d << EOF
234 chmod 775 /usr/sbin/policy-rc.d
239 # make sure we have an up2date system {{{
241 if [ "$UPGRADE_SYSTEM" = "yes" ] ; then
242 echo "Running update + upgrade"
244 DEBIAN_FRONTEND=$DEBIAN_FRONTEND $APTUPGRADE
246 echo "Not running update + upgrade as \$UPDATE_AND_UPGRADE is not set to 'yes'."
251 # remove now useless apt cache {{{
253 if [ "$RM_APTCACHE" = 'yes' ] ; then
254 echo "Cleaning apt cache."
255 # shellcheck disable=SC2086
256 apt-get clean $DPKG_OPTIONS
258 echo "Not cleaning apt cache as \$RM_APTCACHE is unset."
263 # install additional packages {{{
265 # Pre-seed the debconf database with answers. Each question will be marked
266 # as seen to prevent debconf from asking the question interactively.
267 [ -f /etc/debootstrap/debconf-selections ] && {
268 echo "Preseeding the debconf database, some lines might be skipped..."
269 debconf-set-selections < /etc/debootstrap/debconf-selections
272 if [ "$PACKAGES" = 'yes' ] ; then
273 PACKAGES_FILE="/etc/debootstrap/packages"
275 if [ "$ARCH" = 'arm64' ]; then
276 PACKAGES_FILE="/etc/debootstrap/packages-arm64"
279 if ! [ -r "${PACKAGES_FILE}" ] ; then
280 echo "Error: ${PACKAGES_FILE} (inside chroot) not found, exiting." >&2
285 # shellcheck disable=SC2086,SC2046
286 DEBIAN_FRONTEND=$DEBIAN_FRONTEND $APTINSTALL $(grep -v '^#' "${PACKAGES_FILE}") $GRMLPACKAGES
292 # install extra packages {{{
294 if [ "$EXTRAPACKAGES" = 'yes' ] ; then
295 PACKAGELIST=$(find /etc/debootstrap/extrapackages -type f -name '*.deb')
296 if [ -n "$PACKAGELIST" ]; then
297 # shellcheck disable=SC2086
299 # run apt again to resolve any deps
300 DEBIAN_FRONTEND=$DEBIAN_FRONTEND $APTINSTALL
306 # check if the specified Debian package exists
308 output=$(apt-cache show "$1" 2>/dev/null)
314 # determine the kernel version postfix
315 get_kernel_version() {
316 # do not override $KERNEL if set via config file
317 if [ -n "$KERNEL" ] ; then
324 # shellcheck disable=SC2153
336 echo "Only i386, amd64 and arm64 are currently supported" >&2
340 for KPREFIX in "" "2.6-" ; do # iterate through the kernel prefixes,
341 # currently "" and "2.6-"
342 if package_exists linux-image-${KPREFIX}${KARCH} ; then
343 echo ${KPREFIX}${KARCH}
350 # install kernel packages {{{
352 if [ -n "$NOKERNEL" ] ; then
353 echo "Skipping installation of kernel packages as requested via --nokernel"
358 KVER=$(get_kernel_version)
359 if [ -n "$KVER" ] ; then
360 # note: install busybox to be able to debug initramfs
361 KERNELPACKAGES="linux-image-$KVER linux-headers-$KVER busybox firmware-linux-free"
362 # only add firmware-linux if we have non-free as a component
363 if expr "$COMPONENTS" : '.*non-free' >/dev/null ; then
364 KERNELPACKAGES="$KERNELPACKAGES firmware-linux"
366 # shellcheck disable=SC2086
367 DEBIAN_FRONTEND=$DEBIAN_FRONTEND $APTINSTALL $KERNELPACKAGES
369 echo "Warning: Could not find a kernel for your system. Your system won't be able to boot itself!"
374 # reconfigure packages {{{
376 if [ -n "$RECONFIGURE" ] ; then
377 for package in $RECONFIGURE ; do
378 if dpkg --list "$package" >/dev/null 2>&1 | grep -q '^ii' ; then
379 DEBIAN_FRONTEND=$DEBIAN_FRONTEND dpkg-reconfigure "$package" || \
380 echo "Warning: $package does not exist, can not reconfigure it."
387 # set password of user root {{{
390 if [ -n "$NOPASSWORD" ] ; then
391 echo "Skip setting root password as requested."
395 echo "Activating shadow passwords."
399 if chpasswd --help 2>&1 | grep -q -- '-m,' ; then
403 if [ -n "$ROOTPASSWORD" ] ; then
404 echo root:"$ROOTPASSWORD" | chpasswd $CHPASSWD_OPTION
405 export ROOTPASSWORD=''
409 echo "Setting password for user root:"
410 while [ "$a" != "$b" ] ; do
411 printf "Enter new UNIX password for user root: "
416 printf "Retype new UNIX password for user root: "
421 if [ "$a" != "$b" ] ; then
422 echo "Sorry, passwords do not match. Retry."
426 echo root:"$a" | chpasswd $CHPASSWD_OPTION
435 # set up /etc/hosts {{{
437 if ! [ -f /etc/hosts ] ; then
438 cat > /etc/hosts << EOF
440 ::1 localhost ip6-localhost ip6-loopback
442 ff02::2 ip6-allrouters
448 # set default locales {{{
450 if [ -n "$DEFAULT_LOCALES" ] ; then
451 if ! [ -x /usr/sbin/update-locale ] ; then
452 echo "Warning: update-locale executable not available (no locales package installed?)"
453 echo "Ignoring request to run update-locale for $DEFAULT_LOCALES therefore"
457 /usr/sbin/update-locale LANGUAGE="$DEFAULT_LANGUAGE" LANG="$DEFAULT_LOCALES"
462 # adjust timezone {{{
464 if [ -n "$TIMEZONE" ] ; then
465 echo "Adjusting /etc/localtime"
466 ln -sf "/usr/share/zoneinfo/$TIMEZONE" /etc/localtime
468 echo "Setting /etc/timezone to $TIMEZONE"
469 printf '%s\n' "$TIMEZONE" > /etc/timezone
475 # helper function for fstab() {{{
477 echo "Setting up /etc/fstab"
478 cat > /etc/fstab <<EOF
479 # /etc/fstab - created by grml-debootstrap on $(date)
480 # Accessible filesystems, by reference, are maintained under '/dev/disk/'.
481 # See man pages fstab(5), findfs(8), mount(8) and/or blkid(8) for more info.
483 # After editing this file, run 'systemctl daemon-reload' to update systemd
484 # units generated from this file.
488 if [ -n "$TARGET_UUID" ] ; then
489 local rootfs_mount_options=""
491 if [ -z "${FILESYSTEM}" ] ; then
492 FILESYSTEM="$(blkid -o value -s TYPE /dev/disk/by-uuid/"${TARGET_UUID}")"
495 case "${FILESYSTEM}" in
496 # errors=remount-ro is supported only by a few file systems
497 ext*|exfat|fat|jfs|nilfs2|vfat)
498 rootfs_mount_options=",errors=remount-ro"
502 echo "/dev/disk/by-uuid/${TARGET_UUID} / auto defaults${rootfs_mount_options} 0 1" >> /etc/fstab
504 echo "Warning: couldn't identify target UUID for rootfs, your /etc/fstab might be incomplete."
507 if [ -n "$EFI" ] ; then
508 # shellcheck disable=SC2086
509 echo "UUID=$(blkid -o value -s UUID $EFI) /boot/efi vfat umask=0077 0 1" >> /etc/fstab
512 cat >> /etc/fstab << EOF
513 proc /proc proc defaults 0 0
514 /dev/cdrom /mnt/cdrom0 iso9660 ro,user,noauto 0 0
515 # some other examples:
516 # /dev/sda2 none swap sw,pri=0 0 0
517 # /dev/hda1 /Grml ext3 dev,suid,user,noauto 0 2
518 # //1.2.3.4/pub /smb/pub cifs user,noauto,uid=grml,gid=grml 0 0
519 # linux:/pub /beer nfs defaults 0 0
520 # tmpfs /tmp tmpfs size=300M 0 0
521 # /dev/sda5 none swap sw 0 0
526 # generate /etc/fstab {{{
528 # set up /etc/fstab if file is not present (cdebootstrap)
529 if [ ! -f /etc/fstab ] ; then
533 # set up /etc/fstab if file is UNCONFIGURED (debootstrap)
534 if grep -q UNCONFIGURED /etc/fstab ; then
540 # ensure we have according filesystem tools available {{{
544 # note: this is supposed to be coming either via command lines'
545 # $_opt_filesystem or via createfstab()
546 case "${FILESYSTEM}" in
555 if [ -n "${pkg:-}" ] && ! dpkg --list "${pkg}" 2>/dev/null | grep -q '^ii' ; then
556 echo "Filesystem package ${pkg} not present, installing now"
557 DEBIAN_FRONTEND=$DEBIAN_FRONTEND $APTINSTALL "${pkg}"
562 # set up hostname {{{
564 if [ -n "$HOSTNAME" ] ; then
565 echo "Setting hostname to ${HOSTNAME}."
566 echo "$HOSTNAME" > /etc/hostname
568 # adjust postfix configuration
569 if [ -r /etc/postfix/main.cf ] ; then
570 # adjust hostname related options:
571 sed -i "s/grml/$HOSTNAME/g" /etc/postfix/main.cf
573 # listen on loopback interface only:
574 sed -i "s/^inet_interfaces = .*/inet_interfaces = loopback-only/" /etc/postfix/main.cf
575 grep -q inet_interfaces /etc/postfix/main.cf || echo 'inet_interfaces = loopback-only' >> /etc/postfix/main.cf
577 if [ -r /etc/mailname ] ; then
578 # adjust /etc/mailname
579 local etc_mail_domain
580 etc_mail_domain=$(/bin/dnsdomainname 2>/dev/null || echo localdomain)
583 local mailname="$HOSTNAME"
586 local mailname="${HOSTNAME}.${etc_mail_domain}"
589 echo "Setting mailname to ${mailname}"
590 echo "$mailname" > /etc/mailname
596 # generate initrd/initramfs {{{
598 # assume the first available kernel as our main kernel
599 # shellcheck disable=SC2012
600 KERNELIMG=$(ls -1 /boot/vmlinuz-* 2>/dev/null | head -1)
601 if [ -z "$KERNELIMG" ] ; then
602 echo 'No kernel image found, skipping initrd stuff.'>&2
606 KERNELVER=${KERNELIMG#/boot/vmlinuz-}
609 if [ -n "$INITRD" ] ; then
610 echo "Generating initrd."
611 if [ "$INITRD_GENERATOR" = 'dracut' ] ; then
612 DEBIAN_FRONTEND=$DEBIAN_FRONTEND $APTINSTALL dracut
613 dracut --no-hostonly --kver "$KERNELVER" --fstab --add-fstab /etc/fstab --force --reproducible $INITRD_GENERATOR_OPTS
615 update-initramfs -c -t -k "$KERNELVER" $INITRD_GENERATOR_OPTS
622 if [ -z "$EFI" ] ; then
626 if ! dpkg --list efibootmgr 2>/dev/null | grep -q '^ii' ; then
627 echo "Notice: efi option set but no efibootmgr package, installing it therefore."
628 DEBIAN_FRONTEND=$DEBIAN_FRONTEND $APTINSTALL efibootmgr
632 echo "Mounting $EFI on /boot/efi"
633 mount "$EFI" /boot/efi || return 1
635 # if efivarfs kernel module is loaded, but efivars isn't,
636 # then we need to mount efivarfs for efibootmgr usage
637 if ! ls /sys/firmware/efi/efivars/* &>/dev/null ; then
638 echo "Mounting efivarfs on /sys/firmware/efi/efivars"
639 mount -t efivarfs efivarfs /sys/firmware/efi/efivars
642 echo "Invoking efibootmgr"
643 efibootmgr || return 1
646 # grub configuration/installation {{{
648 # helper function to get relevant /dev/disk/by-id/* entries,
649 # based on GRUB's postinst script
653 [ -d /dev/disk/by-id ] || return
655 for path in /dev/disk/by-id/*; do
656 [ -e "${path}" ] || continue
657 printf '%s %s\n' "${path}" "$(readlink -f "${path}")"
658 done | sort -k2 -s -u | cut -d' ' -f1
663 # helper function to report corresponding /dev/disk/by-id/ for a given device name,
664 # based on GRUB's postinst script
668 for id in $(available_ids); do
669 if [ "$(readlink -f "${id}")" = "$(readlink -f "$1")" ]; then
675 # Fall back to the plain device name if there's no by-id link for it.
685 if [ -z "$GRUB" ] ; then
686 echo "Notice: \$GRUB not defined, will not install grub inside chroot at this stage."
690 efi_setup || return 1
692 if [ -n "$EFI" ] ; then
693 GRUB_PACKAGE=grub-efi-amd64
698 # make sure this is pre-defined so we have sane settings for automated
699 # upgrades, see https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=711019
701 grub_device=$(device_to_id "${GRUB}")
702 if [ -z "${grub_device:-}" ] ; then
703 echo "Warning: Could not identify /dev/disk/by-id/... for '${GRUB}', falling back to '${GRUB}'"
704 grub_device="${GRUB}"
707 echo "Setting ${GRUB_PACKAGE} debconf configuration for install device to $GRUB"
708 echo "${GRUB_PACKAGE} ${GRUB_PACKAGE}/install_devices multiselect ${grub_device}" | debconf-set-selections
710 if ! dpkg --list ${GRUB_PACKAGE} 2>/dev/null | grep -q '^ii' ; then
711 echo "Notice: grub option set but no ${GRUB_PACKAGE} package, installing it therefore."
712 DEBIAN_FRONTEND=$DEBIAN_FRONTEND $APTINSTALL ${GRUB_PACKAGE}
715 if ! [ -x "$(command -v grub-install)" ] ; then
716 echo "Error: grub-install not available. (Error while installing grub package?)" >&2
720 if [ -n "$SELECTED_PARTITIONS" ] ; then # using sw-raid
721 for device in $SELECTED_PARTITIONS ; do
722 GRUB="${device%%[0-9]}"
723 echo "Installing grub on ${GRUB}:"
724 if ! grub-install --no-floppy "$GRUB" ; then
725 echo "Error: failed to execute 'grub-install --no-floppy $GRUB'." >&2
730 rm -f /boot/grub/device.map
732 echo "Installing grub on ${GRUB}:"
734 lenny|squeeze|wheezy)
736 grub_dev="$(readlink -f "${GRUB}")"
737 if ! grub-install --no-floppy "${grub_dev}" ; then
738 echo "Error: failed to execute 'grub-install --no-floppy ${grub_dev}'." >&2
741 rm -f /boot/grub/device.map
744 echo "(hd0) ${GRUB}" > /boot/grub/device.map
745 if ! grub-install "(hd0)" ; then
746 echo "Error: failed to execute 'grub-install (hd0)'." >&2
749 rm /boot/grub/device.map
754 echo "Adjusting grub configuration for use on ${GRUB}."
756 # finally install grub
757 if [ -x /usr/sbin/update-grub ] ; then
758 UPDATEGRUB='/usr/sbin/update-grub'
759 elif [ -x /sbin/update-grub ] ; then
760 UPDATEGRUB='/sbin/update-grub'
762 echo "Error: update-grub not available, can not execute it." >&2
766 if [ -n "${BOOT_APPEND}" ] ; then
767 echo "Adding BOOT_APPEND configuration ['${BOOT_APPEND}'] to /etc/default/grub."
768 sed -i "/GRUB_CMDLINE_LINUX_DEFAULT/ s#\"\$# ${BOOT_APPEND}\"#" /etc/default/grub
771 mountpoint /boot/efi &>/dev/null && umount /boot/efi
777 # execute all scripts present in /etc/debootstrap/chroot-scripts/ {{{
779 [ -d /etc/debootstrap/chroot-scripts/ ] || return 0
781 for script in /etc/debootstrap/chroot-scripts/* ; do
782 echo "Executing script $script"
783 $script && echo "done" || echo "failed"
788 # make sure we don't have any running processes left {{{
790 for service in ssh mdadm mdadm-raid ; do
791 if [ -x /etc/init.d/"$service" ] ; then
792 /etc/init.d/"$service" stop || true
798 # unmount /proc and make sure nothing is left {{{
800 # make sure we don't leave any sensible data
801 rm -f /etc/debootstrap/variables
803 [ -n "$POLICYRCD" ] && rm -f /usr/sbin/policy-rc.d
805 umount /sys/firmware/efi/efivars &>/dev/null || true
807 umount /sys >/dev/null 2>/dev/null || true
808 umount /proc >/dev/null 2>/dev/null || true
815 [ -n "$1" ] && EXIT="$1" || EXIT="1"
820 # set signal handler {{{
821 trap signal_handler HUP INT QUIT TERM
824 # execute the functions {{{
826 # always execute install_policy_rcd
829 for i in chrootmirror grmlrepos backportrepos kernelimg_conf \
830 kernel packages extrapackages reconfigure hosts \
831 default_locales timezone fstab install_fs_tools hostname \
832 initrd grub_install passwords \
833 custom_scripts upgrade_system remove_apt_cache services \
834 remove_chrootmirror; do
836 $i && stage $i 'done' || exit 1
839 # always execute the finalize stage:
843 # finally exit the chroot {{{
844 echo "Finished chroot installation, exiting."
848 ## END OF FILE #################################################################
849 # vim: ai tw=80 expandtab foldmethod=marker