X-Git-Url: https://git.grml.org/?p=grml-debootstrap.git;a=blobdiff_plain;f=grml-debootstrap;h=84f475312af3898b2fea1dcf210b666c2d2f30c0;hp=297628075f54b6fe6c3b9d7994af77a602e83f3b;hb=c32ebbf39bf5a259c82874f15e11652917794591;hpb=b38efce83a3195e0db5e11305e0ce54ac7fdb985 diff --git a/grml-debootstrap b/grml-debootstrap index 2976280..84f4753 100755 --- a/grml-debootstrap +++ b/grml-debootstrap @@ -34,26 +34,41 @@ usage() { Usage: $PN [options] - -h|--help Print this usage information and exit. - -v|--version Show summary of options and exit. - - -c|--config Use specified configuration file, - defaults to /etc/debootstrap/config - --hostname Hostname of Debian system - -i|--iso Mountpoint where a Debian ISO is mounted to, - for use instead of fetching packages from a mirror - -m|--mirror Mirror which should be used for apt-get/aptitude. - -p|--mntpoint Mountpoint used for mounting the target system. - -r|--release Release of new Debian system (default: stable) - -t|--target Target partition (/dev/...) or directory. - - --boot_append Add specified appendline to kernel whilst booting - --groot Root device for usage in grub, corresponds with - \$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 - --interactive Use interactive mode (frontend) - --password Use specified password as password for user root. +Bootstrap options: + + -m, --mirror=URL Mirror which should be used for apt-get/aptitude. + -i, --iso=mnt Mountpoint where a Debian ISO is mounted to, for use + instead of fetching packages from a mirror. + -r, --release=name Release of new Debian system (default: stable). + -t, --target=target Target partition (/dev/...) or directory. + -p, --mntpoint=mnt Mountpoint used for mounting the target system. + --debopt=params Extra parameters passed to the debootstrap. + --interactive Use interactive mode (frontend). + +Configuration options: + + + -c, --config=file Use specified configuration file, defaults to + /etc/debootstrap/config + --packages[=f] Install packages defined in /etc/debootstrap/packages. + Option arg: alternative package list file. + --debconf[=f] Pre-seed packages using + /etc/debootstrap/debconf-selections. Option arg: + alternative preseed db file. + --keep_src_list Do not overwrite user provided apt sources.list. + --hostname=name Hostname of Debian system. + --password=pwd Use specified password as password for user root. + + --bootappend=line Add specified appendline to kernel whilst booting. + --groot=device Root device for usage in grub, corresponds with + $TARGET in grub syntax, like hd0,0 for /dev/sda1. + --grub=device Target for grub installation. Use grub syntax for + specifying, like hd0 for /dev/sda. + +Other options: + + -h, --help Print this usage information and exit. + -v, --version Show summary of options and exit. Send bugreports to the grml-team: bugs@grml.org || http://grml.org/bugs/ " @@ -694,9 +709,9 @@ debootstrap_system() { mount_target fi 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 + 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 eend $? else eerror "Error: $MNTPOINT not mounted, can not continue." @@ -722,6 +737,7 @@ preparechroot() { [ -n "$ISO" ] && echo "ISO=$ISO" >> $CHROOT_VARIABLES [ -n "$MIRROR" ] && echo "CHROOTMIRROR=$MIRROR" >> $CHROOT_VARIABLES [ -n "$MIRROR" ] && echo "MIRROR=$MIRROR" >> $CHROOT_VARIABLES + [ -n "$KEEP_SRC_LIST" ] && echo "KEEP_SRC_LIST=$KEEP_SRC_LIST" >> $CHROOT_VARIABLES [ -n "$ROOTPASSWORD" ] && echo "ROOTPASSWORD=$ROOTPASSWORD" >> $CHROOT_VARIABLES [ -n "$TARGET" ] && echo "TARGET=$TARGET" >> $CHROOT_VARIABLES [ -n "$TARGET_UUID" ] && echo "TARGET_UUID=$TARGET_UUID" >> $CHROOT_VARIABLES @@ -739,11 +755,13 @@ preparechroot() { sed -i "s#GROOT=.*#GROOT=\"$GROOT\"#" $MNTPOINT/etc/debootstrap/config cp /etc/debootstrap/packages $MNTPOINT/etc/debootstrap/packages + [ -f /etc/debootstrap/debconf-selections -a "$DEBCONF" = 'yes' ] && \ + cp /etc/debootstrap/debconf-selections $MNTPOINT/etc/debootstrap/ # notice: do NOT use $CHROOT_VARIABLES inside chroot but statically file instead! cp $CHROOT_VARIABLES $MNTPOINT/etc/debootstrap/variables - cp -a /etc/debootstrap/extrapackages/ $MNTPOINT/etc/debootstrap/ + cp -a -L /etc/debootstrap/extrapackages/ $MNTPOINT/etc/debootstrap/ # make sure we can access network [relevant for cdebootstrap] [ -f "$MNTPOINT/etc/resolv.conf" ] || cp /etc/resolv.conf $MNTPOINT/etc/resolv.conf