5 function get_version () {
9 if [ -f /mnt/boot/pl_version ]; then
10 cat /mnt/boot/pl_version
13 function get_kernel_version () {
17 if [ -f /mnt/boot/kernel ]; then
18 strings /mnt/boot/kernel | grep planetlab
20 echo "No kernel at /mnt/boot/kernel"
24 function mount_works () {
26 msg="mount: you must specify the filesystem type"
27 r=`mount $DEVICE /mnt/boot 2>&1`
28 if [ "$r" == "$msg" ] ; then
36 DL=`./sysinfo/systeminfo.py | sort -n | awk '{print $2}' | head -1`
37 if [ -z "$kernel" ] ; then
38 V="No BootImage Found"
40 V="Unable to find kernel image"
44 for dev in /dev/cdrom /dev/cdrom1 $DL ${DL}4 ${DL}1; do
46 if mount_works $dev ; then
47 if [ -z "$kernel" ] ; then
48 V=$( get_version $dev )
50 V=$( get_kernel_version $dev )
52 r=`umount /mnt/boot 2>&1`
53 msg2="umount: /mnt/boot: device is busy"
54 if [ "$r" == "$msg2" ] ; then
55 r=`umount /mnt/boot 2>&1`
62 if [ -z "$kernel" ] ; then
64 wc=$( dmesg | grep "Buffer I/O error" | wc -l )
65 if [ $wc -gt 0 ] ; then
66 echo "Multiple IO errors prevent reading: $wc"
68 echo "No BootImage Found"
76 ) 400>/var/lock/myops.mount