Showing posts with label gentoo. Show all posts
Showing posts with label gentoo. Show all posts

Friday, August 19, 2011

Step 2: boot livedvd-amd64-multilib-11.2.iso from hard disk (with grub2)

After a few days experience of the gentoo livedvd run from usb, I think the usb drive should be saved for some other important data; I decided to copy the iso and run it from hard disk; usually a hard disk has large enough space, people could just copy all files inside /image.squashfs to a local partition, like the way on gentoo-wiki, but this computer assigned to me has a SSD drive default, has only 120G, furthermore, it's already partitioned long time ago, I don't have more space to back up all data on it and don't want to risk re-partition it; so I'd still like the way of loop mount iso on the fly, for saving disk space;
http://www.gentoo-wiki.info/HOWTO_Lightning_fast_install_from_LiveCD

/dev/sda3       240277504   250068991     4895744   83  Linux
/dev/sda5       129341440   132855807     1757184   82  Linux swap / Solaris
/dev/sda6       132857856   152387583     9764864   83  Linux LABEL=UBUNTU
/dev/sda7       152389632   210980863    29295616   83  Linux LABEL=HOME
/dev/sda8       210982912   211372031      194560   83  Linux LABEL=DEBIAN

The ubuntu partition already has grub2 default installed and home partition has a lot of remaining space, so I mkdir /gentoo under /home, put livedvd-amd64-multilib-11.2.iso there, rename or hardlink a short name gentoo.iso there; extract kernel/initramfs from the iso and put into /boot of the ubuntu partition, create a new entry there and no need to install another grub;

Notice that grub2 (version 1.9*) has slightly different syntax with grub1 (version 0.9*):
  1. disk partition order, counter from 1, same as Linux partitions;
  2. better not to change (append entries) in grub.cfg directly, use /boot/grub/custom.cfg instead; because every time later ubuntu upgrade or install new kernels would call update-grub2 that would overwrite grub.cfg; you could change /etc/grub/40_custom (that support script smart calculation) or /boot/grub/custom.cfg on that ubuntu partition; here I use custom.cfg;
Gentoo-11 ~ # cat /mnt/sda6/boot/grub/custom.cfg
menuentry "Gentoo11-Live Linux-3.0.0 (on /dev/sda7 {gentoo/gentoo.iso})" {
	  linux (hd0,6)/boot/gentoo/gentoo aufs_mem=2G cdroot=/dev/sda7 cdroot_type=ext4 isoboot=gentoo/gentoo.iso vga=791 splash=silent,theme:livecd-10 console=tty1 quiet nodetect doload=ahci dox
	  initrd (hd0,7)/gentoo/gentoo-initramfs.gz
}

Compared to previous menuentry in syslinux.cfg, here I removed some unused parameters (like "root=/dev/ram0 init=/linuxrc" because that is the default, I think I should recommend the Gentoo-Ten team to remove that, but not sure if any other computer need it, at least my computer doesn't need it, it could boot, as granted; the only useful parameters here are:
  1. aufs_mem=2G, it means how large of tmpfs layered on top of squashfs by aufs; default it's 420M tmpfs, enough if you don't modify/install too many applications in live mode;
  2. cdroot=/dev/sda7, specify a parameter saves parsing during booting; specify cdroot_type the same way;
  3. isoboot=gentoo/gentoo.iso, you need to specify where do you save that iso inside that partition; it's required;
  4. nodetect doload=ahci dox; depends on if you know your hardware, if no idea, autodetect is best, but I know my hardware, specifying it could save booting time;
The default gentoo kernel/initramfs should work this way I thought originally, but it doesn't, I have to look at the init script and change it a little, here is the diff: http://paste.pocoo.org/show/460334/

the initramfs is just cpio (newc format) + gz; extract and reconstruct in this way;
$ mkdir -vp gentoo-initramfs
$ zcat gentoo.igz |(cd gentoo-initramfs; cpio -d -i)
$ emacs -nw gentoo-initramfs/...; modify /init and /etc/init.scripts
$ (cd gentoo-initramfs/; find |cpio -H newc -o) |gzip -v9 >gentoo-initramfs.gz
Or
$ (cd gentoo-initramfs/; find |cpio -H newc -o) |xz -v9 >gentoo-initramfs.xz
Gentoo-11 ~ # (cd /home/gentoo/; ls -lh gentoo-initramfs.*)
-rw-r--r-- 1 root root 9.8M Aug 16 02:25 gentoo-initramfs.gz
-rw-r--r-- 1 root root 7.5M Aug 15 17:50 gentoo-initramfs.xz
The latest xz (aka. lzma2) could save 20% over "gzip -v9";

Update: use "xz --check=crc32" instead, because some latest xz support "none,crc32,crc64,sha256" or more types of integrity check, default as crc64; the kernel xz dec is "xz embedded" that only support "none or crc32",  kernel may report XZ_OPTIONS_ERROR, you could use "xz -vl ..." to check it, read Documentation/xz.txt for more;
/usr/src/linux-3.0-gentoo-r1/lib/decompress_unxz.c:
-=--:%%--F1  decompress_unxz.c   92% L364   (C/l Abbrev)

        case XZ_OPTIONS_ERROR:
                error("Input was encoded with settings that are not "
                                "supported by this XZ decoder");
                break;

# (cd gentoo-initramfs/; find |cpio -H newc -o) |xz --check=crc32 -v9 >../gentoo-initramfs.xz

Thursday, August 18, 2011

Step 1: boot livedvd-amd64-multilib-11.2.iso from a usbstick (without wiping all data)
Gentoo Linux releases 11.2 LiveDVD: run the iso from hard disk (hack on initramfs)

Recently Gentoo LiveDVD 11.2 was released on Aug 7, I'd like to try it but don't want to waste a blank DVD; the first thing I think is to run it on a usb; the only usb stick I have important data, don't want to try the dd way ("dd if=image.iso of=/dev/sdb")  in faq which will wipe out all data, looking up some documentation on its default isolinux/syslinux, finally I got this way working:

1) mount loop that livedvd-amd64-multilib-11.2.iso; mkdir /gentoo on the usb stick, copy all files inside the iso into that /gentoo;
2) rename its isolinux/ to syslinux/, and isolinux.cfg to syslinux.cfg; yes! thanks to syslinux.zytor.com great work, they're sharing the same configuration file syntax, what you need to do is just rename;
3) since we copied all the files from rootdir of cdrom to /gentoo of another disk(usb), the syslinux.cfg need to be adjusted; find out the "label gentoo-x86_64", change it to this;


