如果ks.cfg有后期脚本,Ubuntu服务器12.04自动安装会在kickseeding运行时冻结


1

我正在尝试制作自定义的Ubuntu Server iso文件。当文件中没有%post并且Ubuntu使用ks配置正确安装时,Kickstart文件(ks.cfg)运行顺畅。

安装完成安装base,apt,grub和它回声:Kickseed Running ......它冻结@ 0%

如果我只在%post部分添加apt-get update(或类似mkdir之类的东西),但apt-get upgrade,apt-get install apache2不能正常工作,安装顺利

我已经创建了十几个iso映像并将它们安装在Virtual Box中。我已经谷歌搜索了3天并检查了ubuntu论坛,但还没有弄清楚问题。我感谢您的帮助。

这就是我制作iso图像的方式。我的ks.file和txt.cfg文件位于isolinux目录中:

root@ubuntu:/home/work
mount -o loop ubuntu-12.04-amd64.iso original-iso/
rsync -a original-iso/ custom-iso/
cp ks.cfg custom-iso/isolinux/
cp txt.cfg custom-iso/isolinux/
chmod -R 777 custom-iso/
#Creating Iso image
mkisofs -D -r -V “$IMAGE_NAME” -cache-inodes -J -l -b 
isolinux/isolinux.bin
-c isolinux/boot.cat -no-emul-boot -boot-load-size 4
-boot-info-table
-o ~/ubuntu-12.04-alternate-custom-amd64.iso custom-iso/

为ks.cfg

#Generated by Kickstart Configurator
#platform=AMD64 or Intel EM64T

#System language
lang en_US
#Language modules to install
langsupport en_US
#System keyboard
keyboard us
#System mouse
mouse
#System timezone
timezone America/Los_Angeles
#Root password
rootpw --iscrypted somethingsomething
#Initial user
user ubuntu --fullname "ubuntu" --iscrypted --password somethingsomething.
#Reboot after installation
reboot
#Use text mode install
text
#Install OS instead of upgrade
install
#Use CDROM installation media
cdrom
#System bootloader configuration
bootloader --location=mbr 
#Clear the Master Boot Record
zerombr yes
#Partition clearing information
clearpart --all --initlabel 
#Disk partitioning information
part /boot --size   128  --fstype=ext3 --asprimary
part /     --size   512  --fstype=ext3 --asprimary 
part swap  --size   512  
part /tmp  --size   512  --fstype=ext3
part /var  --size   512  --fstype=ext3
part /usr  --size  4096  --fstype=ext3
part /home --size  2048  --fstype=ext3
#System authorization infomation
auth  --useshadow  --enablemd5 
#Network information
network --bootproto=dhcp --device=eth0
#Firewall configuration
firewall --disabled --http --ftp --ssh 
#X Window System configuration information
xconfig --depth=32 --resolution=1024x768 --defaultdesktop=GNOME

%post
apt-get update
apt-get upgrade
apt-get install apache2
mkdir /home/user

txt.cfg

default autoinstall
label autoinstall
  menu label ^Install Custom Ubuntu Server
  kernel /install/vmlinuz
  append  file=/cdrom/preseed/ubuntu-server.seed 
initrd=/install/initrd.gz quiet 
ks=cdrom:/isolinux/ks.cfg --

label install
  menu label ^Install Ubuntu Server
  kernel /install/vmlinuz
  append  file=/cdrom/preseed/ubuntu-server.seed vga=788 
initrd=/install/initrd.gz quiet --

label cloud
  menu label ^Multiple server install with MAAS
  kernel /install/vmlinuz
  append   modules=maas-enlist-udeb vga=788 initrd=/install/initrd.gz quiet --

label check
  menu label ^Check disc for defects
  kernel /install/vmlinuz
  append   MENU=/bin/cdrom-checker-menu vga=788 initrd=/install/initrd.gz quiet --

label memtest
  menu label Test ^memory
  kernel /install/mt86plus

label hd
  menu label ^Boot from first hard disk
  localboot 0x80

Answers:


0

试试这个。它应该工作

%post --interpreter=/bin/bash
#!/bin/bash 
apt-get update && apt-get upgrade -y

2
如果没有任何解释,我不敢尝试......应该发生什么?如果某个步骤失败怎么办?为什么大胆,大脸等?
vonbrand
By using our site, you acknowledge that you have read and understand our Cookie Policy and Privacy Policy.
Licensed under cc by-sa 3.0 with attribution required.