Blog Forum Wiki Links Contact Us NetbookUser
RunCore Pro IV SSD Transforms your ASUS EEE PC by increasing 
performance 5-40X. Your satistfaction guaranteed RunCore Pro 70mm SATA Mini PCI-e SSD
RunCore Pro IV 70mm SATA II Mini PCI-e SSD
RunCore Pro IV 2.5 Inch SATA II SSD

You are not logged in.

  • Index
  •  » eeeXubuntu
  •  » eeeXubuntu using finit (fastinit reimplementation)

#1 2008-02-17 8:59:18 am

Jaffa
Member
Registered: 2007-12-02
Posts: 14

eeeXubuntu using finit (fastinit reimplementation)

Hi,

Has anyone tried booting their eeeXubuntu install with finit?

http://helllabs.org/blog/20080205/eeepc … on-update/

Shouldn't be too hard to bootstrap only the essentials from /etc/init.d from a fastinit-like system, but don't want to duplicate any work already done on this.

Cheers,

Andrew

Offline

 

#2 2008-02-26 5:46:20 pm

venin
Member
Registered: 2007-12-17
Posts: 46

Re: eeeXubuntu using finit (fastinit reimplementation)

Please let us know if you do try it. smile

Fastinit and eeeXubuntu would be nice.

Offline

 

#3 2008-04-21 11:38:49 am

ShaqARif
Senior Member
From: London
Registered: 2007-11-14
Posts: 383

Re: eeeXubuntu using finit (fastinit reimplementation)

Anybody with any joy on this?  I'm going to give it a go over the next couple of days, so if anybody has tried it already, please share your experience!


---- eee pc 901 Glossy Black 1GB RAM 4/8GB SSD --------- CrunchBang Linux (adamms kernel)  ------

Offline

 

#4 2008-04-22 6:33:04 pm

richardkemp
Senior Member
From: Essex, UK
Registered: 2007-12-15
Posts: 174

Re: eeeXubuntu using finit (fastinit reimplementation)

I'm just about to have a go... Though reading through it, it looks like it is beyond my abilities. I'd be really interested if someone worked it out though! I think the worst thing about eeeXubuntu compared to easy mode Xandros is boot time. The rest I love!


nLite'd XP on White 4G, 2GB of RAM

Offline

 

#5 2008-04-23 6:02:29 am

smurfy
Member
Registered: 2007-12-03
Posts: 23

Re: eeeXubuntu using finit (fastinit reimplementation)

hey, i also will take a look and try to get it work with eeexubuntu

Offline

 

#6 2008-04-24 6:57:25 pm

smurfy
Member
Registered: 2007-12-03
Posts: 23

Re: eeeXubuntu using finit (fastinit reimplementation)

ok,played a bit with the latest version (18.04.2008) of finit.
mainly played with a vmware image but my last compile works on eeepc too big_smile

what finit does:
- mount fs
- basic otherstuff
- login as a spezifc user
- startx

the problem i have with that, i have more than one user and i want to have a loginpromt.
so i started to modding the finit-alt.c file.

i started first to just replace some paths and starting /etc/init.d/gdm instead of a login and startx.
it worked, but i ran into trouble (later what kind).
so as this does not work i tried to login at tty3 (basic finit spawns only tty3) and do a startx. but startx also crashes.
so i started to stay on the console for a while and adding spawning of more than one tty and also add a respawn function if you logout.

so my status is: (working stuff)
- getting tty1-4 running (more possible but for testing 4 are enough)
- respawn a tty if you logout
- autoswitch to tty1 after boot (about 10 sec)