label gentoo-x86_64
  MENU LABEL Gentoo ^x86_64
  kernel ../boot/gentoo
  append root=/dev/ram0 init=/linuxrc dokeymap aufs looptype=squashfs loop=/gentoo/image.squashfs cdroot initrd=../boot/gentoo.igz vga=791 splash=silent,theme:livecd-10 console=tty1 quiet subdir=gentoo

the "kernel" "initrd=" parameters was parsed by syslinux so it support "../" style relative path, so you could move the whole "/gentoo" to any name, under any path; but the "loop=" and some otherwhere was read by code inside the initramfs (here it's ../boot/gentoo.igz), there some hard code doesn't support relative path, so you must write its full absolute path, prepend "/gentoo" to image.squashfs, and append "subdir=gentoo";

for other label entries if you want to use, you could change the same way;

4) install syslinux bootsector to that usb stick (/dev/sdb has only one vfat partition):
  syslinux -d /gentoo/syslinux /dev/sdb1

Then you could boot it with this usb: find out label gentoo-x86_64 and boot it into LiveDVD 11.2;
The 2.8G iso file has packaged with linux kernel 3.0.0 and most a dozen of major and minor WM Environment (gnome3/kde4/xfce/lxde/windowmaker/openbox/fluxbox/awesome/xmbc/...), and all applications on each WM; just try and found which is your favorite? all the latest software;


http://www.gentoo.org/news/20110807-livedvd.xml
http://syslinux.zytor.com/wiki/index.php/SYSLINUX
http://paste.pocoo.org/show/460334/
http://www.gentoo.org/proj/en/pr/releases/10.0/faq.xml
http://mirrors.kernel.org/gentoo/releases/amd64/11.2/

livedvd-amd64-multilib-11.2.iso                      06-Aug-2011 07:12  2.8G

Saturday, April 23, 2011

grub2 default menu entry

Under Debian or Ubuntu: edit /etc/default/grub, add or uncomment these two lines


GRUB_DEFAULT=saved
GRUB_SAVEDEFAULT=true

And, run update-grub again;

If you want more customized menu entries, you could add them under /etc/grub.d/40_custom, you also need to run update-grub manually; this file would get updated into /boot/grub/grub.cfg automatically in future when you got kernel updates;

Or you could use /boot/grub/custom.cfg directly (if not exist, create it); in this file you don't need to run update-grub; (if you want to know why, read /etc/grub.d/41_custom)

Tuesday, August 17, 2010

编译无需initrd能自启动之Linux内核:要点

使用 initrd (or initramfs) 固然有很多优点,但无可置疑地拖慢了启动速度,这方面编译内核的文档虽多,但我发现还是有不少人因曾经编译失败不能启动的体验而被吓住了,或者因保守起见编译了太多本机不需要的驱动程序,这样拖慢了编译内核的速度 (而且不管是模块形式还是内核形式,都是要么浪费了硬盘空间、要么就浪费了内存);
这方面记录几个要点,保证所生成的内核一定能够自启动。如果还不能启动请联系我。

