github.com/finit-project / finit

Fast init for Linux. Cookies included

Commit log
08d0dc6 🏷 0.3Disable debug Claudio Matsuoka 18 years ago
6e2ea43 Changelog updated Claudio Matsuoka 18 years ago
2679c1b Mount /var/lock and /var/run as tmpfs Claudio Matsuoka 18 years ago
d059003 Fix string termination in path creation Claudio Matsuoka 18 years ago
a1de36c Add note about default user in documentation Claudio Matsuoka 18 years ago
8206803 Remove duplicate unionctl() error in initial reimplementation Claudio Matsuoka 18 years ago
fb8c341 Change poweroff method to reboot(RB_POWER_OFF) (Metalshark) Claudio Matsuoka 18 years ago
7137573 Post-0.2 adjustments Claudio Matsuoka 18 years ago
3e29872 🏷 0.2Cosmetic fix Claudio Matsuoka 18 years ago
944ba85 No need to rename shutdown(), socket functions moved to helpers Claudio Matsuoka 18 years ago
README
☰
Eeepc "fastinit" reimplementations
----------------------------------

finit.c is a reimplementation of the Asus Eeepc fastinit program based
on its library calls. It tries to be an accurate re-creation and keeps
the original bugs and lack of optimization.

finit-mod.c is a fixed/improved version of finit.c.

finit-alt.c is a fixed/improved version of finit.c for alternative Linux
distributions running on the Eeepc (previously ffinit.c). Currently able
to boot unmodified Mandriva Linux.

See Makefile for configurable parameters to better suit your system.


* 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

If mounting the root filesystem fails, execute a maintenance shell. If
mounting the user filesystem fails, fsck and reboot.


* Utilities available in the Eeepc initramfs busybox:

[		cat		cp		cut		dd
dmesg		echo		env		expr		false
grep		insmod		ln		losetup		ls
mdev		mkdir		mknod		mount		mv
pivot_root	realpath	rm		rmmod		sed
sh		sleep		switch_root	test		true
umount		vi


* Devices in the Eeepc initramfs /dev:

console  fb  null  ram0  sda1  sda2  sda3  sr0  tty0



Using finit with alternative systems
------------------------------------

Currently tested only with Mandriva 2008. Proceed with caution, there are
problems related to udev and pam.

1 - Add init=/sbin/finit-mdv to the kernel boot line

2 - Provide a suitable /usr/sbin/services.sh, this is the one I use in my
    test system:

    mkdir /var/lock/subsys
    chmod 1777 /var/lock/subsys
    /etc/init.d/network start
    dhclient eth0
    /sbin/start_udev&
    /etc/init.d/portmap start
    /etc/init.d/nfs-common start

3 - Provide /etc/hostname if you don't have it already

4 - Set the pointer device in the X server configuration to /dev/input/mice

5 - Have a user named "user", or change DEFUSER in the source file