Archive for January, 2008

17th Jan 2008

LFS 6.3 with reiser4 and initrd

上周用了一周时间搞了 LFS 6.3, 用 reiser4 作根分区.
LFS 本身没什么, 细心看 LFS Book 应该就没问题了. 我就分享一下用 reiser4 的经验吧.

www.namesys.com 无法访问, 所以 reiser4 需要的东西可以从这里下载:
http://chichkin_i.zelnet.ru/namesys/

参考文章:
http://www.linuxfromscratch.org/hints/downloads/files/initrd.txt
http://www.linuxfromscratch.org/hints/downloads/files/reiser4-on-2.6.txt

需要的 mkinitrd 脚本:
http://www.linuxfromscratch.org/hints/downloads/files/ATTACHMENTS/initrd/

首先刚开始准备分区时要格式化成 reiser4 ( LiveCD 支持 reiser4 )
然后准备内核:

tar xfv linux-2.6.22.5.tar.bz2
cd linux-2.6.22.5
zcat path-to-patch/reiser4-for-2.6.22-2.patch.gz | patch -p1
cd ..
tar jcfv linux-2.6.22.5-patched.tar.bz2 linux-2.6.22.5
rm linux-2.6.22.5

以后用到内核源码就用这个 linux-2.6.22.5-patched.tar.bz2

然后到了 grub 那节, 跳过. 用grub 启动 reiser4 比较麻烦, 用 lilo 会方便点.

第六章安装完最后一个软件 vim 后, 就要安装 reiser4 的东西了
首先是 libaal

./configure --prefix=/usr --sbindir=/sbin --enable-libminimal --enable-static
make
make install

然后是reiser4progs

./configure --prefix=/usr --sbindir=/sbin --enable-libminimal --enable-full-static
make
make install

编译内核时文件系统选上 reiser4 就可以了

下面是 initrd 用的:

第八章编译内核时要注意这几个配置:
-> General setup -> Initial RAM filesystem and RAM disk (initramfs/initrd) support 选 y
-> Device Drivers -> Block devices -> RAM disk support 选 y
-> File systems -> Ext3 journalling file system support 选 y
然后编译内核.

initrd 需要 busybox 作 shell.
下载: http://www.busybox.net/downloads/busybox-1.01.tar.bz2 切勿贪新.
配置:

make defconfig
sed -r 's/^([^#=]+).+/# \1 is not set/g' -i .config # 配置全部选 n
make menuconfig

像这样配置

	General Configuration --->
		[*] Support for devfs
			 NOTE - only if you using devfs
	Build Options  --->
		[*] Build BusyBox as a static binary (no shared libs)
	Coreutils  --->
		[*] echo (basic SUSv3 version taking no options
	Linux Module Utilities  --->
		[*] insmod
		[*]     Support version 2.1.x to 2.4.x Linux kernels
			NOTE - only if your using a 2.4 kernel
		[*]     Support version 2.6.x Linux kernels
			NOTE - only if your using a 2.6 kernel
	Another Bourne-like Shell  --->
		[*]     Optimize for size instead of speed
		[*]     Enable alias support
		(0) history size
	Linux System Utilities  --->
		[*] pivot_root
		[*] mount

然后编译安装:

make
cp busybox /bin/busybox.static

制作 initrd 镜像:

mkinitrd kernel_version=2.6.22.5 initrdfs=ext3 +module="piix libata ata_piix reiser4 ata_generic reiser4"

附加的 module 按需选择, 看一下 lsmod 是个好主意.

接着添加一个启动脚本, 在启动后清理 initrd :

#!/bin/sh
# Begin $rc_base/init.d/initrd

# Based on sysklogd script from LFS-3.1 and earlier.
# Rewritten by Gerard Beekmans  - gerard@linuxfromscratch.org

source /etc/sysconfig/rc
source $rc_functions

case "$1" in
        start)
        if [ -e /initrd/dev/.devfsd ]
        then   
                umount /initrd/dev
        fi
       
        if [ -e /initrd/proc ]
        then   
                umount /initrd/proc
        fi
       
        if [ -e /initrd/sys ]
        then   
                umount /initrd/sys
        fi
       
        if [ -e /initrd/linuxrc ]
        then   
                umount /initrd
                echo "Clearing Initial RAM Disk..."
                blockdev --flushbufs /dev/ram0
                evaluate_retval
        fi
        ;;
        *)
        echo "Usage: $0 {start}"
        exit 1
        ;;
esac

# End $rc_base/init.d/initrd

保存为 /etc/rc.d/init.d/initrd, 然后在 /etc/rc.d/rcsysinit.d 建一个符号链接:

ln -sf ../init.d/initrd S41initrd

Reboot and enjoy !

Posted by Posted by autumncat under Filed under Linux Comments 2 Comments »

05th Jan 2008

震撼, 感慨.

真噁心..沒素質..竟然把這些東西丟在樓梯口

然後不知道誰寫啲字..哎..這年頭…..

給看不懂啲加嗰徬述

圖中爲兩張m巾+一個套..套裏面有xx.外面有血

其他啲自己想吧

昨天看到这个帖, 心中不禁感慨.
http://bbs.gz4u.net/read.php?tid=906404

致欲尝禁果的人, 凡事要三思!

Posted by Posted by autumncat under Filed under Life Comments 2 Comments »

01st Jan 2008

不明白我说什么就忽视吧.

Writting :

Title: Narrowing the Gap between Rich and Poor

///////////////////////////////////////////////

若二次方程 f(x) = ax^2 + bx + c = x 无实根, 求证 f(f(x)) = x 无实根

A, B, C, D 4个球队进行主客场循环赛, 胜3平1负0, 忽略同分情况, 前两名出线.
若各球队都至少得3分, A队要得几分才能保证出线?
若无上一问的得分限制, 答案又是多少?

///////////////////////////////////////////////

一圆柱形条形磁铁投入一无限长的内径刚好符合磁铁外径的铜管, 磁铁运动情况如何(定性分析)

///////////////////////////////////////////////

喜欢什么科目?
选什么专业?
为什么选数学?
有考研或留学的打算吗?
(以下用英文提问和回答)
在学校时是否双语教学?
平时有说英语吗?
一些课程用英语教授, 你喜欢这样吗? 为什么?
(以下恢复到中文)
在月亮上同一个地方拍到一系列地球升起的照片, 鉴定照片真伪. 如果是假的应怎样修改才合理?
地铁车头形状是怎么样的, 为什么要做成平的而不是子弹头形状?
连续两次满月间月亮绕地球转了多少度?
地球一年自转多少周?

Posted by Posted by autumncat under Filed under Life Comments 5 Comments »