1. 硬盘驱动程序 (或曰主板驱动?)
怎样找到正确的硬盘驱动程序?有人的经验谈是确保选中 ahci, 其实这只是一种流行的选择,当然不能代表所有。发现正确驱动程序的方法是顺着 sysfs 找,这里面提供了非常丰富的信息:
    $ ls -lU /sys/block/sda
lrwxrwxrwx 1 root root 0 2010-08-17 21:03 /sys/block/sda -> ../devices/pci0000:00/0000:00:14.1/host4/target4:0:0/4:0:0:0/block/sda
发现了它在 /devices 下的真正节点是 "/devices/pci0000:00/0000:00:14.1" (而不在 host4 下,想想), 这时再一次访问
    $ ls -lU /sys/devices/pci0000:00/0000:00:14.1
其下 driver -> ../../../bus/pci/drivers/pata_atiixp 因此,此机器上正确的驱动程序是 pata_atiixp,
  找到了正确的驱动程序之后还有一个任务是在 menuconfig 阶段如何找到其对应哪一个菜单项?这个需要在源代码中搜索:
    $ find drivers/ -name Makefile |xargs grep -nw pata_atiixp
drivers/ata/Makefile:28:obj-$(CONFIG_PATA_ATIIXP)    += pata_atiixp.o
  不知道在内核哪个子目录的话就在根目录 find, 一般来说大概知道是在 drivers/ 子目录,省点时间, 搜索所有 Makefile 将结果传给 xargs grep -nw 搜索单词 pata_atiixp, 得到唯一的一个结果 是 CONFIG_PATA_ATIIXP, 这个也许你猜到了结果其实就是小写变大写,但实际中有很多驱动的模块名称与 CONFIG 配置项名称是不一样的。所以 find 搜索能保证一定能找到了 menuconfig 配置项;
  最后一步就是在 menuconfig 过程中,使用 "/" 键,调出搜索界面,输入 PATA_ATIIXP 搜索之,一般来说,就找到了准确的 pata_atiixp 驱动所在菜单项的位置。把它设置为内联编译 (inlined compiling)就可以了。
以当前硬件流行驱动一般都是SATA或者PATA,都在 Device Drivers \ SerialATA and Parallel ATA 目录,而且一般来说一个机器只需要一个此类驱动就足够了 (同时使用两种SATA硬件的还没见过),因此选上 pata_atiixp 之后, 其它选项皆禁用之。
2. 根文件系统
  大概调查一下 (df -Th), 判断一下 根文件系统的类型,是 ext4 还是 btrfs, 与上同理,也把它设置为内联编译。为了常用U盘可以加上FAT支持,其它文件系统皆禁用之。
(注意不要选内核NTFS, 真正要读写NTFS分区可以使用 ntfs-3g 项目全用户层 code 解决)

有了这两点根本上就足够自启动了,以此为出发也可以继续把网卡驱动找出来,
3. 从 /sys/class/net/... 出发,找到 eth0 的真正驱动程序,在源代码搜索 Makefile 找到配置项名称,在 menuconfig 找到菜单项,设为内联编译;其它无关网卡驱动皆清除之。

(最后,清除了若干驱动并且保证了可以自启动的内核,在当前双核系统上一般五分钟编译出来。)

Thursday, July 22, 2010

见到了 Dawn Song 和 周杰伦

http://www.tektalk.org/2008/04/21/海外学人–宋晓东(dawn-song)/
  1. crquan 于 2010-07-21 4:52 pm
    今天到新加坡国大NUS算是亲眼见识了 Dawn Song 之 aggressive, 语速、以及思维转换之快皆非常人所能及也,在1个小时的Seminar里讲了三个普通Seminar的内容,其在UCBerkeley的最新研究是 webblaze, 在Web安全领域的最新Symbolic应用;并且相关 paper 又是其一贯的对security领域四大TOP1会议(IEEE S&P, Usenix security, ACM CCS, NDSS)皆灌水之
    http://webblaze.cs.berkeley.edu/

晚餐在 Bugis 才吃过, 得闻前方有一新加坡闻名小吃街,步行至与 Beach Road 有一条 Link 小径,两旁都是古式三层复式楼;只闻海南鸡饭、以及麻辣飘香、港汇茶点,食客都热情到自己帮忙把店家的桌子往外搬到行人街道,尚有余而不得座者;行间忽见不远处 Bugis 广场有排队长龙, 怕是又有什么大人物吧!走近看,竟然才知是周杰伦,排队者每人皆持两本唱片,黑皮不见其名,排队者约有上千人,等待上台亲笔签名;远处舞台之上有某人伏笔挥持;颇有神采;待良久,竟不能得见全貌;