problems:
- gdm starts but after i login i get an error telling me i started with setuid (http://www.gtk.org/setuid.html)
- startx starts but xsession crashes with a "prng is not seeded" error. but i init the random-seed file and /dev/urandom and /dev/random
- mouse does not working but thats minor stuff. (need to load more libs)
- usplash bar only have ~5 percent and than booting is done,  how do i mod the bar and why does usplash_write displays nothing big_smile

i will post my source with installguide later i hope someone could help me with my problems

edit:
startx problem solved big_smile but gdm still does not work big_smile

Last edited by smurfy (2008-04-24 7:03:05 pm)

Offline

 

#7 2008-04-25 8:04:14 am

richardkemp
Senior Member
From: Essex, UK
Registered: 2007-12-15
Posts: 174

Re: eeeXubuntu using finit (fastinit reimplementation)

Is it necessary to know C to fiddle with this? sad


nLite'd XP on White 4G, 2GB of RAM

Offline

 

#8 2008-04-25 9:08:23 am

smurfy
Member
Registered: 2007-12-03
Posts: 23

Re: eeeXubuntu using finit (fastinit reimplementation)

Short answer: Maybe smile
Long one: You must add defines and maybe add some commands big_smile Also must change Makefile.

-----------------

And here my status and plans for eeexubuntu finit:

Status:
- gdm works and you can login and use firefox, update you dist...
- getting tty1-5 running (you could set it via define)
- respawn a tty if you logout
- autoswitch to tty1 after boot (about 10 sec)
- starting some init.d scripts like hal, dbus, networking
- adding some modules to support mouse

Problems:
- terminal on the x does not work
- usplash still isnt really usefull

Plans:
- release my source big_smile
- test wlan and other eeepc special stuff.
- use a simple configfile etc. to allow customizion without knowing C

if someone could tell me what could be the problem with the terminal on x (shell does not come up) smile

Offline

 

#9 2008-04-25 10:53:25 am

smurfy
Member
Registered: 2007-12-03
Posts: 23

Re: eeeXubuntu using finit (fastinit reimplementation)

Ok,

x terminal problem solved big_smile i have done a quick test on my eeepc, wifi works.
only current problem is, that i dont have a loginshell on my eeepc on tty1-5, at vmware it works.

ok anyways:

http://www.smurfy.de/files/eeepc2504.tar

Installation:
Installation at your own risk big_smile (my eeexubuntu still works big_smile)

compile or simple copy my precompiled file "finit-mdv" to "/sbin/finit-mdv"

go to your /boot/grub/menu.lst and copy a boot entry
than add behind the kernel line: "init=/sbin/finit-mdv"

i will try to do more tests and optimations directly on my eee (can't restart it currently ever minute big_smile)

What should work with this version:
- a realative fast boot and start of gdm
- wifi, network and x apps (don't tested much)

What does not work is the normal reboot, shutdown stuff big_smile

Last edited by smurfy (2008-04-25 10:56:58 am)

Offline

 

#10 2008-04-25 11:19:30 am

metalshark
Member
From: London, England
Registered: 2008-01-24
Posts: 48
Website

Re: eeeXubuntu using finit (fastinit reimplementation)

Sending finit-mdv the USR1 signal means shutdown and USR2 signal means reboot - you can use the kill command for this. The original EEE OS uses an ACPI Event script to achieve it.

If there is a splash screen then it'll either be in the kernel or initrd and could be removed.

The code to spawn X is:

Code:

    if (!fork()) {
        /* child process */

        vhangup();

        close(2);
        close(1);
        close(0);

        if (open("/dev/tty1", O_RDWR, 0))
            exit(1);

        sigemptyset(&act.sa_mask);
        act.sa_handler = SIG_DFL;

        sigemptyset(&nmask2);
        sigaddset(&nmask2, SIGCHLD);
        sigprocmask(SIG_UNBLOCK, &nmask2, NULL);

        for (i = 1; i < NSIG; i++)
            sigaction(i, &sa, NULL);

        dup2(0, 0);
        dup2(0, 1);
        dup2(0, 2);

        touch("/tmp/nologin");

#ifdef AGPDRV
        system("/sbin/modprobe agpgart");
        system("/sbin/modprobe " AGPDRV);
#endif
        
        while (access("/tmp/shutdown", F_OK) < 0) {
            debug("start X as " DEFUSER);
#ifdef DEBUG
            system("su -c startx -l " DEFUSER);
            system("/bin/sh");
#else
            system("su -c startx -l " DEFUSER " &> /dev/null");
#endif
        }

        exit(0);
    }

it closes pipe 0, 1 and 2 (stdin, stdout and stderr respectively), opens stdin on /dev/tty1, then duplicates the open fd (file descriptor) to stdout and stderr.

If you comment out the

Code:

        close(2);
        close(1);
        close(0);

        if (open("/dev/tty1", O_RDWR, 0))
            exit(1);

and

Code:

        dup2(0, 0);
        dup2(0, 1);
        dup2(0, 2);

lines then the terminal on X should work fine. Personally I just use /dev/tty7.

Hope this helps!

Last edited by metalshark (2008-04-25 11:22:05 am)

Offline

 

#11 2008-04-26 5:25:08 am

zache
Member
Registered: 2008-04-14
Posts: 50

Re: eeeXubuntu using finit (fastinit reimplementation)

I wrote some general overview of my testing with finit-mod and Xandros if somebody is interested.

Offline

 

#12 2008-04-29 12:14:43 pm

richardkemp
Senior Member
From: Essex, UK
Registered: 2007-12-15
Posts: 174

Re: eeeXubuntu using finit (fastinit reimplementation)

smurfy - I tested your finit-mdv you linked to above, thanks for your interest in this project! Unfortunately I can only help by testing what you have done...

I timed boot from pressing the on button to the time when I established a connection to my wireless network. Standard eeeXubuntu took 1 minute 23 seconds, finit-mdv took 1 minute 06 seconds. A good improvement, but I noticed it could no longer read information from my battery. And as you mentioned, shutdown does not work. I will report other issues as I find them.

Is the anything in particular I can try out to help you develop this?

On another note, may I suggest you and anyone else developing fastinit for eeeXubuntu leave the possibility of automatic log-in as I think most people use their EEE as a single-user machine for little more than portable web browsing. Not having to log in is very good in this situation. Also, how should I shut down without holding the power button and risking corrupting open files?

Thanks again for the work you have done!


nLite'd XP on White 4G, 2GB of RAM

Offline

 

#13 2008-04-29 12:48:14 pm

SteveLawUK
ExtrEmE User
From: UK
Registered: 2008-03-11
Posts: 3637

Re: eeeXubuntu using finit (fastinit reimplementation)

I like the sound of this and I'll give it a go - once I find out how...

I'd vote for single user though unless there's no difference in speed with the normal autologin and assuming that still works.


2G Surf - "A cracking little machine."

If it ain't broke, don't fix it.

Offline

 

#14 2008-04-29 3:49:37 pm

richardkemp
Senior Member
From: Essex, UK
Registered: 2007-12-15
Posts: 174

Re: eeeXubuntu using finit (fastinit reimplementation)

Instructions in post 9 steve!


nLite'd XP on White 4G, 2GB of RAM

Offline

 

#15 2008-04-29 3:58:58 pm

smurfy
Member
Registered: 2007-12-03
Posts: 23

Re: eeeXubuntu using finit (fastinit reimplementation)

Hey richardkemp,

thanks for your reply. I changed some stuff, i now spawn the x server like the original finit (instead of gdm).
For testing only. and i think its quite faster than gdm+autologin.

as i allready wrote, i want to make a small config file so you could edit the config file instead of recompile the executable.

i will release a new version later this week. i also playing around with a self compiled kernel, because i noticed that the time it needs from grub over kernel init to finit takes a long time.

Offline

 

#16 2008-04-29 4:10:02 pm

SteveLawUK
ExtrEmE User
From: UK
Registered: 2008-03-11
Posts: 3637

Re: eeeXubuntu using finit (fastinit reimplementation)

richardkemp wrote:

Instructions in post 9 steve!

I know sorry, I meant once I get time to sit and read/play smile


2G Surf - "A cracking little machine."

If it ain't broke, don't fix it.

Offline

 

#17 2008-04-29 5:20:08 pm

SteveLawUK
ExtrEmE User
From: UK
Registered: 2008-03-11
Posts: 3637

Re: eeeXubuntu using finit (fastinit reimplementation)

Okay, done it.

I timed 1:07 to desktop + wireless connected without fastinit (from the grub menu) and 0:58 with fastinit.  Not as dramatic a difference as Richard's although it probably averages about the same with fastinit (add about 7/8 seconds from power to grub?) and mine was slightly faster then Richard's beforehand tongue

To repeat Richard's question.  How are we supposed to shutdown?


2G Surf - "A cracking little machine."

If it ain't broke, don't fix it.

Offline

 

#18 2008-04-29 5:41:57 pm

metalshark
Member
From: London, England
Registered: 2008-01-24
Posts: 48
Website

Re: eeeXubuntu using finit (fastinit reimplementation)

Shutting down finit-alt

If you type in

Code:

kill -l

it lists the signals you may send to a process.

Finit listens on signals INT and USR1 for reboots and USR2 for shutdowns.

So the command

Code:

kill -SIGUSR2 1

will send the process with a pid (process id) of 1 a USR2 signal.

The original EEE uses BusyBox to make sure fastinit is pid 1 (last line of this quote from the finit README):

* Eeepc boot process

The essential steps in the boot process carried out in initramfs are:

ROOT=`sed 's!.*root=\([^ ]*\).*!\1!' < /proc/cmdline`
mount -t proc proc /proc
mount -t ext2 -o ro $ROOT /mnt-system
mount -t ext3 -o rw /dev/sda2 /mnt-user
mount -t unionfs -o dirs=/mnt-user=rw:/mnt-system=ro unionfs /mnt
mount --move /mnt-system /mnt/mnt
umount -l /mnt-user
umount /proc
exec switch_root /mnt /sbin/fastinit "$@" </mnt/dev/console >/mnt/dev/console

we can also check this by typing:

Code:

ps ax | grep finit-alt

and noting the pid in the left hand column (it may appear more than once, pick the lowest number and ignore the "grep finit" line).

ASUS use an /etc/acpi script to handle this called powerbtn.sh:

Code:

#!/bin/sh
# /etc/acpi/powerbtn.sh
# Initiates a shutdown when the power putton has been
# pressed.

if ps -Af | grep -q '[k]desktop' && test -f /usr/bin/dcop
then
    dcop --all-sessions --all-users ksmserver ksmserver logout 1 2 2 && exit 0
elif ps -Af | grep -q 'AsusLauncher'
then
    if [ ! -f /home/user/.doingLogin ]
    then
      DISPLAY=:0 su -c /opt/xandros/bin/shutdown_dialog user &
    fi
else
    /bin/kill -SIGUSR2 1
fi

The login screen and kdesktop bits will probably need some tinkering for other window managers. Feel free to PM me if you get stuck.

Last edited by metalshark (2008-04-29 5:43:46 pm)

Offline

 

#19 2008-04-29 6:19:49 pm

richardkemp
Senior Member
From: Essex, UK
Registered: 2007-12-15
Posts: 174

Re: eeeXubuntu using finit (fastinit reimplementation)

Awesome, thanks for the updates guys. I can't wait for your next release, I tried using git before but its a bit too much at once for me so I shall be patient!


nLite'd XP on White 4G, 2GB of RAM

Offline

 

#20 2008-04-30 12:52:21 pm

smurfy
Member
Registered: 2007-12-03
Posts: 23

Re: eeeXubuntu using finit (fastinit reimplementation)

Ok, here is my newest release:)

http://www.smurfy.de/files/finit30042008b.tar.gz

i also attached a INSTALL readme file inside.

There is a precompiled version also. I hope the precompiled version also works for you, because i compiled it with hardy (on the eeepc).

only glitch so far i don't like is the reboot/shutdown stuff.
My Desktop with finit + custom kernel + gdm + crypthomedisk comes up in 40sec (from grub) with login and a long cryptsetup keyprase (i'm a two 1/2 finger typer big_smile)

Last edited by smurfy (2008-04-30 2:55:37 pm)

Offline

 

#21 2008-04-30 1:37:00 pm

SteveLawUK
ExtrEmE User
From: UK
Registered: 2008-03-11
Posts: 3637

Re: eeeXubuntu using finit (fastinit reimplementation)

E: Couldn't find package libconfig0-dev

I tried the precompiled and it just hangs at the loading splash screen.

Last edited by SteveLawUK (2008-04-30 1:49:18 pm)


2G Surf - "A cracking little machine."

If it ain't broke, don't fix it.

Offline

 

#22 2008-04-30 2:56:44 pm

smurfy
Member
Registered: 2007-12-03
Posts: 23

Re: eeeXubuntu using finit (fastinit reimplementation)

Ok, using the precompiled on gutsy causes a kernel panic.

i uploaded "finit30042008b.tar.gz" (see lastpost) with a precompiled version for hardy and gutsy.

for the missing package.. its in the universe ubuntu archive.

a "sudo apt-get install libconfig0-dev" works for me on my eeepc (hardy) and vmware (gutsy)

Last edited by smurfy (2008-04-30 2:58:07 pm)

Offline

 

#23 2008-04-30 3:27:27 pm

SteveLawUK
ExtrEmE User
From: UK
Registered: 2008-03-11
Posts: 3637

Re: eeeXubuntu using finit (fastinit reimplementation)

smurfy wrote:

Ok, using the precompiled on gutsy causes a kernel panic.

i uploaded "finit30042008b.tar.gz" (see lastpost) with a precompiled version for hardy and gutsy.

for the missing package.. its in the universe ubuntu archive.

a "sudo apt-get install libconfig0-dev" works for me on my eeepc (hardy) and vmware (gutsy)

Thanks for both!  (The universe repo wasn't activated on mine (default install)).

I'll try compiling my own first (mostly being 2G, just in case).  EDIT: loads of errors and stuff on that, I'll leave it for now smile

Last edited by SteveLawUK (2008-04-30 3:30:58 pm)


2G Surf - "A cracking little machine."

If it ain't broke, don't fix it.

Offline

 

#24 2008-04-30 3:41:45 pm

SteveLawUK
ExtrEmE User
From: UK
Registered: 2008-03-11
Posts: 3637

Re: eeeXubuntu using finit (fastinit reimplementation)

Well that looked impressive, at first.

Normal boot is about 50 seconds to desktop from grub, and about 1 minute to 1:10 to wireless connected.

Finit left the loading splash screen at about 33 seconds (normally about 40)!  Wow! Thought I.  Now I just see a screen full of:

NetworkManager: <debug> [1209584155.xxxxxx] nm_hal_device_added(): New device added {hal udi is '/org/freedesktop/Hal/devices/pci_8086_2668_{various different things like _alsa_playback_0, _oss_pcm_0_0, etc}').

Last edited by SteveLawUK (2008-04-30 3:43:12 pm)


2G Surf - "A cracking little machine."

If it ain't broke, don't fix it.

Offline

 

#25 2008-04-30 5:15:55 pm

smurfy
Member
Registered: 2007-12-03
Posts: 23

Re: eeeXubuntu using finit (fastinit reimplementation)

hey,

1.
the network manager also creates lots of messages like this. but mostly on tty8. (during startup) on my vmware session (where i test my code and write it) i sometimes get a message on my current tty
i really don't know why the network manager prints that debug messages.

2.
i got the "shutdown" command working. it now works and i can reboot and powerof from X big_smile
i will test it on my eee later, if it works i post the new version tomorrow.

Offline

 
  • Index
  •  » eeeXubuntu
  •  » eeeXubuntu using finit (fastinit reimplementation)

Board footer

Powered by PunBB 1.2.15
© Copyright 2002–2005 Rickard Andersson