나는 완전히 자동화된 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