From patchwork Fri Mar 15 19:14:28 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Stefan Schantl X-Patchwork-Id: 7627 Return-Path: Received: from mail01.ipfire.org (mail01.haj.ipfire.org [172.28.1.202]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature ECDSA (secp384r1) client-signature ECDSA (secp384r1)) (Client CN "mail01.haj.ipfire.org", Issuer "R3" (verified OK)) by web04.haj.ipfire.org (Postfix) with ESMTPS id 4TxDTd1Nt3z3wv4 for ; Fri, 15 Mar 2024 19:15:01 +0000 (UTC) Received: from mail02.haj.ipfire.org (mail02.haj.ipfire.org [172.28.1.201]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature ECDSA (secp384r1) client-signature ECDSA (secp384r1)) (Client CN "mail02.haj.ipfire.org", Issuer "R3" (verified OK)) by mail01.ipfire.org (Postfix) with ESMTPS id 4TxDTY6xgszFLj; Fri, 15 Mar 2024 19:14:57 +0000 (UTC) Received: from mail02.haj.ipfire.org (localhost [127.0.0.1]) by mail02.haj.ipfire.org (Postfix) with ESMTP id 4TxDTY65lFz32pp; Fri, 15 Mar 2024 19:14:57 +0000 (UTC) Received: from mail01.ipfire.org (mail01.haj.ipfire.org [172.28.1.202]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature ECDSA (secp384r1) client-signature ECDSA (secp384r1)) (Client CN "mail01.haj.ipfire.org", Issuer "R3" (verified OK)) by mail02.haj.ipfire.org (Postfix) with ESMTPS id 4TxDTV4DJZz2xk2 for ; Fri, 15 Mar 2024 19:14:54 +0000 (UTC) Received: from [127.0.0.1] (localhost [127.0.0.1]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature ECDSA (secp384r1) server-digest SHA384) (No client certificate requested) by mail01.ipfire.org (Postfix) with ESMTPSA id 4TxDTV1xHPznf; Fri, 15 Mar 2024 19:14:54 +0000 (UTC) DKIM-Signature: v=1; a=ed25519-sha256; c=relaxed/relaxed; d=ipfire.org; s=202003ed25519; t=1710530094; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=LlVIcNeyc3AvB7hEi1B1yNJ8G7tWmRphAVdwKofExMo=; b=pOzWDVon8nSUHF+Ijw9MgCGXQyixn6oP0YTboN2Qe8vZWmcjJpdOceSOO/UaebJsTdr7O3 nZbGA8VV5iJShtAQ== DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=ipfire.org; s=202003rsa; t=1710530094; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=LlVIcNeyc3AvB7hEi1B1yNJ8G7tWmRphAVdwKofExMo=; b=R1QjDX6QDRBcuqvj8uqqOGHGk3T8ZVoneoUbI8KfyIstusc86YuSQtIdOYbFent4i3MVtF uWTM9FcXbahxESeNxkJanXKPf0YylOjqAr3cIHaFZ5aER7ZbNPlS0+S9Y5vepqBGVrZaxi PP/T5Vq4i34OJ2zmCAExoaExpriHhvfx3xZ5WiII/P2pCBfaFQZe0CEhLrKDjrLEYQEYJW aYW3bUzUc6cMT2QsIf+i9683KCNMfp7xkJjsghlhSFkbt1FWAgrsbiNjXT7ux3/6+CrU3Y FZs72fN9/0tr5kwIcn97VBtF2qGGCTBkzI8qE4zep3nypL5gX1PC5GNgAyZfDA== From: Stefan Schantl To: development@lists.ipfire.org Subject: [PATCH 03/17] installer: Ensure to always create the /boot directory. Date: Fri, 15 Mar 2024 20:14:28 +0100 Message-Id: <20240315191442.3951-4-stefan.schantl@ipfire.org> In-Reply-To: <20240315191442.3951-1-stefan.schantl@ipfire.org> References: <20240315191442.3951-1-stefan.schantl@ipfire.org> MIME-Version: 1.0 Message-ID-Hash: 3GSDRJNBYIFBII7235NUU7ANVG5FDNUB X-Message-ID-Hash: 3GSDRJNBYIFBII7235NUU7ANVG5FDNUB X-MailFrom: stefan.schantl@ipfire.org X-Mailman-Rule-Misses: dmarc-mitigation; no-senders; approved; emergency; loop; banned-address; member-moderation; nonmember-moderation; administrivia; implicit-dest; max-recipients; max-size; news-moderation; no-subject; digests; suspicious-header X-Mailman-Version: 3.3.8 Precedence: list List-Id: IPFire development talk Archived-At: List-Archive: List-Help: List-Owner: List-Post: List-Subscribe: List-Unsubscribe: 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 --- src/installer/hw.c | 12 +++++++++--- 1 file changed, 9 insertions(+), 3 deletions(-) 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);