我正在尝试为 Lubuntu iso 创建一个自动安装程序。我已经创建了以下文件:
- 预置文件
- 相应地调整了 grub.cfg 文件。
这是我的预置文件:
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
# Localization
d-i debian-installer/locale string en_US
d-i console-setup/ask_detect boolean false
d-i keyboard-configuration/layoutcode string us
# Network configuration
d-i netcfg/choose_interface select auto
# Mirror settings
d-i mirror/country string manual
d-i mirror/http/hostname string archive.ubuntu.com
d-i mirror/http/directory string /ubuntu
d-i mirror/http/proxy string
# Account setup
d-i passwd/root-login boolean true
d-i passwd/root-password password <root_password>
d-i passwd/root-password-again password <root_password>
# Clock and time zone setup
d-i clock-setup/utc boolean true
d-i time/zone string UTC
# Partitioning
d-i partman-auto/method string regular
d-i partman-auto/choose_recipe select atomic
d-i partman/default_filesystem string ext4
d-i partman-auto/expert_recipe string \
boot-root :: \
512 512 512 ext4 \
$primary{ } $bootable{ } \
method{ format } format{ } \
use_filesystem{ } filesystem{ ext4 } \
mountpoint{ /boot } \
. \
100% 512 100% ext4 \
method{ format } format{ } \
use_filesystem{ } filesystem{ ext4 } \
mountpoint{ / } \
.
# Package selection
tasksel tasksel/first multiselect lubuntu-desktop
# Boot loader installation
d-i grub-installer/only_debian boolean true
d-i grub-installer/with_other_os boolean true
# Finish installation without user interaction
d-i finish-install/reboot_in_progress note
# Preseed late command
d-i preseed/late_command string \
in-target wget -O /tmp/autoinstall.sh http://path/to/your/autoinstall.sh; \
in-target chmod +x /tmp/autoinstall.sh; \
in-target /bin/bash /tmp/autoinstall.sh
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
这是我的 grub.cfg 命令:
menuentry "Install Lubuntu" {
set gfxpayload=keep
linux /casper/vmlinuz file=/cdrom/preseed/ounch.preseed auto=true priority=critical debian-installer/locale=en_US keyboard-configuration/layoutcode=us ubiquity/reboot=casper languagechooser/language-name=English countrychooser/shortlist=US localechooser/supported-locales=en_US.UTF-8 boot=casper automatic-ubiquity quiet splash noprompt noshell ---
initrd /casper/initrd.gz
}
我使用 CUBIC 提取了 Lubuntu iso 映像并修改了上述文件。之后,我使用 CUBIC 打包了 iso 映像,并尝试使用 VM 运行该映像。问题是:iso 忽略了自动安装程序,直接将我带到了 lubuntu live 窗口。有人能帮我吗?感谢您的帮助和支持。
@guiverc - 我已经创建了一个 yaml 文件用作预置,以下是新 yaml 文件的内容:
localization:
locale: en_US
consoleSetup:
askDetect: false
keyboardConfiguration:
layoutCode: us
# Network configuration
networking:
interfaceSelection: auto
# Mirror settings
mirror:
country: manual
http:
hostname: archive.ubuntu.com
directory: /ubuntu
proxy: ""
# Account setup
users:
root:
login: true
password: "<root_password>"
passwordRepeat: "<root_password>"
# Clock and time zone setup
timezone:
utc: true
zone: UTC
# Partitioning
partitions:
method: regular
recipe: atomic
defaultFilesystem: ext4
expertRecipe: |
boot-root :: \
512 512 512 ext4 \
$primary{ } $bootable{ } \
method{ format } format{ } \
use_filesystem{ } filesystem{ ext4 } \
mountpoint{ /boot } \
. \
100% 512 100% ext4 \
method{ format } format{ } \
use_filesystem{ } filesystem{ ext4 } \
mountpoint{ / } \
.
# Package selection
packages:
lubuntu-desktop:
selected: true
# Boot loader installation
bootloader:
installer: true
debian: true
otherOs: true
# Finish installation without user interaction
finish:
rebootInProcess: note
+++++++++++++++++++++++++++++++++++++++++++++我已经将 grub.cfg 配置更新为:
menuentry "Install Lubuntu" {
set gfxpayload=keep
linux /casper/vmlinuz boot=casper file=/cdrom/preseed/ounch.yaml auto=true priority=critical quiet splash noprompt noshell ---
initrd /casper/initrd.gz
}
问题仍然存在。系统忽略了我的预配置文件。