You are not logged in.
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
Please let us know if you do try it. ![]()
Fastinit and eeeXubuntu would be nice.
Offline
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!
Offline
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!
Offline
hey, i also will take a look and try to get it work with eeexubuntu
Offline
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 ![]()
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 ![]()
i will post my source with installguide later i hope someone could help me with my problems
edit:
startx problem solved
but gdm still does not work ![]()
Last edited by smurfy (2008-04-24 7:03:05 pm)
Offline
Is it necessary to know C to fiddle with this? ![]()
Offline
Short answer: Maybe ![]()
Long one: You must add defines and maybe add some commands
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 ![]()
- 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) ![]()
Offline
Ok,
x terminal problem solved
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
(my eeexubuntu still works
)
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
)
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 ![]()
Last edited by smurfy (2008-04-25 10:56:58 am)
Offline
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:
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
close(2);
close(1);
close(0);
if (open("/dev/tty1", O_RDWR, 0))
exit(1);and
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
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!
Offline
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.
Offline
Instructions in post 9 steve!
Offline
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
richardkemp wrote:
Instructions in post 9 steve!
I know sorry, I meant once I get time to sit and read/play ![]()
Offline
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 ![]()
To repeat Richard's question. How are we supposed to shutdown?
Offline
Shutting down finit-alt
If you type in
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
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:
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:
#!/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
fiThe 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
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!
Offline
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
)
Last edited by smurfy (2008-04-30 2:55:37 pm)
Offline
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)
Offline
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
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 ![]()
Last edited by SteveLawUK (2008-04-30 3:30:58 pm)
Offline
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)
Offline
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 ![]()
i will test it on my eee later, if it works i post the new version tomorrow.
Offline