diff options
Diffstat (limited to 'src/sysupdate')
-rw-r--r-- | src/sysupdate/sysupdate-partition.c | 24 | ||||
-rw-r--r-- | src/sysupdate/sysupdate.c | 24 |
2 files changed, 19 insertions, 29 deletions
diff --git a/src/sysupdate/sysupdate-partition.c b/src/sysupdate/sysupdate-partition.c index f3e21001e4..812007fa3b 100644 --- a/src/sysupdate/sysupdate-partition.c +++ b/src/sysupdate/sysupdate-partition.c @@ -48,11 +48,11 @@ static int fdisk_partition_get_attrs_as_uint64( break; if (streq(word, "RequiredPartition")) - flags |= GPT_FLAG_REQUIRED_PARTITION; + flags |= SD_GPT_FLAG_REQUIRED_PARTITION; else if (streq(word, "NoBlockIOProtocol")) - flags |= GPT_FLAG_NO_BLOCK_IO_PROTOCOL; + flags |= SD_GPT_FLAG_NO_BLOCK_IO_PROTOCOL; else if (streq(word, "LegacyBIOSBootable")) - flags |= GPT_FLAG_LEGACY_BIOS_BOOTABLE; + flags |= SD_GPT_FLAG_LEGACY_BIOS_BOOTABLE; else { const char *e; unsigned u; @@ -188,9 +188,9 @@ int read_partition_info( .uuid = id, .label = TAKE_PTR(label_copy), .device = TAKE_PTR(device), - .no_auto = FLAGS_SET(flags, GPT_FLAG_NO_AUTO) && gpt_partition_type_knows_no_auto(ptid), - .read_only = FLAGS_SET(flags, GPT_FLAG_READ_ONLY) && gpt_partition_type_knows_read_only(ptid), - .growfs = FLAGS_SET(flags, GPT_FLAG_GROWFS) && gpt_partition_type_knows_growfs(ptid), + .no_auto = FLAGS_SET(flags, SD_GPT_FLAG_NO_AUTO) && gpt_partition_type_knows_no_auto(ptid), + .read_only = FLAGS_SET(flags, SD_GPT_FLAG_READ_ONLY) && gpt_partition_type_knows_read_only(ptid), + .growfs = FLAGS_SET(flags, SD_GPT_FLAG_GROWFS) && gpt_partition_type_knows_growfs(ptid), }; return 1; /* found! */ @@ -332,11 +332,11 @@ int patch_partition( flags = info->flags; if (tweak_no_auto) - SET_FLAG(flags, GPT_FLAG_NO_AUTO, info->no_auto); + SET_FLAG(flags, SD_GPT_FLAG_NO_AUTO, info->no_auto); if (tweak_read_only) - SET_FLAG(flags, GPT_FLAG_READ_ONLY, info->read_only); + SET_FLAG(flags, SD_GPT_FLAG_READ_ONLY, info->read_only); if (tweak_growfs) - SET_FLAG(flags, GPT_FLAG_GROWFS, info->growfs); + SET_FLAG(flags, SD_GPT_FLAG_GROWFS, info->growfs); r = fdisk_partition_set_attrs_as_uint64(pa, flags); if (r < 0) @@ -354,11 +354,11 @@ int patch_partition( new_flags = old_flags; if (tweak_no_auto) - SET_FLAG(new_flags, GPT_FLAG_NO_AUTO, info->no_auto); + SET_FLAG(new_flags, SD_GPT_FLAG_NO_AUTO, info->no_auto); if (tweak_read_only) - SET_FLAG(new_flags, GPT_FLAG_READ_ONLY, info->read_only); + SET_FLAG(new_flags, SD_GPT_FLAG_READ_ONLY, info->read_only); if (tweak_growfs) - SET_FLAG(new_flags, GPT_FLAG_GROWFS, info->growfs); + SET_FLAG(new_flags, SD_GPT_FLAG_GROWFS, info->growfs); if (new_flags != old_flags) { r = fdisk_partition_set_attrs_as_uint64(pa, new_flags); diff --git a/src/sysupdate/sysupdate.c b/src/sysupdate/sysupdate.c index 8a4e1b5477..944ac41a41 100644 --- a/src/sysupdate/sysupdate.c +++ b/src/sysupdate/sysupdate.c @@ -855,17 +855,14 @@ static int reboot_now(void) { static int process_image( bool ro, char **ret_mounted_dir, - LoopDevice **ret_loop_device, - DecryptedImage **ret_decrypted_image) { + LoopDevice **ret_loop_device) { _cleanup_(loop_device_unrefp) LoopDevice *loop_device = NULL; - _cleanup_(decrypted_image_unrefp) DecryptedImage *decrypted_image = NULL; _cleanup_(umount_and_rmdir_and_freep) char *mounted_dir = NULL; int r; assert(ret_mounted_dir); assert(ret_loop_device); - assert(ret_decrypted_image); if (!arg_image) return 0; @@ -883,8 +880,7 @@ static int process_image( DISSECT_IMAGE_GENERIC_ROOT | DISSECT_IMAGE_REQUIRE_ROOT, &mounted_dir, - &loop_device, - &decrypted_image); + &loop_device); if (r < 0) return r; @@ -894,14 +890,12 @@ static int process_image( *ret_mounted_dir = TAKE_PTR(mounted_dir); *ret_loop_device = TAKE_PTR(loop_device); - *ret_decrypted_image = TAKE_PTR(decrypted_image); return 0; } static int verb_list(int argc, char **argv, void *userdata) { _cleanup_(loop_device_unrefp) LoopDevice *loop_device = NULL; - _cleanup_(decrypted_image_unrefp) DecryptedImage *decrypted_image = NULL; _cleanup_(umount_and_rmdir_and_freep) char *mounted_dir = NULL; _cleanup_(context_freep) Context* context = NULL; const char *version; @@ -910,7 +904,7 @@ static int verb_list(int argc, char **argv, void *userdata) { assert(argc <= 2); version = argc >= 2 ? argv[1] : NULL; - r = process_image(/* ro= */ true, &mounted_dir, &loop_device, &decrypted_image); + r = process_image(/* ro= */ true, &mounted_dir, &loop_device); if (r < 0) return r; @@ -926,14 +920,13 @@ static int verb_list(int argc, char **argv, void *userdata) { static int verb_check_new(int argc, char **argv, void *userdata) { _cleanup_(loop_device_unrefp) LoopDevice *loop_device = NULL; - _cleanup_(decrypted_image_unrefp) DecryptedImage *decrypted_image = NULL; _cleanup_(umount_and_rmdir_and_freep) char *mounted_dir = NULL; _cleanup_(context_freep) Context* context = NULL; int r; assert(argc <= 1); - r = process_image(/* ro= */ true, &mounted_dir, &loop_device, &decrypted_image); + r = process_image(/* ro= */ true, &mounted_dir, &loop_device); if (r < 0) return r; @@ -952,14 +945,13 @@ static int verb_check_new(int argc, char **argv, void *userdata) { static int verb_vacuum(int argc, char **argv, void *userdata) { _cleanup_(loop_device_unrefp) LoopDevice *loop_device = NULL; - _cleanup_(decrypted_image_unrefp) DecryptedImage *decrypted_image = NULL; _cleanup_(umount_and_rmdir_and_freep) char *mounted_dir = NULL; _cleanup_(context_freep) Context* context = NULL; int r; assert(argc <= 1); - r = process_image(/* ro= */ false, &mounted_dir, &loop_device, &decrypted_image); + r = process_image(/* ro= */ false, &mounted_dir, &loop_device); if (r < 0) return r; @@ -972,7 +964,6 @@ static int verb_vacuum(int argc, char **argv, void *userdata) { static int verb_update(int argc, char **argv, void *userdata) { _cleanup_(loop_device_unrefp) LoopDevice *loop_device = NULL; - _cleanup_(decrypted_image_unrefp) DecryptedImage *decrypted_image = NULL; _cleanup_(umount_and_rmdir_and_freep) char *mounted_dir = NULL; _cleanup_(context_freep) Context* context = NULL; _cleanup_free_ char *booted_version = NULL; @@ -993,7 +984,7 @@ static int verb_update(int argc, char **argv, void *userdata) { return log_error_errno(SYNTHETIC_ERRNO(ENODATA), "/etc/os-release lacks IMAGE_VERSION field."); } - r = process_image(/* ro= */ false, &mounted_dir, &loop_device, &decrypted_image); + r = process_image(/* ro= */ false, &mounted_dir, &loop_device); if (r < 0) return r; @@ -1096,7 +1087,6 @@ static int component_name_valid(const char *c) { static int verb_components(int argc, char **argv, void *userdata) { _cleanup_(loop_device_unrefp) LoopDevice *loop_device = NULL; - _cleanup_(decrypted_image_unrefp) DecryptedImage *decrypted_image = NULL; _cleanup_(umount_and_rmdir_and_freep) char *mounted_dir = NULL; _cleanup_(set_freep) Set *names = NULL; _cleanup_free_ char **z = NULL; /* We use simple free() rather than strv_free() here, since set_free() will free the strings for us */ @@ -1106,7 +1096,7 @@ static int verb_components(int argc, char **argv, void *userdata) { assert(argc <= 1); - r = process_image(/* ro= */ false, &mounted_dir, &loop_device, &decrypted_image); + r = process_image(/* ro= */ false, &mounted_dir, &loop_device); if (r < 0) return r; |