Sunday, July 04, 2010

Latest Tweet: http://www.nudt.edu.cn/summerschool/chn/recruitinfo.html 今闻母校国防科大开设“天河计划”研究生国际暑期班(7月19日至8月6日),招生正式七十人、旁听四十人、由国际知名教授、全英文授课、云计算及无线前沿技术、费用全免、西部地区学校正式学员报销往返硬座火车票。报名截止7月10日。

1.课程教学:(每门课程为1个学分)
    1).云计算和虚拟化技术(Prof. Kai Hwang)
    2).无线和移动网络(Prof. WEI WAYNE LI)
    3).高级软件工程(Prof. Haibin Zhu )


找到了三位教授的背景分别是:

    1). Prof. Kai Hwang
毕业于1972年、加州大学伯克利分校博士、现任南加州大学教授、主研并行计算方向
Ph.D. in Electrical Engineering and Computer Science, 1972, UC, Berkeley, Berkeley, CA.  http://ee.usc.edu/faculty_staff/faculty_directory/hwang.htm

    2). Prof. WEI WAYNE LI
南德州大学计算机系教授,主研无线自适应网络方向;
http://engineering.tsu.edu/~wli/

    3).Prof. Haibin Zhu
加拿大尼普森大学计算机系教授,主研软件工程、人机交互;
http://www.nipissingu.ca/faculty/haibinz/

大学所需要的,正是这种不为名、不为利、的教学和科研精神;多一些踏实的研究、少一些银河麒麟般闹剧;希望母校夙愿“建设世界一流大学”有朝一日能够实现!

(同感于1help1@tektalk, 如能开放视频,做成类似于 MIT-Open-Web-Course, 就更精彩了!)
http://www.tektalk.org/2010/07/03/天河计划/

Tuesday, March 02, 2010

关于缓冲区溢出, lostyard 同学有一篇报道 gcc-4.4.1 上的最新进展, 就是 gcc 会产生 %gs:0x14 校验代码,新的攻击代码必须能注意到它的存在并合适绕过它才行,

检查了一下 gcc 手册,发现它是 -fstack-protector 生成的,这个 feature 手册上描述是在 -O1,2,... 各优化级别之外的,可能还有 bug 的额外优化选项, gentoo 上的 gcc 编译器也是遵照这个实现,不知 Ubuntu 为什么把它变成了缺省的,就是默认 enable 这个选项。

这个选项的原理就是在栈上额外分配 0,4,8,12,16 字节内存,使用 %gs:0x14 进行赋值,在函数结束时检查所赋值是否还存在,如果变化了说明栈可能遭受了溢出攻击,运行它会提示 "stack smashing"

$ ./a.out
0xffe80358, ffe80374
0xffe80354, 0
*** stack smashing detected ***: ./a.out terminated
======= Backtrace: =========
/lib32/libc.so.6(__fortify_fail+0x48)[0xf76dd228]
/lib32/libc.so.6(__fortify_fail+0x0)[0xf76dd1e0]
./a.out[0x80484fd]
[0x41414141]
======= Memory map: ========
08048000-08049000 r-xp 00000000 08:09 130818                             /home/gektop/tmp/test/a.out
08049000-0804a000 r--p 00000000 08:09 130818                             /home/gektop/tmp/test/a.out
0804a000-0804b000 rw-p 00001000 08:09 130818                             /home/gektop/tmp/test/a.out
085d1000-085f2000 rw-p 00000000 00:00 0                                  [heap]
f75f6000-f75f7000 rw-p 00000000 00:00 0 
f75f7000-f7734000 r-xp 00000000 08:0a 5808                               /lib32/libc-2.9.so
f7734000-f7736000 r--p 0013d000 08:0a 5808                               /lib32/libc-2.9.so
f7736000-f7737000 rw-p 0013f000 08:0a 5808                               /lib32/libc-2.9.so
f7737000-f773a000 rw-p 00000000 00:00 0 
f773e000-f774a000 r-xp 00000000 08:0a 5784                               /lib32/libgcc_s.so.1
f774a000-f774b000 r--p 0000b000 08:0a 5784                               /lib32/libgcc_s.so.1
f774b000-f774c000 rw-p 0000c000 08:0a 5784                               /lib32/libgcc_s.so.1
f774c000-f774e000 rw-p 00000000 00:00 0 
f774e000-f774f000 r-xp 00000000 00:00 0                                  [vdso]
f774f000-f776b000 r-xp 00000000 08:0a 5810                               /lib32/ld-2.9.so
f776b000-f776c000 r--p 0001c000 08:0a 5810                               /lib32/ld-2.9.so
f776c000-f776d000 rw-p 0001d000 08:0a 5810                               /lib32/ld-2.9.so
ffe6d000-ffe82000 rw-p 00000000 00:00 0                                  [stack]
Aborted


