<?xml version='1.0' encoding='UTF-8'?><?xml-stylesheet href="http://www.blogger.com/styles/atom.css" type="text/css"?><feed xmlns='http://www.w3.org/2005/Atom' xmlns:openSearch='http://a9.com/-/spec/opensearchrss/1.0/' xmlns:georss='http://www.georss.org/georss' xmlns:gd='http://schemas.google.com/g/2005' xmlns:thr='http://purl.org/syndication/thread/1.0'><id>tag:blogger.com,1999:blog-2189179118823705689</id><updated>2011-04-21T15:02:58.860-07:00</updated><title type='text'>Benob's</title><subtitle type='html'></subtitle><link rel='http://schemas.google.com/g/2005#feed' type='application/atom+xml' href='http://benobs.blogspot.com/feeds/posts/default'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/2189179118823705689/posts/default?max-results=100'/><link rel='alternate' type='text/html' href='http://benobs.blogspot.com/'/><link rel='hub' href='http://pubsubhubbub.appspot.com/'/><author><name>Ben</name><uri>http://www.blogger.com/profile/14899730898792268821</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><generator version='7.00' uri='http://www.blogger.com'>Blogger</generator><openSearch:totalResults>1</openSearch:totalResults><openSearch:startIndex>1</openSearch:startIndex><openSearch:itemsPerPage>100</openSearch:itemsPerPage><entry><id>tag:blogger.com,1999:blog-2189179118823705689.post-978359400089676893</id><published>2008-02-03T14:49:00.000-08:00</published><updated>2008-02-03T18:07:43.478-08:00</updated><title type='text'>Eee-Pc fast boot with Ubunutu</title><content type='html'>&lt;div style="text-align: justify;"&gt;&lt;span style="display: block;" id="formatbar_Buttons"&gt;This tutorial shows how to substantially reduce the boot time of an Ubuntu Eee-Pc. The stock boot time is between 45 seconds and 1 minute depending of compiz being used or not. On top of that, you want to add another 15 seconds to type your password, get access to the internet and load firefox. My Eee goes from cold dead to enjoying the internet in about 15 seconds (more, depending on how you count bios spent time).&lt;/span&gt;&lt;br /&gt;&lt;span style="display: block;" id="formatbar_Buttons"&gt;&lt;/span&gt;&lt;/div&gt;&lt;span style="display: block;" id="formatbar_Buttons"&gt;&lt;br /&gt;&lt;/span&gt;&lt;div style="text-align: center;"&gt;&lt;span style="display: block;" id="formatbar_Buttons"&gt;&lt;span class="on" style="display: block;" id="formatbar_CreateLink" title="Link" onmouseover="ButtonHoverOn(this);" onmouseout="ButtonHoverOff(this);" onmouseup="" onmousedown="CheckFormatting(event);FormatbarButton('richeditorframe', this, 8);ButtonMouseDown(this);"&gt;&lt;/span&gt;&lt;/span&gt;&lt;object width="320" height="266" class="BLOG_video_class" id="BLOG_video-cf3e334badb70d85" classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000" codebase="http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=6,0,40,0"&gt;&lt;param name="movie" value="http://www.youtube.com/get_player"&gt;&lt;param name="bgcolor" value="#FFFFFF"&gt;&lt;param name="allowfullscreen" value="true"&gt;&lt;param name="flashvars" value="flvurl=http://v23.nonxt6.googlevideo.com/videoplayback?id%3Dcf3e334badb70d85%26itag%3D5%26app%3Dblogger%26ip%3D0.0.0.0%26ipbits%3D0%26expire%3D1331126629%26sparams%3Did,itag,ip,ipbits,expire%26signature%3D858A404233D010C01CB5AC04B7E2A7EF9248374.504D1E21E3B08B02BEDD2BEE0157BBA34FEAA7EA%26key%3Dck1&amp;amp;iurl=http://video.google.com/ThumbnailServer2?app%3Dblogger%26contentid%3Dcf3e334badb70d85%26offsetms%3D5000%26itag%3Dw160%26sigh%3D49jSSqKlnaVL0C0xKRIDaQZ1d6I&amp;amp;autoplay=0&amp;amp;ps=blogger"&gt;&lt;embed src="http://www.youtube.com/get_player" type="application/x-shockwave-flash"width="320" height="266" bgcolor="#FFFFFF"flashvars="flvurl=http://v23.nonxt6.googlevideo.com/videoplayback?id%3Dcf3e334badb70d85%26itag%3D5%26app%3Dblogger%26ip%3D0.0.0.0%26ipbits%3D0%26expire%3D1331126629%26sparams%3Did,itag,ip,ipbits,expire%26signature%3D858A404233D010C01CB5AC04B7E2A7EF9248374.504D1E21E3B08B02BEDD2BEE0157BBA34FEAA7EA%26key%3Dck1&amp;iurl=http://video.google.com/ThumbnailServer2?app%3Dblogger%26contentid%3Dcf3e334badb70d85%26offsetms%3D5000%26itag%3Dw160%26sigh%3D49jSSqKlnaVL0C0xKRIDaQZ1d6I&amp;autoplay=0&amp;ps=blogger"allowFullScreen="true" /&gt;&lt;/object&gt;&lt;br /&gt;&lt;/div&gt;&lt;br /&gt;This tutorial is for experienced linux users with knowledge of compiling and installing stuff. It does not intend to build a fully working system with webcam, sound and so on. You will have to customize your install to suit your needs.&lt;br /&gt;&lt;br /&gt;&lt;div style="text-align: justify;"&gt;The basic idea is to get rid of the init scripts (from /etc/init.d) and only do the necessary steps (no hardware detection is needed since the eee has static hardware; no services are run: we only want to connect to the internet and be able to check a webpage). Then, run lightweight alternatives to Xorg and the gnome desktop. Our choices will be &lt;a href="http://freedesktop.org/wiki/Software/Xserver"&gt;kdrive&lt;/a&gt; (also known as Xserver, a non-modular server configured at compilation time) and &lt;a href="http://dwm.suckless.org/"&gt;dwm&lt;/a&gt;, a primitive looking fullscreen oriented window manager, also configured at compilation time).&lt;br /&gt;&lt;/div&gt;&lt;ol&gt;&lt;li&gt;Compile Xvesa (from kdrive)&lt;/li&gt;&lt;li&gt;Compile dwm and dmenu&lt;/li&gt;&lt;li&gt;Write the init script, a X session script and some unnecessary eye-candy&lt;br /&gt;&lt;/li&gt;&lt;li&gt;Change the kernel command line to run a customized init process&lt;/li&gt;&lt;li&gt;&lt;span style="font-style: italic;"&gt;Customize your kernel (not done yet)&lt;/span&gt;&lt;br /&gt;&lt;/li&gt;&lt;/ol&gt;&lt;span style="font-weight: bold;font-size:130%;" &gt;1. Compiling Xvesa&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;You can take a look at the &lt;a href="http://freedesktop.org/wiki/Software/Xserver"&gt;xserver&lt;/a&gt; page for compilation instructions. It works nicely, but it is a bit long. Obviously, you don't want to do it on your eee; a more powerful machine would be nicer. Here is the &lt;code&gt;git&lt;/code&gt; command to get the source code:&lt;br /&gt;&lt;span class="anchor" id="line-8"&gt;&lt;/span&gt;&lt;tt&gt;&lt;blockquote&gt;&lt;code&gt;git clone git://anongit.freedesktop.org/git/xserver&lt;/code&gt;&lt;br /&gt;&lt;/blockquote&gt;&lt;/tt&gt;You also need to install build tools and libraries. Try to &lt;code&gt;./configure --enable-kdrive&lt;/code&gt;, get the library name from the error and install it. Here is a certainly incomplete list from my bash history:&lt;br /&gt;&lt;blockquote&gt;&lt;code&gt;libxv-dev libcairo2 libssl-dev libpciaccess-dev libpixman-1-dev&lt;/code&gt;&lt;/blockquote&gt;If you are building under Gutsy, libpixman-1 is outdated: manually install the Hardy &lt;a href="http://packages.ubuntu.com/hardy/libdevel/libpixman-1-dev"&gt;package&lt;/a&gt; with dpkg. Also take the corresponding lib &lt;a href="http://packages.ubuntu.com/hardy/libs/libpixman-1-0"&gt;package&lt;/a&gt; that you will install on both your eee and your build machine.&lt;br /&gt;&lt;br /&gt;I also installed build dependencies for the package &lt;code&gt;xorg-xserver-core&lt;/code&gt;. Then, run &lt;code&gt;./configure --enable-kdrive &amp;amp;&amp;amp; make&lt;/code&gt;. Wait and get &lt;code&gt;Xvesa&lt;/code&gt; in &lt;code&gt;xserver/hw/kdrive/vesa&lt;/code&gt;. This will be your lightweight X11 server. Cool, isn't it?&lt;br /&gt;&lt;br /&gt;There are a bunch of other specialized servers with drivers for different graphic cards. I tried Xfbdev and Xi810 without success. Xvesa does not have much hardware acceleration but it is enough for terminal works and basic web browsing.&lt;br /&gt;&lt;br /&gt;For a matter of conciseness, all additional scripts and programs will be assumed to be available in your path on your eee (put them in /bin or whatever).&lt;br /&gt;&lt;br /&gt;&lt;span style="font-weight: bold;font-size:130%;" &gt;2. Compile dwm and dmenu&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;First, download the &lt;a href="http://www.suckless.org/wiki/dwm"&gt;sources&lt;/a&gt;, then edit config.h and use &lt;code&gt;make clean install&lt;/code&gt; to build and install it. Read the website carefully about shortcomings and limitations. You can also try fluxbox or even metacity if you find dwm too crude. But I like the idea of keeping things simple and fast.&lt;br /&gt;&lt;br /&gt;You don't really need dmenu (from the same author), but it will help to get a shutdown/reboot dialog. Without such a dialog, you will have to type commands in a terminal or press the power button for 5 seconds. Yeah, this is hardcore.&lt;br /&gt;&lt;br /&gt;dwm is easy to use, but not user friendly. So, you can &lt;code&gt;man dwm&lt;/code&gt; or remember these few shortcuts:&lt;br /&gt;&lt;ul&gt;&lt;li&gt;close a window: &amp;lt;alt&amp;gt;&amp;lt;shift&amp;gt;C&lt;/li&gt;&lt;li&gt;goto workspace n (n from 1 to 9): &amp;lt;alt&amp;gt;n&lt;/li&gt;&lt;li&gt;next window: &amp;lt;alt&amp;gt;k (&amp;lt;alt&amp;gt;j, or &amp;lt;alt&amp;gt;&amp;lt;tab&amp;gt;)&lt;/li&gt;&lt;li&gt;maximize window: &amp;lt;alt&amp;gt;&amp;lt;enter&amp;gt;&lt;/li&gt;&lt;li&gt;open terminal: &amp;lt;alt&amp;gt;&amp;lt;shift&amp;gt;&amp;lt;enter&amp;gt;&lt;/li&gt;&lt;li&gt;run a program: &amp;lt;alt&amp;gt;p (with dmenu installed, then type the name of the program)&lt;/li&gt;&lt;li&gt;quit dwm (does not quit X): &amp;lt;alt&amp;gt;&amp;lt;shift&amp;gt;q&lt;/li&gt;&lt;/ul&gt;You may want to checkout the website for the philosophy of tags. It is a neat idea that will always send your browser to the workspace "www" for instance.&lt;br /&gt;&lt;br /&gt;&lt;span style="font-weight: bold;"&gt;3. Write the init script and others&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;The Ubuntu provided init scripts are really over bloated and do a lot of stuff so that your linux experience look like a windows (or mac) experience. The drawback is that you get to wait quite a long time before you can do anything. For that one, we will follow the Vista approach: show a user interface as soon as possible and load things in the background. Ok, Vista is sluggish, and you don't want that. Let's forget about running an anti-virus or vendor added crapware. You will just get X ready and then load everything to get a wifi/internet connection. To get that working, I looked at the primitive boot scripts in rcS and did some trial and error to get the missing steps.&lt;br /&gt;&lt;br /&gt;Here is the init script &lt;code&gt;fastboot.sh&lt;/code&gt;:&lt;code&gt;&lt;br /&gt;&lt;/code&gt;&lt;blockquote&gt;&lt;code&gt;#!/bin/bash&lt;br /&gt;&lt;br /&gt;# set environment&lt;br /&gt;export DISPLAY=:0&lt;br /&gt;export \&lt;br /&gt;PATH=/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin&lt;br /&gt;&lt;br /&gt;# remount root dir, prepare tmp for X11, set permissions in /dev&lt;br /&gt;mount -o remount,rw /&lt;br /&gt;rm -rf /tmp&lt;br /&gt;mkdir /tmp&lt;br /&gt;chmod 777 /tmp&lt;br /&gt;mkdir -p /tmp/.X11-unix&lt;br /&gt;chown 0:0 /tmp/.X11-unix&lt;br /&gt;chmod 1777 /tmp/.X11-unix&lt;br /&gt;chmod o+rw /dev/null /dev/pty* /dev/tty*&lt;br /&gt;&lt;br /&gt;# load mouse module (not sure if evdev is necessary)&lt;br /&gt;modprobe evdev&lt;br /&gt;modprobe psmouse&lt;br /&gt;&lt;br /&gt;# tweak vesa bios resolution to recognize lcd panel&lt;br /&gt;915resolution 5c 800 480 32&lt;br /&gt;&lt;br /&gt;# set hostname&lt;br /&gt;hostname eeepc&lt;br /&gt;&lt;br /&gt;# run X11 server with adequate resolution, mouse and keyboard&lt;br /&gt;Xvesa :0 -nolisten tcp -screen 800x480x24 -mouse ps2 \&lt;br /&gt;-keybd keyboard,,xkbmodel=pc105,xkblayout=us &amp;amp;&lt;br /&gt;&lt;br /&gt;# run x session (window manager...) as an unprivileged user&lt;br /&gt;su user -c session.sh &amp;amp;&lt;br /&gt;&lt;br /&gt;# load a few more modules and setup wifi (wep), get ip address&lt;br /&gt;modprobe battery&lt;br /&gt;modprobe ath_pci&lt;br /&gt;ifconfig ath0 up&lt;br /&gt;iwconfig ath0 essid **************&lt;br /&gt;iwconfig ath0 key **************&lt;br /&gt;dhclient ath0&lt;br /&gt;&lt;br /&gt;# run bash in case things went wrong&lt;br /&gt;bash&lt;/code&gt;&lt;br /&gt;&lt;/blockquote&gt;Don't forget to replace your user name, network essid and wep password. You are left on your own if your wireless setup is different (wpa or others). Of course, this is not secure at all, but who cares, we focus on shortening boot time, not improving security.&lt;br /&gt;&lt;br /&gt;Then, comes your X session. I used to run everything in the fastboot.sh script but getting a non-privileged user is better if you tend to type things like &lt;code&gt;rm -rf /&lt;/code&gt;&lt;code&gt;session.sh&lt;/code&gt;:&lt;blockquote&gt;&lt;code&gt;#!/bin/bash&lt;br /&gt;export DISPLAY=:0&lt;br /&gt;export \&lt;br /&gt;PATH=/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin&lt;br /&gt;&lt;br /&gt;# wait for X&lt;br /&gt;sleep 0.1&lt;br /&gt;&lt;br /&gt;# run session applications&lt;br /&gt;firefox &amp;amp;&lt;br /&gt;uxterm &amp;amp;&lt;br /&gt;&lt;br /&gt;# window manager&lt;br /&gt;notification.sh | dwm&lt;/code&gt;&lt;/blockquote&gt;Nothing particular about this one. Just make sure that the environment is re-setup. The last line runs the window manager and is an opportunity to discover a nice feature of dwm: text read from &lt;code&gt;stdin&lt;/code&gt; is displayed in the notification zone. So, let's make it pretty with date, time, wifi and battery status.&lt;br /&gt;&lt;blockquote&gt;&lt;code&gt;#!/bin/bash&lt;br /&gt;&lt;br /&gt;# loop forever&lt;br /&gt;while [ 1 ]&lt;br /&gt;do&lt;br /&gt;# get the date in "Month Day Time" format&lt;br /&gt;DATE=`date '+%b %d %H:%M'`&lt;br /&gt;&lt;br /&gt;# get battery percentage and a + or - for charing/discharing&lt;br /&gt;BATTERY=`cat /proc/acpi/battery/BAT0/state \&lt;br /&gt;| awk '&lt;br /&gt; /^remaining/{percent=$3}&lt;br /&gt; /charging$/{state="+"} \&lt;br /&gt; / discharging$/{state="-"}&lt;br /&gt;END{print percent "%" state}'`&lt;br /&gt;&lt;br /&gt;# get wifi signal quality and set to "*" if not available&lt;br /&gt;WIFI=`iwconfig ath0 | grep Quality | cut -f2 -d= | cut -f1 -d/`"%"&lt;br /&gt;if [ "$WIFI" == "%" ]; then WIFI="*"; fi&lt;br /&gt;&lt;br /&gt;# display a + if an ip address is set (internet connection available)&lt;br /&gt;if [ "`ifconfig ath0 | grep 'inet addr'`" != "" ]; then WIFI=$WIFI"+"; fi&lt;br /&gt;&lt;br /&gt;# display everything and wait 1 second before the next update&lt;br /&gt;echo "W:$WIFI B:$BATTERY $DATE"&lt;br /&gt;sleep 1&lt;br /&gt;done&lt;/code&gt;&lt;br /&gt;&lt;/blockquote&gt;That looks quite obscure but that gives you minimum status information about your eee. Note the nice +/- display for the battery and the + appearing when dhcp negotiations succeeded.&lt;br /&gt;&lt;br /&gt;&lt;a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="http://4.bp.blogspot.com/_UMowkXTEhHc/R6ZyvGy7upI/AAAAAAAAErk/tHRTR1Q3bw4/s1600-h/screenshot.png"&gt;&lt;img style="margin: 0px auto 10px; display: block; text-align: center; cursor: pointer;" src="http://4.bp.blogspot.com/_UMowkXTEhHc/R6ZyvGy7upI/AAAAAAAAErk/tHRTR1Q3bw4/s400/screenshot.png" alt="" id="BLOGGER_PHOTO_ID_5162940176430512786" border="0" /&gt;&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;One last thing. There are no shutdown facilities available in dwm, and pressing the power button is not recommended. So there are two things to do: setup a shortcut in dwm's config.h and design a nice dialog box for confirmation. Here is the config line (at the end of the file):&lt;blockquote&gt;    &lt;code&gt;//{ MODKEY|ShiftMask, XK_q, quit, NULL },&lt;br /&gt;{ MODKEY|ShiftMask, XK_q, spawn, "shutdown.sh" },&lt;/code&gt;&lt;br /&gt;&lt;/blockquote&gt;Recompile and reinstall. Here is &lt;code&gt;shutdown.sh&lt;/code&gt;:&lt;br /&gt;&lt;blockquote&gt;&lt;code&gt;#!/bin/bash&lt;br /&gt;&lt;br /&gt;ANSWER=`echo -e "Cancel\nShutdown\nReboot"|dmenu -b -p "Quit?"`&lt;br /&gt;&lt;br /&gt;if [ "$ANSWER" == "Shutdown" ]; then&lt;br /&gt;poweroff -f -i&lt;br /&gt;elif [ "$ANSWER" == "Reboot" ]; then&lt;br /&gt;reboot -f -i&lt;br /&gt;fi&lt;/code&gt;&lt;/blockquote&gt;Simple yet efficient. For it to work, you will have to &lt;code&gt;chmod +s /sbin/reboot&lt;/code&gt;. This does not take care (yet) of closing cleanly running programs. So use &amp;lt;alt&amp;gt;&amp;lt;shift&amp;lt;C on firefox if you don't want to get the "restore session" dialog the next time you run it.&lt;br /&gt;&lt;br /&gt;&lt;a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="http://4.bp.blogspot.com/_UMowkXTEhHc/R6ZyvGy7uqI/AAAAAAAAErs/VNuwBz--RYM/s1600-h/screenshot-shutdown.png"&gt;&lt;img style="margin: 0px auto 10px; display: block; text-align: center; cursor: pointer;" src="http://4.bp.blogspot.com/_UMowkXTEhHc/R6ZyvGy7uqI/AAAAAAAAErs/VNuwBz--RYM/s400/screenshot-shutdown.png" alt="" id="BLOGGER_PHOTO_ID_5162940176430512802" border="0" /&gt;&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style="font-weight: bold;"&gt;4. Change the kernel command line to run a customized init process&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;You can press escape when grub shows up; then edit the command line: remove "splash" and add "init=/fastboot.sh". Do it permanently in /boot/grub/menu.lst and also set the timer to zero to save additional boot time (pressing escape will be a little tricky though).&lt;br /&gt;&lt;br /&gt;&lt;span style="font-style: italic; font-weight: bold;"&gt;5. Customize your kernel (not done yet)&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;There is a lot of potential in recompiling a kernel with only the required drivers, getting rid of the initrd which runs blackbox and does a lot of stuff like checking your filesystems and mounting them. But that's another story...&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/2189179118823705689-978359400089676893?l=benobs.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://benobs.blogspot.com/feeds/978359400089676893/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=2189179118823705689&amp;postID=978359400089676893' title='2 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/2189179118823705689/posts/default/978359400089676893'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/2189179118823705689/posts/default/978359400089676893'/><link rel='alternate' type='text/html' href='http://benobs.blogspot.com/2008/02/eee-pc-fast-boot-with-ubunutu.html' title='Eee-Pc fast boot with Ubunutu'/><author><name>Ben</name><uri>http://www.blogger.com/profile/14899730898792268821</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><media:thumbnail xmlns:media='http://search.yahoo.com/mrss/' url='http://4.bp.blogspot.com/_UMowkXTEhHc/R6ZyvGy7upI/AAAAAAAAErk/tHRTR1Q3bw4/s72-c/screenshot.png' height='72' width='72'/><thr:total>2</thr:total></entry></feed>
