#######
# install base
- apt-get install debootstrap debian-archive-keyring kpartx &&
+ apt-get install debootstrap debian-archive-keyring kpartx chase &&
if [ "$use_lvm" = "y" ]; then
if [ "$use_boot" != "n" ] ; then
lvcreate -L 128m -n "$guest"-boot /dev/"$vg"
chroot . apt-get update &&
echo "Apt::Install-Recommends 0;" > etc/apt/apt.conf.d/local-recommends &&
chroot . apt-get install net-tools iproute ifupdown dialog vim netbase xfsprogs &&
- cp -av $dev_root dev/ &&
+ cp -av `chase $dev_root` dev/`basename $dev_root` &&
DEBIAN_FRONTEND=noninteractive chroot . apt-get install grub2 &&
cat > etc/kernel-img.conf << EOF &&
do_symlinks = no
do_initrd = yes
-EOF
- # install a kernel image
- chroot . apt-get install linux-image-2.6-amd64 &&
- cat >> etc/kernel-img.conf << EOF &&
-postinst_hook = update-grub
-postrm_hook = update-grub
EOF
if [ "$use_boot" != "n" ] ; then
- cp -av $dev_boot $dev_boot""1 dev/ &&
+ cp -av `chase $dev_boot` dev/`basename $dev_boot` &&
+ cp -av `chase $dev_boot""1` dev/`basename $dev_boot`1 &&
chroot . grub-install --modules=part_msdos /dev/`basename $dev_boot` &&
+ # install a kernel image
+ chroot . apt-get install linux-image-2.6-amd64 &&
sed -i -e 's/^#GRUB_TERMINAL=console/GRUB_TERMINAL=console/' etc/default/grub &&
echo "(hd0) /dev/`basename $dev_boot`" > boot/grub/device.map &&
chroot . update-grub &&
echo && echo && echo && echo "Hardly tested, expect this to fail." && echo && echo && echo &&
echo "(hd0) /dev/`basename $dev_root`" > boot/grub/device.map &&
chroot . grub-install /dev/"`basename $dev_root`" &&
+ # install a kernel image
+ chroot . apt-get install linux-image-2.6-amd64 &&
sed -i -e 's/^#GRUB_TERMINAL=console/GRUB_TERMINAL=console/' etc/default/grub &&
chroot . update-grub
fi &&