#!/bin/bash
####################################################################
#      File: S08vmachine-sprom
#      Name: Suresh Kumar Nalluru
#
#      Description:
#           If this is a VM, install default sprom values to klm_dc_sprom
#
# Copyright (c) 2012 Insieme Networks, Inc.
# All rights reserved.
#####################################################################

. /etc/init.d/mod_ins/module-load-functions

boot_debug "Installing SPROM driver ... for card index $(get_cmdline_card_index)"
# insert klm_dc_sprom
/sbin/insmod -f /lib/modules/klm_dc_sprom.o  sprom_ci=$(get_cmdline_card_index) g_dbg_lvl=1

case $1 in
    start)
        boot_debug "Installing default sprom values ..."
        BOARDTYPE="$(proc_cmdline_get boardtype)"
        #FRETTA_BRINGUP_HACK - CSCut92229
        #this binariy only applies to rp. causing kernel crash on lc
        if [ "$BOARDTYPE" == "RP" ]; then
            /bin/idprom_host_utility -a x86 > /tmp/idprom_local_card.output
        fi
        boot_debug " done."
    ;;
esac
