File: fwupd-i386-signed.postinst

package info (click to toggle)
fwupd-i386-signed 1.5.7%2B4
  • links: PTS, VCS
  • area: main
  • in suites: bullseye
  • size: 52 kB
  • sloc: sh: 57; makefile: 10
file content (50 lines) | stat: -rwxr-xr-x 1,737 bytes parent folder | download | duplicates (6)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
#!/bin/sh
set -e

#DEBHELPER#

if dpkg-maintscript-helper supports rm_conffile 2>/dev/null; then
	dpkg-maintscript-helper rm_conffile \
		/etc/fwupd.conf 1.0.0~ -- "$@"
	dpkg-maintscript-helper rm_conffile \
		/etc/fwupd/remotes.d/fwupd.conf 1.2.7~ -- "$@"
	dpkg-maintscript-helper rm_conffile \
		/etc/dbus-1/system.d/org.freedesktop.fwupd.conf 1.3.2~ -- "$@"
	dpkg-maintscript-helper rm_conffile \
		/etc/fwupd/ata.conf 1.5.5~ -- "$@"
fi

#Perform transition from /etc/fwupd/uefi.conf to /etc/fwupd/uefi_capsule.conf
if dpkg-maintscript-helper supports mv_conffile 2>/dev/null; then
	ORIGINAL=/etc/fwupd/uefi.conf
	NEW=/etc/fwupd/uefi_capsule.conf
	#If already upgraded this file won't exist
	#If in the middle of an upgrade:
	# -> If unmodified then preinst would have renamed to /etc/fwupd/uefi.conf.dpkg-remove
	# -> If modified, we need to do an in-place upgrade with sed
	if [ -f $ORIGINAL ]; then
		sed "s,\[uefi\],\[uefi_capsule\]," -i $ORIGINAL
	fi
	dpkg-maintscript-helper mv_conffile $ORIGINAL $NEW 1.5.5~ -- "$@"
fi

# Clean up from fwupdate->fwupd transition
# This can be removed after bullseye and focal are released
EFIDIR=$(awk '/^ID=/ {gsub(/"/,""); split($$0,a,"="); print tolower(a[2])}' /etc/os-release)
if [ "${DPKG_MAINTSCRIPT_ARCH}" = "amd64" ]; then
	EFI_NAME=x64
elif [ "${DPKG_MAINTSCRIPT_ARCH}" = "i386" ]; then
	EFI_NAME=ia32
elif [ "${DPKG_MAINTSCRIPT_ARCH}" = "arm64" ]; then
	EFI_NAME=aa64
elif [ "${DPKG_MAINTSCRIPT_ARCH}" = "armhf" ]; then
	EFI_NAME=arm
fi
rm -f /boot/efi/EFI/$EFIDIR/fwup$EFI_NAME.efi
rm -f /var/lib/fwupdate/done
rm -f /var/cache/fwupdate/done
for dir in /var/cache/fwupdate /var/lib/fwupdate; do
	if [ -d $dir ]; then
	        rmdir --ignore-fail-on-non-empty $dir || true
	fi
done