只要能理解它的原理就可以了,演示的时候可以为了减少无关干扰项,可以使用 -fno-stack-protector 把它关闭。

Tuesday, November 17, 2009

发现故事于近期 LinuxWeeklyNews 之 Quotes of the week (语录) 环节:
http://lwn.net/Articles/359270/

The fact is, maintainership does _not_ mean ownership. It means that
you should be _responsible_ for the code, and you get credit for it,
but if problems happen you do NOT "own" it. Not at all.
If you don't understand that, you shouldn't be a maintainer.
-- Linus Torvalds
事实是,维护不是意味着你拥有这部分代码;而是你要对它负责任,你从中获得荣誉和别人的称赞;而当问题发生时,你并不承担错误;完全不是;

可以进一步这封邮件的全文:
http://lwn.net/Articles/360156/

这封出自 Linus 的邮件第一句话就是 "You're full of sh*t." (你就是一坨屎) ...

如果你再有时间和兴趣,还可以进一步阅读讨论线索之全文,以了解整个事件之来龙去脉:
http://thread.gmane.org/gmane.linux.kernel/908831/focus=41872
邮件线索原始标题: "请考虑重置 commit 7d930bc" (即反转 commit 7d930bc 的所有修改)
1) Dmitry Torokhov 报告 2.6.32-rc5 中 cfg80211 (也就是 wireless 部分) 出现 Kernel Oops, 经过一番艰苦 git bisect 之后,发现引起问题的原因在于 commit 7d930bc, 重置这号 commit 之后可以解决;可见这确实是一个邪恶的 commit, 而且 git show 显示它引入于 2.6.32-rc5 之后;
2) David Miller (net-2.6 总管) 说在我的 net-2.6.git 树已修正了,稍晚会推送给 Linus;
3) 这时 Marcel Holtmann 忽然说了句 这个事件是这样解决了,但类似事件我们是不是可以改进下工作流,更多考虑下 最直接那个 MAINTAINER 的看法? (Wireless 的 cfg80211 和 nl80211 接口部分维护人是 Johannes Berg) 让他能有个说句话的机会,而不是直接跳过去了?
4) Johannes Berg 说话了,"唉,类似问题困扰已久" 指的是工作流上,当问题发生时,人们都直接找 Linus 或其它几位顶级 MAINTAINER 要求重置了那个出问题的 commit, 甚至也不通知一下 那个 commit 的原始作者和我们这些底层的 MAINTAINER, 导致我们反而后知后觉,后面 merging 过程中麻烦多多;所以能不能先发给我们,以标题类似于 "发现问题于 某 commit, 我们看怎么解决?"
5) Dmitry Torokhov: 我不明白问题出在哪里,我都已经抄送给 wireless 邮件列表了,我觉得在 -rc5 之后我们要迅速地解决问题
6) Johannes Berg: 我不反对要迅速解决问题,你当然可以直接发给Linus要求直接revert,我只是说能不能先发给MAINTAINER(也就是我了),我们有了更好的办法再汇报给Linus不晚哪,因为有时候 仅仅一个 revert 是不够的,因为原来那个 commit 肯定也是解决了某事情,如果我们直接 revert 可能会导致更糟糕的事情;这种工作流显得更为友好;而不是只被列在Cc里面,好像MAINTAINER的意见只是第二位的;
7) Dmitry Torokhov: 是说 To: 和Cc: 差别待遇吗?好了好了,下次我把你们全列在 To: 里面好吧
8) Marcel Holtmann: 近期我也发现有这种趋势:人们就不管三七二十一,上来就要示 revert, 然后才考虑解决真正的解决问题;
9) Linus 发火了: "你就是一坨屎" BUG 终究是BUG 就要被 revert 掉;那些在 merge window (rc2) 之后还引入 BUG 的人们应该被钉在耻辱柱上;一个 commit 引入的问题比它修正的要多,你说我们是不是就该要 revert 它?
10) Andrew Morton: subsystem maintainers 通常都很不靠谱
11) David Miller: To Andrew: 这很 平常 (common), 但不是普遍的 (universal)
12) Andrew Morton: David, 顺便把这几个 patch 从 -mm 树给接过去?
13) David Miller: 没问题,已应用至 net-2.6 树;其中有个 isdn-eicon-return-on-error.patch 又在用自动格式化工具玩大便 (holy crap someone run that driver through some auto-formatting tool!)
14) Linus Torvalds: 坦率地说,我还是对这个bug是非常的不满意:1) 它是 -rc5 之后引入的 2) 它被多人 bisect 出来,这浪费了多少人的时间? 3) 此 commit 的原始作者(Johannes Berg) 在被告知了 具体哪一个 commit 导致的问题却还想从报告者那里等待更多的信息(你都已经被通知这号commit有问题了,你就不能自己搞定吗?);
15) Marcel Holtmann: 当然是需要修正,但盲目地 revert 可能导致其它副作用; And to be honest, Johannes Berg 在解决 wireless 问题上还是很积极的;
16) Linus Torvalds: 每个人都知道出一问题要修正它;但真正的问题是"我们要最快地修正它" revert 就是最快的办法 我等不及 subsystem maintainer 来修正它;(To Marcel)你别光说讨好的漂亮话了;你错了,你应该感谢 Dmitry ,请求原谅浪费了他的时间;
17) Marcel Holtmann: 其实四天前我的邮箱就有了 Johannes 发过来的 解决办法的 patch 了,你的意思是要我当时就 越过 MAINTAINER (Johannes and David Miller) 直接把它发送给你?
18) Linus Torvalds: 你要我们的用户再多等一天还是再多等五天? 在 -rc5 之后出现的问题我们要在最快的时间把它修正,即使不是最优的结果,但我们的测试用户有多少时间给我们浪费的? 我们要做的就是 "Deal with it", And yes, 有时候 "Dealing with it" 就意味着必要时绕过维护者。 最差的情况下 我们有这样一个严格的管道在必要时 让用户不必在 MAINTAINER 路上等待太多时间
19) Marcel Holtmann: 我也同意。但是公平说,这个 bug 并不是影响着所有人 ...
20) Linus Torvalds: 不是的,你又错了。我是被动卷入这个线索的,其实看一眼那个 commit 就知道那个 memcpy 就有 NULL pointer dereference 问题。有人撞上了这个 problem 这就够了
21) Ingo Molnar 插入: 列举 Johannes 前两天的一封回复邮件,以说明其(Johannes)回复是 无用的, 不负责任的 (Unhelpful, defensive, in denial.) 你的 "hey, nothing happened, we fixed it after all" 表示你对此的无知,此类可避免的事故在将来还会重演
22) Marcel Holtmann: 谁这么说话了?那不是我说的好不好?
23) Ingo Molnar: 没在说你。是说上面写那个邮件的那个人,上面已 quote (就是 Johannes 写的) 部分
24) ... 有时候BUG比较复杂,1天还搞不定;这就证明了你是不够 responsive; 接着讨论要做到什么样才能叫做 responsive, 多少时间响应? ...
25) Linus Torvalds: 拜托,两天看起来是不多,但我们的 merge window 关闭已有5个星期了,我们马上就要发布 (2.6.32) 了

