diff --git a/Makefile b/Makefile index 8a8ec83c..d8a7f4b6 100644 --- a/Makefile +++ b/Makefile @@ -53,7 +53,6 @@ install: dkms dkms.8 gzip -9 $(MAN)/dkms.8 install-redhat-systemd: install - install -D -m 0755 dkms_mkkerneldoth $(LIBDIR)/mkkerneldoth install -D -m 0755 dkms_find-provides $(LIBDIR)/find-provides install -D -m 0755 lsb_release $(LIBDIR)/lsb_release install -D -m 0644 dkms.service $(SYSTEMD)/dkms.service diff --git a/dkms.8.in b/dkms.8.in index 828a93b2..e073120a 100644 --- a/dkms.8.in +++ b/dkms.8.in @@ -274,12 +274,6 @@ it is assumed to be located in See below for more information on the format of .I dkms.conf. .TP -.B \-\-size -The size of the driver disk image to be created. By default, this value is set -at 1440. Any different size should be given as an integer value only, should -be divisible by 20 and should represent the number of kilobytes of the image -size you desire. -.TP .B \-\-config During a .B build @@ -343,15 +337,6 @@ for a module/module-version. This is useful for things like , etc. This saves the trouble of having to actually specify \-k kernel1 \-a arch1 \-k kernel2 \-a arch2 for every kernel you have built your module for. .TP -.B \-\-no\-prepare\-kernel -This option keeps DKMS from first preparing your kernel before building -a module for it. Generally, this option should not be used so as to -ensure that modules are compiled correctly. -.TP -.B \-\-no\-clean\-kernel -This option keeps DKMS from cleaning your kernel source tree after a -build. -.TP .B \-\-no\-depmod This option prevents DKMS from running the depmod command during .B install @@ -383,8 +368,7 @@ and .B remove actions in the RPM spec to ensure that DKMS and RPM behave correctly in all scenarios when upgrading between various versions of a dkms enabled module -RPM package. See the sample.spec file for an example or read more in the section -below on Creating RPMs Which Utilize DKMS. +RPM package. .TP .B \-\-dkmstree path/to/place Provides a destination tree for building and installing modules to. Useful in @@ -460,12 +444,10 @@ directives are case\-sensitive and should be given in It is important to understand that many of the DKMS directives are arrays whose index values are tied together. These array associations can be considered families, and there -are currently four such families of directive arrays. MAKE[#] and MAKE_MATCH[#] make up +are currently three such families of directive arrays. MAKE[#] and MAKE_MATCH[#] make up one family. PATCH[#] and PATCH_MATCH[#] make up the second family. The third and largest family consists of BUILT_MODULE_NAME[#], BUILT_MODULE_LOCATION[#], DEST_MODULE_NAME[#], -DEST_MODULE_LOCATION[#], MODULES_CONF_ALIAS_TYPE[#], MODULES_CONF_OBSOLETES[#], -MODULES_CONF_OBSOLETE_ONLY[#] and STRIP[#]. The fourth -family is made up of only MODULES_CONF[#]. When indexing these arrays when creating your +DEST_MODULE_LOCATION[#] and STRIP[#]. When indexing these arrays when creating your dkms.conf, each family should start at index value 0. .TP .B MAKE[#]= @@ -559,69 +541,6 @@ DEST_MODULE_LOCATION[1]="/kernel/drivers/other/"). DEST_MODULE_LOCATION is ignored on Fedora and Red Hat Enterprise Linux, Novell SuSE Linux Enterprise Server 10 and higher, Novell SuSE Linux 10.0 and higher, and Ubuntu. Instead, the proper distribution-specific directory is used. .TP -.B MODULES_CONF_ALIAS_TYPE[#]= -This directive array specifies how your modules should be aliased in -.I /etc/modules.conf -when your module is installed. This is done in an intelligent fashion so if DKMS -detects an already existing reference in modules.conf, it won't add a new line. If -it is not detected, it will add it to the modules.conf as the last alias number for -that alias type (eg. if MODULES_CONF_ALIAS_TYPE="scsi_hostadapter", no alias -currently exists for that module and the last scsi_hostadapter reference is 6, then -your module will be added as "scsi_hostadapter7"). Common values for this directive -include: -.B scsi_hostadapter -, -.B sound\-slot\- -and -.B eth. -Note that the numeric value of -.B # -is tied to the index of BUILT_MODULE_NAME, BUILT_MODULE_LOCATION, DEST_MODULE_NAME -and DEST_MODULE_LOCATION. The index is also tied to MODULES_CONF_OBSOLETES. -.TP -.B MODULES_CONF_OBSOLETES[#]= -This directive array tells DKMS what modules.conf alias references are obsoleted by the -module you are installing. If your module obsoletes more than one module, this directive -should be a comma\-delimited list of those modules that are obsoleted (eg. for megaraid2, -MODULES_CONF_OBSOLETES[0]="megaraid,megaraid_2002"). When you are installing your module, -DKMS ensures that any entries in -.I /etc/modules.conf -with the same -.B MODULES_CONF_ALIAS_TYPE -are changed over to the new module name. When you are uninstalling -your module, depending on the modules in your -.I /lib/modules -tree, DKMS will take different actions. -If you kernel has an original_module, then modules.conf will not be touched and the non\-obsolete -reference will remain. If the kernel does not have an original_module but does have one -of the obsolete modules, it will replace those references with the first obsolete module name in -the comma\-delimited list that is also in that kernel (thus, your obsolete list should be prioritized -from left to right). If no original_module or obsolete modules are found within the kernel, the alias -entry is removed all\-together. Note that the numeric value of -.B # -is tied to the index of BUILT_MODULE_NAME, BUILT_MODULE_LOCATION, DEST_MODULE_NAME -and DEST_MODULE_LOCATION. The index is also tied to MODULES_CONF_ALIAS_TYPE. -.TP -.B MODULES_CONF_OBSOLETE_ONLY[#]= -If set to -.B yes -, this directive will tell DKMS to only modify -.I /etc/modules.conf -if it finds within it an obsolete reference as specified in the corresponding value of -.B MODULES_CONF_OBSOLETES[#] -array directive. -.TP -.B NO_WEAK_MODULES= -The -.B NO_WEAK_MODULES -parameter prevents dkms from creating a symlink into the weak-updates directory, which is the -default on Red Hat derivatives. The weak modules facility was designed to eliminate the need to -rebuild kernel modules when kernel upgrades occur and relies on the symbols within the kABI. - -Fedora does not guaranteed a stable kABI so it should be disabled in the specific module override by setting it to "yes". For example, for an Nvidia DKMS module you would set the following in /etc/dkms/nvidia.conf: - -NO_WEAK_MODULES="yes" -.TP .B STRIP[#]= By default strip is considered to be "yes". If set to "no", DKMS will not run strip \-g against your built module to remove debug symbols from it. @@ -642,19 +561,6 @@ package. This directive must be present in every dkms.conf. CLEAN specifies the make clean command to be used to clean up both before and after building the module. If unset, it is assumed to be "make clean". .TP -.B REMAKE_INITRD= -This directive specifies whether your initrd should be remade after the module is installed -onto the kernel. Any text after the first character is ignored and if the first character -is not a "y" or a "Y", it is assumed that REMAKE_INITRD="no". -.TP -.B MODULES_CONF[#]= -This directive array specifies what static configuration text -lines need to be added into -.I /etc/modules.conf -for your module. See the section on MODULES.CONF CHANGES for more information regarding the -implications of modifying -.I /etc/modules.conf -.TP .B OBSOLETE_BY= This directive allows you to specify a kernel version that obsoletes the necessity for this particular DKMS module. This can be specified as a particular upstream kernel or an ABI @@ -856,72 +762,6 @@ set in its file. The service works quite simply and if multiple versions of a module are in your system's DKMS tree, it will not do anything and instead explain that manual intervention is required. -.SH MODULES.CONF / MODPROBE.CONF CHANGES -Changes that your module will make to -.I /etc/modules.conf -or -.I /etc/modprobe.conf -should be specified with the -.B MODULES_CONF_ALIAS_TYPE[#] -, the -.B MODULES_CONF_OBSOLETES[#] -and the -.B MODULES_CONF[#] -directive arrays. These arrays should also be used even if your distro uses -.I /etc/sysconfig/kernel -to track kernel modules. - -When the first module is installed upon the first kernel within the user's system, -these entries in -.B MODULES_CONF[#] -are automatically added to -.I /etc/modules.conf -and if -.B REMAKE_INITRD -is specified, then the user's initrd is then remade. Subsequently, as your modules are then -later removed from the user's system, until the final module/version combination is removed -from the final kernel version, those references in -.I modules.conf -will remain. Once the last module/version combination is removed, those references are then -removed. - -As modules/versions are removed and initrds are remade, one of three things will happen if you -have specified a -.B MODULES_CONF_ALIAS_TYPE. -If no original_module exists for that kernel, and no -.B MODULES_CONF_OBSOLETES -modules are found in that kernel too, the -.I modules.conf -alias references will temporarily be removed so that the initrd will successfully -remake. Once the initrd is remade, however; those references are then automatically put -back into -.I modules.conf -(unless you are removing the last instance of the module on the last kernel). -However, if no original_module exists, but there is an OBSOLETE module -found within that kernel, the alias reference is temporarily shifted to point to the -OBSOLETE module so that the initrd can be remade. After it is remade, it then automatically -puts back the alias reference (unless you are removing the last instance of the module -on the last kernel). Lastly, if an original_module does exist for the kernel -version, then -.I modules.conf -is not touched and all references persist (even if you are removing the last instance of the -module on the last kernel). - -Certain module installations might not only require adding references to -.I modules.conf -but also require removing conflicting references that might exist in the user's system. If this -is the case, the -.B MODULES_CONF_OBSOLETES[#] -directive should be utilized to remove these references. More information about this directive -can be found in the -.B DKMS.CONF -section of this man page. - -Note that the end state of your modules.conf file very much depends on what kernel modules exist -in the final kernel you remove your DKMS module from. This is an imperfect system caused by the -fact that there is only one modules.conf file for every kernel on your system even though various -kernels use different modules. In a perfect world, there would be one modules.conf file for -every kernel (just like System.map). .SH AUTHOR Gary Lerhaupt .SH WEBPAGE diff --git a/dkms.bash-completion b/dkms.bash-completion index 04994da0..ce18ff4c 100644 --- a/dkms.bash-completion +++ b/dkms.bash-completion @@ -99,8 +99,7 @@ _dkms() esac options="$options -m -v -k -a --arch -q --quiet -V \ - --version --all --no-prepare-kernel \ - --no-clean-kernel --kernelsourcedir \ + --version --all --kernelsourcedir \ --directive" COMPREPLY=( $( compgen -W "$options" -- $cur ) ) diff --git a/dkms.in b/dkms.in index e9378823..b5749ff5 100644 --- a/dkms.in +++ b/dkms.in @@ -24,24 +24,23 @@ shopt -s extglob # All of the variables we will accept from dkms.conf. # Does not include directives -readonly dkms_conf_variables="CLEAN REMAKE_INITRD remake_initrd PACKAGE_NAME +# The last group of variables has been deprecated +readonly dkms_conf_variables="CLEAN PACKAGE_NAME PACKAGE_VERSION POST_ADD POST_BUILD POST_INSTALL POST_REMOVE PRE_BUILD PRE_INSTALL BUILD_DEPENDS BUILD_EXCLUSIVE_KERNEL BUILD_EXCLUSIVE_ARCH - build_exclude OBSOLETE_BY MAKE MAKE_MATCH MODULES_CONF - modules_conf_array PATCH PATCH_MATCH patch_array BUILT_MODULE_NAME + build_exclude OBSOLETE_BY MAKE MAKE_MATCH + PATCH PATCH_MATCH patch_array BUILT_MODULE_NAME built_module_name BUILT_MODULE_LOCATION built_module_location - DEST_MODULE_NAME dest_module_name MODULES_CONF_OBSOLETES + DEST_MODULE_NAME dest_module_name DEST_MODULE_LOCATION dest_module_location - modules_conf_obsoletes MODULES_CONF_ALIAS_TYPE - modules_conf_alias_type STRIP strip MODULES_CONF_OBSOLETE_ONLY - modules_conf_obsolete_only AUTOINSTALL NO_WEAK_MODULES - SIGN_TOOL" + STRIP strip AUTOINSTALL NO_WEAK_MODULES SIGN_TOOL + + REMAKE_INITRD MODULES_CONF MODULES_CONF_OBSOLETES + MODULES_CONF_ALIAS_TYPE MODULES_CONF_OBSOLETE_ONLY" # Some important regular expressions. Requires bash 3 or above. # Any poor souls still running bash 2 or older really need an upgrade. -readonly y_re='^(Y|y)' readonly mv_re='^([^/]*)/(.*)$' -readonly rh_kernels='(debug|summit|smp|enterprise|bigmem|hugemem|BOOT|vmnix)' # Areas that will vary between Linux and other OS's _get_kernel_dir() { @@ -140,9 +139,8 @@ show_usage() echo $" [-c dkms.conf-location] [-q] [--force] [--force-version-override] [--all]" echo $" [--templatekernel=kernel] [--directive='cli-directive=cli-value']" echo $" [--config=kernel-.config-location] [--archive=tarball-location]" - echo $" [--kernelsourcedir=source-location] [--no-prepare-kernel] [--no-initrd]" + echo $" [--kernelsourcedir=source-location]" echo $" [--binaries-only] [--source-only] [--verbose]" - echo $" [--size]" echo $" [--no-depmod] [--modprobe-on-install] [-j number] [--version]" } @@ -207,7 +205,6 @@ set_module_suffix() # $1 = the kernel to base the module_suffix on kernel_test="${1:-$(uname -r)}" module_uncompressed_suffix=".ko" - [[ $(VER $kernel_test) < $(VER 2.5) ]] && module_uncompressed_suffix=".o" grep -q '\.gz:' /lib/modules/$kernel_test/modules.dep 2>/dev/null && module_compressed_suffix=".gz" grep -q '\.xz:' /lib/modules/$kernel_test/modules.dep 2>/dev/null && module_compressed_suffix=".xz" grep -q '\.zst:' /lib/modules/$kernel_test/modules.dep 2>/dev/null && module_compressed_suffix=".zst" @@ -308,152 +305,40 @@ do_depmod() fi } -# This function is a little hairy -- every distro has slightly different tools -# and naming conventions for creating initial ramdisks. It should probably -# be split out into one function per distro, with make_initrd left as a stub. -make_initrd() -{ - # $1 = kernel version - # $2 = arch - # $3 = 'backup', if backup of old initrd is wanted (using .old-dkms filename suffix) - - [[ $no_initrd ]] && return - local mkinitrd kernel_file initrd_dir="/boot" - for mkinitrd in dracut update-initramfs mkinitrd ''; do - [[ $mkinitrd ]] && which "$mkinitrd" >/dev/null 2>&1 && break - done - - # No mkinitrd? Just return. - [[ $mkinitrd ]] || return 0 - - # Back up our current initrd - echo $"" - # Find out what the proper filename will be - for initrd in "initrd-$1.img" "initramfs-$1.img" "initrd.img-$1" "initrd-$1" ''; do - [[ $initrd && -f $initrd_dir/$initrd ]] && break - done - if ! [[ $initrd ]]; then - # Return if we cannot find an initrd. - warn $"Unable to find an initial ram disk that I know how to handle." \ - $"Will not try to make an initrd." - return 0 - fi - if [[ $3 = backup ]]; then - echo $"Backing up $initrd to $initrd_dir/$initrd.old-dkms" - cp -f "$initrd_dir/$initrd" "$initrd_dir/$initrd.old-dkms" - echo $"Making new $initrd" - echo $"(If next boot fails, revert to $initrd.old-dkms image)" - fi - - if [[ $mkinitrd = dracut ]]; then - invoke_command "$mkinitrd -f $initrd_dir/$initrd $1" "$mkinitrd" background - elif [[ $mkinitrd = update-initramfs ]]; then - invoke_command "$mkinitrd -u -k $1" "$mkinitrd" background - elif $mkinitrd --version >/dev/null 2>&1; then - invoke_command "$mkinitrd -f $initrd_dir/$initrd $1" "$mkinitrd" background - elif [[ -e /etc/SuSE-release || -d /etc/SuSEconfig ]]; then - for kernel_file in vmlinuz vmlinux ''; do - [[ $kernel_file && -f $initrd_dir/$kernel_file ]] && break - done - if [[ ! $kernel_file ]]; then - error $"Unable to find valid kernel file under " \ - $"$initrd_dir for kernel version $1" - return 1; - fi - invoke_command "$mkinitrd -k $kernel_file-$1 -i $initrd" "$mkinitrd" background - elif [[ -e /etc/debian_version ]]; then - invoke_command "$mkinitrd -o $initrd_dir/$initrd $1" "$mkinitrd" background - else - echo $"" - echo $"Calling $mkinitrd (bad exit status 9 may occur)" - invoke_command "$mkinitrd" "$mkinitrd" background - fi - return -} - -# Grab our distro information from RPM-based distros. -distro_version_rpm() +# Grab distro information from os-release. +# Falls back to LSB for compliant distros. +distro_version() { - which rpm > /dev/null 2>&1 || { echo unknown; return; } - local r wp ver dist - - for r in redhat-release sles-release suse-release ovs-release; do - wp=$(rpm -q --whatprovides "$r") || continue - ver=$(rpm -q --qf "%{version}\n" ${wp}) - case $r in - sles*) - echo sles${ver} - ;; - suse*) - echo suse${ver} - ;; - ovs*) - echo ovm${ver} - ;; - redhat*) - case $wp in - redhat*|sl*) - ver=$(echo $ver | \ - sed -e 's/^\([[:digit:]]*\).*/\1/g') - echo el${ver} - ;; - centos*|enterprise*) - echo el${ver} - ;; - fedora*) - echo fc${ver} - ;; - *) - echo unknown - ;; - esac - ;; - *) - echo unknown - ;; - esac + if [[ -r /etc/os-release ]]; then + . /etc/os-release + [[ ${#ID_LIKE[@]} ]] && echo ${ID_LIKE[0]} || echo $ID return - done - echo unknown -} + fi -# Grab distro information from LSB compliant distros. -# Falls back to distro_version_rpm if needed. -distro_version() -{ - # What distribution are we running? - local LSB_DESCRIPTION DISTRIB_ID DISTRIB_RELEASE ver + local DISTRIB_ID # Try the LSB-provided strings first if [ -r /etc/lsb-release ]; then . /etc/lsb-release elif type lsb_release >/dev/null 2>&1; then DISTRIB_ID=$(lsb_release -i -s) - DISTRIB_RELEASE=$(lsb_release -r -s) fi case ${DISTRIB_ID} in Fedora) - echo fc${DISTRIB_RELEASE} + echo fedora ;; RedHatEnterprise*|CentOS|ScientificSL) - # OEL also reports as such; format is 4.7, 5.3 - ver=$(echo "${DISTRIB_RELEASE}" | \ - sed -e 's/^\([[:digit:]]*\).*/\1/g') - echo el${ver} + echo rhel ;; SUSE*) - if [[ $(lsb_release -d -s) =~ Enterprise ]]; then - echo sles${DISTRIB_RELEASE} - else - echo suse${DISTRIB_RELEASE} - fi + echo sles ;; *) - if [[ ${DISTRIB_ID} && ${DISTRIB_RELEASE} ]]; then - echo "${DISTRIB_ID}${DISTRIB_RELEASE}" + if [[ ${DISTRIB_ID} ]]; then + echo "${DISTRIB_ID}" else - distro_version_rpm + echo unknown fi ;; esac @@ -470,34 +355,16 @@ override_dest_module_location() fi case "$running_distribution" in - sles[123456789]) - ;; - suse[123456789]) - ;; - suse10\.[01]) - ;; - fc*) + fedora* | rhel* | ovm*) echo "/extra" && return ;; - el*) - echo "/extra" && return - ;; - ovm*) - echo "/extra" && return - ;; - sles*) - echo "/updates" && return - ;; - suse*) + sles* | suse* | opensuse*) echo "/updates" && return ;; - Ubuntu*) + debian* | ubuntu*) echo "/updates/dkms" && return ;; - Debian*) - echo "/updates/dkms" && return - ;; - Arch*) + arch*) echo "/updates/dkms" && return ;; *) @@ -582,6 +449,12 @@ read_conf() [ -e "$_conf_file" ] && safe_source "$_conf_file" $dkms_conf_variables done + (( ${#REMAKE_INITRD[@]} )) && die 5 $"REMAKE_INITRD has been deprecated." + (( ${#MODULES_CONF[@]} )) && die 5 $"MODULES_CONF has been deprecated." + (( ${#MODULES_CONF_OBSOLETES[@]} )) && die 5 $"MODULES_CONF_OBSOLETES has been deprecated." + (( ${#MODULES_CONF_ALIAS_TYPE[@]} )) && die 5 $"MODULES_CONF_ALIAS_TYPE has been deprecated." + (( ${#MODULES_CONF_OBSOLETE_ONLY[@]} )) && die 5 $"MODULES_CONF_OBSOLETE_ONLY has been deprecated." + # Source in the directive_array for directive in "${directive_array[@]}"; do directive_name=${directive%%=*} @@ -616,13 +489,6 @@ read_conf() built_module_location[$index]=${BUILT_MODULE_LOCATION[$index]} dest_module_name[$index]=${DEST_MODULE_NAME[$index]} dest_module_location[$index]=${DEST_MODULE_LOCATION[$index]} - modules_conf_obsoletes[$index]=${MODULES_CONF_OBSOLETES[$index]} - modules_conf_alias_type[$index]=${MODULES_CONF_ALIAS_TYPE[$index]} - case ${MODULES_CONF_OBSOLETE_ONLY[$index]} in - [yY]*) - modules_conf_obsolete_only[$index]="yes" - ;; - esac case ${STRIP[$index]} in [nN]*) strip[$index]="no" @@ -700,18 +566,8 @@ read_conf() done # Use the generic make and make clean commands if not specified - if [[ $(VER $1) < $(VER 2.6.6) ]]; then - [[ ! $make_command ]] && make_command="make -C $kernel_source_dir SUBDIRS=$dkms_tree/$module/$module_version/build modules" - [[ ! $clean ]] && clean="make -C $kernel_source_dir SUBDIRS=$dkms_tree/$module/$module_version/build clean" - else - [[ ! $make_command ]] && make_command="make -C $kernel_source_dir M=$dkms_tree/$module/$module_version/build" - [[ ! $clean ]] && clean="make -C $kernel_source_dir M=$dkms_tree/$module/$module_version/build clean" - fi - - # Set modules_conf_array - for ((index=0; index < ${#MODULES_CONF[@]}; index++)); do - [[ ${MODULES_CONF[$index]} ]] && modules_conf_array[$index]="${MODULES_CONF[$index]}" - done + [[ ! $make_command ]] && make_command="make -C $kernel_source_dir M=$dkms_tree/$module/$module_version/build" + [[ ! $clean ]] && clean="make -C $kernel_source_dir M=$dkms_tree/$module/$module_version/build clean" # Set patch_array (including kernel specific patches) count=0 @@ -722,9 +578,6 @@ read_conf() fi done - # Set remake_initrd - [[ $REMAKE_INITRD =~ $y_re ]] && remake_initrd="yes" - # Set build_exclude [[ $BUILD_EXCLUSIVE_KERNEL && ! $1 =~ $BUILD_EXCLUSIVE_KERNEL ]] && build_exclude="yes" [[ $BUILD_EXCLUSIVE_ARCH && ! $2 =~ $BUILD_EXCLUSIVE_ARCH ]] && build_exclude="yes" @@ -860,175 +713,6 @@ check_version_sanity() return 0 } -moduleconfig_update_obsoletes() -{ - # $@ = files to process - # Do nothing if we have no obsoletes - ( IFS=; [[ "${modules_conf_obsoletes[*]}" ]] ) || return 0 - # Generate sed args to remove obsolete modules - local mod_diff - for ((index=0; index < ${#dest_module_name[@]}; index++)); do - [[ ${modules_conf_obsoletes[$index]} ]] || continue - for obsolete_module in ${modules_conf_obsoletes[$index]//,/ }; do - # For module.conf style syntax - sa_mc_o[${#sa_mc_o[*]}]="-e" - sa_mc_o[${#sa_mc_o[*]}]="s/\(alias ${modules_conf_alias_type[$index]}[0-9]*\) $obsolete_module$/\1 ${dest_module_name[$index]}/g" - # For /etc/sysconfig/kernel style syntax - sa_sck_o[${#sa_sck_o[*]}]="-e" - sa_sck_o[${#sa_sck_o[*]}]="s/\(INITRD_MODULES.*\)$obsolete_module\b\(.*\)/\1${dest_module_name[$index]}\2/" - done - done - - # Do all the changes at once, record the diffs for posterity - for file in "$@"; do - [[ $file && -w $file ]] || continue - _tmpf="$temp_dir_name/${file##*/}.new" - if [[ $file = /etc/sysconfig/kernel ]]; then - [ -z "${sa_sck_o[@]}" ] || sed "${sa_sck_o[@]}" "$file" > "$_tmpf" - else - [ -z "${sa_mc_o[@]}" ] || sed "${sa_mc_o[@]}" "$file" > "$_tmpf" - fi - if [ -f "$_tmpf" ] && ! mod_diff=$(diff -u "$_tmpf" "$file"); then - echo $"$file updated to replace obsoleted module references:" - echo "$mod_diff" - cp -fp "$_tmpf" "$file" - rm -f "$_tmpf" - fi - done -} - -moduleconfig_add() -{ - # $1 = kernel version - - local temp_dir_name=$(mktemp_or_die -d $tmp_location/dkms.XXXXXX) - local -a sa_mc_o=() sa_sck_o=() - modconfig_files="/etc/modprobe.d/dkms.conf - /etc/modprobe.d/dkms - /etc/modules.conf - /etc/modprobe.conf - /etc/modprobe.d/$package_name.conf - /etc/sysconfig/kernel" - - moduleconfig_update_obsoletes $modconfig_files - - for moduleconfig in $modconfig_files; do - [[ -e $moduleconfig ]] || continue - for ((index=0; index < ${#dest_module_name[@]}; index++)); do - - # Only add it if it can't be found already in config file - if [[ ${modules_conf_alias_type[$index]} ]] && \ - ! grep -qs "alias ${modules_conf_alias_type[$index]}[0-9]* ${dest_module_name[$index]}\b" $moduleconfig && \ - [[ ${modules_conf_obsolete_only[$index]} != yes ]]; then - if [[ $modconfig_files = /etc/modprobe.d/$package_name.conf ]] && [[ ! -e /etc/modprobe.d/$package_name.conf ]]; then - touch /etc/modprobe.d/$package_name.conf - echo $"created /etc/modprobe.d/$package_name.conf.">&2 - fi - aliases=$(awk "/^alias ${modules_conf_alias_type[$index]}/ {print \$2}" $moduleconfig) - if [[ $aliases ]]; then - alias_number=$(($(echo "$aliases" | sed "s/${modules_conf_alias_type[$index]}//" | sort -n | tail -n 1) + 1)) - else - alias_number=0 - fi - echo -e "alias ${modules_conf_alias_type[$index]}${alias_number} ${dest_module_name[$index]}" >> $moduleconfig - echo $"$moduleconfig: added alias reference for '${dest_module_name[$index]}'" - fi - done - - # Add anything else - for ((index=0; index < ${#modules_conf_array[@]}; index++)); do - if [ -n "${modules_conf_array[$index]}" ] && \ - ! grep -q "${modules_conf_array[$index]}" "$moduleconfig"; then - echo -e $"$moduleconfig: added '${modules_conf_array[$index]}'" - echo -e "${modules_conf_array[$index]}" >> $moduleconfig - fi - done - done - - # Delete the temp dir - rm -rf $temp_dir_name -} - -moduleconfig_remove() -{ - # $1 = kernel version - - local temp_dir_name=$(mktemp_or_die -d $tmp_location/dkms.XXXXXX) - modconfig_files="" - [ -e /etc/modprobe.d/dkms.conf ] && modconfig_files="/etc/modprobe.d/dkms.conf" - [ -e /etc/modprobe.d/dkms ] && modconfig_files="/etc/modprobe.d/dkms" - [ -e /etc/modules.conf ] && modconfig_files="$modconfig_files /etc/modules.conf" - [ -e /etc/modprobe.conf ] && modconfig_files="$modconfig_files /etc/modprobe.conf" - [ -e /etc/modprobe.d/$package_name.conf ] && modconfig_files="/etc/modprobe.d/$package_name.conf" - - for moduleconfig in $modconfig_files; do - for ((index=0; index < ${#dest_module_name[@]}; index++)); do - # Remove/Replace aliases (maybe) - [[ ${modules_conf_alias_type[$index]} ]] || continue - find "$install_tree/$1/" -name "${dest_module_name[$index]}.*" -quit 2>/dev/null && continue - - local conf_replacement="" - for obsolete_module in ${modules_conf_obsoletes[$index]//,/ }; do - find $install_tree/$1/ -name "$obsolete_module.*" -quit 2>/dev/null || continue - conf_replacement=$obsolete_module - break - done - - if [[ ! $conf_replacement ]]; then - grep -v "alias ${modules_conf_alias_type[$index]}[0-9]* ${dest_module_name[$index]}" $moduleconfig > $temp_dir_name/moduleconfig.new - mv -f $temp_dir_name/moduleconfig.new $moduleconfig - echo $"$moduleconfig: removed alias for '${dest_module_name[$index]}'" - if [[ $modconfig_files = /etc/modprobe.d/$package_name.conf ]]; then - rm -f /etc/modprobe.d/$package_name.conf - echo $"$moduleconfig: deleted /etc/modprobe.d/$package_name.conf file" - fi - elif grep -q "alias ${modules_conf_alias_type[$index]}[0-9]* ${dest_module_name[$index]}$" $moduleconfig; then - sed "s/\(alias ${modules_conf_alias_type[$index]}[0-9]*\) ${dest_module_name[$index]}$/\1 $conf_replacement/g" \ - $moduleconfig > $temp_dir_name/moduleconfig.new - mv -f $temp_dir_name/moduleconfig.new $moduleconfig - echo $"$moduleconfig: alias for '${dest_module_name[$index]}' changed back to '$conf_replacement'" - fi - done - - # Remove static conf entries - for ((index=0; index < ${#modules_conf_array[@]}; index++)); do - [[ ${modules_conf_array[$index]} ]] || continue - grep -v "${modules_conf_array[$index]}" "$moduleconfig" > $temp_dir_name/moduleconfig.new - echo $"$moduleconfig: removed '${modules_conf_array[$index]}'" - mv -f $temp_dir_name/moduleconfig.new $moduleconfig - done - done - - # Delete the temp dir - rm -rf $temp_dir_name -} - -etc_sysconfig_kernel_modify() -( - [[ -f /etc/sysconfig/kernel && $remake_initrd ]] || return 0 - - # Make a temp directory to store files - local temp_dir_name=$(mktemp_or_die -d $tmp_location/dkms.XXXXXX) - if [[ $1 = add ]]; then - . /etc/sysconfig/kernel - for m in "${dest_module_name[@]}"; do - for l in "${INITRD_MODULES}"; do - [[ $m = $l ]] && continue 2 - done - sed -e "s/INITRD_MODULES=\"\(.*\)\"/INITRD_MODULES=\"\1 $m\"/" /etc/sysconfig/kernel > $temp_dir_name/kernel.new - mv $temp_dir_name/kernel.new /etc/sysconfig/kernel - done - # Remove /etc/sysconfig/kernel entries - elif [[ $1 = delete ]]; then - for m in "${dest_module_name[@]}"; do - sed -e "s/\(INITRD_MODULES.*\)$m\b\(.*\)/\1\2/" /etc/sysconfig/kernel > $temp_dir_name/kernel.new - mv $temp_dir_name/kernel.new /etc/sysconfig/kernel - done - fi - # Delete the temp dir - rm -rf $temp_dir_name -) - check_module_args() { [[ $module && $module_version ]] && return die 1 $"Arguments and are not specified." \ @@ -1148,134 +832,9 @@ prepare_kernel() # Check that kernel-source exists _check_kernel_dir "$1" || { - case "$running_distribution" in - Debian* | Ubuntu* ) - die 1 $"Your kernel headers for kernel $1 cannot be found." \ - $"Please install the linux-headers-$1 package or use the --kernelsourcedir option to tell DKMS where it's located." - ;; - * ) - die 1 $"Your kernel headers for kernel $1 cannot be found at /lib/modules/$1/build or /lib/modules/$1/source." \ - $"You can use the --kernelsourcedir option to tell DKMS where it's located." - ;; - esac - } - - [[ $no_prepare_kernel ]] && return - - if [[ (! ( $(VER $1) < $(VER 2.6.5) ) || -d /etc/SuSEconfig) && \ - -d "$kernel_source_dir" && \ - -z "$ksourcedir_fromcli" ]]; then - echo $"" - echo $"Kernel preparation unnecessary for this kernel. Skipping..." - no_clean_kernel="no-clean-kernel" - return 1 - fi - - # Prepare kernel for module build - echo $"" - echo $"Preparing kernel $1 for module build:" - echo $"(This is not compiling a kernel, just preparing kernel symbols)" - cd $kernel_source_dir - [[ -r .config ]] && { - config_contents=$(cat .config) - echo $"Storing current .config to be restored when complete" + die 1 $"Your kernel headers for kernel $1 cannot be found at /lib/modules/$1/build or /lib/modules/$1/source." \ + $"Please install the linux-headers-$1 package or use the --kernelsourcedir option to tell DKMS where it's located." } - - # Set kernel_config - if [[ -e /etc/redhat-release || -e /etc/fedora-release ]]; then - # Note this also applies to VMware 3.x - if [[ -z $kernel_config && -d $kernel_source_dir/configs ]]; then - local kernel_trunc=${1%%-*} - # Try a .config specific to whatever kernel we are running - if [[ $1 =~ $rh_kernels && -e $kernel_source_dir/configs/kernel-$kernel_trunc-$2-${BASH_REMATCH[1]}.config ]]; then - kernel_config="$kernel_source_dir/configs/kernel-$kernel_trunc-$2-${BASH_REMATCH[1]}.config" - elif [[ -e $kernel_source_dir/configs/kernel-$kernel_trunc-$2.config ]]; then - # If that one does not exist, try a generic one. - kernel_config="$kernel_source_dir/configs/kernel-$kernel_trunc-$2.config" - else - # If that does not exist, fall back to no config file - kernel_config="" - fi - fi - elif [[ (-e /etc/SuSE-release || -d /etc/SuSEconfig) && -z $kernel_config && -d $kernel_source_dir/arch ]]; then - local kernel_trunc=${1%%-*} - case $2 in - i586|i686) - config_arch="i386" - ;; - *) - config_arch=$2 - ;; - esac - for config_type in default smp bigsmp; do - [[ $1 =~ $config_type ]] && kernel_config="$kernel_source_dir/arch/$config_arch/defconfig.$config_type" - [[ -e $kernel_config ]] || kernel_config="" - done - [[ $kernel_config ]] || kernel_config="$kernel_source_dir/arch/$config_arch/defconfig.default" - [[ -e $kernel_config ]] || kernel_config="" - fi - - # Do preparation - if [ -e /boot/vmlinuz.version.h ]; then - echo $"Running UnitedLinux preparation routine" - local kernel_config="/boot/vmlinuz.config" - invoke_command "make mrproper" "make mrproper" background - [[ $config_contents ]] && echo "$config_contents" > .config - invoke_command "cp /boot/vmlinuz.version.h include/linux/version.h" "using /boot/vmlinux.version.h" - invoke_command "cp -f $kernel_config .config" "using $kernel_config" - invoke_command "make KERNELRELEASE=$1 cloneconfig" "make cloneconfig" background - invoke_command "make -j$parallel_jobs CONFIG_MODVERSIONS=1 KERNELRELEASE=$1 dep" "make CONFIG_MODVERSIONS=1 dep" background - elif grep -q rhconfig.h $kernel_source_dir/include/linux/{modversions,version}.h 2>/dev/null; then - echo $"Running Red Hat style preparation routine" - invoke_command "make clean" "make clean" background - [[ $config_contents ]] && echo "$config_contents" > .config - - if [[ $kernel_config ]]; then - echo $"using $kernel_config" - cp -f "$kernel_config" .config - elif [[ -e .config ]]; then - warn $"Using $kernel_source_dir/.config" \ - $"(I hope this is the correct config for this kernel)" - else - warn $"Cannot find a .config file to prepare your kernel with." \ - $"Try using the --config option to specify where one can be found." \ - $"Your build will likely fail because of this." - fi - - # Hack to workaround broken tmp_include_depends for Red Hat - if grep -q "/usr/src/build" $kernel_source_dir/tmp_include_depends 2>/dev/null; then - sed 's/\/usr\/src\/build\/.*\/install//g' $kernel_source_dir/tmp_include_depends > $kernel_source_dir/tmp_include_depends.new - mv -f $kernel_source_dir/tmp_include_depends.new $kernel_source_dir/tmp_include_depends - fi - - invoke_command "make KERNELRELEASE=$1 oldconfig" "make oldconfig" background - kerneldoth_contents=$(cat /boot/kernel.h 2>/dev/null) - invoke_command "/usr/lib/dkms/mkkerneldoth --kernelver $1 --targetarch $2 --output /boot/kernel.h" "running mkkerneldoth" background - else - echo $"Running Generic preparation routine" - invoke_command "make mrproper" "make mrproper" background - [[ $config_contents ]] && echo "$config_contents" > .config - - if [[ $kernel_config ]]; then - echo $"using $kernel_config" - cp -f "$kernel_config" .config - elif [[ -e .config ]]; then - warn $"using $kernel_source_dir/.config" \ - $"(I hope this is the correct config for this kernel)" - else - warn $"Warning! Cannot find a .config file to prepare your kernel with." \ - $"Try using the --config option to specify where one can be found." \ - $"Your build will likely fail because of this." - fi - - invoke_command "make KERNELRELEASE=$1 oldconfig" "make oldconfig" background - if [[ $(VER $1) < $(VER 2.5) ]]; then - invoke_command "make -j$parallel_jobs KERNELRELEASE=$1 dep" "make dep" background - else - invoke_command "make -j$parallel_jobs KERNELRELEASE=$1 prepare-all scripts" "make prepare-all" background - fi - fi - cd - >/dev/null } # Get ready to build a module that has been registered with DKMS. @@ -1399,19 +958,6 @@ clean_build() invoke_command "$clean" "cleaning build area" background cd - >/dev/null - if [[ ! ( $(VER $kernelver) < $(VER 2.6.6) ) && \ - -d $kernel_source_dir && \ - ! -h $kernel_source_dir && \ - ! $ksourcedir_fromcli ]]; then - echo $"Kernel cleanup unnecessary for this kernel. Skipping..." - elif [[ ! $no_clean_kernel ]]; then - cd "$kernel_source_dir" - [[ $kerneldoth_contents ]] || invoke_command "make mrproper" "cleaning kernel tree (make mrproper)" background - [[ $config_contents ]] || echo "$config_contents" > .config - [[ $kerneldoth_contents ]] && echo "$kerneldoth_contents" > /boot/kernel.h - cd - >/dev/null - fi - # Clean the build directory rm -rf "$dkms_tree/$module/$module_version/build" } @@ -1541,7 +1087,7 @@ install_module() for original_module in $archive_pref1 $archive_pref2 $archive_pref3 $archive_pref4; do [[ -f $original_module ]] || continue case "$running_distribution" in - Debian* | Ubuntu* ) + debian* | ubuntu* ) ;; *) echo $" - Found $original_module" @@ -1568,7 +1114,7 @@ install_module() echo $" - Multiple same named modules!" echo $" - $module_count named $m$module_suffix in $lib_tree/" case "$running_distribution" in - Debian* | Ubuntu* ) + debian* | ubuntu* ) ;; *) echo $" - All instances of this module will now be stored for reference purposes ONLY" @@ -1580,7 +1126,7 @@ install_module() dup_name="${module_dup##*/}" dup_tree="${dup_tree/${dup_name}}" case "$running_distribution" in - Debian* | Ubuntu* ) + debian* | ubuntu* ) ;; *) echo $" - Stored $module_dup" @@ -1616,11 +1162,6 @@ install_module() # Run the post_install script run_build_script post_install "$post_install" - # Make modules.conf changes as necessary - echo $"" - moduleconfig_add "$kernelver" - etc_sysconfig_kernel_modify "add" - invoke_command "do_depmod $kernelver" "depmod" background || { do_uninstall "$kernelver" "$arch" die 6 $"Problems with depmod detected. Automatically uninstalling this module." \ @@ -1636,13 +1177,6 @@ install_module() fi fi - # Do remake_initrd things (save old initrd) - [[ $remake_initrd ]] && ! make_initrd "$kernelver" "$arch" backup && { - do_uninstall "$kernelver" "$arch" - die 7 $"Problems with mkinitrd detected. Automatically uninstalling this module." \ - $"Install Failed (mkinitrd problems). Module rolled back to built state." - } - # Restore the status of $force force="$tmp_force" } @@ -1818,7 +1352,7 @@ do_uninstall() local origmod=$(compressed_or_uncompressed "$dkms_tree/$module/original_module/$1/$2" "${dest_module_name[$count]}") if [[ -n "$origmod" ]]; then case "$running_distribution" in - Debian* | Ubuntu* ) + debian* | ubuntu* ) ;; *) echo $" - Archived original module found in the DKMS tree" @@ -1830,12 +1364,6 @@ do_uninstall() else echo $" - No original module was found for this module on this kernel." echo $" - Use the dkms install command to reinstall any previous module version." - - # Remove modules_conf entries from /etc/modules.conf if remake_initrd is set or if this is last instance removed - if [[ $remake_initrd ]] || (do_status $module $module_version | grep -q "installed"); then - echo $"" - moduleconfig_remove "$1" - fi fi done rm -f "$dkms_tree/$module/kernel-$1-$2" @@ -1849,12 +1377,6 @@ do_uninstall() # Run depmod because we changed /lib/modules invoke_command "do_depmod $1" "depmod" background - # Do remake_initrd things (remake initrd) - if [[ $remake_initrd && $was_active ]] && ! make_initrd "$1" "$2" ''; then - warn $"There was a problem remaking your initrd. You must manually remake it" \ - $"before booting into this kernel." - fi - # Delete the original_module if nothing for this kernel is installed anymore if [[ $was_active && -d $dkms_tree/$module/original_module/$1/$2 && ! -d $dkms_tree/$module/original_module/$1/$2/collisions ]]; then echo $"" @@ -1868,10 +1390,6 @@ do_uninstall() echo $"same-named modules and this directory is now where these are located." fi [[ $(find $dkms_tree/$module/original_module/* -maxdepth 0 -type d 2>/dev/null) ]] || rm -rf "$dkms_tree/$module/original_module" - - # Re-add entries to modules.conf if this module/version is still installed on another kernel - # But only do this if it was just ACTIVE on the kernel we just uninstalled from - [[ $was_active && $remake_initrd ]] && do_status $module $module_version | grep -q "installed" && moduleconfig_add "$1" } module_is_added_or_die() @@ -1961,9 +1479,6 @@ remove_module() # Get rid of any remnant directories if necessary if (($(ls "$dkms_tree/$module" | wc -w | awk '{print $1}') == 0)); then rm -rf "$dkms_tree/$module" 2>/dev/null - - # Its now safe to completely remove references in /etc/sysconfig/kernel for SuSE - etc_sysconfig_kernel_modify "delete" fi } @@ -2421,17 +1936,6 @@ run_match() install_module fi done < <(echo "$template_kernel_status") - - # Clean up the kernel tree - if [[ ! ( $(VER $kernelver) < $(VER 2.6.6) ) && -d "$kernel_source_dir" && ! -h "$kernel_source_dir" && -z "$ksourcedir_fromcli" ]]; then - echo $"Kernel cleanup unnecessary for this kernel. Skipping..." - elif [[ ! $no_clean_kernel ]]; then - cd "$kernel_source_dir" - [[ $kerneldoth_contents ]] || invoke_command "make mrproper" "cleaning kernel tree (make mrproper)" background - [[ $config_contents ]] && echo "$config_contents" > .config - [[ $kerneldoth_contents ]] && echo "$kerneldoth_contents" > /boot/kernel.h - cd - >/dev/null - fi fi } @@ -2698,8 +2202,6 @@ ksourcedir_fromcli="" action="" force="" force_version_override="" -no_prepare_kernel="" -no_clean_kernel="" binaries_only="" source_only="" all="" @@ -2707,7 +2209,6 @@ module_suffix="" module_uncompressed_suffix="" module_compressed_suffix="" rpm_safe_upgrade="" -size="1440"; declare -a directive_array=() kernelver=() arch=() weak_modules='' last_mvka='' @@ -2753,15 +2254,6 @@ while (($# > 0)); do echo $"#RELEASE_STRING#" exit 0 ;; - --no-prepare-kernel) - no_prepare_kernel="no-prepare-kernel" - ;; - --no-clean-kernel) - no_clean_kernel="no-clean-kernel" - ;; - --no-initrd) - no_initrd="no-initrd" - ;; --binaries-only) binaries_only="binaries-only" ;; @@ -2805,9 +2297,6 @@ while (($# > 0)); do read_arg _aa "$1" "$2" || shift arch[${#arch[@]}]="$_aa" ;; - --size*) - read_arg size "$1" "$2" || shift - ;; --kernelsourcedir*) read_arg kernel_source_dir "$1" "$2" || shift ksourcedir_fromcli="true" @@ -2880,8 +2369,8 @@ if [[ $arch && $all ]]; then $"--all on the command line." fi -# If initramfs/initrd rebuild is not requested, skip it with Redhat's weak-modules -if [[ $no_initrd && $weak_modules ]]; then +# Since initramfs/initrd rebuild is not requested, skip it with Redhat's weak-modules +if [[ $weak_modules ]]; then weak_modules_no_initrd="--no-initramfs" fi diff --git a/dkms_mkkerneldoth b/dkms_mkkerneldoth deleted file mode 100644 index 9c12b208..00000000 --- a/dkms_mkkerneldoth +++ /dev/null @@ -1,123 +0,0 @@ -#!/bin/bash -# -# Generate a header that defines the kernel we care about. -# -# Version 1.0 -# -# Adapted from Red Hat's initscripts package -# Licensed under the GNU GPL - -kernel_version=`uname -r` -output_file="/boot/kernel.h" -target_arch="" - -# Parse command line arguments -action_flag="" -while [ $# -gt 0 ]; do - case $1 in - --targetarch*|-a) - if echo $1 | grep '=' >/dev/null ; then - target_arch=`echo $1 | sed 's/^.*=//'` - else - target_arch="$2" - shift - fi - ;; - --kernelver*|-k) - if echo $1 | grep '=' >/dev/null ; then - kernel_version=`echo $1 | sed 's/^.*=//'` - else - kernel_version="$2" - shift - fi - ;; - --output*|-o) - if echo $1 | grep '=' >/dev/null ; then - output_file=`echo $1 | sed 's/^.*=//'` - else - output_file="$2" - shift - fi - ;; - esac - shift -done - - -KERNEL_TYPE=`echo ${kernel_version} | sed 's_^.*\(BOOT\|smp\|enterprise\|bigmem\|hugemem\|debug\|vmnix\)$_-\1_;t;s_.*__;'` -KERNEL_RELEASE=`echo ${kernel_version} | sed 's|BOOT\|smp\|enterprise\|bigmem\|hugemem\|debug||g'` - -if [ -n "${target_arch}" ]; then - KERNEL_ARCH="${target_arch}" -else - rpm -q kernel$KERNEL_TYPE-$KERNEL_RELEASE >/dev/null 2>&1 && KERNEL_ARCH=`rpm -q --qf '%{ARCH}' kernel$KERNEL_TYPE-$KERNEL_RELEASE 2>/dev/null` || KERNEL_ARCH=`uname -m` -fi - -if [ -n "$KERNEL_ARCH" ]; then - ENTERPRISE='0' - SMP='0' - UP='0' - BIGMEM='0' - HUGEMEM='0' - BOOT='0' - DEBUG='0' - VMNIX='0' - case "$KERNEL_TYPE" in - -BOOT) - BOOT='1' - if [ "${KERNEL_ARCH}" = "i686" ] || [ "${KERNEL_ARCH}" = "i586" ] || [ "${KERNEL_ARCH}" = "athlon" ]; then - KERNEL_ARCH="i386" - fi - ;; - -smp) SMP='1';; - -enterprise) ENTERPRISE='1';; - -bigmem) BIGMEM='1';; - -hugemem) HUGEMEM='1';; - -vmnix) VMNIX='1';; - *) UP='1';; - esac - cat > ${output_file} << EOF -/* This file is automatically generated at boot time. */ -#ifndef __BOOT_KERNEL_H_ -#define __BOOT_KERNEL_H_ - -/* Kernel type $KERNEL_ARCH$KERNEL_TYPE */ - -#ifndef __MODULE_KERNEL_$KERNEL_ARCH -#define __MODULE_KERNEL_$KERNEL_ARCH 1 -#endif - -#ifndef __BOOT_KERNEL_ENTERPRISE -#define __BOOT_KERNEL_ENTERPRISE $ENTERPRISE -#endif - -#ifndef __BOOT_KERNEL_BIGMEM -#define __BOOT_KERNEL_BIGMEM $BIGMEM -#endif - -#ifndef __BOOT_KERNEL_HUGEMEM -#define __BOOT_KERNEL_HUGEMEM $HUGEMEM -#endif - -#ifndef __BOOT_KERNEL_SMP -#define __BOOT_KERNEL_SMP $SMP -#endif - -#ifndef __BOOT_KERNEL_UP -#define __BOOT_KERNEL_UP $UP -#endif - -#ifndef __BOOT_KERNEL_BOOT -#define __BOOT_KERNEL_BOOT $BOOT -#endif - -#ifndef __BOOT_KERNEL_DEBUG -#define __BOOT_KERNEL_DEBUG $DEBUG -#endif - -#ifndef __BOOT_KERNEL_VMNIX -#define __BOOT_KERNEL_VMNIX $VMNIX -#endif -#endif -EOF -fi diff --git a/kernel_prerm.d_dkms b/kernel_prerm.d_dkms index fd2ebda4..55c59913 100755 --- a/kernel_prerm.d_dkms +++ b/kernel_prerm.d_dkms @@ -3,14 +3,6 @@ # We're passed the version of the kernel being removed inst_kern=$1 -# This is applied from make_initrd function in dkms command, which -# creates the possible initrd backup file. -remove_initrd_backup() { - for initrd in "initrd-$1.img" "initramfs-$1.img" "initrd.img-$1" "initrd-$1"; do - rm -fv /boot/"${initrd}".old-dkms >&2 - done -} - if [ -x /usr/sbin/dkms ]; then while read line; do name=`echo "$line" | awk '{print $1}' | sed 's/,$//' | cut -d'/' -f1` @@ -21,8 +13,6 @@ while read line; do done < <(dkms status -k $inst_kern 2>/dev/null | grep ": installed") fi -remove_initrd_backup "$inst_kern" - rmdir --ignore-fail-on-non-empty \ "/lib/modules/$inst_kern/updates/dkms" \ "/lib/modules/$inst_kern/updates" 2>/dev/null diff --git a/test/dkms_test-1.0/dkms.conf b/test/dkms_test-1.0/dkms.conf index cb3bd38e..21d8a185 100644 --- a/test/dkms_test-1.0/dkms.conf +++ b/test/dkms_test-1.0/dkms.conf @@ -8,7 +8,5 @@ BUILT_MODULE_NAME="dkms_test" AUTOINSTALL="yes" -REMAKE_INITRD="yes" - DEST_MODULE_LOCATION="/kernel/extra"