免费注册 查看新帖 |

Chinaunix

  平台 论坛 博客 文库
最近访问板块 发新帖
查看: 1816 | 回复: 0
打印 上一主题 下一主题

ubuntu 提升启动速度 [复制链接]

论坛徽章:
0
跳转到指定楼层
1 [收藏(0)] [报告]
发表于 2008-12-22 17:26 |只看该作者 |倒序浏览
Installation
If
you are upgrading or downgrading, it is recommended that you boot into
Ubuntu via a normal boot and uninstall the old version first (e.g. in
Synaptic).
As
of version 0.6.0, InitNG has been split into two DEB files; the first
package (initng) contains the program itself while the second
(initng-ifiles) contains the various scripts InitNG needs. As initng is dependent on initng-ifiles, initng will not properly install unless initng-ifiles is either installed first or at the same time.
Version 0.6.7
These instructions were tested on Dappper.  
  • Add the following lines to /etc/apt/sources.list (don't forget to do apt-get update after it):

deb http://debian.space-based.de/debs/ experimental main
deb-src http://debian.space-based.de/debs/ experimental mainYou can also add these repositories via Synaptic (GUI) by following
these instructions
.
  • Build initng from source package to avoid dependency problems (copy and paste both lines together into the terminal):  

sudo apt-get install build-essential && sudo apt-get source initng && sudo apt-get build-dep initng && cd initng-0.6.7 && sudo dpkg-buildpackage && cd ../
  • Install packages initng and initng-ifiles:  

sudo dpkg -i initng_0.6.7*.deb && sudo apt-get install initng-ifilesYou
can also install initng-ifiles and initng via Synaptic. Start Synaptic,
and search for "initng-ifiles." Once done installing initng-ifiles,
search for and install initng. If you are having dependency issues with
initng, follow
these instructions
.
  • (if this is a new installation) edit your GRUB list:  

gksu gedit /boot/grub/menu.lst Make a duplicate Ubuntu entry and rename its title to something like Ubuntu (InitNG). At the end of the kernel line, add:  
init=/sbin/initngOnce
you have made a duplicate entry, your list should look like this,
because you duplicated the first entry. Therefore, the second entry
should look exactly like the first entry with the exception of the
difference in title, and the addition of "init=/sbin/initng" to the
kernel line:

## ## End Default Options ##
title           Ubuntu (InitNG)
root            (hd0,4)
kernel          /boot/vmlinuz-2.6.15-25-386 root=/dev/hda5 ro quiet splash init=/sbin/initng
initrd          /boot/initrd.img-2.6.15-25-386
savedefault
boot
title           Ubuntu, kernel 2.6.15-25-386
root            (hd0,4)
kernel          /boot/vmlinuz-2.6.15-25-386 root=/dev/hda5 ro quiet splash
initrd          /boot/initrd.img-2.6.15-25-386'''
savedefault
boot

  • To ensure that it boots to GUI session, run the following command:  

sudo ng-update add daemon/gdm
  • Remove the debian specific network script (for Dapper), or it will not work properly:  

sudo ng-update del ifupdown-debian
  • Because the path to modprobe and alsactl are different between debian and ubuntu, we need to create some link

sudo ln -s /sbin/alsactl /usr/sbin/alsactl
sudo ln -s /sbin/modprobe /usr/sbin/modprobe
  • Now you will need to configure the runlevel to fit your system.
    • If you have a printer, add cupsd : 'sudo ng-update add daemon/cupsd'
    • If you use an HP printer, you will also need to add hpssd and hpiod : 'sudo ng-update add daemon/hpiod daemon/hpssd'
    • If you use
      NetworkManager
      , the Novell's tool to manage network, follow
      this

    • To use vmware follow
      this

    • If your processor don't use speedstep, remove it : 'sudo ng-update del system/speedstep'
    • If acpi is disabled at startup, you need to remove acpid : 'sudo ng-update del daemon/acpid'
    • If you use fuse to have read access on an NTFS partition, you have to do a
      little tweak

    • Users of AIGLX need to do a
      little change to
        
    • And probably more. If you need help go to the
      Forums Thread
      or join  #initng on freenode
    • To configure and manage InitNG, you can also install a gui. More information
      there

  • To be able to see the wonderfull ubuntu usplash at startup, follow
    this

  • Reboot (using the InitNG GRUB entry) and enjoy the speed

NetworkManager with InitNG
First
be sure that you comment out the line of the interface you want to
control with NM in /etc/network/interfaces as mentioned
here

To use
NetworkManager
, simply add it to the runlevel:
sudo ng-update add NetworkManagerYou will have to modify the script, therefore, open it in a text editor with the following line:
gksu gedit /etc/initng/daemon/NetworkManager.iClear the entire file (CTRL-A for "Select All," and then delete the text), and replace it with this:
# This is a i file, used by initng parsed by install_service
service daemon/NetworkManager/prepare {
        need = system/bootmisc;
        script start = {
                [ -d /var/lib/NetworkManager ] || /bin/mkdir -p /var/lib/NetworkManager
                [ -d /var/run/NetworkManager ] || /bin/mkdir -p /var/run/NetworkManager
                chmod 755 /var/lib/NetworkManager
        };
}
daemon daemon/NetworkManager {
        need = system/bootmisc daemon/dbus daemon/NetworkManager/prepare system/modules/capability daemon/hald daemon/dhcdbd;
        exec daemon  = /usr/sbin/NetworkManager;
        pid_file = /var/run/NetworkManager/NetworkManager.pid;
        forks;
}You will also need to modify dhcdbd
gksu gedit /etc/initng/daemon/dhcdbd.iand replace the following:
exec daemon = /usr/sbin/dhcdbd --system;with the line below:
exec daemon = /sbin/dhcdbd --system;Restart and that should solve the problem

Vmware with InitNG
The
script provide by initng to run vmware don't do exactly what we want. A
workaround is to launch the sysvinit script instead . That's quite
simple:
  • First we need to create a new script, that we will call vmware2.i

gksu gedit /etc/initng/daemon/vmware2.iAnd past this in it.
service daemon/vmware2 {
        need = system/bootmisc virtual/net;
        exec start = /etc/init.d/vmware-player start;
        exec stop = /etc/init.d/vmware-player stop;
}

You will probably have to change /etc/init.d/vmware-player by the one
you have in /etc/init.d, this one is for vmware-plyer install from the
repository, and so the name of the script may change if you install an
other version of vmware
save and exit
  • Add this script to the runlevel

sudo ng-update add daemon/vmware2
  • Restart and that's done.

Using fuse with InitNG
In order to mount NTFS partition with read access using
fuse
, you need to load the fuse module before your NTFS partition is mounted. So we need to tweak a bit the moutfs.i script:
  • Open mountfs.i

gksu gedit /etc/initng/system/mountfs.i
  • At line 5, change

need = system/initial system/mountroot system/checkfs;to
need = system/initial system/mountroot system/checkfs system/modules;
  • And that's all. Easy, isn't it.

Get running AIGLX with InitNG
The
latest version of AIGLX need the latest driver to work. They are
provide by the linux-dri-module package which provide also a script to
load them at startup. This is a sysvinit script. We need to do the same
for InitNG.
  • Open modules.i

gksu gedit /etc/initng/system/modules.i
  • At line 44, you will see the following lines:

if [ -x /sbin/lrm-manager ]
then
        /sbin/lrm-manager --quick
fi
waitThis
launch the linux-restricted-module. We will use the same structure to
launch the linux-dri-module. So just after that, add the following:
if [ -x /sbin/ldm-manager ]
then
        echo "Loading DRI..."
        /sbin/ldm-manager --quick
fi
wait
  • And that's all.

Usplash with InitNG
The usplash support is not compiled by default, but you can enable it easily. IMPORTANT : You will need at least initng version 0.6.7
  • First, download
    this package
    and install it.  
    Change your kernel line:

gksu gedit /boot/grub/menu.lstAt the end, in your intng entry change the option of your kernel line to:
ro quiet init=/sbin/initng-usplash splash
  • Restart and enjoy.

Initng-conf-gtk
Daniel Malmgren has made a wonderfull gui to configure initNG
"With
initng-conf-gtk you can easily start, stop and restart services and
daemons. A nice feature is that all service states are updated in
realtime. It also features an easy to use runlevel editor where you can
create new runlevels, modify existing ones and the possibility to edit
services and daemons (to reach this functionality simply double click a
row in the service list)."
               
               
               

本文来自ChinaUnix博客,如果查看原文请点:http://blog.chinaunix.net/u2/75200/showart_1734991.html
您需要登录后才可以回帖 登录 | 注册

本版积分规则 发表回复

  

北京盛拓优讯信息技术有限公司. 版权所有 京ICP备16024965号-6 北京市公安局海淀分局网监中心备案编号:11010802020122 niuxiaotong@pcpop.com 17352615567
未成年举报专区
中国互联网协会会员  联系我们:huangweiwei@itpub.net
感谢所有关心和支持过ChinaUnix的朋友们 转载本站内容请注明原作者名及出处

清除 Cookies - ChinaUnix - Archiver - WAP - TOP