PDA

View Full Version : Boot the whole system from MMC ?


The Solutor
2006-06-23, 10:11
Hi to everybody.

I was looking around the 770's configuration files when I seen the file

/mnt/initfs/linuxrc

Seems interesting:

Just a piece of the script

check_partitions()
{
grep mtdblock4 /proc/partitions >/dev/null
if [ $? = 0 ] ; then
mtd_found=1
else
mtd_found=0
fi

grep sda1 /proc/partitions >/dev/null
if [ $? = 0 ] ; then
sda_found=1
else
sda_found=0
fi

grep mmc /proc/partitions >/dev/null
if [ $? = 0 ] ; then
mmc_found=1
else
mmc_found=0
fi
}
wait_for_device()
{
complained=0
while [ true ]; do
grep $root_dev /proc/partitions > /dev/null
if [ $? = 0 ]; then
break;
fi
if [ $complained -ne 1 ]; then
echo -n "Waiting for $root_dev_name to become available... "
complained=1
fi
sleep 1
done
if [ $complained -eq 1 ]; then
echo "found it."
fi
}

show_roots()
{
echo "Choose bootup option:"
if [ $mtd_found -eq 1 ]; then
echo " 1) Flash"
fi
if [ $mmc_found -eq 1 ]; then
echo " 2) MMC"
fi
if [ $sda_found -eq 1 ]; then
echo " 3) USB Mass Storage Device"
fi
echo " 9) Start a shell"
echo ""
}




The my idea is that there is some kind of switch that allow to choose the boot partition, but I don't know how to trigger the boot menu.

Anyone has some ideas ?

fanoush
2006-06-23, 11:03
this was already discussed in maemo-developers mailing list
http://www.gossamer-threads.com/lists/maemo/users/6042?search_string=boot%20mmc;#6042

You need either linux flasher to set boot device (flasher --set-root-device mmc) or set it directly on N770. Try as root 'chroot /mnt/initfs cal-tool'.

The Solutor
2006-06-23, 12:18
this was already discussed in maemo-developers mailing list
http://www.gossamer-threads.com/lists/maemo/users/6042?search_string=boot%20mmc;#6042

You need either linux flasher to set boot device (flasher --set-root-device mmc) or set it directly on N770. Try as root 'chroot /mnt/initfs cal-tool'.

Thanks for the reply.

My hope is to start with the boot menu rather than switch the boot device "permanently"

BTW there is an other problem I'm with the 2006 OS, but I think that the binarys in the /initfs directory are "old style" binarys and they doesen't work from the command line of a booted system. :(

P.S. apologies for the poor english

fanoush
2006-06-23, 13:05
My hope is to start with the boot menu rather than switch the boot device "permanently"

yes, you may hope :) But how do you expect to answer the menu?
The menu is useful only for serial console (special cable needed)

BTW there is an other problem I'm with the 2006 OS, but I think that the binarys in the /initfs directory are "old style" binarys and they doesen't work from the command line of a booted system. :(

these are uclibc binaries, use chroot like I suggested, they cannot be executed directly

The Solutor
2006-06-23, 13:21
yes, you may hope :) But how do you expect to answer the menu?
The menu is useful only for serial console (special cable needed)



Er... You are (obviously) right :) , a script that ask what to do in the next reboot can be a better choice, isn't it ? ( maybe an hard button driven menu too)