Skip to content

Commit

Permalink
cleanup: don't chattr if it's not immutable.
Browse files Browse the repository at this point in the history
On kernels without the fix for Samsung laptops, the cleanup script will
fail because the efi variables in sysfs files aren't immutable.  Don't
try to unset the immutable flag if it's not set.

This is discussed here: #69 (comment)

Signed-off-by: Peter Jones <[email protected]>
  • Loading branch information
vathpela committed Jan 8, 2018
1 parent ccbcad4 commit 022f2b6
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion linux/cleanup.in
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,9 @@ for x in @@ESPMOUNTPOINT@@/EFI/@@EFIDIR@@/fw/fwupdate-* ; do
done
for x in /sys/firmware/efi/efivars/fwupdate-*-0abba7dc-e516-4167-bbf5-4d9d1c739416 ; do
if [ "${x}" != "/sys/firmware/efi/efivars/fwupdate-*-0abba7dc-e516-4167-bbf5-4d9d1c739416" ]; then
chattr -i "${x}"
if lsattr "${x}" 2>/dev/null | cut -d\ -f1 | cut -d- -f5 | grep -q i ; then
chattr -i "${x}"
fi
rm -f "${x}"
fi
done
Expand Down

0 comments on commit 022f2b6

Please sign in to comment.