#include "path-util.h"
#include "process-util.h"
#include "random-util.h"
+#include "reread-partition-table.h"
#include "resize-fs.h"
#include "string-util.h"
#include "strv.h"
if (disk_uuid_path)
/* Reread partition table if this is a block device */
- (void) ioctl(setup->image_fd, BLKRRPART, 0);
+ (void) reread_partition_table_fd(setup->image_fd, /* flags= */ 0);
else {
assert(setup->temporary_image_path);
if (r > 0)
log_info("Growing of partition completed.");
- if (S_ISBLK(st.st_mode) && ioctl(image_fd, BLKRRPART, 0) < 0)
- log_debug_errno(errno, "BLKRRPART failed on block device, ignoring: %m");
+ if (S_ISBLK(st.st_mode))
+ (void) reread_partition_table_fd(image_fd, /* flags= */ 0);
/* Tell LUKS about the new bigger size too */
r = sym_crypt_resize(setup->crypt_device, setup->dm_name, new_fs_size / 512U);
if (r > 0)
log_info("Shrinking of partition completed.");
- if (S_ISBLK(st.st_mode) && ioctl(image_fd, BLKRRPART, 0) < 0)
- log_debug_errno(errno, "BLKRRPART failed on block device, ignoring: %m");
+ if (S_ISBLK(st.st_mode))
+ (void) reread_partition_table_fd(image_fd, /* flags= */ 0);
} else { /* → Grow */
if (!FLAGS_SET(flags, HOME_SETUP_RESIZE_DONT_SYNC_IDENTITIES)) {