From 1425940e8220609bafce2eecde3e679cf48d4647 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Timo=20Ter=C3=A4s?= Date: Thu, 26 Jan 2017 13:44:54 +0200 Subject: mkinitfs: have features.d in search path (add -P ) instead of having only one features.d directory, make it a search path to which paths can be prepended with -P option. This allows custom boot media creation scripts to contain features.d overlays, and additional features. --- mkinitfs.in | 42 +++++++++++++++++++++++------------------- 1 file changed, 23 insertions(+), 19 deletions(-) (limited to 'mkinitfs.in') diff --git a/mkinitfs.in b/mkinitfs.in index bc91a13..4ad8a2a 100755 --- a/mkinitfs.in +++ b/mkinitfs.in @@ -15,19 +15,20 @@ startdir=$PWD feature_files() { local dir="$1" local suffix="$2" - local glob file + local glob file fdir for f in $features; do - if [ ! -f "$features_dir/$f.$suffix" ]; then - continue - fi - for glob in $(sed -e '/^$/d' -e '/^#/d' -e "s|^/*|$dir|" "$features_dir/$f.$suffix"); do - for file in $glob; do - if [ -d $file ]; then - find $file -type f - elif [ -e "$file" ]; then - echo $file - fi + for fdir in $features_dirs; do + [ -f "$fdir/$f.$suffix" ] || continue + for glob in $(sed -e '/^$/d' -e '/^#/d' -e "s|^/*|$dir|" "$fdir/$f.$suffix"); do + for file in $glob; do + if [ -d $file ]; then + find $file -type f + elif [ -e "$file" ]; then + echo $file + fi + done done + break done done } @@ -152,7 +153,7 @@ initfs_cpio() { usage() { cat <