4 if [ -f /etc/planetlab/plc_config ]; then
5 source /etc/planetlab/plc_config
10 function get_version () {
14 if [ -f /mnt/boot/pl_version ]; then
15 cat /mnt/boot/pl_version
18 function get_kernel_version () {
22 if [ -f /mnt/boot/kernel ]; then
23 strings /mnt/boot/kernel | grep planetlab
25 echo "No kernel at /mnt/boot/kernel"
29 function mount_works () {
31 msg="mount: you must specify the filesystem type"
32 r=`mount $DEVICE /mnt/boot 2>&1`
33 if [ "$r" == "$msg" ] ; then
41 DL=`/home/${PLC_SLICE_PREFIX}_myops/sysinfo/systeminfo.py | sort -n | awk '{print $2}' | head -1`
42 if [ -z "$kernel" ] ; then
43 V="No BootImage Found"
45 V="Unable to find kernel image"
49 for dev in /dev/cdrom /dev/cdrom1 $DL ${DL}4 ${DL}1; do
51 if mount_works $dev ; then
52 if [ -z "$kernel" ] ; then
53 V=$( get_version $dev )
55 V=$( get_kernel_version $dev )
57 r=`umount /mnt/boot 2>&1`
58 msg2="umount: /mnt/boot: device is busy"
59 if [ "$r" == "$msg2" ] ; then
60 r=`umount /mnt/boot 2>&1`
67 if [ -z "$kernel" ] ; then
69 wc=$( dmesg | grep "Buffer I/O error" | wc -l )
70 if [ $wc -gt 0 ] ; then
71 echo "Multiple IO errors prevent reading: $wc"
73 echo "No BootImage Found"
81 ) 400>/var/lock/myops.mount