# sarge specific stuff
if [ "$RELEASE" = 'sarge' ] ; then
- sed -i "s/ROOT=probe/ROOT=$TARGET/" /etc/mkinitrd/mkinitrd.conf
+ sed -i "s#ROOT=probe#ROOT=$TARGET#" /etc/mkinitrd/mkinitrd.conf
fi
if [ -n "$KERNEL" ] ; then
echo "Activating shadow passwords."
shadowconfig on
echo "Setting password for user root:"
+# TODO: typing the wrong password will exit chroot script
passwd
echo ""
# generate initrd
if [ -n "$INITRD" ] ; then
+ if [ "$RELEASE" = 'sarge' ] ; then
+ echo "Release sarge detected, will not create an initrd."
+ return 0
+ fi
echo "Generating initrd."
update-initramfs -c -t -k $KERNELVER
if [ -f "/boot/initrd.img-$KERNELVER" ] ; then
# copy stage-files to /boot/grub/
[ -d /boot/grub/ ] || mkdir /boot/grub
- cp /usr/lib/grub/i386-pc/* /boot/grub/
+ if [ -d /usr/lib/grub/i386-pc/ ] ; then
+ cp /usr/lib/grub/i386-pc/* /boot/grub/
+ else
+ # sarge ships grub files in another directory
+ cp /lib/grub/i386-pc/* /boot/grub/
+ fi
# finally install grub
update-grub -y