Ubuntu 环境下自定义 Cobbler 安装界面
一 核心思路
二 准备与目录结构
三 自定义 PXE 启动菜单界面
DEFAULT menu.c32
PROMPT 0
TIMEOUT 200
MENU TITLE Cobbler Ubuntu PXE Menu
LABEL local
MENU LABEL Boot from local disk
LOCALBOOT 0
LABEL install-ubuntu-22.04
MENU LABEL Install Ubuntu 22.04 (Auto)
KERNEL ubuntu-22.04-x86_64/vmlinuz
APPEND initrd=ubuntu-22.04-x86_64/initrd.gz ksdevice=bootif lang=en_US url=http://$next_server/cblr/svc/op/ks/system/$name autoinstall
四 自定义 Ubuntu 安装界面与流程
d-i debian-installer/locale string en_US.UTF-8
d-i keyboard-configuration/xkb-keymap select us
d-i netcfg/choose_interface select auto
d-i netcfg/get_hostname string ubuntu-host
d-i netcfg/get_domain string localdomain
d-i mirror/country string manual
d-i mirror/http/hostname string $http_server
d-i mirror/http/directory string /cobbler/ks_mirror/ubuntu-22.04/
d-i mirror/http/proxy string
d-i partman-auto/method string regular
d-i partman-auto/choose_recipe select atomic
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
d-i passwd/user-fullname string Ubuntu User
d-i passwd/username string ubuntu
d-i passwd/user-password-crypted password $1$salt$hashedpassword # 用 openssl passwd -1 生成
d-i passwd/root-login boolean false
d-i user-setup/allow-password-weak boolean true
d-i user-setup/encrypt-home boolean false
d-i pkgsel/include string openssh-server vim
d-i pkgsel/upgrade select none
d-i pkgsel/language-packs multiselect
d-i clock-setup/utc boolean true
d-i time/zone string Asia/Shanghai
d-i clock-setup/ntp boolean true
d-i preseed/late_command string \
in-target sh -c 'echo "ubuntu ALL=(ALL) NOPASSWD:ALL" >/etc/sudoers.d/ubuntu && chmod 440 /etc/sudoers.d/ubuntu'
d-i finish-install/reboot_in_progress note
cobbler profile edit \
--name=ubuntu-22.04-x86_64 \
--kickstart=/var/lib/cobbler/kickstarts/ubuntu-22.04.seed \
--autoinstall=/var/lib/cobbler/kickstarts/ubuntu-22.04.seed
cobbler profile add \
--name=ubuntu-22.04-auto \
--distro=ubuntu-22.04-x86_64 \
--kickstart=/var/lib/cobbler/kickstarts/ubuntu-22.04.seed \
--autoinstall=/var/lib/cobbler/kickstarts/ubuntu-22.04.seed
五 验证与排错