For discussion of Alpine Linux development and developer support

2 2

[alpine-devel] features should be read from $basedir if set

Christian Kampka
Details
Message ID
<1444578607-15095-1-git-send-email-christian@kampka.net>
Sender timestamp
1444578606
DKIM signature
missing
Download raw message
Hi,

I noticed some strage behaviour with mkinitfs when running it against a different basedir using the -b switch.
Apparently, it loads modules to be included in the initramfs from $basedir, but the list of modules defined through the features is not.
This is quite inconsistent as those two things don't necessarily fit together, producing inusable initramfs images.

The attached patch proposes to read features for initramfs from $basedir if set, assuming that this behavour is not intentionally the way it is now.

Cheers,
Christian



---
Unsubscribe:  alpine-devel+unsubscribe@lists.alpinelinux.org
Help:         alpine-devel+help@lists.alpinelinux.org
---

[alpine-devel] [PATCH] mkinitfs: features should be read from $basedir if set

Christian Kampka
Details
Message ID
<1444578607-15095-2-git-send-email-christian@kampka.net>
In-Reply-To
<1444578607-15095-1-git-send-email-christian@kampka.net> (view parent)
Sender timestamp
1444578607
DKIM signature
missing
Download raw message
Patch: +1 -1
---
 mkinitfs.in | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/mkinitfs.in b/mkinitfs.in
index d2a7890..14c728f 100755
--- a/mkinitfs.in
+++ b/mkinitfs.in
@@ -184,7 +184,7 @@ done
 shift $(( $OPTIND - 1 ))
 
 . $(readlink -f "$config")
-features_dir=${features_dir:-"$sysconfdir/features.d"}
+features_dir=${features_dir:-"${basedir%/:-}/${sysconfdir#/}/features.d"}
 [ -n "$myfeatures" ] && features="$myfeatures"
 
 if [ -n "$list_features" ]; then
-- 
2.6.1



---
Unsubscribe:  alpine-devel+unsubscribe@lists.alpinelinux.org
Help:         alpine-devel+help@lists.alpinelinux.org
---
Natanael Copa
Details
Message ID
<20151020112948.48592e50@ncopa-desktop.alpinelinux.org>
In-Reply-To
<1444578607-15095-1-git-send-email-christian@kampka.net> (view parent)
Sender timestamp
1445333388
DKIM signature
missing
Download raw message
On Sun, 11 Oct 2015 17:50:06 +0200
Christian Kampka <christian@kampka.net> wrote:

> Hi,
> 
> I noticed some strage behaviour with mkinitfs when running it against
> a different basedir using the -b switch. Apparently, it loads modules
> to be included in the initramfs from $basedir, but the list of
> modules defined through the features is not. This is quite
> inconsistent as those two things don't necessarily fit together,
> producing inusable initramfs images.
> 
> The attached patch proposes to read features for initramfs from
> $basedir if set, assuming that this behavour is not intentionally the
> way it is now.

I don't think this was intentional and the patch looks correct. Thanks!

-nc



---
Unsubscribe:  alpine-devel+unsubscribe@lists.alpinelinux.org
Help:         alpine-devel+help@lists.alpinelinux.org
---