Driver disks for FC6

Matt Domsch Matt_Domsch at dell.com
Thu Oct 26 18:18:40 UTC 2006


On Wed, Oct 25, 2006 at 11:16:18AM -0700, ravianand wrote:
> >On Wed, 25 Oct 2006, Pasi K?rkk?inen wrote:
> > Reply-To: Development discussions related to Fedora Core <fedora-devel-list at redhat.com>
> > 
> > On Wed, Oct 25, 2006 at 05:25:31PM +0300, Pasi K?rkk?inen wrote:
> > > On Wed, Oct 25, 2006 at 09:07:04AM -0500, Matt Domsch wrote:
> > > > On Tue, Oct 24, 2006 at 03:48:15PM -0700, ravianand wrote:
> > > > > Does DKMS looks for pcitable or it has been updated to package module.alias ?
> > > > 
> > > > It uses pcitable for <= 2.0.13 (the current release).  What's the module.alias change?
> > > https://bugzilla.redhat.com/bugzilla/show_bug.cgi?id=195899#c18
> > > 
> > > FC6 and RHEL5 use the new format, and work properly with it.. 

DKMS patch below which creates the FC5+ driver disk format.  It
auto-generates modules.alias.  Please try this if you use this
feature.

Thanks,
Matt

-- 
Matt Domsch
Software Architect
Dell Linux Solutions linux.dell.com & www.dell.com/linux
Linux on Dell mailing lists @ http://lists.us.dell.com

--- /home/mdomsch/dkms/dev/SOURCES/dkms-2.0.13	2006-06-30 13:13:04.000000000 -0500
+++ /usr/sbin/dkms	2006-10-26 13:12:44.000000000 -0500
@@ -1733,10 +1733,25 @@ make_redhat_driver_disk() 
    
     # Copy files for the driver disk (or warn if not present)
     local files_for_driverdisk="modinfo disk-info modules.dep pcitable modules.pcimap pci.ids"
-    local files_into_driverdisk="modules.cgz $rhdd_filename"
+    # Fedora Core 5 and higher, RHEL5 and higher, strictly require: rhdd, modules.cgz, modinfo, modules.alias, modules.dep
+    # which is in effect ignoring disk-info, pcitable, modules.pcimap and pci.ids
+    # and adding modules.alias, which will be generated.
+    local fc5_required_usercreated_files="modinfo modules.dep"
+
+    # start with the list of DKMS-generated files
+    local files_into_driverdisk="modules.cgz $rhdd_filename modules.alias"
+    local ignore=0
+    local warnlevel="Error!"
     for file in $files_for_driverdisk; do
+	warnlevel="Error!"
+	ignore=0
 	if ! [ -e "$dkms_tree/$module/$module_version/source/redhat_driver_disk/$file" ]; then
-	    echo $"Warning! File: $file not found in $dkms_tree/$module/$module_version/source/redhat_driver_disk/" >&2
+	    if ! is_word_in_list "$file" "$fc5_required_usercreated_files" ; then
+		warnlevel="Notice:"
+		ignore=1
+	    fi
+	    echo $"${warnlevel} File: $file not found in $dkms_tree/$module/$module_version/source/redhat_driver_disk/" >&2
+	    [ $ignore -eq 1 ] && echo $"  If target is Fedora Core 5 or higher, RHEL5 or higher, this can be safely ignored." >&2
 	else
 	    files_into_driverdisk="$file $files_into_driverdisk"
 	    cp -f "$dkms_tree/$module/$module_version/source/redhat_driver_disk/$file" "$dkms_tree/$module/$module_version/driver_disk/" 2>/dev/null
@@ -1756,6 +1771,28 @@ make_redhat_driver_disk() 
     cd $temp_dir_name
     invoke_command "echo -e '$modules_cgz_list' | cpio -oH crc 2>/dev/null | gzip -9 > ./modules.cgz" "compressing modules.cgz" background
     cp -f ./modules.cgz "$dkms_tree/$module/$module_version/driver_disk/"
+
+    # generate modules.alias file
+    # On 2.4 kernels. this won't yield anything.
+    # modules.alias needs to exist, even if its empty.
+    touch ./modules.alias
+    for f in $(echo -e ${modules_cgz_list}); do
+	module_wo_suffix=$(basename ${f} ${module_suffix})
+	tmp_alias="./modules.alias.${module_wo_suffix}"
+	depmod -n ./${f} 2>/dev/null | grep ^alias > ${tmp_alias}
+	if [ -s ${tmp_alias} ]; then
+	    cat ${tmp_alias} >> ./modules.alias
+	else
+	    for a in $(modinfo ./${f} 2>/dev/null | grep ^alias: | awk '{print $2}'); do
+		echo "alias ${a} ${module_wo_suffix}" >> ${tmp_alias}
+	    done
+	    if [ -s ${tmp_alias} ]; then
+		cat ${tmp_alias} >> ./modules.alias
+	    fi
+	fi
+    done
+    cp -f ./modules.alias "$dkms_tree/$module/$module_version/driver_disk/"
+
     cd - >/dev/null
     rm -rf $temp_dir_name
     cd "$dkms_tree/$module/$module_version/driver_disk/"




More information about the fedora-devel-list mailing list