> -----Original Message-----
> From: Andy Lutomirski [mailto:l...@amacapital.net]
> Sent: Wednesday, November 05, 2014 12:36 AM
> 
> Am I missing something here?  The current proposal is missing the
> success/failure part, unless you count the loaded count (in a different sysfs
> directory) as a useful interface for that.

Here is my sample shell script which allow me to do multi capsule binaries 
upload
and obtain error message if error occur:

#!/bin/sh

old=$(cat /sys/devices/platform/efi_capsule_user_helper/capsule_loaded)

for arg in "$@"
do
        if [ -f $arg ]
        then
                echo 1 > /sys/class/firmware/efi-capsule-file/loading
                cat $arg > /sys/class/firmware/efi-capsule-file/data
                echo 0 > /sys/class/firmware/efi-capsule-file/loading

                oldtime=$(date +%S)
                oldtime=$(((time + 2) % 60))
                until [ -f /sys/class/firmware/efi-capsule-file/loading ]
                do
                        newtime=$(date +%S)
                        if [ $newtime -eq $oldtime ]
                        then
                                break
                        fi
                done

                old=$((old + 1))
                new=$(cat 
/sys/devices/platform/efi_capsule_user_helper/capsule_loaded)
                if [ ! $new -eq $old ]
                then
                        echo "Capsule binary $arg upload failed"
                        dmesg | tail | grep -v platform | grep -e efi
                        exit 1
                fi
        else
                echo "File $arg not found !!"
        fi
done
exit 0


Regards,
Wilson

N�����r��y����b�X��ǧv�^�)޺{.n�+����{�y����^n�r���z���h�����&���G���h�(�階�ݢj"���m������z�ޖ���f���h���~�m�

Reply via email to