Linus 对 Kernel 还是相当严格,顺便也提到 Mailing list 这个 "Immediate but asynchronous" 交流方式的优点,

顺便 David Miller 提到有人还在玩 auto-formatting tool 提交补丁,这种在刚开始入门时尚可,入门久了,再玩就没什么意思了,还会引起人家反感,请看这里的二楼评论;
http://roclinux.cn/?p=1440

BTW, 近期发现 有人 做的 KernelPodcast 不错,以语音的方式为大家播报最近 Kernel 进展和人物事件, 可以同时 作为内核 学习 和 英语 学习材料:只是希望可以持久下去, 这样的工作除了 LWN 可以作为全职以外,一般人恐怕很难持续下去:
http://www.kernelpodcast.org/feed/

Saturday, January 10, 2009

黄油文件系统(Btrfs)与南瓜文件系统(Squashfs)

黄油文件系统(Btrfs)是Linux下一代文件系统,具有很多先进的文件系统特性,在2008年9月份的内核峰会上已讨论决定在2.6.29合并入主流内核,现在正是2.6.29的rc开放时期(为期两周),linus在昨天刚刚把它合并进去了~

http://lkml.org/lkml/2008/12/31/85

使用Btrfs的方法详见wiki站点:

http://btrfs.wiki.kernel.org/index.php/Main_Page

可以这么评价吧:
1. Solaris曾经有最后两根救命稻草是DTrace探测工具和ZFS文件系统,现在在Linux上有了带utrace内核的Systemtap和Btrfs文件系统,Solaris操作系统再也没有任何优势了,

另外,在这个页面还包含了很多Btrfs的许多创意想法,有已实现和正在实现的,包括在文件系统层次的RAID5,6:

http://btrfs.wiki.kernel.org/index.php/Project_ideas

