Comments (13)
Probably magick identify
is a good tool for this.
from sbctl.
I'd prefer if we managed to write some Go code for this :) I dislike shelling out for tools and this could either be it's own library, find something already implemented or we make it a thing in go-uefi
.
https://github.com/Foxboron/go-uefi
from sbctl.
Go based BMP decoder/encoder:
https://pkg.go.dev/golang.org/x/image/bmp
I dislike shelling out for tools
I also dislike spawning processes when a complex output parser is required but image magick exact output can be specified which makes parsing trivial.
from sbctl.
@Foxboron what do you think about temporary solution with magick identify
.
It can be an optional dependency. If its not found on the system when a warning will be printed that splash image could not be verified.
from sbctl.
If we are only detecting the filetype pulling imagemagick is a bit much I think, we only really need to peek at 2 bytes in the file to see if it's a BMP (Example). But if you want to try and use more of the output to check towards the accepted image format then It's probably fine :)
from sbctl.
But if you want to try and use more of the output to check towards the accepted image format then It's probably fine
I will do that.
Imagemagick also verifies that the image is valid.
When should image check happen? In GenerateBundle ?
Should it instantly return error or just skip image?
from sbctl.
Maybe also check in bundle
command?
from sbctl.
I think we can just do a hard failure in the bundle
command when there is a file passed there :) No need for one in GenerateBundle
as we should probably assume the values have been validated.
from sbctl.
How should lack of image magick be handled? Maybe print a warning that image could not be verified but proceed?
from sbctl.
If the file extension is not ".bmp" just say it can't be verified. Good enough I think
from sbctl.
I mean the magick
command not the magic numbers.
from sbctl.
Yep, I got that :) But a simple fil extension check if fine if imagemagick is not available I think.
from sbctl.
I made initial check function but it far from finished: igo95862@577c182
from sbctl.
Related Issues (20)
- Enabling Secure Boot with enroll-keys HOT 3
- Automatic signing mkinitcpio post hook not working in latest archlinux package HOT 1
- Mkinitcpio post hook error HOT 4
- In the README the Ubuntu package link is not available, it takes the reader to the OpenSUSE package HOT 3
- Implement sbctl debug HOT 1
- Multiple displays and resolution doesn't work HOT 9
- Cannot re-enroll keys after upgrading system HOT 4
- Kernel removal fails if image file is already removed, resulting in multiple installed kernels on fedora HOT 2
- Unable to make secure boot to work on Surface Go 1st Gen and Arch Linux
- sbctl sign-all does not sign all efi binaries HOT 8
- `sbctl reset` when in setup mode results in PC hang
- Suggestion: Only sign generated file in initcpio hook, use sign-all in a separate pacman hook HOT 4
- sbctl won't work on Fujtsu Lifebook A574/M, BIOS would just reset ANY USER intervention of the secure boot changes HOT 6
- [archlinux] failed signing ***: *** does not exist HOT 3
- my Bios gone black HOT 4
- pacstrap fails due to mkinitcpio post hook HOT 2
- initcpio hook adds temporary files to list HOT 1
- kernel-install plugin fails with uki layout when removing HOT 1
- [Good News] Lenovo Thinkpad Yoga L13 AMD Gen 2 does not brick when removing vendor+ms keys. HOT 6
- sbctl sign failing with "binary has no valid signatures" HOT 4
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from sbctl.