From 206a5d538437e41dde80c874612caee72b637dc5 Mon Sep 17 00:00:00 2001 From: Nagy Karoly Gabriel Date: Fri, 2 Nov 2012 22:54:32 +0100 Subject: [PATCH] mkinitramfs: begun implementing firmware. WIP --- base/mkinitramfs/install/D%libdir_kernel.in.txt | 16 +++++++++++++++- .../mkinitramfs/install/D%sbindir_mkinitramfs.sh | 6 ++++-- 2 files changed, 19 insertions(+), 3 deletions(-) diff --git a/base/mkinitramfs/install/D%libdir_kernel.in.txt b/base/mkinitramfs/install/D%libdir_kernel.in.txt index 507bc9530..d4b7c059f 100644 --- a/base/mkinitramfs/install/D%libdir_kernel.in.txt +++ b/base/mkinitramfs/install/D%libdir_kernel.in.txt @@ -3,7 +3,7 @@ # This copyright note is auto-generated by ./scripts/Create-CopyPatch. # # Filename: package/.../mkinitramfs/install/D%libdir_kernel.in.txt -# Copyright (C) 2007 - 2009 The OpenSDE Project +# Copyright (C) 2007 - 2012 The OpenSDE Project # # More information can be found in the files COPYING and README. # @@ -50,6 +50,20 @@ if [ -n "$moddir" ]; then for dep in $( $MODINFO "$source" | grep "^depends:" | tr -s ' ' | cut -d' ' -f2 | tr ',' ' ' ); do module_install "$dep" done + + for fw in $( $MODINFO "$source" | grep "^firmware:" | tr -s ' ' | cut -d' ' -f2 ); do + if [ -r "$firmwaredir/$fw" ]; then + echo -n " $fw" + fwdir=${fw%/*} + if [ "$fwdir" != "$fw" ]; then + mkdir -p "lib/firmware/$fwdir" + cp -a "$firmwaredir/$fw" "lib/firmware/$fwdir" + else + cp -a "$firmwaredir/$fw" "lib/firmware" + fi + fi + done + fi else modules_missing="$modules_missing $module" diff --git a/base/mkinitramfs/install/D%sbindir_mkinitramfs.sh b/base/mkinitramfs/install/D%sbindir_mkinitramfs.sh index a0333dd00..3b6808ff8 100644 --- a/base/mkinitramfs/install/D%sbindir_mkinitramfs.sh +++ b/base/mkinitramfs/install/D%sbindir_mkinitramfs.sh @@ -3,7 +3,7 @@ # This copyright note is auto-generated by ./scripts/Create-CopyPatch. # # Filename: package/.../mkinitramfs/install/D%sbindir_mkinitramfs.sh -# Copyright (C) 2007 - 2009 The OpenSDE Project +# Copyright (C) 2007 - 2012 The OpenSDE Project # # More information can be found in the files COPYING and README. # @@ -78,6 +78,8 @@ fi moddir="${root}/lib/modules/$kernelver" sysmap="${root}/boot/System.map_$kernelver" libdir="${root}D_libdir" +firmwaredir="${root}/lib/firmware" + if [ -d "$moddir" ]; then echo "kernel: $kernelver, module dir: ${moddir#$root/}" if [ ! -r "$sysmap" ]; then @@ -114,7 +116,7 @@ if [ $? -eq 0 ]; then errno=0 # prepare the environment for the plugins - export root tmpdir kernelver moddir libdir sysmap running + export root tmpdir kernelver moddir libdir firmwaredir sysmap running # call the plugins plugindir="etc/mkinitramfs.d"