Mail archive
alpine-aports

[alpine-aports] [PATCH] Adding the possibility to override defaults config

From: Laurent B <lol.b_at_free.fr>
Date: Wed, 1 May 2019 10:25:00 +0200

This allow to override default config files with custom, simply define
values in mkinitfs.conf:
* init: path to initramfs-init
* fstab: path to fstab
* passwd: path to passwd
* group: path to group
So, it's possible to customize the boot, and allow the busybox trigger
to use the customized configuration file
---
 Makefile    | 1 +
 mkinitfs.in | 8 ++++----
 2 files changed, 5 insertions(+), 4 deletions(-)
diff --git a/Makefile b/Makefile
index 53c71ea..c5e7372 100644
--- a/Makefile
+++ b/Makefile
_at_@ -134,3 +134,4 @@ install: $(SBIN_FILES) $(SHARE_FILES) $(CONF_FILES)
 
 mkinitfs.conf:
 	echo 'features="$(DEFAULT_FEATURES)"' > $_at_
+	echo '#init="/$(datadir)/initramfs-init"' >> $_at_
diff --git a/mkinitfs.in b/mkinitfs.in
index 8cd3de3..8c7aa66 100755
--- a/mkinitfs.in
+++ b/mkinitfs.in
_at_@ -5,10 +5,6 @@ sysconfdir=_at_sysconfdir@
 datadir=_at_datadir@
 
 config="$sysconfdir"/mkinitfs.conf
-init="$datadir"/initramfs-init
-fstab="$datadir"/fstab
-passwd="$datadir"/passwd
-group="$datadir"/group
 
 startdir=$PWD
 
_at_@ -222,6 +218,10 @@ shift $(( $OPTIND - 1 ))
 
 . $(readlink -f "$config")
 [ -n "$myfeatures" ] && features="$myfeatures"
+[ -z "$init" ] && init="$datadir"/initramfs-init
+[ -z "$fstab" ] && fstab="$datadir"/fstab
+[ -z "$passwd" ] && passwd="$datadir"/passwd
+[ -z "$group" ] && group="$datadir"/group
 
 if [ -n "$list_features" ]; then
 	for dir in $features_dirs; do
-- 
2.21.0.windows.1
---
Unsubscribe:  alpine-aports+unsubscribe_at_lists.alpinelinux.org
Help:         alpine-aports+help_at_lists.alpinelinux.org
---
Received on Wed May 01 2019 - 10:25:00 UTC