南瓜文件系统(Squashfs)可能就更熟悉了,它采用gzip或lamz(更高压缩率)来制作只读的映像文件,常见于各发行版的LiveCD光盘中,也在今天早上(UTC时间1月9日凌晨)刚刚合并入主流内核(linus的mainstream内核)

http://marc.info/?l=linux-kernel&m=123153961726343&w=2

关于Squashfs的合并之路,倒不是一帆风顺的:
1. 其作者 Phillip Lougher 在这个线索中提到,在过去的数个月(据我观察有两三年了)中,他不停地接到用户的抱怨说为什么Squashfs停止了开发,于是在六个月前, Phillip 辞掉工作,专职为 Squashfs 开发,直到前不久,在与 Andrew Morton 的一次讨论中, Andrew 觉得可以合并进入 linux-next-for-2.6.31 的分支,但这个过程仍然很漫长,(根据3个月的规则,还至少需要七八个月)。 Phillip 已经6个月没有工作,对此已尽乎绝望,希望能尽快合并入主流,可以重新去找份工作,挣点钱。
2. 接下来的回复中,有两种观点;一种常规的观点是文件系统不是一般的驱动程序,是不能贸然合并的,这是传统的观点; Andrew 也是基于此观点认为 Squashfs 还需要在 linux-next 中观察个半年。反对的观点来自 Alan Cox ,说很多发行版的 LiveCD 已经在用 Squashfs 很多年了,还有什么样的大规模测试比这更能说明问题?
3. 终于, Andrew 同意现在就合并吧!我们终于有了一个以蔬菜命名的文件系统了~
4. 调侃继续:
蔬菜总比 FAT (肥胖) 好吧~
我喜欢南瓜(Squash)胜过于黄油(Butter)~

http://thread.gmane.org/gmane.linux.file-systems/28733/focus=28881

http://marc.info/?l=linux-kernel&m=123153961726343&w=2

Thursday, January 01, 2009

Vim, Bram Moolenaar, 乌干达

From: /usr/share/vim/vim72/doc/uganda.txt

Kibaale Children's Centre  *kcc* *Kibaale*  *charity*


Kibaale(乌干达地名)儿童中心位于非洲东部、靠近Tanzania(坦桑尼亚),在乌干达南部的一个小镇Kibaale。这个地区以Rakai区而闻名。居民大多是农民。尽管人们很穷,食物仍然是足够的。但是这个地区正承受着比世界上任何地方都更严重的AIDS灾难。也有人说它就是起源于这里。据统计有10~30%的乌干达人受到了HIV的感染。因为父母死亡,那里有很多孤儿。在这个地区有大约6万名儿童失去了一位或两位双亲,尽管总人口只有35万。并且这个数字还在持续增长。

这些儿童需要很多帮助。KCC正在努力工作以提供对食物、医疗和教育的需求。食物和医疗是为了让他们保持健康,教育是让他们将来能够自己照顾自己。KCC以基督的名义工作,但援助是提供给任何宗教的儿童。

解决这个地区问题的关键在于教育。这在过去的 Idi Amin 总统在位的数年以及接下来的内战中一直被忽略着。现在政府又重新稳定了,儿童和父母们都必须学习怎样照顾他们自己和怎样避免被感染。那里也为病人和饥饿的人们提供帮助,但它的主要目的是教会人们如何避免生病和怎样种植健康的食物。

大部分孤儿都住在大家庭里。由叔叔或大一点的姐姐来照顾。因为这样的家庭很大,而收入很低,对一个孤儿来说能得到健康的食物就已经很幸运了。而衣服、医疗和教育是已经超出他们能力所能及的。为了帮助这些有需要的孩子们,我们设置了一个专项赞助计划。可以经济上收养一个小孩。仅仅数美元每月就可以让KCC维持对这个小孩所采取的必要措施,就是保持健康和上学,其它对这个孤儿和支持他的家庭所必需的将由KCC来完成。

在直接帮助这名孤儿的同时,他们成长的环境也需要改善。KCC帮助当地学校提高他们的教学方法。在这个中心有一个示范学校来做教师培训。在那里培训保健员,宣传卫生教育,并且鼓励家庭建立好的厕所。我(Bram)帮助建立了一个水泥板生产基地。这些水泥板用于建造好的厕所,并且都以低于成本价出售。

这个项目还包括一个小的疹所,给孩子和他们的家庭提供医疗帮助。当有需要时,还提供到医院的交通。免疫计划也在实施,以应对传染病的发生(这里麻疹和霍乱一直是个问题)。

1994至1995年夏天我花了一整年时间在这个中心,以志愿者的身份工作。我帮助扩展这个中心,和在城市供水方面工作。我了解到KCC所提供的帮助确实有作用。当我回到荷兰时,我想要继续支持KCC。为了这个,我正在募捐基金和组织赞助计划。请考虑以下可能:

