2 # Copyright (C) 2011 O.S. Systems Software LTDA.
5 _UDEV_DAEMON=`udev_daemon`
12 ROOT_IMAGE="rootfs.img"
17 if [ -z "$bootparam_root" -o "$bootparam_root" = "/dev/ram0" ]; then
18 echo "Waiting for removable media..."
19 udevadm trigger --action=add
21 echo "Mounted filesystems"
26 for i in `ls /run/media 2>/dev/null`; do
27 if [ -f /run/media/$i/$ROOT_IMAGE ] ; then
31 elif [ -f /run/media/$i/isolinux/$ROOT_IMAGE ]; then
38 if [ "$found" = "yes" ]; then
41 # don't wait for more than $shelltimeout seconds, if it's set
42 if [ -n "$shelltimeout" ]; then
43 echo " " $(( $shelltimeout - $C ))
44 if [ $C -ge $shelltimeout ]; then
46 echo "Mounted filesystems"
48 echo "Available block devices"
50 fatal "Cannot find $ROOT_IMAGE file in /run/media/* , dropping to a shell "
52 udevadm trigger --action=add
54 echo "Mounted filesystems"
60 killall -9 "${_UDEV_DAEMON##*/}" 2>/dev/null
61 # The existing rootfs module has no support for rootfs images. Assign the rootfs image.
62 bootparam_root="/run/media/$ROOT_DISK/$ISOLINUX/$ROOT_IMAGE"
65 if [ "$bootparam_LABEL" != "boot" -a -f /init.d/$bootparam_LABEL.sh ] ; then
66 if [ -f /run/media/$ROOT_DISK/$ISOLINUX/$ROOT_IMAGE ] ; then
67 ./init.d/$bootparam_LABEL.sh $ROOT_DISK/$ISOLINUX $ROOT_IMAGE $video_mode $vga_mode $console_params
69 fatal "Could not find $bootparam_LABEL script"
72 # If we're getting here, we failed...
73 fatal "Target $bootparam_LABEL failed"