Boot process
From openPMA
[edit] rationale
we'll describe the boot process in order to make make the process of creating custom images easier
[edit] Boot process
- first the bootloader loads the kenrel that is in the aimage.img
- then the kernel boots and loads linuxrc from the aimage.img
CONFIG_CMDLINE="console=null mem=48M root=/dev/null rootflags=physaddr=0x13000000 init=/linuxrc"
[edit] Linuxrc
here the content of build/fs/rootfs:
build/fs/rootfs $ ls -l total 72 drwxr-xr-x 2 root root 4096 2008-01-05 15:35 dev lrwxrwxrwx 1 root root 11 2008-01-05 16:05 etc -> openpma/etc lrwxrwxrwx 1 root root 11 2008-01-05 16:05 lib -> openpma/lib -rwxr-xr-x 1 root root 8275 2008-01-05 15:35 linuxrc drwxr-xr-x 2 root root 4096 2008-01-05 15:33 live drwxr-xr-x 2 root root 4096 2008-01-05 15:35 mnt drwxr-xr-x 16 root root 4096 2008-01-05 15:35 openpma drwxr-xr-x 2 root root 4096 2008-01-05 15:35 proc drwxr-xr-x 2 root root 4096 2008-01-05 15:35 unionfs
then the script starts by exports its path
export LD_LIBRARY_PATH=/openpma/lib:/openpma/usr/lib PATH=/openpma/bin:/openpma/usr/bin:/openpma/sbin:/openpma/usr/sbin
then it populate /dev
devfsd /dev
then it create the console if it doesn't exist:
if [ ! -e /dev/tty1 ]; then mknod /dev/tty1 c 4 1 fi
then it loads the other chip and the framebuffer, both module are proprietary(mabe free drivers exits)
modprobe dm270 modprobe dm270fb
don't know what this is:
. /openpma/etc/functions
then mount proc:
write "Mounting '/proc'..." mount -t proc none /proc >/dev/null 2>&1 status_done
then load the others modules
write "Loading required modules..." modprobe unionfs >/dev/null 2>&1 modprobe nls_cp437 >/dev/null 2>&1 modprobe nls_utf8 >/dev/null 2>&1 status_done
i suppose the status_done are the [ DONE ] that apears on the screen
set the date:
date 112312002006 >/dev/null 2>&1
create the second partition if it doesn't exist
if [ ! -e /dev/discs/disc0/part2 ]; then
NO_PART2="true"
writeln " Resizing media partition,"
write " (this may take a while)..."
parted -s /dev/discs/disc0/disc resize 1 0% 98% >/dev/null 2>&1
if [ $? -gt 0 ]; then
status_failed
writeln "You must have at least 1G free to install openPMA!"
writeln "Please free some space on the harddisk and reboot."
writeln ""
write "$CRED SYSTEM HALTED!"
exit
else
status_done
write "Adding system partition..."
parted -s /dev/discs/disc0/disc mkpart primary 98% 100% >/dev/null 2>&1
if [ $? -gt 0 ]; then
status_failed
else
status_done
write "Formatting system partition..."
mke2fs -p -j -F -m0 /dev/discs/disc0/part2 >/dev/null 2>&1
if [ $? -gt 0 ]; then
status_failed
else
tune2fs -c 5 -i 0 /dev/discs/disc0/part2 >/dev/null 2>&1
status_done
fi
fi
fi
else
write "Checking system partition..."
fsck.ext3 -p /dev/discs/disc0/part2 >/dev/null 2>&1
status_done
fi
mount the second partition to /live
mount -n -t ext3 -o rw,noatime /dev/discs/disc0/part2 /live >/dev/null 2>&1
TO BE CONTINUED

