File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 11PREFIX =/usr/local
22CONFIG_DIR =/etc/default
33BIN_DIR =$(PREFIX ) /bin
4- SCRIPTS =update-m1n1
4+ SCRIPTS =asahi-fwextract update-m1n1
55ARCH_SCRIPTS =update-grub first-boot
66UNITS =first-boot.service
77MULTI_USER_WANTS =first-boot.service
Original file line number Diff line number Diff line change 1+ #! /bin/sh
2+ # SPDX-License-Identifier: MIT
3+
4+ set -eu
5+
6+ [ -e /etc/default/asahi-fwextract ] && . /etc/default/asahi-fwextract
7+
8+ : " ${ASAHIFW:= } "
9+ : " ${VENDORFW:= } "
10+ : " ${VENDORFWTMP:=/ run/ .vendorfw-tmp} "
11+ : " ${PYTHON:= python3} "
12+
13+ if [ -e " $( dirname " $0 " ) " /functions.sh ]; then
14+ . " $( dirname " $0 " ) " /functions.sh
15+ else
16+ . /usr/share/asahi-scripts/functions.sh
17+ fi
18+
19+ umount=false
20+
21+ if [ -z " $ASAHIFW " ] && [ -z " $VENDORFW " ]; then
22+ mount_sys_esp /run/.system-efi
23+ ASAHIFW=" /run/.system-efi/asahi/"
24+ VENDORFW=" /run/.system-efi/vendorfw/"
25+ umount=true
26+ fi
27+
28+ if [ ! -e " ${ASAHIFW} /all_firmware.tar.gz" ]; then
29+ echo " No firmware tarball found, skipping extraction"
30+ exit 0
31+ fi
32+
33+ if [ ! -d " $VENDORFW " ]; then
34+ mkdir -p " $VENDORFW "
35+ fi
36+
37+ if [ ! -d " $VENDORFWTMP " ]; then
38+ mkdir -p " $VENDORFWTMP "
39+ fi
40+
41+ echo " Upgrading vendor firmware package"
42+ " $PYTHON " -m asahi_firmware.update " $ASAHIFW " " $VENDORFWTMP "
43+ mv -f " ${VENDORFWTMP} /*" " $VENDORFW "
44+ rmdir " $VENDORFWTMP "
45+ echo " Firmware upgraded"
46+
47+ $umount && umount /run/.system-efi
48+ true
You can’t perform that action at this time.
0 commit comments