Chinaunix首页 | 论坛 | 博客
  • 博客访问: 116017
  • 博文数量: 32
  • 博客积分: 2067
  • 博客等级: 大尉
  • 技术积分: 383
  • 用 户 组: 普通用户
  • 注册时间: 2009-05-08 07:47
文章分类

全部博文(32)

文章存档

2011年(1)

2010年(14)

2009年(17)

我的朋友

分类: LINUX

2009-11-05 13:47:48

做好lfs6.3,装在u盘上,现在学习blfs,做些笔记,记些手册上没提到的东西


1.开机VFS kernel panic
kvm启动u盘时,出现kernel panic,根据提示我修改menu.lst和fstab,sda全改为hda,然后正常,心里很不爽,u盘明明是被模拟为scsi,为何此处非要hda?
vmware启动刚好相反,一定要改回sda才能启动,看来是kvm的问题了


2.开机出现 Interface eth0 doesn't exist
此处我有两处错误
<1>
我没有eth0,只有eth1,小郁闷...
改之:
mv /etc/sysconfig/network-devices/ifconfig.eth0/ /etc/sysconfig/network-devices/ifconfig.eth1/

<2>
我没有网卡规则文件/etc/udev/rules.d/26-network.rules

根据9楼的解答:

我自己添加了一个/etc/udev/rules.d/26-network.rules文件
内容为:
ACTION=="add", SUBSYTEM=="net", BUS=="pci", SYSFS{address}=="0000:00:0c:29:63:9d:e3", NAME=="eth1"


00:0c:29:63:9d:e3是我虚拟机的网卡mac
查看mac:
cat /sys/class/net/eth1/address
00:0c:29:63:9d:e3

3.grub和ext3
昨天(09.11.9)重做了一遍lfs,莫名发现最后一步grub安装不上

grub> root (hd1,0)
  Filesystem type is ext3, partition type 0x83

grub> setup (hd1)
  Checking if "/boot/grub/stage1" exists... no
  Checking if "/grub/stage1" exists... no

  Error 15: File not found


/boot/grub/stage1却明明是有的,网上查到是lfs的grub和ext3分区配合的不好,所以安装grub时一定要打patch,但我明明已经打过patch了...
格掉换成xfs又需要重新编译内核(我没有加入xfs支持),苦思冥想之下想到我的usb是在笔记本的debian上格式化的,莫非debian和lfs-livecd格式化出来的ext3还不一样?

又google了半天,原来是我debian上的e2fsprogs默认格式化的Inodes是256bytes,grub0.97只认128bytes的,只好把u盘里装好的东西拷出来,打开vmware,
用livecd把u盘第一个分区格式化为ext3(据说用debian来格式化,加参数-I 128即可,未实验过),再把东西拷回u盘,然后安装grub就成功了

又在电脑前趴了一天,一大早起来装grub,看到熟悉的grub界面,泪流满面啊...

4.安装vsftpd
BLFS-6.3手册上没有提到安装vsftpd需要一个补丁,否则出现类似的一堆错误:
sysdeputil.c:162: error: expected declaration specifiers or '...' before 'capset'
sysdeputil.c:162: error: expected declaration specifiers or '...' before 'header'
sysdeputil.c:162: error: expected declaration specifiers or '...' before 'data'
In file included from sysdeputil.c:170:
/usr/include/sys/sendfile.h: In function '_syscall2':
/usr/include/sys/sendfile.h:35: error: storage class specified for parameter 'sendfile'
sysdeputil.c:186: error: storage class specified for parameter 'environ'
sysdeputil.c:187: error: storage class specified for parameter 's_proctitle_space'
sysdeputil.c:187: error: parameter 's_proctitle_space' is initialized
sysdeputil.c:188: error: storage class specified for parameter 's_proctitle_inited'
sysdeputil.c:188: error: parameter 's_proctitle_inited' is initialized
sysdeputil.c:189: error: storage class specified for parameter 's_p_proctitle'
sysdeputil.c:189: error: parameter 's_p_proctitle' is initialized
sysdeputil.c:201: error: storage class specified for parameter 'do_sendfile'
sysdeputil.c:202: error: storage class specified for parameter 'vsf_sysutil_setproctitle_internal'
sysdeputil.c:203: error: storage class specified for parameter 's_proctitle_prefix_str'
sysdeputil.c:215: error: expected '=', ',', ';', 'asm' or '__attribute__' before '{' token
sysdeputil.c:436: error: expected '=', ',', ';', 'asm' or '__attribute__' before '{' token
sysdeputil.c:474: error: storage class specified for parameter 'do_checkcap'
sysdeputil.c:478: error: expected '=', ',', ';', 'asm' or '__attribute__' before '{' token
sysdeputil.c:497: error: expected '=', ',', ';', 'asm' or '__attribute__' before '{' token
sysdeputil.c:514: error: expected '=', ',', ';', 'asm' or '__attribute__' before '{' token
sysdeputil.c:527: error: expected '=', ',', ';', 'asm' or '__attribute__' before '{' token
sysdeputil.c:604: error: expected '=', ',', ';', 'asm' or '__attribute__' before '{' token
sysdeputil.c:641: error: expected '=', ',', ';', 'asm' or '__attribute__' before '{' token
sysdeputil.c:796: error: expected '=', ',', ';', 'asm' or '__attribute__' before '{' token
sysdeputil.c:803: error: expected '=', ',', ';', 'asm' or '__attribute__' before '{' token
sysdeputil.c:809: error: expected '=', ',', ';', 'asm' or '__attribute__' before '{' token
sysdeputil.c:856: error: expected '=', ',', ';', 'asm' or '__attribute__' before '{' token
sysdeputil.c:889: error: expected '=', ',', ';', 'asm' or '__attribute__' before


