diff options
author | Dave Cobbley <david.j.cobbley@linux.intel.com> | 2018-08-14 20:05:37 +0300 |
---|---|---|
committer | Brad Bishop <bradleyb@fuzziesquirrel.com> | 2018-08-23 04:26:31 +0300 |
commit | eb8dc40360f0cfef56fb6947cc817a547d6d9bc6 (patch) | |
tree | de291a73dc37168da6370e2cf16c347d1eba9df8 /meta-openembedded/meta-oe/recipes-bsp/edac-utils/files/make-init-script-be-able-to-automatically-load-EDAC-.patch | |
parent | 9c3cf826d853102535ead04cebc2d6023eff3032 (diff) | |
download | openbmc-eb8dc40360f0cfef56fb6947cc817a547d6d9bc6.tar.xz |
[Subtree] Removing import-layers directory
As part of the move to subtrees, need to bring all the import layers
content to the top level.
Change-Id: I4a163d10898cbc6e11c27f776f60e1a470049d8f
Signed-off-by: Dave Cobbley <david.j.cobbley@linux.intel.com>
Signed-off-by: Brad Bishop <bradleyb@fuzziesquirrel.com>
Diffstat (limited to 'meta-openembedded/meta-oe/recipes-bsp/edac-utils/files/make-init-script-be-able-to-automatically-load-EDAC-.patch')
-rw-r--r-- | meta-openembedded/meta-oe/recipes-bsp/edac-utils/files/make-init-script-be-able-to-automatically-load-EDAC-.patch | 98 |
1 files changed, 98 insertions, 0 deletions
diff --git a/meta-openembedded/meta-oe/recipes-bsp/edac-utils/files/make-init-script-be-able-to-automatically-load-EDAC-.patch b/meta-openembedded/meta-oe/recipes-bsp/edac-utils/files/make-init-script-be-able-to-automatically-load-EDAC-.patch new file mode 100644 index 000000000..fddc25f60 --- /dev/null +++ b/meta-openembedded/meta-oe/recipes-bsp/edac-utils/files/make-init-script-be-able-to-automatically-load-EDAC-.patch @@ -0,0 +1,98 @@ +make init script be able to automatically load EDAC module. + +Upstream-Status: Inappropriate [embedded specific] + +Signed-off-by: Roy.Li <rongqing.li@windriver.com> +--- + src/etc/edac.init.in | 49 +++++++++++++++++++++++++++++++++++++++++++++++-- + 1 file changed, 47 insertions(+), 2 deletions(-) + +diff --git a/src/etc/edac.init.in b/src/etc/edac.init.in +index 7a51da9..5b568c4 100644 +--- a/src/etc/edac.init.in ++++ b/src/etc/edac.init.in +@@ -42,7 +42,6 @@ for dir in "$sysconfdir/default" "$sysconfdir/sysconfig"; do + [ -f "$dir/$SERVICE" ] && . "$dir/$SERVICE" + done + +- + ############################################################################### + + service_start () +@@ -52,6 +51,46 @@ service_start () + # Assume that if EDAC_DRIVER is not set, then EDAC is configured + # automatically, thus return successfully, but don't do anything. + # ++ if [ ! -f /etc/edac/edac-driver ]; then ++ [ -d /sys/bus/edac/devices/mc/mc0 ] && \ ++ echo `lsmod | grep _edac | cut -d" " -f1` > /etc/edac/edac-driver ++ fi ++ ++ [ -f /etc/edac/edac-driver ] && EDAC_DRIVER=`cat /etc/edac/edac-driver` ++ ++ if [ -z "$EDAC_DRIVER" ]; then ++ ++ DRIVER_PATH=/lib/modules/`uname -r`/kernel/drivers/edac ++ oldpath=`pwd` ++ if [ -d $DRIVER_PATH ]; then ++ ++ cd $DRIVER_PATH ++ ++ for i in $(/bin/ls | /usr/bin/cut -d. -f1) ; do ++ /sbin/modprobe $i 2>/dev/null ++ if [ -d /sys/bus/edac/devices/mc/mc0 ]; then ++ echo $i> /etc/edac/edac-driver ++ EDAC_DRIVER=$i ++ break ++ fi ++ /sbin/modprobe -r $i 2>/dev/null ++ done ++ ++ cd "$oldpath" ++ ++ ++ if [ -z "$EDAC_DRIVER" ]; then ++ echo "This board may not support EDAC, or EDAC module may not be compiled in" ++ exit ++ fi ++ ++ else ++ echo "This board may not support EDAC, or EDAC module may not be compiled in" ++ exit ++ fi ++ ++ fi ++ + if [ -n "$EDAC_DRIVER" ]; then + echo -n "Starting ${SERVICE}: " + modprobe $EDAC_DRIVER +@@ -76,12 +115,15 @@ service_start () + service_stop () + { + echo -n "Disabling ${SERVICE}: " ++ ++ [ -f /etc/edac/edac-driver ] && EDAC_DRIVER=`cat /etc/edac/edac-driver` ++ + if [ -n "$EDAC_DRIVER" ]; then + modprobe -r $EDAC_DRIVER + STATUS=$? + [ $STATUS -eq 0 ] && echo success || echo failure + else +- echo "Not supported for this configuration." ++ echo "Not supported for this configuration, or EDAC Module is not loaded." + STATUS=6 + fi + } +@@ -92,6 +134,9 @@ service_status () + { + # Print the current status of the service. Required by LSB. + # ++ [ -f /etc/edac/edac-driver ] && EDAC_DRIVER=`cat /etc/edac/edac-driver` ++ [ -z "$EDAC_DRIVER" ] && STATUS=1 && exit ++ + edac-ctl --status + STATUS=0 + } +-- +1.7.10.4 + |