-
-
Notifications
You must be signed in to change notification settings - Fork 20
Add fwupd support / LVFS script #829
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: dasharo_develop
Are you sure you want to change the base?
Conversation
9b33f6a to
05ca8cb
Compare
Integrate the functionality of capsule_cabinet.sh into capsule.sh. Cabinets can now be created using `./capsule.sh create_cabinet capsule.cap`. Prior functionality and calls of capsule.sh remain unaffected. Upstream-Status: Inappropriate [Dasharo downstream] Signed-off-by: Filip Lewiński <filip.lewinski@3mdeb.com>
Add a command that allows uploading built cabinets to LVFS. Upstream-Status: Inappropriate [Dasharo downstream] Signed-off-by: Filip Lewiński <filip.lewinski@3mdeb.com>
Fix the script so that the artifacts match our naming convention. Upstream-Status: Inappropriate [Dasharo downstream] Signed-off-by: Filip Lewiński <filip.lewinski@3mdeb.com>
6453a5a to
eb759e5
Compare
| die "no '.config' file in current directory" | ||
| fi | ||
|
|
||
| while read -r line; do |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Please add local line above this. I should have done this earlier.
| # Option names match terminology of GenerateCapsule which conveniently start | ||
| # with different letters: | ||
| # * t - trusted | ||
| # * o - other | ||
| # * s - signer |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Was the comment removed by mistake?
|
|
||
| if [ ! -f "$capsule" ]; then | ||
| die "File $capsule not found" | ||
| fi |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
While at it, I think it's worth adding this check from recap.sh:
local fmp_guid_bytes_hex=edd5cb6d2de8444cbda17194199ad92a
if [ "$(xxd -l 16 -ps "$capsule")" != "$fmp_guid_bytes_hex" ]; then
die "'$capsule' is not an FMP capsule file"
fiAs is, it's possible to make a cabinet out of any file.
| echo ' upload_lvfs upload a cabinet (.cab) to LVFS' | ||
| echo ' options: -c credentials-file -u lvfs-base-url -e email -t token' | ||
| echo ' positional argument: cabinet-file (optional if exactly one .cab in current dir)' |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
To document environment variables:
| echo ' upload_lvfs upload a cabinet (.cab) to LVFS' | |
| echo ' options: -c credentials-file -u lvfs-base-url -e email -t token' | |
| echo ' positional argument: cabinet-file (optional if exactly one .cab in current dir)' | |
| echo ' upload_lvfs upload a cabinet (.cab) to LVFS, options' | |
| echo ' [-c credentials-file] (defaults to ~/.config/dasharo-credentials/lvfs)' | |
| echo ' [-u lvfs-base-url] (defaults to $LVFS_URL)' | |
| echo ' [-e email] (defaults to $LVFS_EMAIL)' | |
| echo ' [-t token] (defaults to $LVFS_TOKEN)' | |
| echo ' positional argument:' | |
| echo ' cabinet-file (optional if exactly one .cab in current dir)' |
Output:
Usage: capsule.sh subcommand [subcommand-args...]
Subcommands:
box export standalone GenerateCapsule out of EDK2
help print this message
keygen use OpenSSL to auto-generate test keys suitable for signing
positional argument: directory-path
make build a capsule, options:
-t root-certificate-file
-o subroot-certificate-file
-s signing-certificate-file
-b (the flag adds battery check DXE into the capsule)
create_cabinet create a fwupd cabinet (.cab) from a capsule
positional argument: capsule-file
upload_lvfs upload a cabinet (.cab) to LVFS, options
[-c credentials-file] (defaults to ~/.config/dasharo-credentials/lvfs)
[-u lvfs-base-url] (defaults to $LVFS_URL)
[-e email] (defaults to $LVFS_EMAIL)
[-t token] (defaults to $LVFS_TOKEN)
positional argument:
cabinet-file (optional if exactly one .cab in current dir)
Oh, and the subcommands were intentionally sorted alphabetically so it's a bit faster to find them in help output.
| cat > "${archive_dir}/firmware.metainfo.xml" << EOF | ||
| <?xml version='1.0' encoding='utf-8'?> | ||
| <component type="firmware"> | ||
| <id>com.${vendor}.${CONFIG_MAINBOARD_SMBIOS_PRODUCT_NAME}.${CONFIG_MAINBOARD_VERSION}.system.firmware</id> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Not introduced here, but still.
| <id>com.${vendor}.${CONFIG_MAINBOARD_SMBIOS_PRODUCT_NAME}.${CONFIG_MAINBOARD_VERSION}.system.firmware</id> | |
| <id>${id}</id> |
And somewhere above:
local id=com.${vendor}.${CONFIG_MAINBOARD_SMBIOS_PRODUCT_NAME}.${CONFIG_MAINBOARD_VERSION}.system.firmware
id=${id// /_}
id=${id////_}I was testing with QEMU's firmware and LVFS did not accept com.emulation.QEMU x86 q35/ich9.1.0.system.firmware for an ID.
Integrate the functionality of capsule_cabinet.sh into capsule.sh. Cabinets can now be created using
./capsule.sh create_cabinet capsule.cap. Prior functionality and calls of capsule.sh remain unaffected.Upstream-Status: Inappropriate [Dasharo downstream]
issue: Dasharo/dasharo-issues#1432
ref: DSH-1123