1. 赞助一名小孩上小学,17欧元每月(或更多)
2. 赞助一名小孩上中学,25欧元每月(或更多)
3. 赞助一个疹所,任何数额每月或每季度
4. 单笔捐款

相比于其它儿童赞助组织来说,这此数额都是很低的。这是因为这些钱都是直接到这个中心去了。机构本身的运作费用保持在低于5%。这是个小机构并且依赖于志愿者来运作,因此是可以做到的。如果你想赞助一名小孩,你应该想好需要至少保持一年。

怎样知道你的钱花在了正确的地方呢?首先,你可以得到我作为VIM的作者的个人保证。我信任在这个中心工作的人们,我在私下里了解这里的每一个人。更进一步说,这个中心也被 World Vision, Save the Child Fund 和 International Child Fund 这些组织所共同赞助和监管。我们大约每年对这个中心进行造访和检查一次进度(使用我们自己的钱)。我个人在 1996, 1998, 2000, 2001, 和 2003 年都分别访问过这个中心。访问报告都在ICCF的网站上有。

如果你有更多的疑问,请发电邮给我:

这个中心的地址是:

Kibaale Children's Centre
p.o. box 1658
Masaka, Uganda, East Africa

汇款方法:

USA: ...

Canada: ...

Holland: ...

Germany: ...

World: ...

Europe: ...

Credit Card: 请使用PayPal汇款至 ...
Others: 请汇款至这个银行帐号, ... 请以欧元或美元的形式电汇或邮寄支票,最小额度是70美元,(我的银行帐号不能接受小于70美元的外国支票,致歉)
邮寄支票地址: ...

请尽量使用欧元汇款以减少汇率损失。

这个地址长期有效。


原文在线地址:

http://vim.cybermirror.org/runtime/doc/uganda.txt

http://www.vim.org/htmldoc/uganda.html


Google地图搜索KCC所在位置(东非):

http://maps.google.com/?q=Masaka,+Uganda,+East+Africa

荷兰ICCF组织网站,

http://iccf-holland.org/

上有每年财务报告都可以下载,最近一期是2007年的:

The financial report for 2007 is available (PDF).

http://iccf-holland.org/jaar2007.pdf

2007年中所有捐款总额是47,688欧元,其中持续赞助是20,802欧元,单笔捐款26,633欧元,利息253。

2007年的花费中只有0.4%是用于管理和运作费用。在2006年的费用比较高是因为花在了一个合法的程序以把 iccf.nl 域名要回来。2007的主要费用花在银行取出外国支票上。

这份文件中还提到了,从2001至2007年,捐款收入在稳步增长,从2001年的2万多至2007年的接近5万欧元。

基金是以每次大笔的形式直接转往乌干达,这样以减少银行手续费。

在2008年1月份有91名儿童被赞助收养。比前一年多了6名。捐款的月收入是大约1300欧元。还有很多赞助者是每年支付的。希望在2008年至少能收到同样多的捐款。

而单笔捐款是完全偶然的,也无法预知2008年的情况。

此财务报告由 Adiswil 制作于 2008-02-16 。

KCF has made a newsletter with various information: fall2007.pdf (PDF)

http://iccf-holland.org/newsletter/fall2007.pdf

Friday, December 12, 2008

和平、友爱与火箭! (HP首席技术专家的基于ARM板的开源飞行高度记录软件开发实记) (From: OLS2008论文集)

Subject: 和平、友爱与火箭! (HP首席技术专家的基于ARM板的开源飞行高度记录软件开发实记) (From: OLS2008论文集)

http://ols.fedoraproject.org/OLS/Reprints-2008/

Bdale Garbee Peace, Love, and Rockets!

http://ols.fedoraproject.org/OLS/Reprints-2008/garbee-reprint.pdf

作者 Bdale Garbee 是 HP 的开源和Linux首席技术专家,同时是一位模型火箭飞行爱好者,

他和他的儿子很喜欢制作和飞行各种各样的模型火箭,但是当他们想要一款电子高度计用于探测火箭实飞高度时,却发现市面上现有的产品都是功能很有限,且依赖于专有的软件来配置和解析出数据,这个令人很不爽!

这篇论文描述了他们如何制作开放的硬件和软件来满足自己对于高度的好奇心,现场演示文件中包含有更详细的更强动力的火箭设计计划,并包含了照片和视频材料。

这些材料应该是任何对开放的小型嵌入式设备好奇的人们都感兴趣的。
硬件是基于ARM的,以 "TAPR Open Hardware" 协议开放,
并且完全是基于开源的设计工具实现的。
软件是以GNU工具链和很多开源库在 FreeRTOS 上实现的。

有兴趣的同学们可以读这篇论文。