RE: [PATCH v2 3/3] efi: Capsule update with user helper interface

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



> -----Original Message-----
> From: Andy Lutomirski [mailto:luto@xxxxxxxxxxxxxx]
> 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��������+%������w��{.n�����{����*jg��������ݢj����G�������j:+v���w�m������w�������h�����٥





[Index of Archives]     [Linux ARM Kernel]     [Linux ARM]     [Linux Omap]     [Fedora ARM]     [IETF Annouce]     [Security]     [Bugtraq]     [Linux OMAP]     [Linux MIPS]     [ECOS]     [Asterisk Internet PBX]     [Linux API]

  Powered by Linux