summaryrefslogtreecommitdiff
path: root/hook-functions
diff options
context:
space:
mode:
authorScott James Remnant <scott@ubuntu.com>2009-12-16 17:47:49 +0000
committermaximilian attems <maks@debian.org>2010-04-05 04:09:43 +0200
commit553aa3742ca43b4ba4e87b2dea2c5d31cc43a124 (patch)
treeefc5a2caa83f7499bef8bca3cdbda43918c83660 /hook-functions
parent135b1620f5d591c6ffe6059124802d534d5473fb (diff)
downloadinitramfs-tools-553aa3742ca43b4ba4e87b2dea2c5d31cc43a124.tar.gz
initramfs-tools-553aa3742ca43b4ba4e87b2dea2c5d31cc43a124.zip
mkinitramfs: generate pre-cached boot order file
if tsort is available, use it instead of custom sorting code if a pre-cached order file is available, use that instead [ move cache_run_scripts from scripts/functions to hook-scripts as only used on mkinitramfs build and not on boot ] Signed-off-by: maximilian attems <maks@debian.org>
Diffstat (limited to 'hook-functions')
-rw-r--r--hook-functions16
1 files changed, 16 insertions, 0 deletions
diff --git a/hook-functions b/hook-functions
index ab2f486..cf41e42 100644
--- a/hook-functions
+++ b/hook-functions
@@ -485,6 +485,22 @@ EOF
}
+# cache boot scripts order
+cache_run_scripts()
+{
+ DESTDIR=${1}
+ scriptdir=${2}
+ initdir=${DESTDIR}${scriptdir}
+ [ ! -d ${initdir} ] && return
+
+ runlist=$(get_prereq_pairs | tsort)
+ for crs_x in ${runlist}; do
+ [ -f ${initdir}/${crs_x} ] || continue
+ echo "${scriptdir}/${crs_x}" >> ${initdir}/ORDER
+ echo "[ -e /conf/param.conf ] && . /conf/param.conf" >> ${initdir}/ORDER
+ done
+}
+
# minimal supported kernel version
check_minkver()
{