[转贴]5秒钟启动你的linux
- dsj
- 帖子: 810
- 注册时间: 2008-08-21 20:26
[转贴]5秒钟启动你的linux
这个是原文
finit 官方地址是: http://helllabs.org/finit/
Boots into Linux in 5 Seconds
Introduction
Booting fast can significantly impact the user experiences. This HowTo briefly introduce Boot Gear, a method to make a Linux desktop boot into X window faster, and yet remain full functional.
The best result so-far is 5 seconds from boot loader into X:
To reduce the boot time, Boot Gear bypass lots of initial actions, improve the parallel process, and use a rewritten init/startx program instead of autologin and display manager.
Hardware detail of testing platform is Ubuntu 8.04 x86, with Linux Kernel 2.6.24:
Motherboard: Gigabyte C51-MCP51
CPU: AMD Athlon 64 Processor 3000+
Memory: Hyundai 1GB
Hard Disk: WDC WD1600JS-55N
Step 1: Get rid of initrd
By building the necessary funtions into kernel, you can directly boot without initial ramdisk.
For example, the kernel needs these modules to initialize my SATA2 hard drive:
sd_mod (CONFIG_BLK_DEV_SD)
scsi_mod (CONFIG_SCSI)
libata (CONFIG_ATA)
sata_nv (CONFIG_SATA_NV)
ata_generic (CONFIG_ATA_GENERIC)
Since I use Ext3 as filesystem, CONFIG_EXT3_FS is also needed. Change these settings in .config from =m to =y, build by make bzImage, and copy the file arch/x86/boot/bzImage to /vmlinuz-fast. This is our new kernel.
Step 2: Use a fast init
The init used to be InitNG, but soon I have moved to finit due to its extremely fast speed.
Check out the source code:
git clone http://helllabs.org/git/eeepc.git
Be sure to modify the default user account in Makefile, after make, copy the file finit-mdv to /sbin/finit-mdv.
Step 3: Start the X
The Xorg needs dbus, udev and hal daemon. Add a script called /usr/sbin/services.sh:
#!/bin/sh
/etc/init.d/dbus start 2&>1 > /var/log/service.log
/etc/init.d/udev start 2&>1 >> /var/log/service.log &
/etc/init.d/hal start 2&>1 >> /var/log/service.log &
This will be executed by finit after startx.
Step 4: Log everything while booting (Optinal)
To profile (and showing off) the result of boot time, you need a tool called bootchart.
Download bootchart-0.9.tar.bz2 from the website, extract it and install by ./install.sh.
Edit /sbin/bootchartd and change init variable:
init="/sbin/finit-mdv"
Add a new line into /usr/sbin/services.sh:
/sbin/bootchartd stop
Finally, modify the bootloader entry (GRUB for example):
title Boot Gear fast booting
root (hd0,6)
kernel /vmlinuz-fast root=/dev/sda7 ro init=/sbin/bootchartd
Note that you can't use UUID format as root parameter.
After reboot, we have a fast booting Linux system now.
Where do we go from here
Let's take a more detail look at booting process:
You may have noticed that X start from the third second, and then services.sh was executed.
There still quite some hard works to do, including:
* BIOS setting adjust
* startx script simplify
* udev script/rule simplify
Fedora has discussed a worth reading feature named OneSecondX.
Boot Gear is a sub-project of PUD GNU/Linux, a Live CD aim to provide a light and quick Linux desktop, yet remain simple and easy to use.
Thanks, and feedback welcome!
Pin-Shiun Chen (penk) <penkia@gmail.com>
finit 官方地址是: http://helllabs.org/finit/
Boots into Linux in 5 Seconds
Introduction
Booting fast can significantly impact the user experiences. This HowTo briefly introduce Boot Gear, a method to make a Linux desktop boot into X window faster, and yet remain full functional.
The best result so-far is 5 seconds from boot loader into X:
To reduce the boot time, Boot Gear bypass lots of initial actions, improve the parallel process, and use a rewritten init/startx program instead of autologin and display manager.
Hardware detail of testing platform is Ubuntu 8.04 x86, with Linux Kernel 2.6.24:
Motherboard: Gigabyte C51-MCP51
CPU: AMD Athlon 64 Processor 3000+
Memory: Hyundai 1GB
Hard Disk: WDC WD1600JS-55N
Step 1: Get rid of initrd
By building the necessary funtions into kernel, you can directly boot without initial ramdisk.
For example, the kernel needs these modules to initialize my SATA2 hard drive:
sd_mod (CONFIG_BLK_DEV_SD)
scsi_mod (CONFIG_SCSI)
libata (CONFIG_ATA)
sata_nv (CONFIG_SATA_NV)
ata_generic (CONFIG_ATA_GENERIC)
Since I use Ext3 as filesystem, CONFIG_EXT3_FS is also needed. Change these settings in .config from =m to =y, build by make bzImage, and copy the file arch/x86/boot/bzImage to /vmlinuz-fast. This is our new kernel.
Step 2: Use a fast init
The init used to be InitNG, but soon I have moved to finit due to its extremely fast speed.
Check out the source code:
git clone http://helllabs.org/git/eeepc.git
Be sure to modify the default user account in Makefile, after make, copy the file finit-mdv to /sbin/finit-mdv.
Step 3: Start the X
The Xorg needs dbus, udev and hal daemon. Add a script called /usr/sbin/services.sh:
#!/bin/sh
/etc/init.d/dbus start 2&>1 > /var/log/service.log
/etc/init.d/udev start 2&>1 >> /var/log/service.log &
/etc/init.d/hal start 2&>1 >> /var/log/service.log &
This will be executed by finit after startx.
Step 4: Log everything while booting (Optinal)
To profile (and showing off) the result of boot time, you need a tool called bootchart.
Download bootchart-0.9.tar.bz2 from the website, extract it and install by ./install.sh.
Edit /sbin/bootchartd and change init variable:
init="/sbin/finit-mdv"
Add a new line into /usr/sbin/services.sh:
/sbin/bootchartd stop
Finally, modify the bootloader entry (GRUB for example):
title Boot Gear fast booting
root (hd0,6)
kernel /vmlinuz-fast root=/dev/sda7 ro init=/sbin/bootchartd
Note that you can't use UUID format as root parameter.
After reboot, we have a fast booting Linux system now.
Where do we go from here
Let's take a more detail look at booting process:
You may have noticed that X start from the third second, and then services.sh was executed.
There still quite some hard works to do, including:
* BIOS setting adjust
* startx script simplify
* udev script/rule simplify
Fedora has discussed a worth reading feature named OneSecondX.
Boot Gear is a sub-project of PUD GNU/Linux, a Live CD aim to provide a light and quick Linux desktop, yet remain simple and easy to use.
Thanks, and feedback welcome!
Pin-Shiun Chen (penk) <penkia@gmail.com>
- 想入非非
- 帖子: 8078
- 注册时间: 2008-07-14 22:42
- 来自: Beijing
- 联系:
- BigSnake.NET
- 帖子: 12522
- 注册时间: 2006-07-02 11:16
- 来自: 廣州
- 联系:
Re: [转贴]5秒钟启动你的linux
这个根本就是变态玩法嘛..
^_^ ~~~
要理解递归,首先要理解递归。
地球人都知道,理论上,理论跟实际是没有差别的,但实际上,理论跟实际的差别是相当大滴。
要理解递归,首先要理解递归。
地球人都知道,理论上,理论跟实际是没有差别的,但实际上,理论跟实际的差别是相当大滴。
- bones7456
- 帖子: 8495
- 注册时间: 2006-04-12 20:05
- 来自: 杭州
- 联系:
- xjpvictor
- 帖子: 2837
- 注册时间: 2007-08-22 15:55
- 系统: Archlinux
- 来自: 新加坡
- 联系:
Re: [转贴]5秒钟启动你的linux
Me too..bones7456 写了:5秒钟我的bios还没启动好grub呢~
Entschuldigung. Ich habe keine ahnung.
Secure with PGP: gpg --recv-keys 0x68b6e3d8
Fingerprint: 5556 517C F52F E402 DDF5 5400 6D30 F13E 68B6 E3D8
Towards A Sustainable Earth: Print Only When Necessary
Secure with PGP: gpg --recv-keys 0x68b6e3d8
Fingerprint: 5556 517C F52F E402 DDF5 5400 6D30 F13E 68B6 E3D8
Towards A Sustainable Earth: Print Only When Necessary
- Vivi.FFix
- 帖子: 94
- 注册时间: 2008-08-11 1:38
Re: [转贴]5秒钟启动你的linux
5秒应该是从grub到X吧,亲眼见到才信,udev、autodetect就会占用3-4秒
grub前的扫描 机子不同效果不同
还是老方法:只加载必要模块、精简启动脚本。
grub前的扫描 机子不同效果不同
还是老方法:只加载必要模块、精简启动脚本。
>_<
吃飯睡覺打Vivi
‘千杯不醉只醉月光’
吃飯睡覺打Vivi
‘千杯不醉只醉月光’
- 自由建客
- 帖子: 13468
- 注册时间: 2008-07-30 23:21
- 系统: Debian stable AMD64
Re: [转贴]5秒钟启动你的linux
我家的黑白电视机都没那么快
- sinyadvan
- 帖子: 724
- 注册时间: 2008-04-02 15:36
- 来自: O_O
Re: [转贴]5秒钟启动你的linux
呃,进grub就要6s的飘过
^o^ && O_O && ^_^
One World|One Dream|One Piece
愛 ^_^ 這個 美麗的世界O_O
本公司专治各种不服、不爽、谩骂、挑衅。
One World|One Dream|One Piece
愛 ^_^ 這個 美麗的世界O_O
本公司专治各种不服、不爽、谩骂、挑衅。
- yimo
- 帖子: 4
- 注册时间: 2008-05-24 15:47
Re: [转贴]5秒钟启动你的linux
这个觉得跟windows的那种超快启动一个样,没什么大的价值……
- adagio
- 论坛版主
- 帖子: 22110
- 注册时间: 2008-02-17 23:47
- 来自: 美丽富饶的那啥星球
Re: [转贴]5秒钟启动你的linux
嗯,我家机顶盒启动都要1分多钟……自由建客 写了:我家的黑白电视机都没那么快
明天就换大三八!
——8核CPU、8G内存、8T硬盘……
8卡交火,80寸大屏放8个……
IPv8的光纤要8条……
---------------------------------------------------------------------------------
★ [图片版]新手当自强(续)FAQ
★ [新手进阶]挂载、fstab、调整linux分区
★ [图片版]E17桌面环境配置手把手
——8核CPU、8G内存、8T硬盘……
8卡交火,80寸大屏放8个……
IPv8的光纤要8条……
---------------------------------------------------------------------------------
★ [图片版]新手当自强(续)FAQ
★ [新手进阶]挂载、fstab、调整linux分区
★ [图片版]E17桌面环境配置手把手
-
- 帖子: 69
- 注册时间: 2008-05-13 22:02
Re: [转贴]5秒钟启动你的linux
尝试一下还不错,不过总体意义不大
- eexpress
- 帖子: 58428
- 注册时间: 2005-08-14 21:55
- 来自: 长沙
- 自由建客
- 帖子: 13468
- 注册时间: 2008-07-30 23:21
- 系统: Debian stable AMD64
Re: [转贴]5秒钟启动你的linux
靠!用笔记本通常都是开盖即用的。
- sinyadvan
- 帖子: 724
- 注册时间: 2008-04-02 15:36
- 来自: O_O
Re: [转贴]5秒钟启动你的linux
呃,你说的是忘关机的吧自由建客 写了:靠!用笔记本通常都是开盖即用的。
^o^ && O_O && ^_^
One World|One Dream|One Piece
愛 ^_^ 這個 美麗的世界O_O
本公司专治各种不服、不爽、谩骂、挑衅。
One World|One Dream|One Piece
愛 ^_^ 這個 美麗的世界O_O
本公司专治各种不服、不爽、谩骂、挑衅。
- 想入非非
- 帖子: 8078
- 注册时间: 2008-07-14 22:42
- 来自: Beijing
- 联系: