-
Notifications
You must be signed in to change notification settings - Fork 282
New issue
Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? # to your account
flashy: Check image file size against flash device size #150
Conversation
@kawmarco has imported this pull request. If you are a Facebook employee, you can view this diff on Phabricator. |
Hey @lhl2617, thanks for the PRs! For this one, I'm wondering if we could compare the image size with the mtd device size instead (imagining we'd eventually have images > 32M eventually), would that make sense? |
@kawmarco Good point! One issue is that sometimes we do not always know the target mtd device, but during flashing we always do. I'll modify the function to take in an optional target flash device, which if defined, this function will cross check the size of the image against the size of the flash device. |
b12eb5b
to
1c3f837
Compare
d0aa5f8
to
ef3460a
Compare
Updated as per this description :) |
ef3460a
to
82f8710
Compare
// Takes in maybeDeviceI denoting a deviceID, which if non-empty is used to | ||
// get the flash device and ensure that the image file size is smaller than the size of the | ||
// flash device. | ||
var ValidateImageFile = func(imageFilePath string, maybeDeviceID string) error { |
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.
moved from validate.ValidateImageFile
.
@kawmarco has imported this pull request. If you are a Facebook employee, you can view this diff on Phabricator. |
Tested locally, looking good :-)
|
@lhl2617 merged. Thanks :) 🥇 |
Summary: As title. Corresponds to `fw-util` in f137c9a The difference is that the image file size is validated against the target flash device's size, if the flash target device ID is provided (it is optional during `./flashy -checkimage` or the `check-image` utility, during which the image file size check is bypassed. This is to support validating images on dev servers,) Pull Request resolved: #150 Test Plan: Unit tests (`go test ./...`) Reviewed By: deathowl Pulled By: kawmarco fbshipit-source-id: 6e38204e94
Thanks @deathowl #templeOS |
Summary: As title. Corresponds to `fw-util` in facebook@f137c9a The difference is that the image file size is validated against the target flash device's size, if the flash target device ID is provided (it is optional during `./flashy -checkimage` or the `check-image` utility, during which the image file size check is bypassed. This is to support validating images on dev servers,) Pull Request resolved: facebook#150 Test Plan: Unit tests (`go test ./...`) Reviewed By: deathowl Pulled By: kawmarco fbshipit-source-id: 6e38204e94
Summary
As title. Corresponds to
fw-util
in f137c9aThe difference is that the image file size is validated against the target flash device's size, if the flash target device ID is provided (it is optional during
./flashy -checkimage
or thecheck-image
utility, during which the image file size check is bypassed. This is to support validating images on dev servers,)Test plan
Unit tests (
go test ./...
)