Skip to content

Commit

Permalink
include/lk/snappy_boot_*.h: add additional defines for run/recovery s…
Browse files Browse the repository at this point in the history
…ignature

Also remove the TODO about what to set the version to, since we have resolved
this issue.

Signed-off-by: Ian Johnson <ian.johnson@canonical.com>
  • Loading branch information
anonymouse64 committed Nov 24, 2020
1 parent e761d88 commit e5b6da1
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 5 deletions.
1 change: 1 addition & 0 deletions include/lk/snappy_boot_common.h
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@
#define _BOOTLOADER_SNAP_BOOT_COMMON_H

#define SNAP_BOOTSELECT_SIGNATURE ('S' | ('B' << 8) | ('s' << 16) | ('e' << 24))
#define SNAP_BOOTSELECT_RUN_SIGNATURE ('S' | ('B' << 8) | ('s' << 16) | ('e' << 24))

// note SNAP_NAME_MAX_LEN also defines the max length of a recovery system label
#define SNAP_NAME_MAX_LEN (256)
Expand Down
10 changes: 5 additions & 5 deletions include/lk/snappy_boot_v2.h
Original file line number Diff line number Diff line change
Expand Up @@ -20,14 +20,14 @@
#ifndef _BOOTLOADER_SNAP_BOOT_V2_H
#define _BOOTLOADER_SNAP_BOOT_V2_H

// TODO: what bit fields should be set for this to be v2?
#define SNAP_BOOTSELECT_VERSION_V2 0x00010010
#define SNAP_BOOTSELECT_SIGNATURE_RECOVERY ('S' | ('R' << 8) | ('s' << 16) | ('e' << 24))

/* snappy bootselect partition format structure for run mode */
typedef struct SNAP_RUN_BOOT_SELECTION {
/* Contains value BOOTSELECT_SIGNATURE defined above */
/* Should always contain value of SNAP_BOOTSELECT_RUN_SIGNATURE defined in common.h */
uint32_t signature;
/* snappy boot select version */
/* Should always contain value of SNAP_BOOTSELECT_VERSION_V2 */
uint32_t version;

/* kernel_status, one of: 'empty', "try", "trying" */
Expand Down Expand Up @@ -133,9 +133,9 @@ typedef struct SNAP_RUN_BOOT_SELECTION {

/* snappy bootselect partition format structure for recovery*/
typedef struct SNAP_RECOVERY_BOOT_SELECTION {
/* Contains value BOOTSELECT_SIGNATURE defined above */
/* Should always contain value of SNAP_BOOTSELECT_SIGNATURE_RECOVERY defined above */
uint32_t signature;
/* snappy boot select version */
/* Should always contain value of SNAP_BOOTSELECT_VERSION_V2 */
uint32_t version;

/** snapd_recovery_mode is what mode the system will be booted in, one of
Expand Down

0 comments on commit e5b6da1

Please sign in to comment.