--interactive Use interactive mode (frontend).
--nodebootstrap Skip debootstrap, only do configuration to the target.
--grub <device> Target for grub installation. Usage example: /dev/sda
- --arch <arch> Architecture to use. Currently only i386 is supported.
+ --arch <arch> Set target architecture, use for installing i386 on amd64.
--filesystem <fs> Filesystem that should be used when target is a partition
or Virtual Machine (see --vmfile).
--insecure Do not download and check Release file signatures.
/etc/debootstrap/config
-d, --confdir <path> Place of config files for debootstrap, defaults
to /etc/debootstrap
- --packages <file> Install packages defined in specified list file.
+ --packages <file> Install packages defined in specified list file
+ instead of using /etc/debootstrap/packages.
--nopackages Skip installation of packages defined in
/etc/debootstrap/packages
--debconf <file> Pre-seed packages using specified pre-seed db file.
+ --grmlrepos Enable Grml's Debian repository (deb.grml.org).
--keep_src_list Do not overwrite user provided apt sources.list.
--hostname <name> Hostname of Debian system.
+ --nopassword Do not prompt for the root password.
--password <pwd> Use specified password as password for user root.
--bootappend <line> Add specified appendline to kernel whilst booting.
--chroot-scripts <d> Execute chroot scripts from specified directory.
[ "$_opt_pre_scripts_set" ] && PRE_SCRIPTS='yes'
[ "$_opt_chroot_scripts_set" ] && CHROOT_SCRIPTS='yes'
[ "$_opt_keep_src_list" ] && KEEP_SRC_LIST='yes'
+[ "$_opt_grmlrepos" ] && GRMLREPOS='yes'
[ "$_opt_hostname" ] && HOSTNAME=$_opt_hostname
[ "$_opt_password" ] && ROOTPASSWORD=$_opt_password
+[ "$_opt_nopassword" ] && NOPASSWORD='yes'
[ "$_opt_bootappend" ] && BOOT_APPEND=$_opt_bootappend
[ "$_opt_grub" ] && GRUB=$_opt_grub
[ "$_opt_arch" ] && ARCH=$_opt_arch
# ask for password {{{
prompt_for_password()
{
- ROOTPW1='PW1'
- ROOTPW2='PW2'
- while [ "$ROOTPW1" != "$ROOTPW2" ]; do
- ROOTPW1=$(dialog --insecure --stdout --title "${PN}" --passwordbox \
- "Please enter the password for the root account:" 10 60)
- [ $? -eq 0 ] || bailout
- ROOTPW2=$(dialog --insecure --stdout --title "${PN}" --passwordbox \
- "Please enter the password for the root account again for \
- confirmation:" 10 60)
- [ $? -eq 0 ] || bailout
-
- if [ "$ROOTPW1" != "$ROOTPW2" ]; then
- $(dialog --stdout --title "${PN}" --ok-label \
- "Retry" --msgbox "Passwords do not match!" 10 60)
- fi
- done
- ROOTPASSWORD="$ROOTPW1"
+ if [ "$_opt_nopassword" ] ; then
+ einfo "Skip asking for root password as requested."
+ return 0
+ fi
+
+ ROOTPW1='PW1'
+ ROOTPW2='PW2'
+ while [ "$ROOTPW1" != "$ROOTPW2" ]; do
+ ROOTPW1=$(dialog --insecure --stdout --title "${PN}" --passwordbox \
+ "Please enter the password for the root account:" 10 60)
+ [ $? -eq 0 ] || bailout
+ ROOTPW2=$(dialog --insecure --stdout --title "${PN}" --passwordbox \
+ "Please enter the password for the root account again for \
+ confirmation:" 10 60)
+ [ $? -eq 0 ] || bailout
+
+ if [ "$ROOTPW1" != "$ROOTPW2" ]; then
+ $(dialog --stdout --title "${PN}" --ok-label \
+ "Retry" --msgbox "Passwords do not match!" 10 60)
+ fi
+ done
+ ROOTPASSWORD="$ROOTPW1"
}
# }}}
ORIG_TARGET="$TARGET" # store for later reuse
qemu-img create -f raw "${TARGET}" "${VMSIZE}"
- echo 4 66 | mksh /usr/share/grml-debootstrap/bootgrub.mksh -A | dd of="$TARGET" conv=notrunc
+ echo 4 66 | /usr/share/grml-debootstrap/bootgrub.mksh -A | dd of="$TARGET" conv=notrunc
dd if=/dev/zero bs=1 conv=notrunc count=64 seek=446 of="$TARGET"
parted -s "${TARGET}" 'mkpart primary ext3 2M -1'
[ -n "$KEEP_SRC_LIST" ] && echo "KEEP_SRC_LIST=$KEEP_SRC_LIST" >> $CHROOT_VARIABLES
[ -n "$MIRROR" ] && echo "MIRROR=$MIRROR" >> $CHROOT_VARIABLES
[ -n "$PACKAGES" ] && echo "PACKAGES=$PACKAGES" >> $CHROOT_VARIABLES
+ [ -n "$GRMLREPOS" ] && echo "GRMLREPOS=$GRMLREPOS" >> $CHROOT_VARIABLES
[ -n "$RM_APTCACHE" ] && echo "RM_APTCACHE=$RM_APTCACHE" >> $CHROOT_VARIABLES
[ -n "$ROOTPASSWORD" ] && echo "ROOTPASSWORD=$ROOTPASSWORD" >> $CHROOT_VARIABLES
+ [ -n "$NOPASSWORD" ] && echo "NOPASSWORD=true" >> $CHROOT_VARIABLES
[ -n "$SELECTED_PARTITIONS" ] && echo "SELECTED_PARTITIONS=$SELECTED_PARTITIONS" >> $CHROOT_VARIABLES
[ -n "$TARGET" ] && echo "TARGET=$TARGET" >> $CHROOT_VARIABLES
[ -n "$TARGET_UUID" ] && echo "TARGET_UUID=$TARGET_UUID" >> $CHROOT_VARIABLES
# execute filesystem check {{{
fscktool() {
- if [ "$FSCK" = 'yes' ] ; then
- [ -n "$FSCKTOOL" ] || FSCKTOOL="fsck.${MKFS#mkfs.}"
- einfo "Checking filesystem on $TARGET using $FSCKTOOL"
- $FSCKTOOL $TARGET
- eend $?
- fi
+ if [ -n "$VIRTUAL" ] ; then
+ einfo "Skipping filesystem check since we deploy a virtual machine."
+ return 0
+ fi
+
+ if [ "$FSCK" = 'yes' ] ; then
+ [ -n "$FSCKTOOL" ] || FSCKTOOL="fsck.${MKFS#mkfs.}"
+ einfo "Checking filesystem on $TARGET using $FSCKTOOL"
+ $FSCKTOOL $TARGET
+ eend $?
+ fi
}
# }}}
# }}}
## END OF FILE #################################################################
-# vim: ai tw=100 expandtab foldmethod=marker shiftwidth=3
+# vim: ai tw=100 expandtab foldmethod=marker shiftwidth=2