tar xvf vsftpd-2.0.5.tar.gz
cd vsftpd-2.0.5
install -v -d -m 0755 /var/ftp/empty &&
install -v -d -m 0755 /home/ftp &&
groupadd -g 47 vsftpd &&
useradd -d /dev/null -c "vsftpd User" -g vsftpd -s /bin/false \
-u 47 vsftpd &&
groupadd -g 45 ftp &&
useradd -c anonymous_user -d /home/ftp -g ftp -s /bin/false -u 45 ftp


需要下载补丁
vsftp补丁
patch sysdeputil.c attachment.bin
然后按照手册make

如果使用最新的vsftpd-2.2.1则不需要此补丁

另外我按照我自己在debian上的/etc/vsftpd.conf配置无法启动vsftpd
http://blog.chinaunix.net/u3/96229/showart.php?id=1922649
稍微修改一下就能用了:
listen=YES
background=YES
anonymous_enable=YES
dirlist_enable=YES
anon_world_readable_only=YES
local_enable=YES
write_enable=YES
anon_upload_enable=YES
anon_mkdir_write_enable=YES
dirmessage_enable=YES
xferlog_enable=YES
chroot_local_user=YES
chroot_list_enable=YES
pam_service_name=vsftpd
anon_root=/home/ftp
max_clients=3
max_per_ip=2
nopriv_user=vsftpd
secure_chroot_dir=/var/ftp/empty

5.安装gdb7
这个没有任何难度
wget
tar xvf
gdb-7.0.tar.bz2
cd gdb-7.0
./configure --prefix=/usr --disable-werror
make
make install


6.安装minicom2.3
这个也没有任何难度
wget
tar xvf
minicom-2.3.tar.gz
cd minicom-2.3
./configure --prefix=/usr
make
make install


7.安装bash-completion-1.1
这个也不难
wget
tar xvf bash-completion-1.1.tar.bz2
cd bash-completion-1.1
./configure --prefix=/usr
make install
mv bash_completion /etc/

vim ~/.bash_profile
加入:
if [ -f /etc/bash_completion ]; then
. /etc/bash_completion
fi


8.安装skyeye1.2.9_rc1
这个稍微有点麻烦,一开始make时报错,google很久尝试了一下几种办法最后:
wget http://sourceforge.net/projects/skyeye/files/skyeye/skyeye-1.2.9_rc1/skyeye-1.2.9_rc1.tar.gz/download?use_mirror=ncu
tar xvf skyeye-1.2.9_rc1.tar.gz
cd skyeye-1.2.9_rc1
export LIBS=-ldl && ./configure --prefix=/usr
make
make install

根据
make后还可以跟一些参数

昨天(09.11.13)再次重做lfs,这次用的是vmware+livecd+svn-20091106-packages+u盘,所以后面的笔记都基于svn了
为了削弱u盘读写速度慢的因素影响,我加了一个虚拟磁盘sda,u盘的sdb1挂载至/mnt/lfs,sda挂载至/mnt/lfs/sources
果然速度提高了很多,断断续续8个多小时,比以前用livecd+物理机+u盘做6.3还快一点
第一次脱离youbest的教程,完全看官方手册做,好在制作过程基本一切正常,但还有两个问题:
1.很尴尬,我不会用grub2,貌似grub2不用自己写引导菜单,对我livecd+sda+u盘的方式识别不太好,找不到内核
对grub.cfg也不熟,所以我猥琐地卸掉它逃回到grub了
那一刻,我理解了为何到了二十一世纪的今天,还有大把linux教程在用redhat9
2.遇到了问题9:
9.VFS:unable to mount root fs on unknown-block(0,0)
参考此文
关键的这个:
Device Drivers  --->
[*] Fusion MPT device support  --->
    --- Fusion MPT device support 
  | |    < >   Fusion MPT ScsiHost drivers for SPI (NEW)
  | |    <*>   Fusion MPT ScsiHost drivers for FC
  | |    < >   Fusion MPT ScsiHost drivers for SAS (NEW)
  | |    (128) Maximum number of scatter gather entries (16 - 128) (NEW)
  | |    <*>   Fusion MPT misc device (ioctl) driver
  | |    [ ]   Fusion MPT logging facility (NEW)
svn-20091106的内核为最新的2.6.31.5,也许是和livecd内核相差太大,读入livecd的config后很多选项没有选,包括scsi之类
虽然我添加了很多,但因为不太明白Fusion MPT是什么,所以没选
继续googleing,最终还是没看明白,虽然我是学硬件的,但对实际产品知之甚少,惭愧...
阅读(1290) | 评论(0) | 转发(0) |
给主人留下些什么吧!~~