From 496e19c102a55e0a680f5016f3032cd9b70c4200 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?G=C3=A1bor=20Stefanik?= Date: Mon, 1 Jan 2024 23:36:13 +0100 Subject: [PATCH] After bootstrap, drop to a shell if needed, then shut down cleanly --- steps/improve/after.sh | 20 ++++++++++++++++++++ steps/manifest | 1 + 2 files changed, 21 insertions(+) create mode 100644 steps/improve/after.sh diff --git a/steps/improve/after.sh b/steps/improve/after.sh new file mode 100644 index 00000000..9a3ddb6e --- /dev/null +++ b/steps/improve/after.sh @@ -0,0 +1,20 @@ +#!/bin/sh +# +# SPDX-FileCopyrightText: 2024 Gábor Stefanik +# +# SPDX-License-Identifier: GPL-3.0-or-later +# +# After bootstrap, drop to a shell if needed, then shut down cleanly. + +. /steps/bootstrap.cfg +. /steps/env + +if [ "${INTERACTIVE}" = True ]; then + env - PATH=${PREFIX}/bin PS1="\w # " bash -i +fi + +if [ "${CHROOT}" = False ]; then + sync + mount -o remount,ro / + echo o > /proc/sysrq_trigger # power off +fi diff --git a/steps/manifest b/steps/manifest index 6dedaead..bb355393 100644 --- a/steps/manifest +++ b/steps/manifest @@ -182,3 +182,4 @@ build: binutils-2.41 build: gcc-13.1.0 improve: null_time ( FORCE_TIMESTAMPS == True ) improve: update_checksums ( UPDATE_CHECKSUMS == True ) +improve: after