-
Notifications
You must be signed in to change notification settings - Fork 6
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
NAVQP-30: re-work reliable upgrade support as an image feature #45
Open
dkonyshev
wants to merge
1
commit into
imx-5.15.32-vb
Choose a base branch
from
NAVQP-30-fix-swupdate
base: imx-5.15.32-vb
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.
Open
Changes from all commits
Commits
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
20 changes: 20 additions & 0 deletions
20
recipes-bsp/u-boot/u-boot-imx/001-reliable_update_mmcroot_setup.patch
This file contains 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,20 @@ | ||
diff --git a/board/voxelbotics/navqp/navqp.c b/board/voxelbotics/navqp/navqp.c | ||
index e1232aacca..01ec173423 100644 | ||
--- a/board/voxelbotics/navqp/navqp.c | ||
+++ b/board/voxelbotics/navqp/navqp.c | ||
@@ -550,7 +550,15 @@ int board_init(void) | ||
int board_late_init(void) | ||
{ | ||
#ifdef CONFIG_ENV_IS_IN_MMC | ||
+ char mmcblk[32]; | ||
+ u32 dev_no = mmc_get_env_dev(); | ||
+ /* rootfs partition number is boot partition + 2 for reliable upgrade */ | ||
+ int part = env_get_ulong("mmcpart", 10, 1) + 2; | ||
+ | ||
board_late_mmc_env_init(); | ||
+ sprintf(mmcblk, "/dev/mmcblk%dp%d rootwait rw", | ||
+ mmc_map_to_kernel_blk(dev_no), part); | ||
+ env_set("mmcroot", mmcblk); | ||
#endif | ||
#ifdef CONFIG_ENV_VARS_UBOOT_RUNTIME_CONFIG | ||
env_set("board_name", "EVK"); |
This file contains 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 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 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 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 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,151 @@ | ||
software = | ||
{ | ||
version = "@@SWU_VERSION@@"; | ||
hardware-compatibility: [ "@@SWU_HWCOMPAT@@" ]; | ||
@@SWU_BOARD@@ = { | ||
stable: | ||
{ | ||
copy1: | ||
{ | ||
partitions: ( | ||
{ | ||
type = "diskformat"; | ||
device = "@@SWU_STG_DEV@@p1"; | ||
|
||
properties: { | ||
fstype = "vfat"; | ||
force = "true"; | ||
} | ||
}, | ||
{ | ||
type = "diskformat"; | ||
device = "@@SWU_STG_DEV@@p3"; | ||
|
||
properties: { | ||
fstype = "ext4"; | ||
force = "true"; | ||
} | ||
} | ||
); | ||
images: ( | ||
{ | ||
name = "bootloader"; | ||
filename = "@@SWU_UBOOT_FILE@@"; | ||
version = "@@SWU_UBOOT_VERSION@@"; | ||
install-if-different = true; | ||
device = "@@SWU_STG_DEV@@"; | ||
offset = "32K"; | ||
sha256 = "$swupdate_get_sha256(@@SWU_UBOOT_FILE@@)"; | ||
} | ||
); | ||
files: ( | ||
{ | ||
filename = "Image"; | ||
device = "@@SWU_STG_DEV@@p1"; | ||
path = "/Image"; | ||
filesystem = "vfat"; | ||
preserve-attributes = true; | ||
sha256 = "$swupdate_get_sha256(Image)"; | ||
|
||
}, | ||
{ | ||
filename = "@@KERNEL_DEVICETREE_BASENAME@@.dtb"; | ||
device = "@@SWU_STG_DEV@@p1"; | ||
path = "/@@KERNEL_DEVICETREE_BASENAME@@.dtb"; | ||
filesystem = "vfat"; | ||
preserve-attributes = true; | ||
sha256 = "$swupdate_get_sha256(@@KERNEL_DEVICETREE_BASENAME@@.dtb)"; | ||
|
||
}, | ||
{ | ||
filename = "@@SWU_ROOTFS_FILE@@"; | ||
type = "archive"; | ||
device = "@@SWU_STG_DEV@@p3"; | ||
path = "/"; | ||
filesystem = "ext4"; | ||
installed-directly = true; | ||
preserve-attributes = true; | ||
sha256 = "$swupdate_get_sha256(@@SWU_ROOTFS_FILE@@)"; | ||
|
||
} | ||
); | ||
bootenv: ( | ||
{ | ||
name = "mmcpart"; | ||
value = "1"; | ||
}, | ||
); | ||
}; | ||
copy2: | ||
{ | ||
partitions: ( | ||
{ | ||
type = "diskformat"; | ||
device = "@@SWU_STG_DEV@@p2"; | ||
|
||
properties: { | ||
fstype = "vfat"; | ||
force = "true"; | ||
} | ||
}, | ||
{ | ||
type = "diskformat"; | ||
device = "@@SWU_STG_DEV@@p4"; | ||
|
||
properties: { | ||
fstype = "ext4"; | ||
force = "true"; | ||
} | ||
} | ||
); | ||
images: ( | ||
{ | ||
name = "bootloader"; | ||
filename = "@@SWU_UBOOT_FILE@@"; | ||
version = "@@SWU_UBOOT_VERSION@@"; | ||
install-if-different = true; | ||
device = "@@SWU_STG_DEV@@"; | ||
offset = "32K"; | ||
sha256 = "$swupdate_get_sha256(@@SWU_UBOOT_FILE@@)"; | ||
} | ||
); | ||
files: ( | ||
{ | ||
filename = "Image"; | ||
device = "@@SWU_STG_DEV@@p2"; | ||
path = "/Image"; | ||
filesystem = "vfat"; | ||
preserve-attributes = true; | ||
sha256 = "$swupdate_get_sha256(Image)"; | ||
|
||
}, | ||
{ | ||
filename = "@@KERNEL_DEVICETREE_BASENAME@@.dtb"; | ||
device = "@@SWU_STG_DEV@@p2"; | ||
path = "/@@KERNEL_DEVICETREE_BASENAME@@.dtb"; | ||
filesystem = "vfat"; | ||
preserve-attributes = true; | ||
sha256 = "$swupdate_get_sha256(@@KERNEL_DEVICETREE_BASENAME@@.dtb)"; | ||
|
||
}, | ||
{ | ||
filename = "@@SWU_ROOTFS_FILE@@"; | ||
type = "archive"; | ||
device = "@@SWU_STG_DEV@@p4"; | ||
path = "/"; | ||
filesystem = "ext4"; | ||
installed-directly = true; | ||
preserve-attributes = true; | ||
sha256 = "$swupdate_get_sha256(@@SWU_ROOTFS_FILE@@)"; | ||
} | ||
); | ||
bootenv: ( | ||
{ | ||
name = "mmcpart"; | ||
value = "2"; | ||
}, | ||
); | ||
}; | ||
}; | ||
}; | ||
} |
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.
Can we get rid of hard-coding partitioning into the code?
Also, if we do boot1/root1/boot2/root2 partitioning this code may not be required?