#!/bin/sh loggerName=1-before-Upload.sh RamDiskDir=/mnt/data/fw SetError="dbus-send --system --print-reply --dest=com.rexroth.akku.SysService /SysObj com.rexroth.akku.SysInterface.freporterror string:"dummy" string:"3243" string:""" RdyFlagSet="dbus-send --system --print-reply --dest=com.rexroth.akku.SysService /SysObj com.rexroth.akku.SysInterface.frdyflagset int32:7" RdyFlagResetSet="dbus-send --system --print-reply --dest=com.rexroth.akku.SysService /SysObj com.rexroth.akku.SysInterface.frdyflagreset int32:7" logger -s -t $loggerName "START FIRMWARE UPDATE" # Arbeitsspeicher freischaufeln sync sync sync echo 3 > /proc/sys/vm/drop_caches # Genug freigeschaufelt ? ######################### FreeRam=`free | grep Mem: | awk '{print $4}'` if [ $FreeRam -lt 85000 ]; then logger -s -t $loggerName "Error: Ram zu klein <$FreeRam>" $SetError exit 1 fi mount | grep 'ramfs on /mnt/data/fw' &> /dev/null if [ "$?" -ne "0" ]; then # Ram Disk anlegen mkdir $RamDiskDir mount -t ramfs ramfs $RamDiskDir if [ "$?" -lt "0" ]; then logger -s -t $loggerName "Error: Anlegen der Ramdisk" $SetError exit 1 fi fi # Ready weggnehmen ################## $RdyFlagResetSet dbus-send --system --print-reply --dest=com.rexroth.akku.GUIService /GUI com.rexroth.akku.gui.fpopupString string:"FW Update" string:"Upload Image" int32:2 int32:0 exit 0