diff options
author | Daan De Meyer <daan.j.demeyer@gmail.com> | 2023-01-12 22:42:30 +0100 |
---|---|---|
committer | Daan De Meyer <daan.j.demeyer@gmail.com> | 2023-01-17 20:09:22 +0100 |
commit | e1878ef72a2f88652b13a320bb57275c54128aca (patch) | |
tree | 6344a55413f7ff768c06f6d83d8e9779436363f3 /src/home/homectl.c | |
parent | mkfs-util: Shorten strv operations error handling (diff) | |
download | systemd-e1878ef72a2f88652b13a320bb57275c54128aca.tar.xz systemd-e1878ef72a2f88652b13a320bb57275c54128aca.zip |
repart: Allow configuring sector size
Let's allow users to configure the (logical) sector size of their
image. This is required when building images for a 4k sector size
disk on a 512b sector size host or vice-versa.
Diffstat (limited to 'src/home/homectl.c')
-rw-r--r-- | src/home/homectl.c | 20 |
1 files changed, 0 insertions, 20 deletions
diff --git a/src/home/homectl.c b/src/home/homectl.c index 0a4c01834a..fd71e98eef 100644 --- a/src/home/homectl.c +++ b/src/home/homectl.c @@ -1798,26 +1798,6 @@ static int parse_disk_size(const char *t, uint64_t *ret) { return 0; } -static int parse_sector_size(const char *t, uint64_t *ret) { - int r; - - assert(t); - assert(ret); - - uint64_t ss; - - r = safe_atou64(t, &ss); - if (r < 0) - return log_error_errno(r, "Failed to parse sector size parameter %s", t); - if (ss < 512 || ss > 4096) /* Allow up to 4K due to dm-crypt support and 4K alignment by the homed LUKS backend */ - return log_error_errno(SYNTHETIC_ERRNO(ERANGE), "Sector size not between 512 and 4096: %s", t); - if (!ISPOWEROF2(ss)) - return log_error_errno(SYNTHETIC_ERRNO(EINVAL), "Sector size not power of 2: %s", t); - - *ret = ss; - return 0; -} - static int resize_home(int argc, char *argv[], void *userdata) { _cleanup_(sd_bus_flush_close_unrefp) sd_bus *bus = NULL; _cleanup_(user_record_unrefp) UserRecord *secret = NULL; |