设为首页
收藏本站
用户名
Email
自动登录
找回密码
密码
登录
注册
快捷导航
平台
Portal
论坛
BBS
文库
项目
群组
Group
我的博客
Space
搜索
搜索
热搜:
shell
linux
mysql
本版
用户
LinuxSir.cn,穿越时空的Linuxsir!
»
论坛
›
Linux 发行版讨论区 —— LinuxSir.cn
›
Debian Linux
›
求助:定制Debian的安装CD出错
返回列表
查看:
1176
|
回复:
6
求助:定制Debian的安装CD出错
[复制链接]
duxingxia09
duxingxia09
当前离线
积分
12
IP卡
狗仔卡
发表于 2009-6-1 10:00:08
|
显示全部楼层
|
阅读模式
我的大体步骤是参考如下:
http://www.linuxsir.cn/bbs/thread295282.html
由于我想定制lenny,所以修改了一下脚本
#!/bin/bash
# Step 0 : install tools needed
apt-get update
#apt-get install --yes mkisofs debootstrap unionfs-modules-`uname -r`
apt-get install --yes mkisofs debootstrap unionfs-fuse
# Step 1 : make directory
export workdir=/tmp/cdiso1
mkdir -p $workdir/{roiso,rwiso,newiso,scripts,bootstrap}
# Step 2 : download the d-i image and make it(iso) writable with unionfs
cd $workdir
#cp ~/iso/debian-501-i386-netinst.iso .
mount -o loop ~/iso/debian-501-i386-netinst.iso $workdir/roiso
mount -t unionfs -o dirs=$workdir/rwiso=rw:$workdir/roiso/=ro unionfs $workdir/newiso
# Step 3a : download the indices file ( to update the pool)
cd $workdir/scripts/
#wget [url]http://debian.linux.org.tw/debian/indices/override.etch.contrib.gz[/url]
#wget [url]http://debian.linux.org.tw/debian/indices/override.etch.contrib.src.gz[/url]
#wget [url]http://debian.linux.org.tw/debian/indices/override.etch.extra.contrib.gz[/url]
#wget [url]http://debian.linux.org.tw/debian/indices/override.etch.extra.main.gz[/url]
#wget [url]http://debian.linux.org.tw/debian/indices/override.etch.extra.non-free.gz[/url]
#wget [url]http://debian.linux.org.tw/debian/indices/override.etch.main.debian-installer.gz[/url]
#wget [url]http://debian.linux.org.tw/debian/indices/override.etch.main.gz[/url]
#wget [url]http://debian.linux.org.tw/debian/indices/override.etch.main.src.gz[/url]
#wget [url]http://debian.linux.org.tw/debian/indices/override.etch.non-free.gz[/url]
#wget [url]http://debian.linux.org.tw/debian/indices/override.etch.non-free.src.gz[/url]
cp ~/iso/debianoverride/* .
gunzip *.gz
# Step 3b : create the configration for the apt-ftparchive
cd $workdir/scripts/
cp ~/iso/apt.conf .
cp ~/iso/config_binary .
cp ~/iso/config_installer .
# Step 4 : build the bootstrap and download the extra package
# move the downloaded deb to the d-i ISO 's pool
cd $workdir
#debootstrap etch $workdir/bootstrap [url]http://debian.linux.org.tw/debian/[/url]
debootstrap lenny $workdir/bootstrap [url]http://211.86.156.210:80/debian/[/url]
chroot $workdir/bootstrap apt-get update
chroot $workdir/bootstrap apt-get -y install apt-move
chroot $workdir/bootstrap apt-get clean
chroot $workdir/bootstrap apt-get -y install --download-only eject file sudo vim-tiny console-common kbd locales gdm xfce4 desktop-base x-window-system-core xresprobe
chroot $workdir/bootstrap apt-move update
cp -a $workdir/bootstrap/mirrors/debian/pool $workdir/newiso/
chroot $workdir/bootstrap apt-get clean
# Step 5 : update Release file and indices
cd $workdir/newiso
apt-ftparchive -c $workdir/scripts/apt.conf generate $workdir/scripts/config_installer
apt-ftparchive -c $workdir/scripts/apt.conf generate $workdir/scripts/config_binary
apt-ftparchive -c $workdir/scripts/apt.conf release dists/lenny > ./dists/lenny/Release
# Step 6a : create the preseed.cfg to auto-install the extra packages
cd $workdir/newiso/.disk/
cp ~/iso/preseed.cfg .
# Step 6b : append the boot parameter to include the preseed.cfg
cd $workdir/newiso/isolinux
#sed isolinux.cfg to append : preseed/file=/cdrom/preseed.cfg
cp isolinux.cfg isolinux.cfg.org
sed -e '15,28s:gz:gz preseed/file=/cdrom/.disk/preseed.cfg:g' isolinux.cfg.org > isolinux.cfg
# Step 7 : create the ISO
cd $workdir
mkisofs -o ./cdiso.iso -r -J -l -no-emul-boot -boot-load-size 4 -boot-info-table -b isolinux/isolinux.bin -c isolinux/boot.cat ./newiso/
# Step 8 : clean
umount $workdir/newiso $workdir/roiso
mv cdi.iso ~/iso/
复制代码
//apt.conf 如下:
APT::FTPArchive::Release::Origin "Debian";
APT::FTPArchive::Release::Label "Debian";
APT::FTPArchive::Release::Suite "stable";
APT::FTPArchive::Release::Version "5.0";
APT::FTPArchive::Release::Codename "lenny";
APT::FTPArchive::Release::Architectures "i386";
APT::FTPArchive::Release::Components "main non-free contrib";
APT::FTPArchive::Release::Description "Debian lenny";
复制代码
//config_installer如下:
Dir {
ArchiveDir "$workdir/newiso/";
OverrideDir "$workdir/scripts/";
CacheDir "$workdir/";
};
TreeDefault {
Directory "pool/";
};
BinDirectory "pool/main" {
Packages "dists/lenny/main/debian-installer/binary-i386/Packages";
BinOverride "override.lenny.main";
ExtraOverride "override.lenny.extra.main";
};
Default {
Packages {
Extensions ".udeb";
Compress ". gzip"
};
Contents {
Compress "gzip"
};
};
复制代码
//config_binary如下:
Dir {
ArchiveDir "$workdir/newiso/";
OverrideDir "$workdir/scripts/";
CacheDir "$workdir/";
};
TreeDefault {
Directory "pool/";
};
BinDirectory "pool/main" {
Packages "dists/lenny/main/binary-i386/Packages";
BinOverride "override.lenny.main";
ExtraOverride "override.lenny.extra.main";
};
BinDirectory "pool/contrib" {
Packages "dists/lenny/contrib/binary-i386/Packages";
BinOverride "override.lenny.contrib";
ExtraOverride "override.lenny.extra.contrib";
};
Default {
Packages {
Extensions ".deb";
Compress ". gzip";
};
Contents {
Compress "gzip";
};
};
复制代码
//preseed.cfg如下:
# Individual additional packages to install
d-i pkgsel/include string eject file sudo vim-tiny console-common kbd locales gdm xfce4 desktop-base x-window-system-core xresprobe
tasksel tasksel/first multiselect standard, xfce-desktop
复制代码
//debianoverride文件夹内容如下:
# ls
override.lenny.contrib.gz override.lenny.main.gz
override.lenny.contrib.src.gz override.lenny.main.src.gz
override.lenny.extra.contrib.gz override.lenny.non-free.gz
override.lenny.extra.main.gz override.lenny.non-free.src.gz
override.lenny.extra.non-free.gz
复制代码
先请教一个脚本问题:
mount -t unionfs -o dirs=$workdir/rwiso=rw:$workdir/roiso/=ro unionfs $workdir/newiso
复制代码
可以换成如下命令吗?请大牛解释一下上一个命令,谢谢
unionfs-fuse dirs=$workdir/rwiso=rw:$workdir/roiso/=ro $workdir/newiso
复制代码
前面的安装步骤都没有问题,主要是后面出错,提示信息如下:
root@ubuntu:/tmp/cdis/newiso# apt-ftparchive -c ../scripts/apt.conf generate ../scripts/config_installer
E: Unable to open $workdir/scripts/override.lenny.main - fopen (2 No such file or directory)
E: Error processing directory pool/main
Done Packages, Starting contents.
Done. 0B in 0 archives. Took 0s
复制代码
//但是明明有的阿
root@ubuntu:/tmp/cdis/newiso# ls ../scripts/
apt.conf override.lenny.extra.main
config_binary override.lenny.extra.non-free
config_installer [color=red]override.lenny.main[/color]
override.lenny.contrib override.lenny.main.src
override.lenny.contrib.src override.lenny.non-free
override.lenny.extra.contrib override.lenny.non-free.src
复制代码
小弟十分无解,重新做了一遍还是不行,为什么会出现这样的情况呢?
不知道是不是有人碰到跟我一样的问题
请成功定制过的帮手解决一下,谢谢~~~
回复
使用道具
举报
提升卡
置顶卡
沉默卡
喧嚣卡
变色卡
显身卡
duxingxia09
duxingxia09
当前离线
积分
12
IP卡
狗仔卡
楼主
|
发表于 2009-6-3 22:17:40
|
显示全部楼层
哎。。。自己解决了
回复
支持
反对
使用道具
举报
显身卡
duxingxia09
duxingxia09
当前离线
积分
12
IP卡
狗仔卡
楼主
|
发表于 2009-6-4 12:34:51
|
显示全部楼层
现在我修改了一下脚本,可以正常生成安装的iso,但是
debian-installer不能正常识别preseed.cfg,就是不能按照我预先给定的命令安装
请教一下大家 debian的安装过程怎么制定preseed.cfg?
我写的preseed.cfg 如下:
# Individual additional packages to install
d-i pkgsel/include string eject file sudo vim-tiny console-common kbd locales gdm xfce4 desktop-base x-window-system-core xresprobe
#tasksel tasksel/first multiselect standard, xfce-desktop
tasksel tasksel/first multiselect xfce-desktop
复制代码
isolinux.cfg如下:
# D-I config version 1.0
include menu.cfg
default vesamenu.c32
prompt 0
timeout 0
preseed/file=/cdrom/.disk/preseed.cfg
复制代码
但是很奇怪,我安装过程选择了desktop和standart,结果安装的桌面环境还是gnome,无语
生成iso的脚本如下:
#!/bin/bash
# Step 0 : install tools needed
apt-get update
apt-get install --yes mkisofs debootstrap
# Step 1 : make directory
export workdir=/tmp/cdiso
mkdir -p $workdir/{roiso,newiso,scripts,bootstrap}
# Step 2 : download the d-i image and make it(iso) writable with unionfs
cd $workdir
#export http_proxy=http://*.*.*.*:*/
#wget http://cdimage.debian.org/debian-cd/5.0.1/i386/iso-cd/debian-501-i386-netinst.iso
wget http://ftp.hk.debian.org/debian-cd/5.0.0/i386/iso-cd/debian-500-i386-netinst.iso
mount -o loop ./debian-500-i386-netinst.iso $workdir/roiso
rsync -azvb $workdir/roiso/ newiso/
umount roiso/
# Step 3a : download the indices file ( to update the pool)
cd $workdir/scripts/
#export http_proxy=
#wget http://mirrors.163.com/debian/indices/override.lenny.contrib.gz
#wget http://mirrors.163.com/debian/indices/override.lenny.contrib.src.gz
#wget http://mirrors.163.com/debian/indices/override.lenny.extra.contrib.gz
#wget http://mirrors.163.com/debian/indices/override.lenny.extra.main.gz
#wget http://mirrors.163.com/debian/indices/override.lenny.extra.non-free.gz
#wget http://mirrors.163.com/debian/indices/override.lenny.main.gz
#wget http://mirrors.163.com/debian/indices/override.lenny.main.src.gz
#wget http://mirrors.163.com/debian/indices/override.lenny.non-free.gz
#wget http://mirrors.163.com/debian/indices/override.lenny.non-free.src.gz
wget http://ftp.hk.debian.org/debian/indices/override.lenny.contrib.gz
wget http://ftp.hk.debian.org/debian/indices/override.lenny.contrib.src.gz
wget http://ftp.hk.debian.org/debian/indices/override.lenny.extra.contrib.gz
wget http://ftp.hk.debian.org/debian/indices/override.lenny.extra.main.gz
wget http://ftp.hk.debian.org/debian/indices/override.lenny.extra.non-free.gz
wget http://ftp.hk.debian.org/debian/indices/override.lenny.main.gz
wget http://ftp.hk.debian.org/debian/indices/override.lenny.main.src.gz
wget http://ftp.hk.debian.org/debian/indices/override.lenny.non-free.gz
wget http://ftp.hk.debian.org/debian/indices/override.lenny.non-free.src.gz
gunzip *.gz
# Step 3b : create the configration for the apt-ftparchive
cd $workdir/scripts/
cat >>apt.conf <<EOF
APT {
FTPArchive {
Release {
Origin "Debian";
Label "Debian";
Suite "stable";
Version "5.0.0";
Codename "lenny";
Architectures "i386";
Components "main contrib";
Description "Duxingxia Debian Lenny distribution ";
};
};
};
EOF
cat >>apt-ftparchive-deb.conf <<EOF
Dir {
ArchiveDir "$workdir/newiso/";
OverrideDir "$workdir/scripts";
CacheDir "$workdir";
};
TreeDefault {
Directory "pool/";
};
BinDirectory "pool/main" {
Packages "dists/lenny/main/binary-i386/Packages";
BinOverride "override.lenny.main";
ExtraOverride "override.lenny.extra.main";
};
BinDirectory "pool/contrib" {
Packages "dists/lenny/contrib/binary-i386/Packages";
BinOverride "override.lenny.contrib";
ExtraOverride "override.lenny.extra.contrib";
};
Default {
Packages {
Extensions ".deb";
Compress ". gzip";
};
Contents {
Compress "gzip";
};
};
EOF
cat >>apt-ftparchive-udeb.conf <<EOF
Dir {
ArchiveDir "$workdir/newiso/";
OverrideDir "$workdir/scripts";
CacheDir "$workdir";
};
TreeDefault {
Directory "pool/";
};
BinDirectory "pool/main" {
Packages "dists/lenny/main/debian-installer/binary-i386/Packages";
BinOverride "override.lenny.main";
ExtraOverride "override.lenny.extra.main";
};
Default {
Packages {
Extensions ".udeb";
Compress ". gzip"
};
Contents {
Compress "gzip"
};
};
EOF
# Step 4 : build the bootstrap and download the extra package
# move the downloaded deb to the d-i ISO 's pool
cd $workdir
#debootstrap lenny $workdir/bootstrap http://debian.cn99.com/debian/
debootstrap lenny $workdir/bootstrap http://ftp.hk.debian.org/debian/
chroot $workdir/bootstrap apt-get update
chroot $workdir/bootstrap apt-get -y install apt-move
chroot $workdir/bootstrap apt-get clean
chroot $workdir/bootstrap apt-get -y install --download-only eject file sudo vim-tiny console-common kbd locales gdm xfce4 desktop-base x-window-system-core
xresprobe
chroot $workdir/bootstrap apt-move update
cp -a $workdir/bootstrap/mirrors/debian/pool $workdir/newiso/
chroot $workdir/bootstrap apt-get clean
# Step 5 : update Release file and indices
cd $workdir/newiso
apt-ftparchive -c $workdir/scripts/apt.conf generate $workdir/scripts/apt-ftparchive-udeb.conf
apt-ftparchive -c $workdir/scripts/apt.conf generate $workdir/scripts/apt-ftparchive-deb.conf
apt-ftparchive -c $workdir/scripts/apt.conf release dists/lenny > ./dists/lenny/Release
# Step 6a : create the preseed.cfg to auto-install the extra packages
cd $workdir/newiso/.disk/
cat >>preseed.cfg <<EOF
# Individual additional packages to install
d-i pkgsel/include string eject file sudo vim-tiny console-common kbd locales gdm xfce4 desktop-base x-window-system-core xresprobe
#tasksel tasksel/first multiselect standard, xfce-desktop
tasksel tasksel/first multiselect xfce-desktop
EOF
# Step 6b : append the boot parameter to include the preseed.cfg
cd $workdir/newiso/isolinux
echo "preseed/file=/cdrom/.disk/preseed.cfg" >> isolinux.cfg
# Step 7 : create the ISO
cd $workdir
mkisofs -o ./cdiso.iso -r -J -l -no-emul-boot -boot-load-size 4 -boot-info-table -b isolinux/isolinux.bin -c isolinux/boot.cat ./newiso/
# Step 8 : clean
#mv cdi.iso /home/duxingxia/iso/
#rm -rf $workdir
复制代码
回复
支持
反对
使用道具
举报
显身卡
yjwork
yjwork
当前离线
积分
158
IP卡
狗仔卡
发表于 2009-6-4 14:27:04
|
显示全部楼层
你测试是用的光盘安装还是硬盘安装
回复
支持
反对
使用道具
举报
显身卡
duxingxia09
duxingxia09
当前离线
积分
12
IP卡
狗仔卡
楼主
|
发表于 2009-6-4 16:30:12
|
显示全部楼层
我生成iso后用虚拟机安装测试的
结果d-i 的命令行还是不起作用
不知道哪里出错了。。
Post by
yjwork;1994039
你测试是用的光盘安装还是硬盘安装
回复
支持
反对
使用道具
举报
显身卡
zheng501gf
zheng501gf
当前离线
积分
4
IP卡
狗仔卡
发表于 2009-12-30 16:39:22
|
显示全部楼层
不知道楼主的问题解决了没有??
想请教请教!
回复
支持
反对
使用道具
举报
显身卡
cashbell
cashbell
当前离线
积分
1
IP卡
狗仔卡
发表于 2009-12-30 19:08:55
|
显示全部楼层
我按照楼主的脚本生成ISO成功了,但是预置文件preseed.cfg不起作用,而且该ISO在虚拟机中进行光盘完整性校验时总是通不过,有没有高手可以指点一下,我将感谢非常!
我用两种方法试验preseed.cfg,一种是将preseed.cfg放在光盘根目录的.disk文件夹中,然后在isolinux/isolinux.cfg中添加
preseed/file=/cdrom/.disk/preseed.cfg
preseed/file/checksum=56bb074c274d8a2c71a88f6839fc12a9
还有一种是直接修改install.386中的initrd.gz,加入preseed.cfg。
结果都不行,郁闷阿
回复
支持
反对
使用道具
举报
显身卡
返回列表
高级模式
B
Color
Image
Link
Quote
Code
Smilies
您需要登录后才可以回帖
登录
|
注册
本版积分规则
发表回复
回帖后跳转到最后一页
浏览过的版块
Slackware Linux
Linux 基础讨论区(新手速成)
LFS(LinuxfromScratch)
Redhat/Fedora/CentOS Linux
LinuxSir 论坛管理
服务器架设、应用、维护
SuSE Linux
Linux 输入开发与研究
Gentoo Linux
Archlinux讨论区
Copyright © 2002-2023
LinuxSir.cn
(http://www.linuxsir.cn/) 版权所有 All Rights Reserved.
Powered by
RedflagLinux!
技术支持:
中科红旗
|
京ICP备19024520号
快速回复
返回顶部
返回列表