From: Stefan Schantl Date: Sun, 25 Feb 2024 10:43:16 +0000 (+0100) Subject: installer: Ensure to always create the /boot directory. X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=c33d8915716a95443956892c02fe7a3635dd8a70;p=people%2Fstevee%2Fipfire-2.x.git installer: Ensure to always create the /boot directory. Ensure to always create the /boot directory during the mounting of the various created file systems. If the /boot directory does not exist some following mount operations could not be performed correctly and the installation/mounting will fail. Signed-off-by: Stefan Schantl --- diff --git a/src/installer/hw.c b/src/installer/hw.c index a196bf8be..b9ed92459 100644 --- a/src/installer/hw.c +++ b/src/installer/hw.c @@ -904,10 +904,16 @@ int hw_mount_filesystems(struct hw_destination* dest, const char* prefix) { return r; // boot - if (*dest->part_boot) { - snprintf(target, sizeof(target), "%s%s", prefix, HW_PATH_BOOT); - mkdir(target, S_IRWXU|S_IRWXG|S_IRWXO); + snprintf(target, sizeof(target), "%s%s", prefix, HW_PATH_BOOT); + r = mkdir(target, S_IRWXU|S_IRWXG|S_IRWXO); + + if (r) { + hw_umount_filesystems(dest, prefix); + return r; + } + + if (*dest->part_boot) { r = hw_mount(dest->part_boot, target, filesystem, 0); if (r) { hw_umount_filesystems(dest, prefix);