安装介质:ubuntu-10.04-desktop-i386.iso
我尝试了很多不同的引导参数,但安装程序要么忽略了预置配置,要么直接将自己作为 LiveCD 引导。
我尝试过的引导参数示例:
auto url= http://mydomain.com/path/preseed.cfg boot=casper only-ubiquity initrd=/casper/initrd.lz 安静的飞溅——
如果我删除only-ubiquity,它会作为 LiveCD 启动。如果我删除boot=casper,它将无法启动。如果我添加vga=normal locale=en_US console-setup/layoutcode=us console-setup/ask_detect=false interface=auto,它仍然无法进行自动安装。如果我删除auto,它是一样的。
启动此类安装的正确引导参数是什么?
从服务器托管的 apache 日志中preseed.cfg,我看到安装程序在获取预置文件时没有问题。我的预置文件几乎与https://help.ubuntu.com/10.04/installation-guide/example-preseed.txt 中的文件相同。此外,我已经运行debconf-set-selections -c preseed.cfg以确保预置文件是正确的。
是否可以通过引导提示向 Debian 安装程序添加变量,以便可以在预置文件中使用该变量?
特别是,我正在尝试解决以下问题:
我们有一个非常广泛的安装后脚本,通常是从服务器下载的。但是现在我想创建 Packer 映像并将安装后脚本与其他 Packer 文件一起保留在版本控制中。为了访问 preseed,我可以在引导命令中执行“preseed/url=http://{{ .HTTPIP }}:{{ .HTTPPort }}/preseed.cfg”。但现在我希望安装程序从同一位置下载安装后脚本。
目前,安装后挂钩如下所示:
d-i preseed/late_command string wget -q -O /tmp/postinstall.sh http://our.public.server/postinstall.jessie.sh ; sh /tmp/postinstall.sh
Run Code Online (Sandbox Code Playgroud)
理想情况下,我想做类似的事情:
d-i preseed/late_command string wget -q -O /tmp/postinstall.sh http://{{ .HTTPIP }}:{{ .HTTPPort }}/postinstall.jessie.sh ; sh /tmp/postinstall.sh
Run Code Online (Sandbox Code Playgroud)
但是当然 Debian 安装程序不会用所需的值替换那些。所以我在想有可能将类似环境变量的变量传递给我们可以在 preseed 文件中使用的安装程序。
任何提示或提示表示赞赏!
编辑:尝试将 late_command 添加到引导命令中,但没有被接受。
编辑:尝试预置/运行,但它在不允许目标内命令的不同环境中运行。
编辑:这可以是一种解决方法:如何在 debian preseed 文件中通过管道将命令组合在一起?但我更喜欢将脚本放在一个单独的文件中。如果不可能,那也是不可能的。
我尝试使用专家配方为 debian 6.0.5 netinstall 配置 lvm。我不想被问到任何问题,但它一直问我“将更改写入磁盘并配置 LVM?”
这是我的 preseed.cfg 的一部分:
d-i partman-auto/disk string /dev/sda
d-i partman-auto/method string lvm
d-i partman-auto/purge_lvm_from_device boolean true
d-i partman-auto/choose_recipe select boot-root
d-i partman-auto-lvm/new_vg_name string vg00
d-i partman-auto/expert_recipe string \
boot-root :: \
128 50 128 ext2 \
$primary{ } $bootable{ } \
method{ format } format{ } \
use_filesystem{ } filesystem{ ext2 } \
mountpoint{ /boot } \
. \
10000 50 10000 ext4 \
$defaultignore{ } \
$lvmok{ } \
lv_name{ root } \ …Run Code Online (Sandbox Code Playgroud) 我需要知道如何通过 di early/command 或 di preseed/run 将其添加到 preseed 中,以便preseed.cfg从/proc/cmdline参数中设置我的镜像。
如果我做:
d-i preseed/run string ws/ubuntu.sh
#!/bin/sh
for x in `cat /proc/cmdline`; do
case $x in RPHOST*)
eval $x
d-i mirror/http/hostname string ${RPHOST}
d-i mirror/http/mirror string ${RPHOST}
d-i apt-setup/security_host string ${RPHOST}
;;
esac;
done
Run Code Online (Sandbox Code Playgroud)
它失败。
它在 CentOS 启动%pre部分运行良好,但我不知道如何通过 debian/ubuntu 预置来实现。
我正在尝试完全自动化地预置 debian 11 netinstall。\n我在这里阅读了许多文档:
\n这是我的引导行(来自 grub.cfg)
\nset default="autoinstall"\nset timeout=3\n\nmenuentry "Debian 11 Fully Automated UEFI LVM LUKS BTRFS Remote Decrypt DEBUG TTY4" --id autoinstall {\n set background_color=black\n linux /debian-installer/amd64/linux auto=true url=tftp://192.168.1.100/preseed/debseed11_crypt.cfg net.ifnames=0 biosdevname=0 ipv6.disable=1 language=en locale=en_US.UTF-8 keymap=fr vga=788 noprompt DEBCONF_DEBUG=5 --- quiet\n initrd /debian-installer/amd64/initrd.gz\n}\nRun Code Online (Sandbox Code Playgroud)\n这是我的预置文件:
\n#### Preseed preconfiguration file (for Debian buster)\n### Partman early command\n### Kernal parameter\n#d-i debian-installer/add-kernel-opts string net.ifnames=0 biosdevname=0 hostname=unassigned-hostname domain=unassigned-domain\n#d-i debconf/priority critical\n\n#d-i debian-installer/add-kernel-opts string net.ifnames=0 biosdevname=0 console=ttyS0,19200n8\n### Localization\nd-i debian-installer/locale string en_US\nd-i debian-installer/language string en\nd-i …Run Code Online (Sandbox Code Playgroud) 预播工作非常适合我使用:
auto url=http://mydomain.com/preseed.cfg
Run Code Online (Sandbox Code Playgroud)
但是一旦我使用 https 连接,它就不再起作用了。
auto url=https://mydomain.com/preseed.cfg
Run Code Online (Sandbox Code Playgroud)
使用 wget 我可以毫无问题地下载预置文件,使用 lynx 我得到一个
"SSL-Error:no issuer was found"
Run Code Online (Sandbox Code Playgroud)
所以它看起来像一个证书问题,我使用startssl.com来生成我的免费证书,nginx充当ssl网络服务器(使用firefox访问https站点没有问题)。
如何调试这个?如何强制通过 ssl 连接获取文件?
我正在尝试使用以下分区方法设置预安装(Ubuntu 12.04.03 64 位),但它不起作用,我不知道为什么。
拜托,欧比旺,你是我唯一的希望。
该-1所以我试图改变在大小最初是10亿-1,但它并没有区别。
d-i partman-lvm/device_remove_lvm boolean true
d-i partman-md/device_remove_md boolean true
d-i partman-auto/purge_lvm_from_device boolean true
d-i partman-auto/disk string /dev/sda /dev/sdb
d-i partman-auto/method string raid
d-i partman-auto-lvm/new_vg_name string vg_sys
d-i partman-auto-lvm/guided_size string max
d-i partman-auto/choose_recipe select raid-lvm
d-i partman-auto/expert_recipe string \
raid-lvm :: \
512 10 512 raid \
$primary{ } $lvmignore{ } $bootable{ } \
method{ raid } \
. \
8192 20 -1 raid \
$primary{ } $lvmignore{ } \
method{ raid …Run Code Online (Sandbox Code Playgroud) (注意,在这个问题中,前导#表示根提示符,而不是注释。此外,我已将实际主机名替换为<myhostname>。)
正如debconf (7)手册页所述,dpkg-reconfigure可以使用多个前端中的任何一个来调用,包括默认(“对话框”)交互式前端和“非交互式”前端。
我的想法正确吗?
# dpkg-reconfigure postfix
Run Code Online (Sandbox Code Playgroud)
调用对话框前端,并按Enter回答每个问题,应该相当于运行以下命令?
# dpkg-reconfigure -f noninteractive postfix
Run Code Online (Sandbox Code Playgroud)
如果是这样,那么我不明白以下差异。
在从我的网络主机映像(已安装 postfix)中新填充 Debian 9“Stretch”的 VPS 上,我使用以下命令进行预置debconf-set-selections:
# debconf-set-selections <<< "postfix postfix/destinations string <myhostname>"
# debconf-set-selections <<< "postfix postfix/mailbox_limit string 51200000"
# debconf-set-selections <<< "postfix postfix/mailname string <myhostname>"
# debconf-set-selections <<< "postfix postfix/main_mailer_type select Internet Site"
# debconf-set-selections <<< "postfix postfix/protocols select ipv4"
# debconf-set-selections <<< "postfix postfix/root_address …Run Code Online (Sandbox Code Playgroud) 预置 Ubuntu / Debian 工作正常 - 系统可启动。
但fdisk -l结果如下:
Disk /dev/sda: 50 GiB, 53687091200 bytes, 104857600 sectors
Units: sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 4096 bytes
I/O size (minimum/optimal): 4096 bytes / 4096 bytes
Disklabel type: dos
Disk identifier: 0x000e157a
Device Boot Start End Sectors Size Id Type
/dev/sda1 63 192779 192717 94.1M 83 Linux
/dev/sda2 * 192780 1172744 979965 478.5M 83 Linux
/dev/sda3 1172745 96470324 95297580 45.5G 83 Linux …Run Code Online (Sandbox Code Playgroud) partman多年来,我一直在使用以下设置来自动安装 VM:
d-i partman-auto/disk string /dev/sda
d-i partman-auto/method string regular
d-i partman-lvm/device_remove_lvm boolean true
d-i partman-md/device_remove_md boolean true
d-i partman-lvm/confirm boolean true
d-i partman/alignment string "optimal"
d-i partman-auto/expert_recipe string \
boot-root :: \
64 512 300% linux-swap \
$primary{ } \
method{ swap } format{ } \
. \
500 10000 1000000000 ext4 \
$primary{ } $bootable{ } \
method{ format } format{ } \
use_filesystem{ } filesystem{ ext4 } \
mountpoint{ / } \
.
d-i partman/confirm_write_new_label boolean …Run Code Online (Sandbox Code Playgroud) preseed ×10
debian ×6
ubuntu ×4
partition ×2
automation ×1
debconf ×1
dpkg ×1
lvm ×1
packer ×1
pxe-boot ×1
ssl ×1
supermicro ×1
ubuntu-10.04 ×1
ubuntu-12.04 ×1