mirror of
https://github.com/fosslinux/live-bootstrap.git
synced 2026-03-23 19:46:31 +01:00
refactor(script-generator): move resume init mount/network logic into helpers.sh
This commit is contained in:
parent
d7093313d7
commit
4af03590fb
4 changed files with 49 additions and 18 deletions
|
|
@ -529,10 +529,15 @@ void output_call_script(FILE *out, char *type, char *name, int bash_build, int s
|
||||||
}
|
}
|
||||||
|
|
||||||
void output_resume_network_init(FILE *out) {
|
void output_resume_network_init(FILE *out) {
|
||||||
fputs("mount | grep ' on /dev ' >/dev/null 2>&1 || (mkdir -p /dev; mount -t devtmpfs devtmpfs /dev)\n", out);
|
fputs("if [ -f ", out);
|
||||||
fputs("mount | grep ' on /proc ' >/dev/null 2>&1 || (mkdir -p /proc; mount -t proc proc /proc)\n", out);
|
write_steps_prefix(out);
|
||||||
fputs("if [ \"${CHROOT}\" = False ] && [ \"${NETWORK_READY}\" = True ] && command -v dhcpcd >/dev/null 2>&1; then\n", out);
|
fputs("helpers.sh ]; then\n", out);
|
||||||
fputs("dhcpcd --waitip=4 || true\n", out);
|
fputs(". ", out);
|
||||||
|
write_steps_prefix(out);
|
||||||
|
fputs("helpers.sh\n", out);
|
||||||
|
fputs("resume_network_init \"", out);
|
||||||
|
fputs(config_root, out);
|
||||||
|
fputs("\"\n", out);
|
||||||
fputs("fi\n", out);
|
fputs("fi\n", out);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -12,17 +12,3 @@
|
||||||
if test "$retval" = 0; then
|
if test "$retval" = 0; then
|
||||||
guix_cv_have_recent_guile_gcrypt="yes"
|
guix_cv_have_recent_guile_gcrypt="yes"
|
||||||
else
|
else
|
||||||
--- guix-1.5.0/configure
|
|
||||||
+++ guix-1.5.0/configure
|
|
||||||
@@ -8377,8 +8377,9 @@
|
|
||||||
else
|
|
||||||
|
|
||||||
$GUILE -c "(use-modules (gcrypt hash))
|
|
||||||
- (equal? (hash-algorithm sha256)
|
|
||||||
- (lookup-hash-algorithm 'sha256))" > /dev/null 2>&1
|
|
||||||
+ (let ((algorithm (lookup-hash-algorithm 'sha256)))
|
|
||||||
+ (and algorithm
|
|
||||||
+ (= 32 (hash-size algorithm))))" > /dev/null 2>&1
|
|
||||||
retval=$?
|
|
||||||
|
|
||||||
if test "$retval" = 0; then
|
|
||||||
|
|
|
||||||
|
|
@ -10,6 +10,26 @@
|
||||||
# Set constant umask
|
# Set constant umask
|
||||||
umask 022
|
umask 022
|
||||||
|
|
||||||
|
resume_network_init() {
|
||||||
|
local cfg_root
|
||||||
|
cfg_root="${1:-/steps}"
|
||||||
|
|
||||||
|
if [ -f "${cfg_root}/bootstrap.cfg" ]; then
|
||||||
|
# shellcheck source=/dev/null
|
||||||
|
. "${cfg_root}/bootstrap.cfg"
|
||||||
|
fi
|
||||||
|
if [ -f "${cfg_root}/env" ]; then
|
||||||
|
# shellcheck source=/dev/null
|
||||||
|
. "${cfg_root}/env"
|
||||||
|
fi
|
||||||
|
|
||||||
|
mount | grep ' on /dev ' >/dev/null 2>&1 || (mkdir -p /dev; mount -t devtmpfs devtmpfs /dev)
|
||||||
|
mount | grep ' on /proc ' >/dev/null 2>&1 || (mkdir -p /proc; mount -t proc proc /proc)
|
||||||
|
if [ "${CHROOT}" = False ] && [ "${NETWORK_READY}" = True ] && command -v dhcpcd >/dev/null 2>&1; then
|
||||||
|
dhcpcd --waitip=4 || true
|
||||||
|
fi
|
||||||
|
}
|
||||||
|
|
||||||
# Get a list of files
|
# Get a list of files
|
||||||
get_files() {
|
get_files() {
|
||||||
echo "."
|
echo "."
|
||||||
|
|
|
||||||
|
|
@ -10,6 +10,26 @@
|
||||||
# Set constant umask
|
# Set constant umask
|
||||||
umask 022
|
umask 022
|
||||||
|
|
||||||
|
resume_network_init() {
|
||||||
|
local cfg_root
|
||||||
|
cfg_root="${1:-/steps}"
|
||||||
|
|
||||||
|
if [ -f "${cfg_root}/bootstrap.cfg" ]; then
|
||||||
|
# shellcheck source=/dev/null
|
||||||
|
. "${cfg_root}/bootstrap.cfg"
|
||||||
|
fi
|
||||||
|
if [ -f "${cfg_root}/env" ]; then
|
||||||
|
# shellcheck source=/dev/null
|
||||||
|
. "${cfg_root}/env"
|
||||||
|
fi
|
||||||
|
|
||||||
|
mount | grep ' on /dev ' >/dev/null 2>&1 || (mkdir -p /dev; mount -t devtmpfs devtmpfs /dev)
|
||||||
|
mount | grep ' on /proc ' >/dev/null 2>&1 || (mkdir -p /proc; mount -t proc proc /proc)
|
||||||
|
if [ "${CHROOT}" = False ] && [ "${NETWORK_READY}" = True ] && command -v dhcpcd >/dev/null 2>&1; then
|
||||||
|
dhcpcd --waitip=4 || true
|
||||||
|
fi
|
||||||
|
}
|
||||||
|
|
||||||
# Get a list of files
|
# Get a list of files
|
||||||
get_files() {
|
get_files() {
|
||||||
echo "."
|
echo "."
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue