{"id":18519283,"url":"https://github.com/linux-surface/surface-uefi-firmware","last_synced_at":"2025-04-09T08:32:14.386Z","repository":{"id":42122621,"uuid":"252478493","full_name":"linux-surface/surface-uefi-firmware","owner":"linux-surface","description":"UEFI firmware updates for surface using fwupd. WIP, be careful.","archived":false,"fork":false,"pushed_at":"2024-06-05T18:08:33.000Z","size":74,"stargazers_count":119,"open_issues_count":17,"forks_count":9,"subscribers_count":9,"default_branch":"master","last_synced_at":"2025-03-07T13:23:23.316Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":"","language":"Shell","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/linux-surface.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2020-04-02T14:28:01.000Z","updated_at":"2025-02-24T04:48:23.000Z","dependencies_parsed_at":"2022-09-10T05:50:47.349Z","dependency_job_id":"cceae10b-9d36-463d-a6ba-d605d51137e2","html_url":"https://github.com/linux-surface/surface-uefi-firmware","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/linux-surface%2Fsurface-uefi-firmware","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/linux-surface%2Fsurface-uefi-firmware/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/linux-surface%2Fsurface-uefi-firmware/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/linux-surface%2Fsurface-uefi-firmware/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/linux-surface","download_url":"https://codeload.github.com/linux-surface/surface-uefi-firmware/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":248003318,"owners_count":21031770,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2024-11-06T17:15:54.790Z","updated_at":"2025-04-09T08:32:14.070Z","avatar_url":"https://github.com/linux-surface.png","language":"Shell","funding_links":[],"categories":[],"sub_categories":[],"readme":"# UEFI firmware updates for linux-surface\n\nThis is a (mostly) automated patcher for converting the UEFI firmware updates\nthat Microsoft ships with their official driver installation packages into a\nformat that can be installed under linux using fwupd.\n\nLuckily for us Microsoft uses UEFI capsules for their firmwares, which is a\nstandarized format already supported by fwupd. All we have to do is add a\nlittle bit of metadata.\n\n### How?\n\n```C\n#include \u003cstd_disclaimer.h\u003e\n\n/*\n * You are attempting to flash the firmware on an extemely locked down system.\n * It is unknown if the device can recover itself from a bad firmware flash.\n *\n * NO responsibility is taken for damages to your hardware or any other\n * consequences you may face because of flashing your firmware using unofficial\n * and unsupported tools.\n *\n * Be careful!\n */\n```\n\nFirst you need to download the driver package for your surface model from\nMicrosofts website. It will present you with a list of files, they are for\nmultiple versions of Windows. Just use the first one.\n\nhttps://support.microsoft.com/en-us/help/4023482/surface-download-drivers-and-firmware-for-surface\n\nYou will also have to install the `msiextract`, `gcab` and `dos2unix` programs through\nyour distributions package manager.\n\n```bash\n# Debian based\n$ sudo apt install msitools gcab dos2unix\n\n# Arch based, msitools is in the AUR, use whatever helper you like\n$ yay -S gcab msitools dos2unix\n\n# Fedora\n$ sudo dnf install msitools gcab dos2unix\n```\n\nWe are going to assume you have a directory tree that looks like this, and\nthat you are currently in the `surface-uefi-firmware` directory:\n\n```\n.\n├── SurfaceBook2_Win10_19041_22.023.33295.0.msi\n└── surface-uefi-firmware\n    ├── README.sh\n    ├── repack.sh\n    └── template.metainfo.xml\n\n1 directory, 4 files\n```\n\nYou will need to run the `repack.sh` script, which will unpack the MSI,\nextract all UEFI firmwares from it, and generate fwupd metadata for it.\n\n```bash\n$ ./repack.sh ../SurfaceBook2_Win10_19041_22.023.33295.0.msi -o fwupdates\n```\n\nOnce the script finishes you can find a list of cab files inside of\nthe fwupdates folder:\n\n```bash\n$ tree fwupdates/\nfwupdates/\n├── SurfaceKeyboard_8.0.2048_96729509-963f-4608-bb2f-4788d0c76404.cab\n├── surfaceme_208.8.13570_f3d5747d-24e3-44dd-9118-d332d932bced.cab\n├── SurfacePD_1.0.1025_d8a91eed-fb95-4a5f-84db-9497294247e7.cab\n├── surfacesam_6.1.12427_52ef6898-ded3-40bc-a1ee-36cc0459b1d4.cab\n├── surfacesmf_57.0.299_8230d1a7-94f1-4f2d-934b-5fa2fb6a91c0.cab\n├── surfacetouch_4.1.1536_408b2012-cc30-4abc-9fb9-545f18841262.cab\n├── SurfaceTPM_7.2.512_a1adec1f-c12a-461d-b69c-114259d40cb6.cab\n├── surfacetrackpad_0.8.0_1c12a6dd-54c2-4b20-8c17-3d3372a11096.cab\n└── surfaceuefi_15.0.2956_a1bb21b6-5cd1-48ea-ad29-f7c3236ebf0a.cab\n```\n\nUsing fwupd, you can install all the firmware files at once\n\n``` bash\n$ for f in fwupdates/*; do \n    sudo fwupdmgr install --allow-older --allow-reinstall --no-reboot-check \"$f\"\n  done\n```\nor à la carte\n\n```bash\n$ fwupdmgr install --allow-older --allow-reinstall --force \u003cpath-to-cab-file\u003e\n```\n\n\n### Why?\n\nBecause I don't want to dualboot, and reinstalling Windows every few months\nwill cost more time over the long run than developing this.\n\nAdditionally, this is more open than the Windows firmware update process. This\nallows you to downgrade the firmware in the event that you *really really\nneed to*, unlike Windows.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Flinux-surface%2Fsurface-uefi-firmware","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Flinux-surface%2Fsurface-uefi-firmware","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Flinux-surface%2Fsurface-uefi-firmware/lists"}