summaryrefslogtreecommitdiff
path: root/usr.sbin/fw_update
AgeCommit message (Collapse)Author
2023-11-15Don't let signify mess up our status lineAndrew Fresh
While not verbose the status line is built as we go, so save errors from signify until after we've finished the status line. This should exit and print the error immediately, since this happens when fetching the SHA256.sig and fw_update exits early in that case.
2023-11-15Improve output after waiting for package db lockAndrew Fresh
OpenBSD::PackageInfo::lock_db will send messages to STDERR if we ended up waiting for a lock, if that happens, it stomped over the "fw_update:" prefix on the status line so tidy up and print it out again.
2023-11-15Better handle ftp errors in fw_updateAndrew Fresh
Trap STDERR to post-process it looking for 404 errors to handle them differently. The fetch method now also returns different error codes for errors that can continue on. Currently only 404 is special and everything else should cause fw_update to exit early without trying all the files. Exit early if the SHA256.sig gets a 404 because that is required to figure out what valid firmware are.
2023-11-15Improve fw_update output on errorsAndrew Fresh
Mostly some setup for the future, by separating out the filehandles we use for the status and errors more specifically, we can trap the things we know about without hiding surprises.
2023-10-14Verify but don't overwrite SHA256.sig in fw_update(8)Andrew Fresh
Signify is happy to overwite the file with the signature stripped off. However, if we do that, when downloading firmware we lose the ability to check the signature before verifying checksums on the downloaded files. Noticed by Thomas <exnihilo () fastmail ! org> Right deraadt@
2023-09-28Don't register firmware already in /var/db/pkgAndrew Fresh
If installing firmware with `make install` from a port, it doesn't register properly by adding "@option firmware" to the packing list, this means we ignore that it is installed and reinstall it over and over with the registration ending up in a tmpdir named directory inside the existing directory in /var/db/pkg. Unfortunately I don't know of a good way to automatically clean up from that, so we just print a message after installing the actual firmware. Reported by job@ No complaints about the patch on tech@ for several weeks.
2023-09-28Exit successfully at the end of fw_updateAndrew Fresh
Otherwise the exit status depends on whether we kept any firmware. Reported by Brian Conway <bconway () rcesoftware ! com> The clean solution suggested by guenther@
2023-09-28Download firmware to LOCALSRC when using filenamesAndrew Fresh
Previously if you did: fw_update otus-firmware-1.0p1.tgz and that firmware didn't exist in the current directory, we would download that firmware into the current directory. Which is not the expected outcome.
2023-08-31Add spaces for failure statusAndrew Fresh
2023-08-31Exit fw_update(8) lock_db subprocess when parent exitsAndrew Fresh
If fw_update exits unexpectedly the package database would never unlock. select solution from millert@
2023-08-31Improve feedback from fw_update(8)Andrew Fresh
Show status as we go with spinner rather than printing only at the end. Suggestions from deraadt@ Most of this has been in snapshots for a while
2023-07-22match AMD x86 CPUs in fw_update(8)Jonathan Gray
ok deraadt@
2023-06-27Inform fw_update(8) about qcpas(4) pattern.Patrick Wildt
ok kettenis@
2023-02-16remove the '(R)' from the intel cpu match patternJonathan Gray
Intel(R) does not appear in cpu0: Intel Atom(R) x6425RE Processor @ 1.90GHz, 1895.90 MHz, 06-96-01 reported by patrick@ ok deraadt@
2023-01-24match unknown ATI display devices as amdgpu in fw_updateJonathan Gray
For recent devices amdgpu matches via the hardware ip discovery table, not with a table of pci vendor and product ids. So amdgpu_devlist.h and pcidevs do not cover all devices that amdgpu may match. in dmesg amdgpu with an unknown product takes the form: ramdisk kernel, bios/mbr: vga1 at pci12 dev 0 function 0 vendor "ATI", unknown product 0x687f rev 0xc3 ramdisk kernel, efi or non-x86 arch: vendor "ATI", unknown product 0x687f (class display subclass VGA, rev 0x03) at pci12 dev 0 function 0 not configured non-ramdisk kernel: amdgpu0 at pci12 dev 0 function 0 vendor "ATI", unknown product 0x687f rev 0xc3 ok deraadt@ on an earlier version
2022-12-12Remove extra : in parameter substitutionAndrew Fresh
From Rob Whitlock <rwhitlock22 () gmail ! com>
2022-12-06Install arm64-qcom-dtb upon encountering a qcgpio(4) device.Patrick Wildt
ok phessler@ sthen@ tobhe@
2022-11-17Add apple-boot firmware for Apple arm64 machines in fw_update(8) patterns.Tobias Heider
The pattern matches the printed CPU_IMPL_APPLE name as in: cpu0 at mainbus0 mpidr 0: Apple Icestorm Pro r2p0 cpu0 at mainbus0 mpidr 0: Apple Blizzard r1p0 ok deraadt@ afresh@ kettenis@
2022-08-06match recent Intel CPUs in fw_update(8)Jonathan Gray
Intel CPUs mostly used to have processor name strings of the form cpu0: Intel(R) Pentium(R) M processor 1.60GHz ("GenuineIntel" 686-class) 1.60 GHz, 06-0d-06 cpu0: Intel(R) Core(TM) i7-5600U CPU @ 2.60GHz, 2494.61 MHz, 06-3d-04 recent CPUs use cpu0: 11th Gen Intel(R) Core(TM) i5-1130G7 @ 1.10GHz, 30009.37 MHz, 06-8c-01 cpu0: 12th Gen Intel(R) Core(TM) i5-12400, 4390.71 MHz, 06-97-02 cpu0: 12th Gen Intel(R) Core(TM) i7-1260P, 1995.55 MHz, 06-9a-03 change pattern used to handle this also covers oddities such as cpu0: Genuine Intel(R) CPU @ 600MHz, 600.10 MHz cpu0: Genuine Intel(R) CPU @ 1.00GHz, 1000.13 MHz, 06-26-01 cpu0: Genuine Intel(R) CPU L2400 @ 1.66GHz ("GenuineIntel" 686-class) 1.67 GHz, 06-0e-08 test chips use "Genuine Intel(R) CPU 0000"
2022-08-05Support wildcards in fw_update patternsAndrew Fresh
Up to two wildcards, since we have to work around the way ksh does things. Tweaks and suggestions from kn@ and halex@
2022-03-10Inform fw_update(8) about mtw(4) pattern.hastings
ok jsg@
2022-03-09spelling/wordingJonathan Gray
ok afresh1@
2022-02-20Only use /snapshots dir when -currentAndrew Fresh
Not during release, -stable, or -beta. This diverges from how packages work and how things were done in the past where -beta also looked in /snapshots. Discussed in icb. OK deraadt@
2022-02-20Remove downloaded SHA256.sig if signature validation failsAndrew Fresh
Without the "noclobber" setting we would have overwitten with an empty file and best not to leave a failed file around. Noticed by florian@
2022-02-20Show summary even if no firmware are detected or installedAndrew Fresh
OK florian@
2022-02-19Ignore sitelib in perl snippetAndrew Fresh
All base tools should be doing that and I forgot. While here remove the no longer necessary TERM handler, it was only needed so a TERM signal would still trigger the END block.
2022-02-15make use of pkg_* infra simplificationsMarc Espie
okay afresh1@
2022-02-11Lock the pkg db while runningAndrew Fresh
At least when not running in the installer. Suggestions from espie@ Works for me sthen@ fine deraadt@
2022-02-10Don't unregister firmware if we can't fetch the SHA256.sigAndrew Fresh
Also avoid trying to download it multiple times if it fails, which makes error reporting much nicer. Noticed by and OK semarie@
2022-01-30Localize variables used only in functionsAndrew Fresh
Somehow I missed some
2022-01-29Clean up exit codesAndrew Fresh
Being different didn't help me figure out what was going wrong anyway. Suggested by deraadt@
2022-01-29rtwn and urtwn firmware got better licenses and moved to baseAndrew Fresh
2022-01-29"Unregister" installed firmware that isn't in the SHA256.sigAndrew Fresh
We assume in this case that the firmware's license was improved and it moved to be distributed in the base system. If we find that situation remove the package registration but leave the firmware files.
2022-01-24Redownload existing files with failed checksumsAndrew Fresh
2022-01-22Support multiple -v as promised in the man pageAndrew Fresh
There are now four levels of verbosity: 0. Prints only the summary 1. Prints a line when installing/removing 2. Uses the ftp(1) progress bar 3. Provides more details for debugging With some excellent ksh knowledge provided by kn@
2022-01-12Bug fixes and performance improvementsAndrew Fresh
Plus improving usage to match the man page fine deraadt@
2022-01-11Tidy up some commentsAndrew Fresh
requested by deraadt@
2022-01-08Don't download SHA256.sig unless it's neededAndrew Fresh
This allows installing local files without network. it *might* work now deraadt@
2022-01-07whitespaceAndrew Fresh
2022-01-06repair usageTheo de Raadt
2022-01-06Switch fw_update -D to instead -FAndrew Fresh
The perl version of fw_update used -D for something else and although the mneumonic isn't as good, the conflict was worse. Requested by deraadt@
2022-01-06Make it possible to compile the patterns utility with the source treeAnton Lindqvist
checked out anywhere. While here, tidy up the Makefile a bit. ok deraadt@
2022-01-05Commit the correct version of fw_updateAndrew Fresh
Sigh.
2022-01-05Add the shell based fw_update and updated man pageAndrew Fresh
This allows installing firmware from the installer without having to wait to boot into a live system. commit deraadt@
2022-01-05We are moving back to a shell-script based fw_update, written in such aTheo de Raadt
way that the install script can also run it. This allows earlier retrieval of downloaded firmwares, based upon patterns found in dmesg. many iterations of this in snaps for about a month.
2015-01-23Killing my darling. Functionality and binary name moved to pkg_* andAlexander Hall
friends. So long and thanks for all the fish. ok deraadt@
2014-02-23- add a -p <path> switch for specifying the location ofAlexander Hall
firmware packages - reword 'firmware files' to 'firmware' - pick some style and whitespace nits ok deraadt@
2014-02-23print out the path to the firmware packages in verbose mode, for use withAlexander Hall
the upcoming -p <path> flag
2014-02-23Document where firmwares come from, as step 1 of dealing with off-lineTheo de Raadt
some firmware retrieval issues I discovered. ok espie halex
2014-02-04various minor fixes; ok halexJason McIntyre