X-Git-Url: https://git.grml.org/?p=grml-debootstrap.git;a=blobdiff_plain;f=grml-debootstrap;h=7d6d6a39485e84961b8fbc034387fee3db65e6e2;hp=3c55932ee58d937771e268ee4a4d95e13f119d4c;hb=43b1b3a0c5b6d1fe61ba035e30cd7ddffd4958a0;hpb=ca382b6a00f5bb3232230b5033a4039e4531a25b diff --git a/grml-debootstrap b/grml-debootstrap index 3c55932..7d6d6a3 100755 --- a/grml-debootstrap +++ b/grml-debootstrap @@ -51,6 +51,7 @@ Bootstrap options: \$TARGET in grub syntax, like hd0,0 for /dev/sda1. --grub Target for grub installation. Use grub syntax for specifying, like hd0 for /dev/sda. + --arch Architecture to use. Currently only i386 is supported. Configuration options: @@ -149,6 +150,7 @@ fi [ "$_opt_bootappend" ] && BOOT_APPEND=$_opt_bootappend [ "$_opt_groot" ] && GROOT=$_opt_groot [ "$_opt_grub" ] && GRUB=$_opt_grub +[ "$_opt_arch" ] && ARCH=$_opt_arch [ "$_opt_verbose" ] && VERBOSE="-v" [ "$_opt_help" ] && { @@ -509,14 +511,19 @@ else # if not running automatic installation display configuration and prompt fo einfo "$PN - Please recheck configuration before execution:" echo echo " Target: $TARGET" - case "$MNTPOINT" in "$TARGET") ;; *) echo " Mount point: $MNTPOINT" ;; esac - [ -n "$GRUB" ] && echo " Install grub: $GRUB" || echo " Install grub: no" - [ -n "$RELEASE" ] && echo " Using release: $RELEASE" - [ -n "$MIRROR" ] && echo " Using mirror: $MIRROR" - [ -n "$HOSTNAME" ] && echo " Using hostname: $HOSTNAME" - [ -n "$ISO" ] && echo " Using ISO: $ISO" - case "$MNTPOINT" in "$TARGET") ;; *) echo " Important! Continuing will delete all data from ${TARGET}!" ;; esac - echo + + # do not display if MNTPOINT is the default one + case "$MNTPOINT" in /mnt/debootstrap*) ;; *) echo " Mount point: $MNTPOINT" ;; esac + + [ -n "$GRUB" ] && echo " Install grub: $GRUB" || echo " Install grub: no" + [ -n "$RELEASE" ] && echo " Using release: $RELEASE" + [ -n "$MIRROR" ] && echo " Using mirror: $MIRROR" + [ -n "$HOSTNAME" ] && echo " Using hostname: $HOSTNAME" + [ -n "$ISO" ] && echo " Using ISO: $ISO" + + echo " Important! Continuing will delete all data from ${TARGET}!" + + echo einfon "Is this ok for you? [y/N] " read a if ! [ "$a" = 'y' -o "$a" = 'Y' ] ; then @@ -754,17 +761,18 @@ mount_target() { # install main chroot {{{ debootstrap_system() { - if ! grep -q "$MNTPOINT" /proc/mounts ; then - mount_target - fi if [ "$_opt_nodebootstrap" ]; then einfo "Skipping debootstrap as requested." return fi + if grep -q "$MNTPOINT" /proc/mounts || [ -n "$DIRECTORY" ] ; then einfo "Running $DEBOOTSTRAP $DEBOOTSTRAP_OPT for release ${RELEASE}${ARCHINFO} using ${MIRROR}${ISO}" - [ -n "$MIRROR" ] && $DEBOOTSTRAP $ARCHCMD $DEBOOTSTRAP_OPT $RELEASE $MNTPOINT $MIRROR || \ - $DEBOOTSTRAP $ARCHCMD $DEBOOTSTRAP_OPT $RELEASE $MNTPOINT $ISO + if [ -n "$MIRROR" ] ; then + $DEBOOTSTRAP $ARCHCMD $DEBOOTSTRAP_OPT $RELEASE $MNTPOINT $MIRROR + else + $DEBOOTSTRAP $ARCHCMD $DEBOOTSTRAP_OPT $RELEASE $MNTPOINT $ISO + fi eend $? else eerror "Error: $MNTPOINT not mounted, can not continue."