-
-
Notifications
You must be signed in to change notification settings - Fork 3
Novacustom capsule tests #800
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
Draft
philipanda
wants to merge
19
commits into
develop
Choose a base branch
from
novacustom-capsule-tests
base: develop
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Draft
Changes from all commits
Commits
Show all changes
19 commits
Select commit
Hold shift + click to select a range
54ec2ad
prepare_capsule_update_tests_drive.sh: Add script
philipanda 9491a75
capsule-update-files/Shell.efi: Add UEFI shell executable
philipanda e11eca0
capsule-update-files: Add nsh scripts
philipanda fd8c3e3
options-lib_dcu: turn off lock bios instead of failing
philipanda 90ece87
novacustom-mtl.robot: Add capsule update support to config
philipanda f48e75e
dasharo-stability/capsule-update.robot: Allow running without serial
philipanda 6becd58
keywords.robot: Identify Path To USB: Only get partition if it exists
philipanda c3831ee
lib/flash: Fail if flashing fails instead of ignoring it
philipanda a7a160d
options-lib_dcu: Fix catching missing bootentry
philipanda 3a64a45
prepare_capsule_update_tests_drive: Dynamically find drive mountpoint
philipanda f25b110
capsule-update-startup.nsh: Remove setting STEP variable file
philipanda b5301c8
scripts/lib/robot.sh: Comment-out-back the full command debug print
philipanda 736c98a
capsule-update.robot: adapt the tests for no uefi shell and no serial
philipanda f00b978
options-lib_dcu: Set Nextboot Bootentry: convert to lowercase
philipanda 444c0d2
capsule-update.robot: Check whether the version changed
philipanda 1c3cc9b
capsule-update.robot: Update preparation instructions
philipanda 46f9fb8
prepare_capsule_update_tests_drive: Add FW to drive
philipanda 2ded105
capsule-update.robot: Fix wrong capsule filename
philipanda d6b42dd
capsule-update.robot: Fix checking if version changed
philipanda File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
Binary file not shown.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
SPDX-FileCopyrightText: 2024 3mdeb <contact@3mdeb.com> | ||
|
||
SPDX-License-Identifier: Apache-2.0 |
26 changes: 26 additions & 0 deletions
26
dasharo-stability/capsule-update-files/capsule-update-startup.nsh
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,26 @@ | ||
# SPDX-FileCopyrightText: 2025 3mdeb <contact@3mdeb.com> | ||
# | ||
# SPDX-License-Identifier: Apache-2.0 | ||
|
||
set LOG_FILE fs0:\logs.txt | ||
|
||
# load variables to allow saving state between runs | ||
|
||
fs0:\variable_capsule_file.nsh | ||
fs0:\variable_step.nsh | ||
|
||
# Variables expected to be loaded: | ||
# - STEP - integer flag for choosing operation mode | ||
# - CAPSULE_FILE - path to the capsule file | ||
|
||
# Step 0 - launch capsule update | ||
if "%STEP%" == "0" then | ||
fs0:\CapsuleApp.efi "%CAPSULE_FILE%" -NR | ||
reset | ||
endif | ||
|
||
# Step 1 - check update status | ||
if "%STEP%" == "1" then | ||
fs0:\CapsuleApp.efi -S > "%LOG_FILE%" | ||
reset | ||
endif |
4 changes: 4 additions & 0 deletions
4
dasharo-stability/capsule-update-files/variable_capsule_file.nsh
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
# SPDX-FileCopyrightText: 2025 3mdeb <contact@3mdeb.com> | ||
# | ||
# SPDX-License-Identifier: Apache-2.0 | ||
set CAPSULE_FILE fs0:\wrong_cert.cap |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
# SPDX-FileCopyrightText: 2025 3mdeb <contact@3mdeb.com> | ||
# | ||
# SPDX-License-Identifier: Apache-2.0 | ||
set STEP 0 |
Large diffs are not rendered by default.
Oops, something went wrong.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,71 @@ | ||
#!/usr/bin/env bash | ||
|
||
# SPDX-FileCopyrightText: 2025 3mdeb <contact@3mdeb.com> | ||
# | ||
# SPDX-License-Identifier: Apache-2.0 | ||
|
||
DRIVE=$1 | ||
DRIVE_LABEL=CAPSULE_USB | ||
FILES_DIR=dasharo-stability/capsule-update-files | ||
CAPSULE_FILES_DIR=dl-cache/edk2 | ||
|
||
|
||
if [[ -z $1 ]]; then | ||
echo "Usage: | ||
$0 <flash_drive_device_file> | ||
Example: | ||
sudo -E $0 /dev/sdc | ||
Note: | ||
must be run as super user" | ||
exit 1 | ||
fi | ||
|
||
if [[ $USER != 'root' ]]; then | ||
echo "$0 has to be run as root" | ||
echo "Example:" | ||
echo " sudo -E $0 /dev/sdc" | ||
exit 1 | ||
fi | ||
|
||
if [[ ! -f $CAPSULE_FW_FILE ]]; then | ||
echo "CAPSULE_FW_FILE must be a valid capsule, right now CAPSULE_FW_FILE=$CAPSULE_FW_FILE" | ||
exit 1 | ||
fi | ||
|
||
if ! [ -b $DRIVE ]; then | ||
echo "drive $DRIVE doesn't exist" | ||
exit 1 | ||
fi | ||
|
||
# try to unmount, fails if not mounted | ||
udisksctl unmount -b $DRIVE || true | ||
# format to fat32 | ||
mkfs.vfat $DRIVE # requires root privilege | ||
fatlabel $DRIVE $DRIVE_LABEL | ||
sleep 1 | ||
# mount drive | ||
udisksctl mount -b $DRIVE | ||
mount_point=$(udisksctl info -b $DRIVE | grep -Po '^ *MountPoints: *\K.*') | ||
|
||
# create boot directories | ||
mkdir -p "$mount_point"/EFI/BOOT | ||
|
||
CAPSULE_BASENAME=$(realpath "$CAPSULE_FW_FILE") | ||
CAPSULE_BASENAME=$(basename "$CAPSULE_BASENAME") | ||
CAPSULE_BASENAME="${CAPSULE_BASENAME%.*}" | ||
|
||
# copy files | ||
cp $FILES_DIR/Shell.efi "$mount_point"/EFI/BOOT/bootx64.efi | ||
cp $FILES_DIR/CapsuleApp.efi "$mount_point"/CapsuleApp.efi | ||
cp $FILES_DIR/capsule-update-startup.nsh "$mount_point"/startup.nsh | ||
cp $FILES_DIR/variable_capsule_file.nsh "$mount_point"/variable_capsule_file.nsh | ||
cp $FILES_DIR/variable_step.nsh "$mount_point"/variable_step.nsh | ||
cp $CAPSULE_FILES_DIR/${CAPSULE_BASENAME}_wrong_cert.cap "$mount_point"/wrong_cert.cap | ||
cp $CAPSULE_FILES_DIR/${CAPSULE_BASENAME}_invalid_guid.cap "$mount_point"/invalid_guid.cap | ||
cp $CAPSULE_FW_FILE "$mount_point"/valid_capsule.cap | ||
cp $FW_FILE "$mount_point"/pre-capsule.rom | ||
|
||
# cleanup | ||
udisksctl unmount -b $DRIVE | ||
|
||
echo "Done" |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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.
Why not use https://github.com/Dasharo/osfv-test-data/tree/master/uefi-shell?
Also, this isn't proper license for something that came from edk2 code.