From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.1 (2015-04-28) on sa.local.altlinux.org X-Spam-Level: X-Spam-Status: No, score=-0.1 required=5.0 tests=ALL_TRUSTED,BAYES_00, DKIM_ADSP_CUSTOM_MED,FREEMAIL_FROM,MISSING_DATE,MISSING_MID, NML_ADSP_CUSTOM_MED autolearn=no autolearn_force=no version=3.4.1 From: "Leonid Krivoshein" To: make-initrd@lists.altlinux.org Subject: [make-initrd] [PATCH v6 17/22] bootchain-core: few minor improvements to the rootfs step X-BeenThere: make-initrd@lists.altlinux.org X-Mailman-Version: 2.1.12 Precedence: list Reply-To: make-initrd@lists.altlinux.org List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Date: Sun, 24 Oct 2021 17:22:39 -0000 X-List-Received-Date: Sun, 24 Oct 2021 17:22:39 -0000 Message-ID: <20211024172239.CCE-bxXtWu_TPSYTWHVdiHLyNE6Fy9KJsYsJkqJKoLc@z> Archived-At: List-Archive: Now the step is run only once, additional checks are performed, and a safe way to end the daemon main loop is used. Signed-off-by: Leonid Krivoshein --- features/bootchain-core/data/lib/bootchain/rootfs | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/features/bootchain-core/data/lib/bootchain/rootfs b/features/bootchain-core/data/lib/bootchain/rootfs index 6ac64a6..aaba01d 100755 --- a/features/bootchain-core/data/lib/bootchain/rootfs +++ b/features/bootchain-core/data/lib/bootchain/rootfs @@ -2,9 +2,10 @@ . bootchain-sh-functions -[ -n "$prevdir" ] || +launch_step_once +[ -n "$prevdir" ] && mountpoint -q -- "$prevdir" || fatal "no previous step to use as rootfs" - -run mount --move "$prevdir" "$rootmnt" +[ "$prevdir" = "$rootmnt" ] || + run mount --move -- "$prevdir" "$rootmnt" echo localdev > /etc/initrd/method -exit 2 +break_bc_loop -- 2.24.1