;;
esac
- case "$RELEASE" in
- lenny|squeeze|wheezy)
- if grep -q '^GRUB_DISABLE_LINUX_UUID=.*true' "${MNTPOINT}"/etc/default/grub 2>/dev/null ; then
- ewarn "GRUB_DISABLE_LINUX_UUID is set to true in /etc/default/grub, not adjusting root= in grub.cfg."
- ewarn "Please note that your system might NOT be able to properly boot."
- else
- einfo "Adjusting grub.cfg for successful boot sequence."
- sed -i "s;root=[^ ]\+;root=UUID=$TARGET_UUID;" "${MNTPOINT}"/boot/grub/grub.cfg
- fi
- ;;
- esac
+ if grep -q '^GRUB_DISABLE_LINUX_UUID=.*true' "${MNTPOINT}"/etc/default/grub 2>/dev/null ; then
+ ewarn "GRUB_DISABLE_LINUX_UUID is set to true in /etc/default/grub, not adjusting root= in grub.cfg."
+ ewarn "Please note that your system might NOT be able to properly boot."
+ else
+ einfo "Adjusting grub.cfg for successful boot sequence."
+ sed -i "s;root=[^ ]\+;root=UUID=$TARGET_UUID;" "${MNTPOINT}"/boot/grub/grub.cfg
+ fi
umount "${MNTPOINT}"/proc
umount "${MNTPOINT}"/sys
# make sure we can access network [relevant for cdebootstrap]
[ -f "${MNTPOINT}"/etc/resolv.conf ] || cp $VERBOSE /etc/resolv.conf "${MNTPOINT}"/etc/resolv.conf
- # provide system's /etc/hosts to the target:
- if ! [ -f "$MNTPOINT/etc/hosts" ] ; then
- cp $VERBOSE /etc/hosts "${MNTPOINT}"/etc/hosts
- fi
-
# setup default locales
[ -n "$LOCALES" ] && cp $VERBOSE "${CONFFILES}"/locale.gen "${MNTPOINT}"/etc/locale.gen
# execute all scripts in /etc/debootstrap/post-scripts/ {{{
execute_post_scripts() {
- # make sure we have $MNTPOINT available for our scripts
+ # make sure we have $MNTPOINT and HOSTNAME available for our scripts
export MNTPOINT
+ export TARGET_HOSTNAME=$HOSTNAME
if [ -d "$_opt_scripts" ] || [ "$SCRIPTS" = 'yes' ] ; then
# legacy support for /etc/debootstrap/scripts/