# variables {{{
PN="$(basename $0)"
-VERSION='0.20'
+VERSION='0.23'
MNTPOINT="/mnt/debootstrap.$$"
# inside the chroot system locales might not be available, so use minimum:
grep -v 'Extended$' | \
gawk -v num=0 -v ORS=' ' '/^\/dev\// {print $1}')
- [ -n "$AVAILABLE_PARTITIONS" ] || echo "FIXME: no partitions available?"
+ if [ -z "$AVAILABLE_PARTITIONS" ] ; then
+ dialog --title "$PN" --trim \
+ --msgbox "Sorry, no partitions found. Please configure your
+ harddisks (see /proc/partitions) using a tool like fdisk,
+ cfdisk, gpart, gparted,..." 0 0
+ exit 0
+ fi
+
PARTITION_LIST=$(for i in $(echo $AVAILABLE_PARTITIONS) ; do
echo "$i $(vol_id --type $i 2>/dev/null || echo [no_filesystem_yet])"
done)
if ! grep -q $MNTPOINT /proc/mounts ; then
mount_target
fi
- if grep -q $MNTPOINT /proc/mounts ; then
+ if grep -q $MNTPOINT /proc/mounts || [ -n "$DIRECTORY" ] ; then
einfo "Running $DEBOOTSTRAP for release ${RELEASE}${ARCHINFO} using ${MIRROR}${ISO}"
[ -n "$MIRROR" ] && $DEBOOTSTRAP $ARCHCMD $RELEASE $MNTPOINT $MIRROR || \
$DEBOOTSTRAP $ARCHCMD $RELEASE $MNTPOINT $ISO
[ -n "$ROOTPASSWORD" ] && echo "ROOTPASSWORD=$ROOTPASSWORD" >> $CHROOT_VARIABLES
[ -n "$TARGET" ] && echo "TARGET=$TARGET" >> $CHROOT_VARIABLES
[ -n "$TARGET_UUID" ] && echo "TARGET_UUID=$TARGET_UUID" >> $CHROOT_VARIABLES
-
+
cp $CONFFILES/chroot-script $MNTPOINT/bin/chroot-script
chmod 755 $MNTPOINT/bin/chroot-script
mkdir $MNTPOINT/etc/debootstrap/
# MAKEDEV is just a forking bomb crap, let's do it on our own instead :)
( cd $MNTPOINT/dev && tar zxf /etc/debootstrap/devices.tar.gz )
- # copy any existing existing files to chroot
- [ -d /etc/debootstrap/boot ] && cp -a /etc/debootstrap/boot/* $MNTPOINT/boot/
- [ -d /etc/debootstrap/etc ] && cp -a /etc/debootstrap/etc/* $MNTPOINT/etc/
- [ -d /etc/debootstrap/share ] && cp -a /etc/debootstrap/share/* $MNTPOINT/share/
- [ -d /etc/debootstrap/usr ] && cp -a /etc/debootstrap/usr/* $MNTPOINT/usr/
- [ -d /etc/debootstrap/var ] && cp -a /etc/debootstrap/var/* $MNTPOINT/var/
+ # copy any existing files to chroot
+ [ -d /etc/debootstrap/boot ] && cp -a -L /etc/debootstrap/boot/* $MNTPOINT/boot/
+ [ -d /etc/debootstrap/etc ] && cp -a -L /etc/debootstrap/etc/* $MNTPOINT/etc/
+ [ -d /etc/debootstrap/share ] && cp -a -L /etc/debootstrap/share/* $MNTPOINT/share/
+ [ -d /etc/debootstrap/usr ] && cp -a -L /etc/debootstrap/usr/* $MNTPOINT/usr/
+ [ -d /etc/debootstrap/var ] && cp -a -L /etc/debootstrap/var/* $MNTPOINT/var/
# copy local network setup to chroot
if [ -r /etc/network/interfaces -a ! -r "${MNTPOINT}"/etc/network/interfaces ] ; then