在使用预置文件自动安装 Debian Jessie 期间无法创建/安装交换

在使用预置文件自动安装 Debian Jessie 期间无法创建/安装交换

我尝试创建完全自动化的 Debian Jessie 安装程序。我为此目的使用定制的压制文件。为了测试我使用虚拟盒子。一切都很好,除了分区阶段出现一个错误。安装程序创建分区表时出现错误:
The attempt to mount a filesystem with type swap ... at none failed

在此输入图像描述

我正在寻找解决方法避免这个错误

我的环境:

cat /etc/issue  
Debian GNU/Linux 8 \n \l

uname -a
Linux localhost 3.16.0-4-amd64 #1 SMP Debian 3.16.7-ckt9-3~deb8u1 (2015-04-24) x86_64 GNU/Linux`

我的定制preseed.cfg有以下内容:

# Locale configuration.
d-i debian-installer/language           string en
d-i debian-installer/country            string US
d-i debian-installer/locale             string en_US.UTF-8

# Keyboard configuration.
d-i console-tools/archs                 select at
d-i console-keymaps-at/keymap           select us
d-i keyboard-configuration/xkb-keymap   select us

# Network configuration.
d-i netcfg/choose_interface             select auto
d-i netcfg/dhcp_failed                  note
d-i netcfg/dhcp_options                 select Do not configure the network at this time

d-i netcfg/use_dhcp                     boolean true
d-i netcfg/disable_dhcp                 boolean false
d-i netcfg/dhcp_timeout                 string 0

d-i netcfg/get_hostname                 string localhost
d-i netcfg/get_domain                   string

# Mirror configuration.
apt-mirror-setup apt-setup/use_mirror   boolean false
apt-mirror-setup apt-setup/mirror/error select Ignore
apt-mirror-setup apt-setup/no_mirror    boolean true

# Time configuration.
d-i clock-setup/utc                     boolean true
d-i time/zone                           string Zulu
d-i clock-setup/ntp                     boolean false

# User configuration.
d-i passwd/root-password                password r00t
d-i passwd/root-password-again          password r00t
d-i passwd/make-user                    boolean true
d-i passwd/user-fullname                string localuser
d-i passwd/username                     string localuser
d-i passwd/user-password                password n0nr00t
d-i passwd/user-password-again          password n0nr00t

popularity-contest popularity-contest/participate boolean false

# Partition configuration.
d-i partman-auto/method                 string regular
d-i partman-auto/disk                   string /dev/sda
d-i partman-auto/choose_recipe          select home

d-i     partman-auto/expert_recipe string                       \
        localhost ::                                            \
                2048 4096 40960 ext4                            \
                        $primary{ } $bootable{ }                \
                        method{ format } format{ }              \
                        use_filesystem{ } filesystem{ ext4 }    \
                        label{ root }                           \
                        mountpoint{ / }                         \
                .                                               \
                128 256 10240 ext4                              \
                        method{ format } format{ }              \
                        label{ home }                           \
                        use_filesystem{ } filesystem{ ext4 }    \
                        label{ home }                           \
                        mountpoint{ /home }                     \
                .                                               \
                128 256 100% linux-swap                         \
                        method{ swap } forman{ }                \
                .
d-i partman-partitioning/confirm_write_new_label                \
                                        boolean true
d-i partman/choose_partition            select finish
d-i partman/confirm                     boolean true
d-i partman/confirm_nooverwrite         boolean true

# GRUB configuration.
d-i grub-installer/only_debian          boolean true
d-i grub-installer/with_other_os        boolean true
d-i grub-installer/bootdev              string default

# Finish.
d-i finish-install/reboot_in_progress   note

这并不重要,但要明确的是,应该注意我使用以下命令创建图像实时构建通过以下方式:

#!/bin/bash

echo -e "Remove old artefacts ($(date +%H-%M-%S))."
rm -rf installer

echo -e "Prepare for generate new image ($(date +%H-%M-%S))."
mkdir installer && cd installer

echo -e "Configure Live Builder ($(date +%H-%M-%S))."
lb config \
--apt-indices false \
--ignore-system-defaults \
--architectures amd64 \
--linux-flavours "amd64" \
--binary-images iso-hybrid \
--mode debian \
--source false \
--distribution jessie \
--win32-loader false \
--debian-installer true \
--bootloader syslinux \
--memtest none \
--archive-areas "main contrib non-free" \
--debootstrap-options "--variant=minbase"

echo -e "Inject custom content ($(date +%H-%M-%S))."
mkdir -p config/includes.installer
cp -v ../preseed.cfg config/includes.installer

echo -e "Build image ($(date +%H-%M-%S))."
lb build
cd ..

if [ -f installer/live-image-amd64.hybrid.iso ]; then
    echo -e "Create image successfully complite ($(date +%H-%M-%S))."
    echo -e "Have a nice day!"
else
    echo -e "Perhaps something bad is happing ($(date +%H-%M-%S))..."
fi

答案1

method{ swap } forman{ }                \

那里有错别字,forman应该是format

以防万一,搜索swap一下预置示例

相关内容