pax_global_header00006660000000000000000000000064144225075610014520gustar00rootroot0000000000000052 comment=782bd07641b957012f9b8d621bf9b51f82bfc728 dkms-3.0.11/000077500000000000000000000000001442250756100125405ustar00rootroot00000000000000dkms-3.0.11/.github/000077500000000000000000000000001442250756100141005ustar00rootroot00000000000000dkms-3.0.11/.github/workflows/000077500000000000000000000000001442250756100161355ustar00rootroot00000000000000dkms-3.0.11/.github/workflows/tests.yml000066400000000000000000000114011442250756100200170ustar00rootroot00000000000000name: Run tests on: # Build at 23:00 every Sunday schedule: - cron: "0 23 * * 1" pull_request: push: jobs: test-distributions: name: Build in containers strategy: matrix: distro: - {name: "alpine", tag: "3.17", variant: "-lts"} - {name: "alpine", tag: "3.17", variant: "-virt"} - {name: "alpine", tag: "3.16", variant: "-lts"} - {name: "alpine", tag: "3.16", variant: "-virt"} - {name: "alpine", tag: "3.15", variant: "-lts"} - {name: "alpine", tag: "3.15", variant: "-virt"} - {name: "archlinux", tag: "latest"} - {name: "archlinux", tag: "latest", variant: "-lts"} - {name: "archlinux", tag: "latest", variant: "-zen"} - {name: "centos", tag: "7"} - {name: "almalinux", tag: "9"} - {name: "almalinux", tag: "8"} - {name: "debian", tag: "11"} - {name: "debian", tag: "10"} - {name: "ubuntu", tag: "22.04"} - {name: "ubuntu", tag: "20.04"} - {name: "ubuntu", tag: "18.04"} runs-on: ubuntu-20.04 container: image: docker://docker.io/library/${{ matrix.distro.name }}:${{ matrix.distro.tag }} steps: - uses: actions/checkout@v3 - name: Install Alpine dependencies if: matrix.distro.name == 'alpine' run: | apk --no-cache --update add bash gcc linux${{ matrix.distro.variant }} linux${{ matrix.distro.variant }}-dev make openssl coreutils - name: Install Arch Linux dependencies if: matrix.distro.name == 'archlinux' run: | pacman -Syu --noconfirm diffutils gcc make linux${{ matrix.distro.variant }}-headers openssl - name: Install CentOS dependencies if: matrix.distro.name == 'centos' run: | yum install -y diffutils elfutils-libelf-devel gcc kernel kernel-devel make openssl - name: Install AlmaLinux dependencies if: matrix.distro.name == 'almalinux' run: | yum install -y diffutils elfutils-libelf-devel gcc kernel kernel-devel make openssl - name: Install Debian dependencies if: matrix.distro.name == 'debian' run: | apt-get update -q apt-get install -qy gcc make linux-headers-amd64 linux-image-amd64 openssl - name: Install Ubuntu dependencies if: matrix.distro.name == 'ubuntu' run: | apt-get update -q apt-get install -qy gcc make linux-headers-generic linux-image-generic openssl shim-signed - name: Compute packaged kernel version id: versions run: | KERNEL_VER='' if [ "${{ matrix.distro.name }}" = alpine ] ; then KERNEL_VER="$(apk info --contents "linux${{ matrix.distro.variant }}-dev" | sed -n 's:^lib/modules/\([^/][^/]*\)/.*:\1:p' | head -n 1)" elif [ "${{ matrix.distro.name }}" = archlinux ] ; then KERNEL_VER="$(pacman -Qql "linux${{ matrix.distro.variant }}-headers" | sed -n 's:^/usr/lib/modules/\([^/]\+\)/.*:\1:p' | head -n 1)" elif [ "${{ matrix.distro.name }}" = centos ] || [ "${{ matrix.distro.name }}" = almalinux ] ; then KERNEL_VER="$(LANG=C rpm -qi kernel-devel | sed -n 's/^Source RPM *: kernel-\(.*\).src.rpm$/\1.x86_64/p' | tail -n 1)" elif [ "${{ matrix.distro.name }}" = debian ] ; then KERNEL_VER="$(LANG=C dpkg --status linux-headers-amd64 | sed -n 's/^Depends: linux-headers-\(\S\+\)\( .*\)\?/\1/p' | head -n 1)" elif [ "${{ matrix.distro.name }}" = ubuntu ] ; then KERNEL_VER="$(LANG=C dpkg --status linux-headers-generic | sed -n 's/^Depends: linux-headers-\(\S\+\)\( .*\)\?/\1/p' | head -n 1)" fi if [ -z "${KERNEL_VER}" ] ; then echo >&2 "Error: no kernel package found" exit 1 fi echo "Found packaged kernel ${KERNEL_VER}" echo "KERNEL_VER=${KERNEL_VER}" >> "$GITHUB_ENV" - name: Install dkms run: make install - name: Run tests run: | if [ "${{ matrix.distro.name }}" = alpine ] && [ "${{ matrix.distro.variant }}" = "-lts" ]; then ./run_test.sh --no-signing-tool else ./run_test.sh fi test-vm: name: Test in Ubuntu VM strategy: matrix: version: - 22.04 - 20.04 runs-on: ubuntu-${{ matrix.version }} steps: - uses: actions/checkout@v3 - name: Install dependencies run: | sudo apt-get update -q sudo apt-get install -qqy make - name: Install dkms run: sudo make install - name: Run tests run: sudo ./run_test.sh - name: Install the test module run: sudo dkms install test/dkms_test-1.0 - name: Load the test module run: sudo modprobe dkms_test - name: Remove the test module run: sudo dkms remove --all -m dkms_test -v 1.0 dkms-3.0.11/.gitignore000066400000000000000000000000271442250756100145270ustar00rootroot00000000000000dist/* *.o dkms dkms.8 dkms-3.0.11/COPYING000066400000000000000000000432541442250756100136030ustar00rootroot00000000000000 GNU GENERAL PUBLIC LICENSE Version 2, June 1991 Copyright (C) 1989, 1991 Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA Everyone is permitted to copy and distribute verbatim copies of this license document, but changing it is not allowed. Preamble The licenses for most software are designed to take away your freedom to share and change it. By contrast, the GNU General Public License is intended to guarantee your freedom to share and change free software--to make sure the software is free for all its users. This General Public License applies to most of the Free Software Foundation's software and to any other program whose authors commit to using it. (Some other Free Software Foundation software is covered by the GNU Lesser General Public License instead.) You can apply it to your programs, too. When we speak of free software, we are referring to freedom, not price. Our General Public Licenses are designed to make sure that you have the freedom to distribute copies of free software (and charge for this service if you wish), that you receive source code or can get it if you want it, that you can change the software or use pieces of it in new free programs; and that you know you can do these things. To protect your rights, we need to make restrictions that forbid anyone to deny you these rights or to ask you to surrender the rights. These restrictions translate to certain responsibilities for you if you distribute copies of the software, or if you modify it. For example, if you distribute copies of such a program, whether gratis or for a fee, you must give the recipients all the rights that you have. You must make sure that they, too, receive or can get the source code. And you must show them these terms so they know their rights. We protect your rights with two steps: (1) copyright the software, and (2) offer you this license which gives you legal permission to copy, distribute and/or modify the software. Also, for each author's protection and ours, we want to make certain that everyone understands that there is no warranty for this free software. If the software is modified by someone else and passed on, we want its recipients to know that what they have is not the original, so that any problems introduced by others will not reflect on the original authors' reputations. Finally, any free program is threatened constantly by software patents. We wish to avoid the danger that redistributors of a free program will individually obtain patent licenses, in effect making the program proprietary. To prevent this, we have made it clear that any patent must be licensed for everyone's free use or not licensed at all. The precise terms and conditions for copying, distribution and modification follow. GNU GENERAL PUBLIC LICENSE TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION 0. This License applies to any program or other work which contains a notice placed by the copyright holder saying it may be distributed under the terms of this General Public License. The "Program", below, refers to any such program or work, and a "work based on the Program" means either the Program or any derivative work under copyright law: that is to say, a work containing the Program or a portion of it, either verbatim or with modifications and/or translated into another language. (Hereinafter, translation is included without limitation in the term "modification".) Each licensee is addressed as "you". Activities other than copying, distribution and modification are not covered by this License; they are outside its scope. The act of running the Program is not restricted, and the output from the Program is covered only if its contents constitute a work based on the Program (independent of having been made by running the Program). Whether that is true depends on what the Program does. 1. You may copy and distribute verbatim copies of the Program's source code as you receive it, in any medium, provided that you conspicuously and appropriately publish on each copy an appropriate copyright notice and disclaimer of warranty; keep intact all the notices that refer to this License and to the absence of any warranty; and give any other recipients of the Program a copy of this License along with the Program. You may charge a fee for the physical act of transferring a copy, and you may at your option offer warranty protection in exchange for a fee. 2. You may modify your copy or copies of the Program or any portion of it, thus forming a work based on the Program, and copy and distribute such modifications or work under the terms of Section 1 above, provided that you also meet all of these conditions: a) You must cause the modified files to carry prominent notices stating that you changed the files and the date of any change. b) You must cause any work that you distribute or publish, that in whole or in part contains or is derived from the Program or any part thereof, to be licensed as a whole at no charge to all third parties under the terms of this License. c) If the modified program normally reads commands interactively when run, you must cause it, when started running for such interactive use in the most ordinary way, to print or display an announcement including an appropriate copyright notice and a notice that there is no warranty (or else, saying that you provide a warranty) and that users may redistribute the program under these conditions, and telling the user how to view a copy of this License. (Exception: if the Program itself is interactive but does not normally print such an announcement, your work based on the Program is not required to print an announcement.) These requirements apply to the modified work as a whole. If identifiable sections of that work are not derived from the Program, and can be reasonably considered independent and separate works in themselves, then this License, and its terms, do not apply to those sections when you distribute them as separate works. But when you distribute the same sections as part of a whole which is a work based on the Program, the distribution of the whole must be on the terms of this License, whose permissions for other licensees extend to the entire whole, and thus to each and every part regardless of who wrote it. Thus, it is not the intent of this section to claim rights or contest your rights to work written entirely by you; rather, the intent is to exercise the right to control the distribution of derivative or collective works based on the Program. In addition, mere aggregation of another work not based on the Program with the Program (or with a work based on the Program) on a volume of a storage or distribution medium does not bring the other work under the scope of this License. 3. You may copy and distribute the Program (or a work based on it, under Section 2) in object code or executable form under the terms of Sections 1 and 2 above provided that you also do one of the following: a) Accompany it with the complete corresponding machine-readable source code, which must be distributed under the terms of Sections 1 and 2 above on a medium customarily used for software interchange; or, b) Accompany it with a written offer, valid for at least three years, to give any third party, for a charge no more than your cost of physically performing source distribution, a complete machine-readable copy of the corresponding source code, to be distributed under the terms of Sections 1 and 2 above on a medium customarily used for software interchange; or, c) Accompany it with the information you received as to the offer to distribute corresponding source code. (This alternative is allowed only for noncommercial distribution and only if you received the program in object code or executable form with such an offer, in accord with Subsection b above.) The source code for a work means the preferred form of the work for making modifications to it. For an executable work, complete source code means all the source code for all modules it contains, plus any associated interface definition files, plus the scripts used to control compilation and installation of the executable. However, as a special exception, the source code distributed need not include anything that is normally distributed (in either source or binary form) with the major components (compiler, kernel, and so on) of the operating system on which the executable runs, unless that component itself accompanies the executable. If distribution of executable or object code is made by offering access to copy from a designated place, then offering equivalent access to copy the source code from the same place counts as distribution of the source code, even though third parties are not compelled to copy the source along with the object code. 4. You may not copy, modify, sublicense, or distribute the Program except as expressly provided under this License. Any attempt otherwise to copy, modify, sublicense or distribute the Program is void, and will automatically terminate your rights under this License. However, parties who have received copies, or rights, from you under this License will not have their licenses terminated so long as such parties remain in full compliance. 5. You are not required to accept this License, since you have not signed it. However, nothing else grants you permission to modify or distribute the Program or its derivative works. These actions are prohibited by law if you do not accept this License. Therefore, by modifying or distributing the Program (or any work based on the Program), you indicate your acceptance of this License to do so, and all its terms and conditions for copying, distributing or modifying the Program or works based on it. 6. Each time you redistribute the Program (or any work based on the Program), the recipient automatically receives a license from the original licensor to copy, distribute or modify the Program subject to these terms and conditions. You may not impose any further restrictions on the recipients' exercise of the rights granted herein. You are not responsible for enforcing compliance by third parties to this License. 7. If, as a consequence of a court judgment or allegation of patent infringement or for any other reason (not limited to patent issues), conditions are imposed on you (whether by court order, agreement or otherwise) that contradict the conditions of this License, they do not excuse you from the conditions of this License. If you cannot distribute so as to satisfy simultaneously your obligations under this License and any other pertinent obligations, then as a consequence you may not distribute the Program at all. For example, if a patent license would not permit royalty-free redistribution of the Program by all those who receive copies directly or indirectly through you, then the only way you could satisfy both it and this License would be to refrain entirely from distribution of the Program. If any portion of this section is held invalid or unenforceable under any particular circumstance, the balance of the section is intended to apply and the section as a whole is intended to apply in other circumstances. It is not the purpose of this section to induce you to infringe any patents or other property right claims or to contest validity of any such claims; this section has the sole purpose of protecting the integrity of the free software distribution system, which is implemented by public license practices. Many people have made generous contributions to the wide range of software distributed through that system in reliance on consistent application of that system; it is up to the author/donor to decide if he or she is willing to distribute software through any other system and a licensee cannot impose that choice. This section is intended to make thoroughly clear what is believed to be a consequence of the rest of this License. 8. If the distribution and/or use of the Program is restricted in certain countries either by patents or by copyrighted interfaces, the original copyright holder who places the Program under this License may add an explicit geographical distribution limitation excluding those countries, so that distribution is permitted only in or among countries not thus excluded. In such case, this License incorporates the limitation as if written in the body of this License. 9. The Free Software Foundation may publish revised and/or new versions of the General Public License from time to time. Such new versions will be similar in spirit to the present version, but may differ in detail to address new problems or concerns. Each version is given a distinguishing version number. If the Program specifies a version number of this License which applies to it and "any later version", you have the option of following the terms and conditions either of that version or of any later version published by the Free Software Foundation. If the Program does not specify a version number of this License, you may choose any version ever published by the Free Software Foundation. 10. If you wish to incorporate parts of the Program into other free programs whose distribution conditions are different, write to the author to ask for permission. For software which is copyrighted by the Free Software Foundation, write to the Free Software Foundation; we sometimes make exceptions for this. Our decision will be guided by the two goals of preserving the free status of all derivatives of our free software and of promoting the sharing and reuse of software generally. NO WARRANTY 11. BECAUSE THE PROGRAM IS LICENSED FREE OF CHARGE, THERE IS NO WARRANTY FOR THE PROGRAM, TO THE EXTENT PERMITTED BY APPLICABLE LAW. EXCEPT WHEN OTHERWISE STATED IN WRITING THE COPYRIGHT HOLDERS AND/OR OTHER PARTIES PROVIDE THE PROGRAM "AS IS" WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. THE ENTIRE RISK AS TO THE QUALITY AND PERFORMANCE OF THE PROGRAM IS WITH YOU. SHOULD THE PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF ALL NECESSARY SERVICING, REPAIR OR CORRECTION. 12. IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MAY MODIFY AND/OR REDISTRIBUTE THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES, INCLUDING ANY GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING OUT OF THE USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED TO LOSS OF DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY YOU OR THIRD PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER PROGRAMS), EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGES. END OF TERMS AND CONDITIONS How to Apply These Terms to Your New Programs If you develop a new program, and you want it to be of the greatest possible use to the public, the best way to achieve this is to make it free software which everyone can redistribute and change under these terms. To do so, attach the following notices to the program. It is safest to attach them to the start of each source file to most effectively convey the exclusion of warranty; and each file should have at least the "copyright" line and a pointer to where the full notice is found. Copyright (C) This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with this program; if not, write to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. Also add information on how to contact you by electronic and paper mail. If the program is interactive, make it output a short notice like this when it starts in an interactive mode: Gnomovision version 69, Copyright (C) year name of author Gnomovision comes with ABSOLUTELY NO WARRANTY; for details type `show w'. This is free software, and you are welcome to redistribute it under certain conditions; type `show c' for details. The hypothetical commands `show w' and `show c' should show the appropriate parts of the General Public License. Of course, the commands you use may be called something other than `show w' and `show c'; they could even be mouse-clicks or menu items--whatever suits your program. You should also get your employer (if you work as a programmer) or your school, if any, to sign a "copyright disclaimer" for the program, if necessary. Here is a sample; alter the names: Yoyodyne, Inc., hereby disclaims all copyright interest in the program `Gnomovision' (which makes passes at compilers) written by James Hacker. , 1 April 1989 Ty Coon, President of Vice This General Public License does not permit incorporating your program into proprietary programs. If your program is a subroutine library, you may consider it more useful to permit linking proprietary applications with the library. If this is what you want to do, use the GNU Lesser General Public License instead of this License. dkms-3.0.11/Makefile000066400000000000000000000044061442250756100142040ustar00rootroot00000000000000RELEASE_DATE := "27 April 2023" RELEASE_MAJOR := 3 RELEASE_MINOR := 0 RELEASE_MICRO := 11 RELEASE_NAME := dkms RELEASE_VERSION := $(RELEASE_MAJOR).$(RELEASE_MINOR).$(RELEASE_MICRO) RELEASE_STRING := $(RELEASE_NAME)-$(RELEASE_VERSION) DIST := unstable SHELL=bash SBIN = $(DESTDIR)/usr/sbin ETC = $(DESTDIR)/etc/dkms VAR = $(DESTDIR)/var/lib/dkms MAN = $(DESTDIR)/usr/share/man/man8 INITD = $(DESTDIR)/etc/rc.d/init.d LIBDIR = $(DESTDIR)/usr/lib/dkms BASHDIR = $(DESTDIR)/usr/share/bash-completion/completions KCONF = $(DESTDIR)/etc/kernel SHAREDIR = $(DESTDIR)/usr/share DOCDIR = $(SHAREDIR)/doc/dkms SYSTEMD = $(DESTDIR)/usr/lib/systemd/system #Define the top-level build directory BUILDDIR := $(shell pwd) TOPDIR := $(shell pwd) .PHONY = tarball all: clean tarball clean: -rm -rf dist/ -rm -rf dkms -rm -rf dkms.8 dkms: dkms.in sed -e 's/#RELEASE_STRING#/$(RELEASE_STRING)/' $^ > $@ dkms.8: dkms.8.in sed -e 's/#RELEASE_STRING#/$(RELEASE_STRING)/' -e 's/#RELEASE_DATE#/$(RELEASE_DATE)/' $^ > $@ install: dkms dkms.8 mkdir -p $(VAR) install -D -m 0755 dkms_common.postinst $(LIBDIR)/common.postinst install -D -m 0755 dkms $(SBIN)/dkms install -D -m 0755 dkms_autoinstaller $(LIBDIR)/dkms_autoinstaller install -D -m 0644 dkms_framework.conf $(ETC)/framework.conf mkdir -p $(ETC)/framework.conf.d install -D -m 0644 dkms.bash-completion $(BASHDIR)/dkms install -D -m 0644 dkms.8 $(MAN)/dkms.8 install -D -m 0755 kernel_install.d_dkms $(KCONF)/install.d/dkms install -D -m 0755 kernel_postinst.d_dkms $(KCONF)/postinst.d/dkms install -D -m 0755 kernel_prerm.d_dkms $(KCONF)/prerm.d/dkms gzip -n -9 $(MAN)/dkms.8 install-redhat: install 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 install-debian: install install -D -m 0755 dkms_apport.py $(SHAREDIR)/apport/package-hooks/dkms_packages.py install -D -m 0755 kernel_postinst.d_dkms $(KCONF)/header_postinst.d/dkms install-doc: install -d -m 0644 COPYING $(DOCDIR) install -d -m 0644 README.md $(DOCDIR) TARBALL=$(BUILDDIR)/dist/$(RELEASE_STRING).tar.gz tarball: $(TARBALL) $(TARBALL): dkms dkms.8 mkdir -p $(@D) git archive --prefix=$(RELEASE_STRING)/ --add-file=dkms --add-file=dkms.8 -o $@ HEAD dkms-3.0.11/README.md000066400000000000000000000146761442250756100140350ustar00rootroot00000000000000Dynamic Kernel Module System (DKMS) == This intention of this README is to explain how DKMS can be used in conjunction with tarballs which contain a dkms.conf file within them. The DKMS project (and any updates) can be found at: https://github.com/dell/dkms Installation -- Installation is performed from the source directory with one of the following commands: ``` make install make install-debian make install-redhat ``` Distribution specific installations (RPM, DEB, etc.) are not contained in this source repository. Installation via DKMS Tarballs -- DKMS can install directly from the following: 1. Generic module source tarballs which contain a dkms.conf file 2. Specially created DKMS tarballs with module source, pre-built module binaries and a dkms.conf file 3. Specially created DKMS tarballs with pre-built module binaries and a dkms.conf file 4. Manual placement of module source and dkms.conf file into `/usr/src/-/` directory In order to load any tarball into the DKMS tree, you must use the following command: ``` # dkms ldtarball /path/to/dkms_enabled.tar.gz ``` This command will first inspect the tarball to ensure that it contains a dkms.conf configuration file for that module. If it cannot find this file anywhere within the archive, then the ldtarball will fail. From here, it will place the source in the tarball into `/usr/src/-/`. If source already exists in the directory, it will not overwrite it unless the --force option is specified. If the tarball is of type "c" above and does not contain source, it will only continue to load the tarball if existing module source is found in `/usr/src/-/` or if the --force option is specified. Continuing on, if the tarball is of type "b" or "c" it will then load any pre-built binaries found within the tarball into the dkms tree, but will stop short of installing them. Thus, all pre-built binaries will then be of in the *built* state when checked from the `dkms status` command. You can then use the `dkms install` command to install any of these binaries. To create a tarball of type "1" above, you need only to take module source and a dkms.conf file for that module and create a tarball from them. Tarballs of type *2* or type *3* are created with the `dkms mktarball` command. To create a type *3* tarball, you must specify the flag `--binaries-only` with the `mktarball`. Installation on Systems with no Module Source and/or Compiler -- If you choose not to load module source on your system or if you choose not to load a compiler such as gcc onto your system, DKMS can still be used to install modules. It does this through use of DKMS binary only tarballs as explained in this README under tarballs of type *c*. If your system does not have module source, loading the dkms tarball will fail because of this. To avoid this, use the --force flag, as such: ``` # dkms ldtarball /path/to/dkms_enabled.tar.gz --force ``` This will load the pre-built binaries into the dkms tree, and create the directory `/usr/src/-/` which will only contain the module's dkms.conf configuration file. Once the tarball is loaded, you can then use `dkms install` to install any of the pre-built modules. Of course, since module source will not be located in your dkms tree, you will not be able to build any modules with DKMS for this package. Module signing -- By default, DKMS generates a self signed certificate for signing modules at build time and signs every module that it builds before it gets compressed in the configured kernel compression mechanism of choice. This requires the `openssl` command to be present on the system. Private key and certificate are auto generated the first time DKMS is run and placed in `/var/lib/dkms`. These certificate files can be pre-populated with your own certificates of choice. The location as well can be changed by setting the appropriate variables in `/etc/dkms/framework.conf`. For example, to allow usage of the system default Ubuntu `update-secureboot-policy` set the configuration file as follows: ``` mok_signing_key="/var/lib/shim-signed/mok/MOK.priv" mok_certificate="/var/lib/shim-signed/mok/MOK.der" ``` The paths specified in `mok_signing_key`, `mok_certificate` and `sign_file` can use the variable `${kernelver}` to represent the target kernel version. ``` sign_file="/lib/modules/${kernelver}/build/scripts/sign-file" ``` The variable `mok_signing_key` can also be a `pkcs11:...` string for a [PKCS#11 engine](https://www.rfc-editor.org/rfc/rfc7512), as long as the `sign_file` program supports it. Secure Boot -- On an UEFI system with Secure Boot enabled, modules require signing (as described in the above paragraph) before they can be loaded and the firmware of the system must know the correct public certificate to verify the module signature. For importing the MOK certificate make sure `mokutil` is installed. To check if Secure Boot is enabled: ``` # mokutil --sb-state SecureBoot enabled ``` With the appropriate key material on the system, enroll the public key: ``` # mokutil --import /var/lib/dkms/mok.pub" ``` You'll be prompted to create a password. Enter it twice, it can also be blank. Reboot the computer. At boot you'll see the MOK Manager EFI interface: ![SHIM UEFI key management](/images/mok-key-1.png) Press any key to enter it, then select "Enroll MOK": ![Perform MOK management](/images/mok-key-2.png) Then select "Continue": ![Enroll MOK](/images/mok-key-3.png) And confirm with "Yes" when prompted: ![Enroll the key(s)?](/images/mok-key-4.png) After this, enter the password you set up with `mokutil --import` in the previous step: ![Enroll the key(s)?](/images/mok-key-5.png) At this point you are done, select "OK" and the computer will reboot trusting the key for your modules: ![Perform MOK management](/images/mok-key-6.png) After reboot, you can inspect the MOK certificates with the following command: ``` # mokutil --list-enrolled | grep DKMS Subject: CN=DKMS module signing key ``` To check the signature on a built DKMS module that is installed on a system: ``` # modinfo dkms_test | grep ^signer signer: DKMS module signing key ``` The module can now be loaded without issues. Further Documentation -- Once DKMS is installed, you can reference its man page for further information on different DKMS options and also to understand the formatting of a module's dkms.conf configuration file. The DKMS project is located at: https://github.com/dell/dkms dkms-3.0.11/dkms.8.in000066400000000000000000000733741442250756100142120ustar00rootroot00000000000000.\" -*- nroff -*- .\" .\" .SY, .YS, .OP macros from /usr/share/groff/1.21/tmac/an-ext.tmac .\" .\" Declare start of command synopsis. Sets up hanging indentation. .de SY . ie !\\n(mS \{\ . nh . nr mS 1 . nr mA \\n(.j . ad l . nr mI \\n(.i . \} . el \{\ . br . ns . \} . . HP \w'\fB\\$1\fP\ 'u . B "\\$1" .. . . .\" End of command synopsis. Restores adjustment. .de YS . in \\n(mIu . ad \\n(mA . hy \\n(HY . nr mS 0 .. . . .\" Declare optional option. .de OP . ie \\n(.$-1 \ . RI "[\fB\\$1\fP" "\ \\$2" "]" . el \ . RB "[" "\\$1" "]" .. .TH DKMS 8 #RELEASE_DATE# #RELEASE_STRING# .SH NAME dkms \- Dynamic Kernel Module Support .SH SYNOPSIS .SY dkms .OP action .OP options .OP module/module-version .OP /path/to/source-tree .OP /path/to/tarball.tar .OP /path/to/driver.rpm .YS .SH DESCRIPTION .B dkms is a framework which allows kernel modules to be dynamically built for each kernel on your system in a simplified and organized fashion. .SH ACTIONS .SY add .OP "module/module\-version | /path/to/source\-tree | /path/to/tarball.tar" .YS .IP "" 4 Adds a module/module\-version combination to the tree for builds and installs. If .IR module/module\-version , .IR "\-m module/module\-version" , or .I \-m module\ \-v module\-version are passed as options, this command requires source in .I /usr/src/\-/ as well as a properly formatted .I dkms.conf file. If .I /path/to/source\-tree is passed as an option, and source-tree contains a .I dkms.conf file, it will copy .I /path/to/source\-tree to .IR /usr/src/module\-module\-version . If .I /path/to/tarball.tar is passed, this command behaves like the .B ldtarball command. .SY remove .OP module/module\-version .OP -k kernel/arch .OP \-\-all .YS .IP "" 4 Removes a module/version or module/version/kernel/arch combination from the tree. If the module is currently installed, it first uninstalls it and if applicable, will replace it with its original_module. Use the .B \-\-all option in order to remove all instances for every kernel at once. .SY build .OP module/module\-version .OP -k kernel/arch .OP --force .YS .IP "" 4 Builds the specified module/version combo for the specified kernel/arch. If the .I \-k option is not specified it builds for the currently running kernel and arch. All builds occur in the directory .I /var/lib/dkms///build/. If the module/module\-version combo has not been added, dkms will try to add it, and in that case .B build can take the same arguments that .B add can. If the module is already built, it will not be rebuilt again by default, and the .B --force option should be used to override this. .SY unbuild .OP module/module\-version .OP -k kernel/arch .OP \-\-all .YS .IP "" 4 Undoes the build for a module/version or module/version/kernel/arch combination from the tree. If the module is currently installed, it first uninstalls it and if applicable, will replace it with its original_module. Finally all binary kernel modules are removed. Use the .B \-\-all option in order to remove all instances for every kernel at once. .SY install .OP module/module\-version .OP -k kernel/arch .OP --force .OP /path/to/driver.rpm .YS .IP "" 4 Installs a built module/version combo onto the kernel it was built for. If the kernel option is not specified it assumes the currently running kernel. If the module has not been built, dkms will try to build it. If the module has not been added, dkms will try to add it. In both cases, the .B install command can then take the same arguments as the .B build or .B add commands. If the module is already installed, it will not be reinstalled again by default, and the .B --force option should be used to override this. If you pass a .rpm file, dkms will try to install that file with .BR "rpm -Uvh" , and it will perform an .B autoinstall action to be sure that everything is built for your kernel if the RPM installed successfully. .SY uninstall .OP module/module\-version .OP -k kernel/arch .OP \-\-all .YS .IP "" 4 Uninstalls an installed module/module\-version combo from the kernel/arch passed in the -k option, or the current kernel if the -k option was not passed. Use the .B \-\-all option in order to uninstall all instances for every kernel at once. After uninstall completion, the driver will be left in the built state. To completely remove a driver, the remove action should be utilized. .SY match .OP --templatekernel kernel/arch .OP -k kernel/arch .YS .IP "" 4 Match installs modules onto the specified kernel by looking at the configuration of the specified .B templatekernel. Every module that is installed on the .B templatekernel within .B dkms is then installed on that specified kernel. .SY mktarball .OP module/module\-version .OP -k kernel/arch .OP --archive /path/to/tarball.tar .OP --source-only .OP --binaries-only .YS .IP "" 4 Creates a tarball archive for the specified module/version of all files in the DKMS tree for that module/version combination. This includes the source and any built modules for kernels in the tree (as specified). Otherwise, you can specify a singular kernel to archive only, or multiple kernels to archive (\-k kernel1/arch1 \-k kernel2/arch2). Optionally, you can use .B \-\-archive to specify the file that you would like to save this tarball to. You can also specify .B \-\-binaries\-only if you want the resultant tarball not to include the module source. Likewise, .B \-\-source-only can be used to specify that no prebuilt binaries should be included in the tarball. In general, .B mktarball is great for systems management purposes as you can build your driver on just one system and then use .B ldtarball on all of your other systems to get the same built modules loaded without having to wait for anything to compile. .SY ldtarball .OP /path/to/tarball.tar .OP --force .YS .IP "" 4 This takes a tarball made from the .B mktarball command and loads it into your DKMS tree. This will leave any newly added modules in the built state and .B dkms install should then be called to install any of them. If files already exist where .B ldtarball is attempting to place them, it will warn and not copy over them. The .B \-\-force option should be used to override this. .SY status .OP module/module\-version .OP -k kernel/arch .YS .IP "" 4 Returns the current status of modules, versions and kernels within the tree as well as whether they have been added, built or installed. Status can be shown for just a certain module, a certain kernel, a module/version combination or a module/version/kernel combination. .SY autoinstall .YS .IP "" 4 Attempt to install the latest revision of all modules that have been installed for other kernel revisions. dkms_autoinstaller is a stub that uses this action to perform its work. .SH OPTIONS .TP .B \-m / The name of the module and module version you want to operate on. The .B \-m part of this option is optional, and can be omitted in virtually all circumstances. .TP .B \-v The version of the module to execute the specified action upon. This option only has to be specified if you pass a .B \-m option without a component of its own. .TP .B \-k / The kernel and arch to perform the action upon. You can specify multiple kernel version/arch pairs on the command line by repeating the \-k argument with a different kernel version and arch. However, not all actions support multiple kernel versions (it will error out in this case). The arch part can be omitted, and DKMS will assume you want it to be the arch of the currently running system. .TP .B \-a, \-\-arch The system architecture to perform the action upon. It is optional if you pass it as part of the .B \-k option. If not specified, it assumes the arch of the currently running system (`uname \-m`). You can specify multiple arch parameters on the same command line by repeating the \-a argument with a different arch name. When multiple architectures are specified, there must be a 1:1 relationship between \-k arguments to \-a arguments. DKMS will then assume the first \-a argument aligns with the first \-k kernel and so on for the second, third, etc. For example, if you were to specify: \-k kernel1 \-k kernel2 \-a i386 \-k kernel3 \-a i686 \-a x86_64, DKMS would process this as: kernel1-i386, kernel2-i686, kernel3-x86_64. .TP .B \-q, \-\-quiet Quiet. .TP .B \-V, \-\-version Prints the currently installed version of dkms and exits. .TP .B \-c The location of the .I dkms.conf file. This is needed for the add action and if not specified, it is assumed to be located in .I /usr/src/\-/. See below for more information on the format of .I dkms.conf. .TP .B \-\-config During a .B build this option is used to specify an alternate location for the kernel .config file which was used to compile that kernel. Normally, .B dkms uses the Red Hat standard location and config filenames located in .I /usr/src/linux\-/configs/. If the config for the kernel that you are building a module for is not located here or does not have the expected name in this location, you will need to tell .B dkms where the necessary .config can be found so that your kernel can be properly prepared for the module build. .TP .B \-\-archive This option is used during a .B ldtarball action to specify the location of the tarball you wish to load into your DKMS tree. You only have to specify the .B --archive part of this option if does not already exist as a file. .TP .B \-\-templatekernel This option is required for the action: .B match. Match will look at the templatekernel specified and install all of the same module/version combinations on the other kernel. .TP .B \-\-force This option can be used in conjunction with .B ldtarball to force copying over of extant files. .TP .B \-\-binaries\-only This option can be used in conjunction with .B mktarball in order to create a DKMS tarball which does not contain the source for the module within it. This can be helpful in reducing the size of the tarball if you know that the system which this tarball will be loaded upon already has the source installed. In order to load a tarball made as binaries-only .B you must have the module source in that systems DKMS tree. If you do not, DKMS .B will refuse to load a binaries-only tarball. .TP .B \-\-source\-only This option can be used in conjunction with .B mktarball but do not want the tarball you create to have any prebuilt modules within it, passing this option will keep its internal DKMS tarball from containing any prebuilt modules. .TP .B \-\-all This option can be used to automatically specify all relevant kernels/arches for a module/module-version. This can be used for things like remove, unbuild and uninstall. 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\-depmod This option prevents DKMS from running the depmod command during .B install and .B uninstall which will avoid (re)calculating module dependencies and thereby save time. .TP .B \-\-modprobe\-on\-install This option executes modprobe on the modules upon successful installation. .TP .B \-\-kernelsourcedir Using this option you can specify the location of your kernel source directory. Most likely you will not need to set this if your kernel source is accessible via .I /lib/modules/$kernel_version/build. .TP .B \-\-directive <"cli\-directive=cli\-value"> Using this option, you can specify additional directives from the command line. The .B \-\-directive option can be used multiple times on the same command-line to specify multiple additional command line directives. .TP .B \-\-rpm_safe_upgrade This flag should be used when packaging DKMS enabled modules in RPMs. It should be specified during both the .B add 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. .TP .B \-\-dkmstree path/to/place Provides a destination tree for building and installing modules to. Useful in cases that you don't want to contaminate a system when using solely for building. .TP .B \-\-sourcetree path/to/place Provides a location to build a DKMS package from. Useful for systems that you may not have root access, but would still like to be able to build DKMS packages. .TP .B \-\-installtree path/to/place Provides a location to place modules when a .I dkms install command is issued. .TP .B \-j number Run no more than .I number jobs in parallel; see the -j option of .I make(1). Defaults to the number of CPUs in the system, detected by .I nproc(1). Specify 0 to impose no limit on the number of parallel jobs. .SH ORIGINAL MODULES During the first install of a module for a , .B dkms will search .I /lib/modules/ for a pre-existing module of the same name. If one is found, it will automatically be saved as an "original_module" so that if the newer module is later removed, .B dkms will put the original module back in its place. Currently, DKMS searches for these original modules with first preference going to modules located in .I /lib/modules//updates/ followed by .B $DEST_MODULE_LOCATION (as specified in .I dkms.conf ). If one cannot be found in either location, a find will be used to locate one for that kernel. If none are found, then during a later uninstall, your kernel will not have that module replaced. If more than one is found, then the first one located (by preference indicated above) will be considered the "original_module". As well, all copies of the same-named module will be removed from your kernel tree and placed into .I /var/lib/dkms//original_module/$kernelver/collisions so that they can be *manually* accessible later. DKMS will never actually do anything with the modules found underneath the /collisions directory, and they will be stored there until you manually delete them. .SH DKMS.CONF When performing an .BR add , a proper .I dkms.conf file must be found. A properly formatted conf file is essential for communicating to .B dkms how and where the module should be installed. While not all the directives are required, providing as many as possible helps to limit any ambiguity. Note that the .I dkms.conf is really only a shell\-script of variable definitions which are then sourced in by the .B dkms executable (of the format, DIRECTIVE="directive text goes here"). As well, the directives are case\-sensitive and should be given in .B ALL CAPS. 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 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[#] and STRIP[#]. When indexing these arrays when creating your dkms.conf, each family should start at index value 0. .TP .B PACKAGE_NAME= This directive is used to give the name associated with the entire package of modules. This is the same name that is used with the .B \-m option when building, adding, etc. and may not necessarily be the same as the MODULE_NAME. This directive must be present in every dkms.conf. .TP .B PACKAGE_VERSION= This directive is used to give the version associated with the entire package of modules being installed within that dkms package. This directive must be present in every dkms.conf. .TP .B BUILT_MODULE_NAME[#]= This directive gives the name of the module just after it is built. If your DKMS module package contains more than one module to install, this is a .B required directive for all of the modules. This directive should explicitly not contain any trailing ".o" or ".ko". Note that for each module within a dkms package, the numeric value of .B # must be the same for each of BUILT_MODULE_NAME, BUILT_MODULE_LOCATION, DEST_MODULE_NAME and DEST_MODULE_LOCATION and that the numbering should start at 0 (eg. BUILT_MODULE_NAME[0]="qla2200" BUILT_MODULE_NAME[1]="qla2300"). .TP .B BUILT_MODULE_LOCATION[#]= This directive tells DKMS where to find your built module after it has been built. This pathname should be given relative to the root directory of your source files (where your dkms.conf file can be found). If unset, DKMS expects to find your .B BUILT_MODULE_NAME[#] in the root directory of your source files. Note that for each module within a dkms package, the numeric value of .B # must be the same for each of BUILT_MODULE_NAME, BUILT_MODULE_LOCATION, DEST_MODULE_NAME and DEST_MODULE_LOCATION and that the numbering should start at 0 (eg. BUILT_MODULE_LOCATION[0]="some/dir/" BUILT_MODULE_LOCATION[1]="other/dir/"). .TP .B DEST_MODULE_NAME[#]= This directive can be used to specify the name of the module as it should be installed. This will rename the module from .B BUILT_MODULE_NAME[#] to .B DEST_MODULE_NAME[#]. This directive should explicitly not contain any trailing ".o" or ".ko". If unset, it is assumed to be the same value as .B BUILT_MODULE_NAME[#]. Note that for each module within a dkms package, the numeric value of .B # must be the same for each of BUILT_MODULE_NAME, BUILT_MODULE_LOCATION, DEST_MODULE_NAME and DEST_MODULE_LOCATION and that the numbering should start at 0 (eg. DEST_MODULE_NAME[0]="qla2200_6x" DEST_MODULE_NAME[1]="qla2300_6x"). .TP .B DEST_MODULE_LOCATION[#]= This directive specifies the destination where a module should be installed to, once compiled. It also is used for finding original_modules. This is a .B required directive, except as noted below. This directive must start with the text "/kernel" which is in reference to /lib/modules//kernel. Note that for each module within a dkms package, the numeric value of .B # must be the same for each of BUILT_MODULE_NAME, BUILT_MODULE_LOCATION, DEST_MODULE_NAME and DEST_MODULE_LOCATION and that the numbering should start at 0 (eg. DEST_MODULE_LOCATION[0]="/kernel/drivers/something/" 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 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. STRIP[0] is used as the default for any unset entries in the STRIP array. .TP .B MAKE[#]= The MAKE directive array tells DKMS which make command should be used for building your module. The default make command should be put into .B MAKE[0]. Other entries in the MAKE array will only be used if their corresponding entry in .B MAKE_MATCH[#] matches, as a regular expression (using grep -E), the kernel that the module is being built for. Note that if no value is placed in .B MAKE_MATCH[#] for any .B MAKE[#] where # > 0, then that .B MAKE directive is ignored. .B MAKE_MATCH[0] is optional and if it is populated, it will be used to determine if MAKE[0] should be used to build the module for that kernel. If multiple .B MAKE_MATCH directives match against the kernel being built for, the last matching .B MAKE[#] will be used to build your module. If no MAKE directive is specified or if no MAKE_MATCH matches the kernel being built for, DKMS will attempt to use a generic MAKE command to build your module. KERNELRELEASE will be automatically appended to MAKE[#]. If you want to suppress this behavior, you can quote the make command: 'make'. .TP .B MAKE_MATCH[#]= See the above entry on .B MAKE[#] directives. This array should be populated with regular expressions which, when matched against the kernel being built for, will tell .B DKMS to use the corresponding make command in the .B MAKE[#] directive array to build your module. .TP .B CLEAN= 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 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 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 bump of a kernel. For example, "2.6.24" would be an upstream kernel and "2.6.24\-16" would represent an ABI bump for a kernel. Both are valid in this area. Please avoid the use of .B OBSOLETE_BY wherever possible. It's use indicates a lack of proper module versioning using .B MODULE_VERSION() tags in the module source itself. It is better to fix the .B MODULE_VERSION() tags than use .B OBSOLETE_BY. This also introduces a implicit distribution/version dependency on the package, as the value of .B OBSOLETE_BY is meaningful only in the context of a single distribution/version. If you feel you must use it, please use as such in dkms.conf: ubuntu_804="Ubuntu 8.04" if [ \-x /usr/bin/lsb_release ]; then if [ "$(/usr/bin/lsb_release \-sir)" == "${ubuntu_804}" ]; then OBSOLETE_BY="2.6.25" fi fi .TP .B PATCH[#]= Use the PATCH directive array to specify patches which should be applied to your source before a build occurs. All patches are expected to be in \-p1 format and are applied with the patch \-p1 command. Each directive should specify the filename of the patch to apply, and all patches must be located in the patches subdirectory of your source directory ( .I /usr/src/\-/patches/ ). If any patch fails to apply, the build will be halted and the rejections can be inspected in .I /var/lib/dkms///build/. If a PATCH should only be applied conditionally, the .B PATCH_MATCH[#] array should be used, and a corresponding regular expression should be placed in .B PATCH_MATCH[#] which will alert dkms to only use that .B PATCH[#] if the regular expression matches the kernel which the module is currently being built for. .TP .B PATCH_MATCH[#]= See the above description for .B PATCH[#] directives. If you only want a patch applied in certain scenarios, the .B PATCH_MATCH array should be utilized by giving a regular expression which matches the kernels you intend the corresponding .B PATCH[#] to be applied to before building that module. .TP .B AUTOINSTALL= If this directive is set to .B yes then the service .I /etc/rc.d/init.d/dkms_autoinstaller will automatically try to install this module on any kernel you boot into. See the section on .B dkms_autoinstaller for more information. .TP .B BUILD_DEPENDS[#]= This optional directive is an array that allows you to specify other modules as dependencies for your module. Each array element should be the .B PACKAGE_NAME of another module that is managed by dkms. Do not specify a version or architecture in the dependency. Note that this directive is only advisory; missing or broken dependencies cause non-fatal warnings. .TP .B BUILD_EXCLUSIVE_KERNEL= This optional directive allows you to specify a regular expression which defines the subset of kernels which DKMS is allowed to build your module for. If the kernel being built for does not match against this regular expression (or does not the satisfy the constraints of any other .B BUILD_EXCLUSIVE_* directive), the dkms build will error out with exit code 77. Note that dkms autoinstall will ignore this type of error condition and simply skip the respective modules. For example, if you set it as ="^2\.4.*", your module would not be built for 2.6 or later kernels. .TP .B BUILD_EXCLUSIVE_KERNEL_MIN= and .B BUILD_EXCLUSIVE_KERNEL_MAX= These optional directives allow one to specify the minimal and maximal kernel versions supported by the module. If one (or both) of these are defined, the module will not be built for kernels outside the specified version limits. For example, if you set .B BUILD_EXCLUSIVE_KERNEL_MIN as "=3.5", your module would be built for e.g. "3.5-rc2", "3.6.18" or other later versions but not for "3.4.999" or earlier kernels. Similarly, if you set .B BUILD_EXCLUSIVE_KERNEL_MAX as ="4.12", your module would be built for e.g. "4.11.999", "3.9-rc5" or other earlier versions, but not for "4.12-rc1" or later kernels. .TP .B BUILD_EXCLUSIVE_ARCH= This optional directive functions very similarly to .B BUILD_EXCLUSIVE_KERNEL except that it matches against the kernel architecture. For example, if you set it to ="i.86", your module would not be built for ia32e, x86_64, amd64, s390, etc. .TP .B BUILD_EXCLUSIVE_CONFIG= This optional directive allows you to specify a space separated list of kernel configuration options ("CONFIG_FOO") that must be enabled in the targeted kernels ".config" file (either to be compiled in or to be built as a module) or absent (if prefixed with an exclamation mark, e.g. "!CONFIG_BAR") in order to build the module. For example, if you set it as ="CONFIG_PCI !CONFIG_PREEMPT_RT", your module would only be built for kernels that have PCI enabled, but the RT patchset disabled. .TP .B POST_ADD= The name of the script to be run after an .B add is performed. The path should be given relative to the root directory of your source. .TP .B POST_BUILD= The name of the script to be run after a .B build is performed. The path should be given relative to the root directory of your source. .TP .B POST_INSTALL= The name of the script to be run after an .B install is performed. The path should be given relative to the root directory of your source. .TP .B POST_REMOVE= The name of the script to be run after a .B remove is performed. The path should be given relative to the root directory of your source. .TP .B PRE_BUILD= The name of the script to be run before a .B build is performed. The path should be given relative to the root directory of your source. .TP .B PRE_INSTALL= The name of the script to be run before an .B install is performed. The path should be given relative to the root directory of your source. If the script exits with a non\-zero value, the install will be aborted. This is typically used to perform a custom version comparison. .TP .SH DKMS.CONF VARIABLES Within your .I dkms.conf file, you can use certain variables which will be replaced at run\-time with their values. .TP .B $kernelver This variable can be used within a directive definition and during use, the actual kernel version in question will be substituted in its place. This is especially useful in MAKE commands when specifying which INCLUDE statements should be used when compiling your module (eg. MAKE="make all INCLUDEDIR=/lib/modules/${kernelver}/build/include"). .TP .B $kernel_source_dir This variable holds the value of the location of your kernel source directory. Usually, this will be .IR /lib/modules/$kernelver/build , unless otherwise specified with the .B \-\-kernelsourcedir option. .SH DKMS.CONF OVERRIDES You can override the module-provided .I dkms.conf files. Every time after a dkms.conf file is read, dkms will look for and read the following files in order: .PP .I /etc/dkms/.conf .br .I /etc/dkms/\-.conf .br .I /etc/dkms/\-\-.conf .br .I /etc/dkms/\-\-\-.conf .PP You can use these files to override settings in the module-provided dkms.conf files. .SH /etc/dkms/framework.conf This configuration file controls how the overall DKMS framework handles. It is sourced in every time the dkms command is run. Mainly it can currently be used to set different default values for the variables. The file contains descriptions for each directive it supports. Additionally to /etc/dkms/framework.conf, .B any file matching the glob /etc/dkms/framework.conf.d/*.conf will be loaded as well. .TP .B $dkms_tree, $source_tree, $install_tree, $tmp_location Control which folders DKMS uses for components and artifacts. .TP .B $verbose Can be set to anything but a null value to enable verbose output in DKMS. .TP .B $symlink_modules Controls whether binary modules are copied to /lib/modules or if only symlinks are created there. Note that these variables can also be manipulated on the command line with \-\-dkmstree, \-\-sourcetree, \-\-installtree and \-\-symlink-modules options. .TP .B $autoinstall_all_kernels Used by the common postinst for DKMS modules. It controls if the build should be done for all installed kernels or only for the current and latest installed kernel. It has no command line equivalent. .TP .B $sign_file This is the path of the .I sign-file kernel binary that is used to sign the kernel modules. The variable .B $kernelver can be used in path to represent the target kernel version. The path for the binary depends on the distribution. .TP .B $mok_signing_key, $mok_certificate Location of the key and certificate files used for Secure boot. The variable .B $kernelver can be used in path to represent the target kernel version. .I mok_signing_key can also be a "pkcs11:..." string for PKCS#11 engine, as long as the sign_file program supports it. .TP .B $modprobe_on_install Automatically load the built modules upon successful installation. .SH dkms_autoinstaller This boot\-time service automatically installs any module which has .B AUTOINSTALL="yes" set in its .B dkms.conf 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 AUTHOR Gary Lerhaupt, Emil Velikov, Simone Caronni, Xu Zhen .SH WEBPAGE .I https://github.com/dell/dkms dkms-3.0.11/dkms.bash-completion000066400000000000000000000042221442250756100165040ustar00rootroot00000000000000# bash completion for dkms # Copied from the Mandriva dkms package # This function complete on available kernels # _kernels() { COMPREPLY=( $( cd /lib/modules && compgen -d -- "$cur" ) ) } # complete on full directory names under $1 _subdirectories() { COMPREPLY=( $( cd $1 && compgen -d -- "$cur" ) ) } # complete on $2 part of filenames matching pattern $1 under /usr/src _filename_parts() { COMPREPLY=( $( command ls -F /usr/src/ 2>/dev/null | grep -E '^'$1'/$' \ | sed -r -e 's/^([^-]+)-(.+)\/$/\'$2'/' | grep "^$cur" ) ) } _dkms() { local cur prev command module i COMPREPLY=() cur=${COMP_WORDS[COMP_CWORD]} if [[ $COMP_CWORD -eq 1 ]] ; then COMPREPLY=( $( compgen -W "add autoinstall remove build unbuild install uninstall \ match mktarball ldtarball \ status" -- $cur ) ) else prev=${COMP_WORDS[COMP_CWORD-1]} command=${COMP_WORDS[1]} case $prev in -m) if [ "$command" = 'add' ]; then _filename_parts '.*-.*' 1 else _subdirectories /var/lib/dkms fi return 0 ;; -v) for (( i=1; i < COMP_CWORD; i++ )); do if [[ "${COMP_WORDS[i]}" == -m ]]; then module=${COMP_WORDS[i+1]} break fi done if [ -n "$module" ]; then if [ "$command" = 'add' ]; then _filename_parts "$module-.*" 2 else _subdirectories /var/lib/dkms/$module fi return 0 fi ;; -k) _kernels return 0 ;; -@\(c|-spec|-archive|-config\)) _filedir return 0 ;; --kernelsourcedir) _filedir -d return 0 ;; esac if [[ "$cur" == -* ]]; then case $command in add) options='-c --rpm_safe_upgrade' ;; remove) options='--rpm_safe_upgrade' ;; build) options='--config --force' ;; install) options='--force' ;; ldtarball) options='--archive --force' ;; mktarball) options='--source-only --binaries-only' ;; match) options='--templatekernel' ;; esac options="$options -m -v -k -a --arch -q --quiet -V \ --version --all --kernelsourcedir \ --directive" COMPREPLY=( $( compgen -W "$options" -- $cur ) ) fi fi } complete -F _dkms dkms dkms-3.0.11/dkms.in000066400000000000000000002674031442250756100140420ustar00rootroot00000000000000#!/bin/bash # # Dynamic Kernel Module Support (DKMS) # Copyright (C) 2003-2008 Dell, Inc. # by Gary Lerhaupt, Matt Domsch, & Mario Limonciello # Copyright (C) 2012 by Darik Horn # # This program is free software; you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by # the Free Software Foundation; either version 2 of the License, or # (at your option) any later version. # # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the # GNU General Public License for more details. # # You should have received a copy of the GNU General Public License # along with this program; if not, write to the Free Software # Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA # shopt -s extglob # All of the variables we will accept from dkms.conf. # Does not include directives # 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_ARCH BUILD_EXCLUSIVE_CONFIG BUILD_EXCLUSIVE_KERNEL BUILD_EXCLUSIVE_KERNEL_MIN BUILD_EXCLUSIVE_KERNEL_MAX 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 DEST_MODULE_LOCATION dest_module_location STRIP strip AUTOINSTALL NO_WEAK_MODULES SIGN_FILE MOK_SIGNING_KEY MOK_CERTIFICATE REMAKE_INITRD MODULES_CONF MODULES_CONF_OBSOLETES MODULES_CONF_ALIAS_TYPE MODULES_CONF_OBSOLETE_ONLY" # All of the variables not related to signing we will accept from framework.conf. readonly dkms_framework_nonsigning_variables="source_tree dkms_tree install_tree tmp_location verbose symlink_modules autoinstall_all_kernels modprobe_on_install" # All of the signing related variables we will accept from framework.conf. readonly dkms_framework_signing_variables="sign_file mok_signing_key mok_certificate" # Some important regular expressions. Requires bash 3 or above. # Any poor souls still running bash 2 or older really need an upgrade. readonly mv_re='^([^/]*)/(.*)$' # Areas that will vary between Linux and other OS's _get_kernel_dir() { if [[ -z $ksourcedir_fromcli ]]; then KVER=$1 case ${current_os} in Linux) DIR="/lib/modules/$KVER/build" ;; GNU/kFreeBSD) DIR="/usr/src/kfreebsd-headers-$KVER/sys" ;; esac echo $DIR else echo $kernel_source_dir fi } _check_kernel_dir() { DIR=$(_get_kernel_dir $1) case ${current_os} in Linux) test -e $DIR/include ;; GNU/kFreeBSD) test -e $DIR/kern && test -e $DIR/conf/kmod.mk ;; *) return 1 ;; esac return $? } # Run a command that we may or may not want to be detailed about. invoke_command() { # $1 = command to be executed using eval. # $2 = Description of command to run # $3 = 'background' if you want to run the command asynchronously. local exitval=0 [[ $verbose ]] && echo -e "$1" || echo -en "$2..." if [[ $3 = background && ! $verbose ]]; then local pid progresspid (eval "$1" >/dev/null 2>&1) & pid=$! { on_exit() { kill $(jobs -p) 2>/dev/null wait $(jobs -p) 2>/dev/null } trap on_exit EXIT while [ -d /proc/$pid ]; do sleep 3 & wait $! echo -en "." done } & progresspid=$! wait $pid 2>/dev/null exitval=$? kill $progresspid 2>/dev/null wait $progresspid 2>/dev/null else eval "$1"; exitval=$? fi (($exitval > 0)) && echo -en "(bad exit status: $exitval)" echo -en "\n" return $exitval } error() ( exec >&2 echo -n $"Error! " for s in "$@"; do echo "$s"; done ) warn() ( exec >&2 echo -n $"Warning: " for s in "$@"; do echo "$s"; done ) deprecated() ( exec >&2 echo -n $"Deprecated feature: " for s in "$@"; do echo "$s"; done ) # Print an error message and die with the passed error code. die() { # $1 = error code to return with # rest = strings to print before we exit. ret=$1 shift error "$@" [[ $die_is_fatal = yes ]] && exit $ret || return $ret } mktemp_or_die() { local t t=$(mktemp "$@") && echo "$t" && return [[ $* = *-d* ]] && die 1 $"Unable to make temporary directory" die 1 "Unable to make temporary file." } show_usage() { echo $"Usage: $0 [action] [options]" echo $" [action] = { add | remove | build | install | uninstall | match | autoinstall |" echo $" mktarball | ldtarball | status }" echo $" [options] = [-m module] [-v module-version] [-k kernel-version] [-a arch]" 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]" echo $" [--binaries-only] [--source-only] [--verbose]" echo $" [--no-depmod] [--modprobe-on-install] [-j number] [--version]" } VER() { # $1 = kernel version string # Pad all numbers in $1 so that they have at least three digits, e.g., # 2.6.9-1cvs200409091247 => 002.006.009-001cvs200409091247 # The result should compare correctly as a string. echo $1 | sed -e 's:\([^0-9]\)\([0-9]\):\1 \2:g' \ -e 's:\([0-9]\)\([^0-9]\):\1 \2:g' \ -e 's:\(.*\): \1 :' \ -e 's: \([0-9]\) : 00\1 :g' \ -e 's: \([0-9][0-9]\) : 0\1 :g' \ -e 's: ::g' } # Find out how many CPUs there are so that we may pass an appropriate -j # option to make. Ignore hyperthreading for now. get_num_cpus() { # use nproc(1) from coreutils 8.1-1+ if available, otherwise single job if [ -x /usr/bin/nproc ]; then nproc else echo "1" fi } # Finds a .ko or .ko.xz based on a directory and module name # must call set_module_suffix first compressed_or_uncompressed() { # module dir = $1 # module = $2 local test1="$1/$2$module_uncompressed_suffix" local test2="$1/$2$module_uncompressed_suffix$module_compressed_suffix" if [[ -e "$test1" ]]; then echo "$test1" elif [[ -e "$test2" ]]; then echo "$test2" fi } # Finds .ko or .ko.xz based on a tree and module name # must call set_module_suffix first find_module() { # tree = $1 # module = $2 find "$1" -name "$2$module_uncompressed_suffix" -o -name "$2$module_suffix" -type f return $? } # Figure out the correct module suffix for the kernel we are currently # dealing with, which may or may not be the currently installed kernel. set_module_suffix() { # $1 = the kernel to base the module_suffix on kernel_test="${1:-$(uname -r)}" module_uncompressed_suffix=".ko" 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" module_suffix="$module_uncompressed_suffix$module_compressed_suffix" } set_kernel_source_dir_and_kconfig() { if [[ -z "${ksourcedir_fromcli}" ]]; then # $1 = the kernel to base the directory on kernel_source_dir="$(_get_kernel_dir "$1")" fi if [[ -z "${kconfig_fromcli}" ]]; then kernel_config="${kernel_source_dir}/.config" fi } check_all_is_banned() { if [[ $all ]]; then die 5 $"The action $1 does not support the --all parameter." fi } # A little test function for DKMS commands that only work on one kernel. have_one_kernel() { if (( ${#kernelver[@]} != 1 )); then die 4 $"The action $1 does not support multiple kernel version parameters on the command line." fi check_all_is_banned $1 } # Set up the kernelver and arch arrays. You must have a 1:1 correspondence -- # if there is an entry in kernelver[$i], there must also be an entry in arch[$i] # Note the special casing for the status action -- the status functions just # report on what we already have, and will break with the preprocessing that # this function provides. setup_kernels_arches() { # If all is set, use dkms status to fill the arrays if [[ $all && $1 != status ]]; then local i=0 while read line; do line=${line#*/}; line=${line#*/}; # (I would leave out the delimiters in the status output # in the first place.) kernelver[$i]=${line%/*} arch[$i]=${line#*/} i=$(($i + 1)) done < <(module_status_built "$module" "$module_version" | sort -V) fi # Set default kernel version and arch, if none set (but only --all isn't set) if [[ $1 != status ]]; then if [[ ! $kernelver && ! $all ]]; then kernelver[0]=$(uname -r) fi if [[ ! $arch ]]; then kernelver_rpm=$(rpm -qf "/lib/modules/$kernelver" 2>/dev/null | \ grep -v "not owned by any package" | grep kernel | head -n 1) if ! arch[0]=$(rpm -q --queryformat "%{ARCH}" "$kernelver_rpm" 2>/dev/null); then arch[0]=$(uname -m) if [[ $arch = x86_64 ]] && grep -q Intel /proc/cpuinfo && ls $install_tree/$kernelver/build/configs 2>/dev/null | grep -q "ia32e"; then arch[0]="ia32e" fi fi fi fi # If only one arch is specified, make it so for all the kernels if ((${#arch[@]} == 1 && ${#kernelver[@]} > 1)); then while ((${#arch[@]} < ${#kernelver[@]})); do arch[${#arch[@]}]=$arch done fi # Set global multi_arch multi_arch="" local i=0 for ((i=0; $i < ${#arch[@]}; i++)); do [[ $arch != ${arch[$i]} ]] && { multi_arch="true" break } done } do_depmod() { if [[ $no_depmod ]]; then return fi # $1 = kernel version if [ "${current_os}" != "Linux" ] ; then return fi if [[ -f /boot/System.map-$1 ]]; then depmod -a "$1" -F "/boot/System.map-$1" else depmod -a "$1" fi } # Grab distro information from os-release. # Falls back to LSB for compliant distros. distro_version() { if [[ -r /etc/os-release ]]; then . /etc/os-release if [[ "$ID" = "ubuntu" ]]; then # ID_LIKE=debian in ubuntu echo $ID elif [[ ${#ID_LIKE[@]} != 0 ]]; then echo ${ID_LIKE[0]} else echo $ID fi return fi 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) fi case ${DISTRIB_ID} in Fedora) echo fedora ;; RedHatEnterprise*|CentOS|ScientificSL) echo rhel ;; SUSE*) echo sles ;; *) if [[ ${DISTRIB_ID} ]]; then echo "${DISTRIB_ID}" else echo unknown fi ;; esac } override_dest_module_location() { local orig_location="$1" [[ ${addon_modules_dir} ]] && echo "/${addon_modules_dir}" && return if [ "$current_os" = "GNU/kFreeBSD" ] ; then # Does not support subdirs, regardless of distribution echo "" && return fi case "$running_distribution" in fedora* | rhel* | ovm*) echo "/extra" && return ;; sles* | suse* | opensuse*) echo "/updates" && return ;; debian* | ubuntu*) echo "/updates/dkms" && return ;; arch*) echo "/updates/dkms" && return ;; *) ;; esac echo "$orig_location" } # Source a file safely. # We want to ensure that the .conf file we source does not stomp all over # parts of the environment we don't want them to. This makes it so that # it is harder to accidentally corrupt our environment. conf files can # still deliberately trash the environment by abusing dkms_directive env # variables or by crafting special values that will make eval do evil things. safe_source() { # $1 = file to source # $@ = environment variables to echo out local to_source_file="$1"; shift declare -a -r export_envs=("$@") local tmpfile=$(mktemp_or_die) ( exec >"$tmpfile" . "$to_source_file" >/dev/null # This is really ugly, but a neat hack # Remember, in bash 2.0 and greater all variables are really arrays. for _export_env in "${export_envs[@]}"; do for _i in $(eval echo \${!$_export_env[@]}); do eval echo '$_export_env[$_i]=\"${'$_export_env'[$_i]}\"' done done # handle DKMS_DIRECTIVE stuff specially. for directive in $(set | grep ^DKMS_DIRECTIVE | cut -d = -f 2-3); do directive_name=${directive%%=*} directive_value=${directive#*=} echo "$directive_name=\"$directive_value\"" done ) . "$tmpfile" rm "$tmpfile" (( ${#REMAKE_INITRD[@]} )) && deprecated "REMAKE_INITRD ($to_source_file)" (( ${#MODULES_CONF[@]} )) && deprecated "MODULES_CONF ($to_source_file)" (( ${#MODULES_CONF_OBSOLETES[@]} )) && deprecated "MODULES_CONF_OBSOLETES ($to_source_file)" (( ${#MODULES_CONF_ALIAS_TYPE[@]} )) && deprecated "MODULES_CONF_ALIAS_TYPE ($to_source_file)" (( ${#MODULES_CONF_OBSOLETE_ONLY[@]} )) && deprecated "MODULES_CONF_OBSOLETE_ONLY ($to_source_file)" } # Source a dkms.conf file and perform appropriate postprocessing on it. # Do our best to not repeatedly source the same .conf file -- this can happen # when chaining module installation functions or autoinstalling. read_conf() { # $1 kernel version (required) # $2 arch (required) # $3 dkms.conf location (optional) local return_value=0 local read_conf_file="$dkms_tree/$module/$module_version/source/dkms.conf" # Set variables supported in dkms.conf files (eg. $kernelver) local kernelver="$1" local arch="$2" set_kernel_source_dir_and_kconfig "$1" # Find which conf file to check [[ $conf ]] && read_conf_file="$conf" [[ $3 ]] && read_conf_file="$3" [[ -r $read_conf_file ]] || die 4 $"Could not locate dkms.conf file." \ $"File: $read_conf_file does not exist." [[ $last_mvka = $module/$module_version/$1/$2 && \ $last_mvka_conf = $(readlink -f $read_conf_file) ]] && return # Clear variables and arrays for var in $dkms_conf_variables; do unset $var done # Source in the dkms.conf. # Allow for user-specified overrides in order of specificity. local _conf_file for _conf_file in "$read_conf_file" "/etc/dkms/$module.conf" \ "/etc/dkms/$module-$module_version.conf" "/etc/dkms/$module-$module_version-$1.conf" \ "/etc/dkms/$module-$module_version-$1-$2.conf"; do [ -e "$_conf_file" ] && safe_source "$_conf_file" $dkms_conf_variables done # Source in the directive_array for directive in "${directive_array[@]}"; do directive_name=${directive%%=*} directive_value=${directive#*=} export $directive_name="$directive_value" echo $"DIRECTIVE: $directive_name=\"$directive_value\"" done # Set variables clean="$CLEAN" package_name="$PACKAGE_NAME" package_version="$PACKAGE_VERSION" post_add="$POST_ADD" post_build="$POST_BUILD" post_install="$POST_INSTALL" post_remove="$POST_REMOVE" pre_build="$PRE_BUILD" pre_install="$PRE_INSTALL" obsolete_by="$OBSOLETE_BY" # Fail if no PACKAGE_NAME if [[ ! $package_name ]]; then echo $"dkms.conf: Error! No 'PACKAGE_NAME' directive specified.">&2 return_value=1 fi # Fail if no PACKAGE_VERSION if [[ ! $package_version ]]; then echo $"dkms.conf: Error! No 'PACKAGE_VERSION' directive specified.">&2 return_value=1 fi # Set module naming/location arrays local index array_size=0 s for s in ${#BUILT_MODULE_NAME[@]} \ ${#BUILT_MODULE_LOCATION[@]} \ ${#DEST_MODULE_NAME[@]} \ ${#DEST_MODULE_LOCATION[@]}; do ((s > array_size)) && array_size=$s done for ((index=0; index < array_size; index++)); do # Set values built_module_name[$index]=${BUILT_MODULE_NAME[$index]} built_module_location[$index]=${BUILT_MODULE_LOCATION[$index]} dest_module_name[$index]=${DEST_MODULE_NAME[$index]} dest_module_location[$index]=${DEST_MODULE_LOCATION[$index]} case ${STRIP[$index]} in [nN]*) strip[$index]="no" ;; [yY]*) strip[$index]="yes" ;; '') strip[$index]=${strip[0]:-yes} ;; esac # If unset, set by defaults [[ ! ${built_module_name[$index]} ]] && \ ((array_size == 1)) && \ built_module_name[$index]=$PACKAGE_NAME [[ ! ${dest_module_name[$index]} ]] && \ dest_module_name[$index]=${built_module_name[$index]} [[ ${built_module_location[$index]} && \ ${built_module_location[$index]:(-1)} != / ]] && \ built_module_location[$index]="${built_module_location[$index]}/" # FAIL if no built_module_name if [[ ! ${built_module_name[$index]} ]]; then echo $"dkms.conf: Error! No 'BUILT_MODULE_NAME' directive specified for record #$index." >&2 return_value=1 fi # FAIL if built_module_name ends in .o or .ko case ${built_module_name[$index]} in *.o|*.ko) echo $"dkms.conf: Error! 'BUILT_MODULE_NAME' directive ends in '.o' or '.ko' in record #$index." >&2 return_value=1 ;; esac # FAIL if dest_module_name ends in .o or .ko case ${dest_module_name[$index]} in *.o|*.ko) echo $"dkms.conf: Error! 'DEST_MODULE_NAME' directive ends in '.o' or '.ko' in record #$index." >&2 return_value=1 ;; esac # Override location for specific distributions dest_module_location[$index]="$(override_dest_module_location ${dest_module_location[$index]})" # Fail if no DEST_MODULE_LOCATION if [[ ! ${DEST_MODULE_LOCATION[$index]} ]]; then echo $"dkms.conf: Error! No 'DEST_MODULE_LOCATION' directive specified for record #$index.">&2 return_value=1 fi # Fail if bad DEST_MODULE_LOCATION case ${DEST_MODULE_LOCATION[$index]} in /kernel*) ;; /updates*) ;; /extra*) ;; *) echo $"dkms.conf: Error! Directive 'DEST_MODULE_LOCATION' does not begin with">&2 echo $"'/kernel', '/updates', or '/extra' in record #$index.">&2 return_value=1 ;; esac done # Warn if no modules are specified if ((array_size == 0)); then echo $"dkms.conf: Warning! Zero modules specified." >&2 fi # Get the correct make command [[ ${MAKE_MATCH[0]} ]] || make_command="${MAKE[0]}" for ((index=0; index < ${#MAKE[@]}; index++)); do [[ ${MAKE[$index]} && ${MAKE_MATCH[$index]} && \ $1 =~ ${MAKE_MATCH[$index]} ]] && \ make_command="${MAKE[$index]}" done # Use the generic make and make clean commands if not specified [[ ! $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" # Check if clang was used to compile or lld was used to link the kernel. if [[ -e $kernel_source_dir/vmlinux ]]; then if readelf -p .comment $kernel_source_dir/vmlinux | grep -q clang; then make_command="${make_command} CC=clang" fi if readelf -p .comment $kernel_source_dir/vmlinux | grep -q LLD; then make_command="${make_command} LD=ld.lld" fi elif [[ -e "${kernel_config}" ]]; then if grep -q CONFIG_CC_IS_CLANG=y "${kernel_config}"; then make_command="${make_command} CC=clang" fi if grep -q CONFIG_LD_IS_LLD=y "${kernel_config}"; then make_command="${make_command} LD=ld.lld" fi fi # Set patch_array (including kernel specific patches) count=0 for ((index=0; index < ${#PATCH[@]}; index++)); do if [[ ${PATCH[$index]} && (! ${PATCH_MATCH[$index]} || $1 =~ ${PATCH_MATCH[$index]}) ]]; then patch_array[$count]="${PATCH[$index]}" count=$(($count+1)) fi done # Set build_exclude [[ $BUILD_EXCLUSIVE_KERNEL && ! $1 =~ $BUILD_EXCLUSIVE_KERNEL ]] && build_exclude="yes" [[ $BUILD_EXCLUSIVE_KERNEL_MIN && "$(VER "$1")" < "$(VER "$BUILD_EXCLUSIVE_KERNEL_MIN")" ]] && build_exclude="yes" [[ $BUILD_EXCLUSIVE_KERNEL_MAX && "$(VER "$1")" > "$(VER "$BUILD_EXCLUSIVE_KERNEL_MAX")" ]] && build_exclude="yes" [[ $BUILD_EXCLUSIVE_ARCH && ! $2 =~ $BUILD_EXCLUSIVE_ARCH ]] && build_exclude="yes" if [[ $BUILD_EXCLUSIVE_CONFIG && -e "${kernel_config}" ]]; then local kconf for kconf in $BUILD_EXCLUSIVE_CONFIG ; do case "$kconf" in !*) grep -q "^${kconf#!}=[ym]" "${kernel_config}" && build_exclude="yes" ;; *) grep -q "^${kconf}=[ym]" "${kernel_config}" || build_exclude="yes" ;; esac done fi # Set clean [[ $clean ]] || clean="make clean" ((return_value == 0)) && last_mvka="$module/$module_version/$1/$2" && last_mvka_conf="$(readlink -f "$read_conf_file")" return $return_value } # Source specified variables from dkms framework configuration files. read_framework_conf() { for i in /etc/dkms/framework.conf /etc/dkms/framework.conf.d/*.conf; do [[ -e "$i" ]] && safe_source "$i" "$@" done } # Little helper function for parsing the output of modinfo. get_module_verinfo(){ local ver local srcver local checksum local vals= while read -a vals; do case "${vals[0]}" in version:) ver="${vals[1]}" checksum="${vals[2]}" ;; srcversion:) srcver="${vals[1]}" ;; esac done < <(modinfo "$1") echo -E "${ver}" # Use obsolete checksum info if srcversion is not available echo -E "${srcver:-$checksum}" } # Compare two modules' version # Output: # "==": They are the same version and the same srcversion # "=": They are the same version, but not the same srcversion # ">": 1st one is newer than 2nd one # "<": 1st one is older than 2nd one # "?": Cannot determine # Returns 0 if same version, otherwise 1 compare_module_version() { readarray -t ver1 <<< "$(get_module_verinfo "$1")" readarray -t ver2 <<< "$(get_module_verinfo "$2")" if [[ "${ver1[0]}" = "${ver2[0]}" ]]; then if [[ "${ver1[1]}" = "${ver2[1]}" ]]; then echo "==" else echo "=" fi return 0 elif [[ ! "$ver1" ]] || [[ ! "$ver2" ]]; then echo "?" elif [[ "$(VER "${ver1[0]}")" > "$(VER "${ver2[0]}")" ]]; then echo ">" else echo "<" fi return 1 } # Perform some module version sanity checking whenever we are installing # modules. check_version_sanity() { # $1 = kernel_version # $2 = arch # $3 = obs by kernel version # $4 = dest_module_name local lib_tree="$install_tree/$1" res= echo $"Running module version sanity check." local i=0 if [ -n "$3" ]; then # Magic split into array syntax saves trivial awk and cut calls. local -a obs=(${3//-/ }) local -a my=(${1//-/ }) local obsolete=0 if [[ ${obs} && ${my} ]]; then if [[ $(VER ${obs}) == $(VER ${my}) && ! $force ]]; then # They get obsoleted possibly in this kernel release if [[ ! ${obs[1]} ]]; then # They were obsoleted in this upstream kernel obsolete=1 elif [[ $(VER ${my[1]}) > $(VER ${obs[1]}) ]]; then # They were obsoleted in an earlier ABI bump of the kernel obsolete=1 elif [[ $(VER ${my[1]}) = $(VER ${obs[1]}) ]]; then # They were obsoleted in this ABI bump of the kernel obsolete=1 fi elif [[ $(VER ${my}) > $(VER ${obs}) && ! $force ]]; then # They were obsoleted in an earlier kernel release obsolete=1 fi fi if ((obsolete == 1)); then echo $"" >&2 echo $"Module has been obsoleted due to being included" >&2 echo $"in kernel $3. We will avoid installing" >&2 echo $"for future kernels above $3." >&2 echo $"You may override by specifying --force." >&2 return 1 fi fi set_module_suffix "$1" read -a kernels_module < <(find_module "$lib_tree" "${4}") [ -z $kernels_module ] && return 0 if [[ "$force_version_override" == "true" ]]; then # Skip the following version checking code. return 0 fi if [[ ${kernels_module[1]} ]]; then warn $"Warning! Cannot do version sanity checking because multiple ${4}$module_suffix" \ $"modules were found in kernel $1." return 0 fi local dkms_module=$(compressed_or_uncompressed "$dkms_tree/$module/$module_version/$1/$2/module/" "${4}") local cmp_res="$(compare_module_version "${kernels_module}" "${dkms_module}")" if [[ "${cmp_res}" = ">" ]]; then if [[ ! "$force" ]]; then error $"Module version $(get_module_verinfo "${dkms_module}" | head -n 1) for $4${module_suffix}" \ $"is not newer than what is already found in kernel $1 ($(get_module_verinfo "${kernels_module}" | head -n 1))." \ $"You may override by specifying --force." return 1 fi elif [[ "${cmp_res}" = "==" ]]; then if [[ ! "$force" ]]; then # if the module has neither version nor srcversion/checksum, check the binary files instead local verinfo="$(get_module_verinfo "${dkms_module}")" if [[ "$(echo "$verinfo" | tr -d '[:space:]')" ]] || diff "${kernels_module}" "${dkms_module}" &>/dev/null; then echo $"Module version $(echo "$verinfo" | head -n 1) for $4${module_suffix}" >&2 echo $"exactly matches what is already found in kernel $1." >&2 echo $"DKMS will not replace this module." >&2 echo $"You may override by specifying --force." >&2 return 1 fi fi fi return 0 } check_module_args() { [[ $module && $module_version ]] && return die 1 $"Arguments and are not specified." \ $"Usage: $1 / or" \ $" $1 -m / or" \ $" $1 -m -v " } read_conf_or_die() { read_conf "$@" && return die 8 $"Bad conf file."\ $"File: ${3:-$conf} does not represent a valid dkms.conf file." } run_build_script() { # $1 = script type # $2 = script to run local script_type run [[ $2 ]] || return 0 case "$1" in pre_build|post_build) script_type='build' ;; *) script_type='source' ;; esac run="$dkms_tree/$module/$module_version/$script_type/$2" if [[ -x ${run%% *} ]]; then echo $"" echo $"Running the $1 script:" ( cd "$dkms_tree/$module/$module_version/$script_type/" exec $run ) else echo $"" warn $"The $1 script is not executable." fi } # Register a DKMS-ified source tree with DKMS. # This function is smart enough to register the module if we # passed a source tree or a tarball instead of relying on the source tree # being unpacked into /usr/src/$module-$module_version. add_module() { # If $archive is set and $module and $module_version are not, # try loading the tarball passed first. if [[ $archive_location && ! $module && ! $module_version ]]; then load_tarball elif [[ $try_source_tree && ! $module && ! $module_version ]]; then add_source_tree "$try_source_tree" fi # Check that we have all the arguments check_module_args add # Do stuff for --rpm_safe_upgrade if [[ $rpm_safe_upgrade ]]; then local pppid=$(awk '/PPid:/ {print $2}' /proc/$PPID/status) local lock_name=$(mktemp_or_die $tmp_location/dkms_rpm_safe_upgrade_lock.$pppid.XXXXXX) echo "$module-$module_version" >> $lock_name ps -o lstart --no-headers -p $pppid 2>/dev/null >> $lock_name fi # Check that this module-version hasn't already been added if is_module_added "$module" "$module_version"; then die 3 $"DKMS tree already contains: $module-$module_version" \ $"You cannot add the same module/version combo more than once." fi [[ $conf ]] || conf="$source_tree/$module-$module_version/dkms.conf" # Check that /usr/src/$module-$module_version exists if ! [[ -d $source_tree/$module-$module_version ]]; then die 2 $"Could not find module source directory." \ $"Directory: $source_tree/$module-$module_version does not exist." fi # Check the conf file for sanity read_conf_or_die "$kernelver" "$arch" "$conf" # Create the necessary dkms tree structure echo $"Creating symlink $dkms_tree/$module/$module_version/source -> $source_tree/$module-$module_version" mkdir -p "$dkms_tree/$module/$module_version/build" ln -s "$source_tree/$module-$module_version" "$dkms_tree/$module/$module_version/source" # Run the post_add script run_build_script post_add "$post_add" } # Prepare a kernel source or include tree for compiling a module. # Most modern-ish distros do not require this function at all, # so it will be removed in a future release. prepare_kernel() { # $1 = kernel version to prepare # $2 = arch to prepare set_kernel_source_dir_and_kconfig "$1" # Check that kernel-source exists _check_kernel_dir "$1" || { 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." } } prepare_signing() { do_signing=0 if [[ ! -f "${kernel_config}" ]]; then echo "Kernel config ${kernel_config} not found, modules won't be signed" return fi if ! grep -q "^CONFIG_MODULE_SIG_HASH=" "${kernel_config}"; then echo "The kernel is be built without module signing facility, modules won't be signed" return fi sign_hash=$(grep "^CONFIG_MODULE_SIG_HASH=" "${kernel_config}" | cut -f2 -d= | sed 's/"//g') # Lazy source in signing related configuration read_framework_conf $dkms_framework_signing_variables if [ ! "${sign_file}" ]; then case "$running_distribution" in debian* ) sign_file="/usr/lib/linux-kbuild-${kernelver%.*}/scripts/sign-file" ;; ubuntu* ) sign_file="$(command -v kmodsign)" if [[ ! -x "${sign_file}" ]]; then sign_file="/usr/src/linux-headers-$kernelver/scripts/sign-file" fi ;; esac if [[ ! -f "${sign_file}" ]]; then sign_file="/lib/modules/$kernelver/build/scripts/sign-file" fi fi echo "Sign command: $sign_file" if [[ ! -f "${sign_file}" ]] || [[ ! -x "${sign_file}" ]]; then echo "Binary ${sign_file} not found, modules won't be signed" return fi if [[ -z "${mok_signing_key}" ]]; then # No custom key specified, use the default key created by update-secureboot-policy for Ubuntu # Debian's update-secureboot-policy has no --new-key option case "$running_distribution" in ubuntu* ) mok_signing_key="/var/lib/shim-signed/mok/MOK.priv" mok_certificate="/var/lib/shim-signed/mok/MOK.der" if [[ ! -f "${mok_signing_key}" ]] || [[ ! -f "${mok_certificate}" ]]; then if [[ ! -x "$(command -v update-secureboot-policy)" ]]; then echo "Binary update-secureboot-policy not found, modules won't be signed" return fi # update-secureboot-policy won't create new key if $mok_certificate exists if [[ -f "${mok_certificate}" ]]; then rm -f "${mok_certificate}" fi echo "Certificate or key are missing, generating them using update-secureboot-policy..." SHIM_NOTRIGGER=y update-secureboot-policy --new-key &>/dev/null update-secureboot-policy --enroll-key fi ;; esac fi if [ ! "${mok_signing_key}" ]; then mok_signing_key="/var/lib/dkms/mok.key" fi echo "Signing key: $mok_signing_key" if [ ! "${mok_certificate}" ]; then mok_certificate="/var/lib/dkms/mok.pub" fi echo "Public certificate (MOK): $mok_certificate" # scripts/sign-file.c in kernel source also supports using "pkcs11:..." as private key if [[ "$mok_signing_key" != "pkcs11:"* ]] && ( [ ! -f "$mok_signing_key" ] || [ ! -f "$mok_certificate" ] ); then echo "Certificate or key are missing, generating self signed certificate for MOK..." if ! command -v openssl >/dev/null; then echo "openssl not found, can't generate key and certificate." return fi openssl req -new -x509 -nodes -days 36500 -subj "/CN=DKMS module signing key" \ -newkey rsa:2048 -keyout "$mok_signing_key" \ -outform DER -out "$mok_certificate" > /dev/null 2>&1 if [ ! -f "${mok_signing_key}" ]; then echo "Key file ${mok_signing_key} not found and can't be generated, modules won't be signed" return fi fi if [ ! -f "${mok_certificate}" ]; then echo "Certificate file ${mok_certificate} not found and can't be generated, modules won't be signed" return fi do_signing=1 } # Get ready to build a module that has been registered with DKMS. prepare_build() { # If the module has not been added, try to add it. is_module_added "$module" "$module_version" || add_module local -r base_dir="$dkms_tree/$module/$module_version/$kernelver/$arch" local -r build_dir="$dkms_tree/$module/$module_version/build" local -r source_dir="$dkms_tree/$module/$module_version/source" # Check that the module has not already been built for this kernel [[ -d $base_dir ]] && die 3 \ $"This module/version has already been built on: $kernelver" \ $"Directory $base_dir already exists. Use the dkms remove function before trying to build again." # Read the conf file set_module_suffix "$kernelver" read_conf_or_die "$kernelver" "$arch" # Error out if build_exclude is set [[ $build_exclude ]] && die 77 \ $"The $base_dir/dkms.conf for module $module includes a BUILD_EXCLUSIVE directive which does not match this kernel/arch/config."\ $"This indicates that it should not be built." # Error out if source_tree is basically empty (binary-only dkms tarball w/ --force check) (($(ls $source_dir | wc -l | awk {'print $1'}) < 2)) && die 8 \ $"The directory $source_dir does not appear to have module source located within it."\ $"Build halted." # Set up temporary build directory for build rm -rf "$build_dir" cp -a "$source_dir/" "$build_dir" cd "$build_dir" # Apply any patches for p in "${patch_array[@]}"; do [[ ! -e $build_dir/patches/$p ]] && \ report_build_problem 5 \ $" Patch $p as specified in dkms.conf cannot be" \ $"found in $build_dir/patches/." invoke_command "patch -p1 < ./patches/$p" "applying patch $p" || \ report_build_problem 6 $"Application of patch $p failed." \ $"Check $build_dir for more information." done if [[ -e "${kernel_config}" ]]; then if grep -q 'CONFIG_CC_IS_CLANG=y' "${kernel_config}"; then local cc=clang if command -v "$cc" >/dev/null; then export CC="$cc" export KERNEL_CC="$cc" fi fi if grep -q 'CONFIG_LD_IS_LLD=y' "${kernel_config}"; then local ld=ld.lld if command -v "$ld" >/dev/null; then export LD="$ld" export KERNEL_LD="$ld" fi fi fi # Run the pre_build script run_build_script pre_build "$pre_build" } # Build our previously prepared source tree. prepare_build must be called # before calling this function. actual_build() { local -r base_dir="$dkms_tree/$module/$module_version/$kernelver/$arch" local -r build_dir="$dkms_tree/$module/$module_version/build" local -r build_log="$build_dir/make.log" echo $"" echo $"Building module:" if [ -f "$kernel_source_dir/.kernelvariables" ]; then export CC=$(echo -e "show-%:\n\t@echo \$(\$*)\ninclude $kernel_source_dir/.kernelvariables" | make -f - show-CC) else unset CC fi invoke_command "$clean" "Cleaning build area" background echo $"DKMS make.log for $module-$module_version for kernel $kernelver ($arch)" >> "$build_log" date >> "$build_log" local the_make_command="${make_command/#make/make -j$parallel_jobs KERNELRELEASE=$kernelver}" invoke_command "{ $the_make_command; } >> $build_log 2>&1" "$the_make_command" background || \ report_build_problem 10 $"Bad return status for module build on kernel: $kernelver ($arch)" \ $"Consult $build_log for more information." # Make sure all the modules built successfully for ((count=0; count < ${#built_module_name[@]}; count++)); do [[ -e ${built_module_location[$count]}${built_module_name[$count]}$module_uncompressed_suffix ]] && continue report_build_problem 7 \ $" Build of ${built_module_name[$count]}$module_uncompressed_suffix failed for: $kernelver ($arch)" \ $"Make sure the name of the generated module is correct and at the root of the" \ $"build directory, or consult make.log in the build directory" \ $"$build_dir for more information." done cd - >/dev/null # Build success, so create DKMS structure for a built module mkdir -p "$base_dir/log" [[ $kernel_config ]] && cp -f "$kernel_config" "$base_dir/log/" mv -f "$build_log" "$base_dir/log/make.log" 2>/dev/null # Save a copy of the new module mkdir "$base_dir/module" >/dev/null for ((count=0; count < ${#built_module_name[@]}; count++)); do local the_module="$build_dir/${built_module_location[$count]}${built_module_name[$count]}" local built_module="$the_module$module_uncompressed_suffix" local compressed_module="$the_module$module_suffix" [[ ${strip[$count]} != no ]] && strip -g "$built_module" if (( do_signing )); then echo "Signing module $built_module" "$sign_file" "$sign_hash" "$mok_signing_key" "$mok_certificate" "$built_module" fi if [ "$module_compressed_suffix" = ".gz" ]; then gzip -9f "$built_module" || compressed_module="" elif [ "$module_compressed_suffix" = ".xz" ]; then xz -f "$built_module" || compressed_module="" elif [ "$module_compressed_suffix" = ".zst" ]; then zstd -q -f -T0 -20 --ultra "$built_module" || compressed_module="" fi if [ -n "$compressed_module" ]; then cp -f "$compressed_module" "$base_dir/module/${dest_module_name[$count]}$module_suffix" >/dev/null else cp -f "$built_module" "$base_dir/module/${dest_module_name[$count]}$module_uncompressed_suffix" >/dev/null fi done # Run the post_build script run_build_script post_build "$post_build" } # Clean up after a build. clean_build() { # Run the clean commands cd "$dkms_tree/$module/$module_version/build" invoke_command "$clean" "Cleaning build area" background cd - >/dev/null # Clean the build directory rm -rf "$dkms_tree/$module/$module_version/build" } do_build() { set_kernel_source_dir_and_kconfig "$kernelver" prepare_kernel "$kernelver" "$arch" prepare_signing prepare_build actual_build clean_build } # Force the installation of a module if this is listed # in the files in $forced_modules_dir, if any force_installation() { forced_modules_dir="/usr/share/dkms/modules_to_force_install" to_force="" if [ -d $forced_modules_dir ]; then for elem in $forced_modules_dir/*; do if [ -e $elem ]; then to_force="$to_force $(cat $elem)" fi done for elem in $to_force; do if [ "${1}" = "${elem}" ]; then echo "force" return 0 elif [ "${1}_version-override" = "${elem}" ]; then echo "version-override" return 0 fi done fi return 1 } # Install a previously built module # There are huge swaths of code here that special-case for various distros. # They should be split into their own functions. do_install() { # If the module has not been built, try to build it first. is_module_built "$module" "$module_version" "$kernelver" "$arch" || do_build local base_dir="$dkms_tree/$module/$module_version/$kernelver/$arch" # Save the status of $force tmp_force="$force" # If the module is set to be force-installed local ret=$(force_installation $module) if [[ "$ret" == "force" ]];then force="true" echo "Forcing installation of $module" elif [[ "$ret" == "version-override" ]];then force_version_override="true" echo "Forcing version override of $module" fi # Make sure that kernel exists to install into [[ -e $install_tree/$kernelver ]] || die 6 \ $"The directory $install_tree/$kernelver doesn't exist." \ $"You cannot install a module onto a non-existant kernel." # Read the conf file read_conf_or_die "$kernelver" "$arch" # Check that its not already installed (kernel symlink) is_module_installed "$module" "$module_version" "$kernelver" "$arch" && die 5 \ $"This module/version combo is already installed for kernel $kernelver ($arch)." # If upgrading using rpm_safe_upgrade, go ahead and force the install # else we can wind up with the first half of an upgrade failing to install anything, # while the second half of the upgrade, the removal, then succeeds, leaving us with # nothing installed. [[ $rpm_safe_upgrade ]] && force="true" # Save the original_module if one exists, none have been saved before, and this is the first module for this kernel local lib_tree="$install_tree/$kernelver" local any_module_installed local count for ((count=0; count < ${#built_module_name[@]}; count++)); do echo $"" echo $"${dest_module_name[$count]}$module_suffix:" # Check this version against what is already in the kernel check_version_sanity "$kernelver" "$arch" "$obsolete_by" "${dest_module_name[$count]}" || continue if ((count == 0)) && ! run_build_script pre_install "$pre_install" && ! [[ $force ]]; then die 101 $"pre_install failed, aborting install." \ $"You may override by specifying --force." fi local m=${dest_module_name[$count]} local installed_modules=$(find_module "$lib_tree" "$m") local module_count=${#installed_modules[@]} echo $" - Original module" local original_copy=$(compressed_or_uncompressed "$dkms_tree/$module/original_module/$kernelver/$arch" "$m") if [[ -L $dkms_tree/$module/kernel-$kernelver-$arch && -n "$original_copy" ]]; then echo $" - An original module was already stored during a previous install" elif ! [[ -L $dkms_tree/$module/kernel-$kernelver-$arch ]]; then local archive_pref1=$(compressed_or_uncompressed "$lib_tree/extra" "$m") local archive_pref2=$(compressed_or_uncompressed "$lib_tree/updates" "$m") local archive_pref3=$(compressed_or_uncompressed "$lib_tree${dest_module_location[$count]}" "$m") local archive_pref4="" ((module_count == 1)) && archive_pref4=${installed_modules[0]} local original_module="" local found_orginal="" for original_module in $archive_pref1 $archive_pref2 $archive_pref3 $archive_pref4; do [[ -f $original_module ]] || continue case "$running_distribution" in debian* | ubuntu* ) ;; *) echo $" - Found $original_module" echo $" - Storing in $dkms_tree/$module/original_module/$kernelver/$arch/" echo $" - Archiving for uninstallation purposes" mkdir -p "$dkms_tree/$module/original_module/$kernelver/$arch" mv -f "$original_module" "$dkms_tree/$module/original_module/$kernelver/$arch/" ;; esac found_original="yes" break done if [[ ! $found_original ]] && ((module_count > 1)); then echo $" - Multiple original modules exist but DKMS does not know which to pick" echo $" - Due to the confusion, none will be considered during a later uninstall" elif [[ ! $found_original ]]; then echo $" - No original module exists within this kernel" fi else echo $" - This kernel never originally had a module by this name" fi if ((module_count > 1)); then echo $" - Multiple same named modules!" echo $" - $module_count named $m$module_suffix in $lib_tree/" case "$running_distribution" in debian* | ubuntu* ) ;; *) echo $" - All instances of this module will now be stored for reference purposes ONLY" echo $" - Storing in $dkms_tree/$module/original_module/$kernelver/$arch/collisions/" ;; esac for module_dup in $(find_module "$lib_tree" "$m"); do dup_tree="${module_dup#$lib_tree}"; dup_name="${module_dup##*/}" dup_tree="${dup_tree/${dup_name}}" case "$running_distribution" in debian* | ubuntu* ) ;; *) echo $" - Stored $module_dup" mkdir -p "$dkms_tree/$module/original_module/$kernelver/$arch/collisions/$dup_tree" mv -f $module_dup "$dkms_tree/$module/original_module/$kernelver/$arch/collisions/$dup_tree" ;; esac done fi # Copy module to its location echo $" - Installation" echo $" - Installing to $install_tree/$kernelver${dest_module_location[$count]}/" mkdir -p $install_tree/$kernelver${dest_module_location[$count]} [[ $symlink_modules ]] && symlink="-s" local toinstall=$(compressed_or_uncompressed "$base_dir/module" "$m") cp -f $symlink "$toinstall" "$install_tree/$kernelver${dest_module_location[$count]}/${toinstall##*/}" any_module_installed=1 done if ((${#built_module_name[@]} > 0)) && [[ ! "${any_module_installed}" ]]; then die 6 $"Installation aborted." fi # Create the kernel- symlink to designate this version as active rm -f "$dkms_tree/$module/kernel-$kernelver-$arch" 2>/dev/null ln -s "$module_version/$kernelver/$arch" "$dkms_tree/$module/kernel-$kernelver-$arch" 2>/dev/null # Add to kabi-tracking if [ -z "$NO_WEAK_MODULES" ]; then if [[ ${weak_modules} ]]; then echo $"Adding any weak-modules" list_each_installed_module "$module" "$kernelver" "$arch" | ${weak_modules} ${weak_modules_no_initrd} --add-modules fi fi # Run the post_install script run_build_script post_install "$post_install" invoke_command "do_depmod $kernelver" "depmod" background || { do_uninstall "$kernelver" "$arch" die 6 $"Problems with depmod detected. Automatically uninstalling this module." \ $"Install Failed (depmod problems). Module rolled back to built state." exit 6 } if [[ $modprobe_on_install ]]; then # Make the newly installed modules available immediately find /sys/devices -name modalias -print0 | xargs -0 cat | sort -u | xargs modprobe -a -b -q if [ -f /lib/systemd/system/systemd-modules-load.service ]; then systemctl restart systemd-modules-load.service fi fi # Restore the status of $force force="$tmp_force" } # List each kernel object that has been installed for a particular module. list_each_installed_module() { # $1 = module # $2 = kernel version # $3 = arch local count local real_dest_module_location local mod for ((count=0; count < ${#built_module_name[@]}; count++)); do real_dest_module_location="$(find_actual_dest_module_location $1 $count $2 $3)" mod=$(compressed_or_uncompressed "$install_tree/$2${real_dest_module_location}" "${dest_module_name[$count]}") echo "$mod" done } is_module_added() { [[ $1 && $2 ]] || return 1 [[ -d $dkms_tree/$1/$2 ]] || return 2 [[ -L $dkms_tree/$1/$2/source || -d $dkms_tree/$1/$2/source ]]; } is_module_built() { [[ $1 && $2 && $3 && $4 ]] || return 1 local d="$dkms_tree/$1/$2/$3/$4" m='' [[ -d $d/module ]] || return 1 local default_conf="$dkms_tree/$1/$2/source/dkms.conf" # If a custom dkms.conf was specified use it, otherwise use the default one. local real_conf="${conf:-${default_conf}}" read_conf_or_die "$3" "$4" "$real_conf" set_module_suffix "$3" for m in "${dest_module_name[@]}"; do local t=$(compressed_or_uncompressed "$d/module" "$m") test -n "$t" || return 1 done } # This assumes we have already checked to see if the module has been built. _is_module_installed() { [[ $1 && $2 && $3 && $4 ]] || return 1 local d="$dkms_tree/$1/$2/$3/$4" local k="$dkms_tree/$1/kernel-$3-$4" [[ -L $k && $(readlink -f $k) = $d ]] } # This does not. is_module_installed() { is_module_built "$@" && _is_module_installed "$@"; } maybe_add_module() ( is_module_added "$1" "$2" && { echo $"Module $1/$2 already added." return 0 } module="$1" module_version="$2" add_module ) maybe_build_module() ( is_module_built "$1" "$2" "$3" "$4" && { if [[ "$force" = "true" ]]; then do_unbuild "$3" "$4" else echo $"Module $1/$2 already built for kernel $3 ($4), skip." \ $"You may override by specifying --force." return 0 fi } module="$1" module_version="$2" kernelver="$3" arch="$4" do_build ) maybe_install_module() ( is_module_installed "$1" "$2" "$3" "$4" && { if [[ "$force" = "true" ]]; then do_uninstall "$3" "$4" else echo $"Module $1/$2 already installed on kernel $3 ($4), skip." \ $"You may override by specifying --force." return 0 fi } module="$1" module_version="$2" kernelver="$3" arch="$4" do_install ) build_module() { local i=0 for ((i=0; i < ${#kernelver[@]}; i++)); do maybe_build_module "$module" "$module_version" "${kernelver[$i]}" "${arch[$i]}" done } install_module() { local i=0 for ((i=0; i < ${#kernelver[@]}; i++)); do maybe_install_module "$module" "$module_version" "${kernelver[$i]}" "${arch[$i]}" done } possible_dest_module_locations() { # $1 = count # There are two places an installed module may really be: # 1) "$install_tree/$kernelver/${dest_module_location[$count]}/${dest_module_name[$count]}$module_suffix" # 2) "$install_tree/$kernelver/${DEST_MODULE_LOCATION[$count]}/${dest_module_name[$count]}$module_suffix" # override_dest_module_location() is what controls whether or not they're the same. local location location[0]="${dest_module_location[$count]}" [[ ${DEST_MODULE_LOCATION[$count]} != ${dest_module_location[$count]} ]] && \ location[1]="${DEST_MODULE_LOCATION[$count]}" echo "${location[@]}" } find_actual_dest_module_location() { local module="$1" local count="$2" local kernelver="$3" local arch="$4" local locations="$(possible_dest_module_locations $count)" local l local dkms_owned local installed dkms_owned=$(compressed_or_uncompressed "${dkms_tree}/${module}/kernel-${kernelver}-${arch}/module" "${dest_module_name[$count]}") for l in $locations; do installed=$(compressed_or_uncompressed "${install_tree}/${kernelver}${l}" "${dest_module_name[${count}]}") if [[ -n "${installed}" ]] && compare_module_version "${dkms_owned}" "${installed}" &>/dev/null; then echo "${l}" return 0 fi done } # Remove compiled DKMS modules from any kernels they are installed in. do_uninstall() { # $1 = kernel version # $2 = arch echo $"Module $module-$module_version for kernel $1 ($2)." set_module_suffix "$1" # If kernel- symlink points to this module, check for original_module and put it back local was_active="" local kernel_symlink=$(readlink -f "$dkms_tree/$module/kernel-$1-$2") local real_dest_module_location if [[ $kernel_symlink = $dkms_tree/$module/$module_version/$1/$2 ]]; then was_active="true" echo $"Before uninstall, this module version was ACTIVE on this kernel." # remove kabi-tracking if last instance removed if [ -z "$NO_WEAK_MODULES" ]; then if [[ ${weak_modules} ]] && (module_status_built $module $module_version |grep -q "installed"); then echo $"Removing any linked weak-modules" list_each_installed_module "$module" "$1" "$2" | ${weak_modules} ${weak_modules_no_initrd} --remove-modules fi fi for ((count=0; count < ${#built_module_name[@]}; count++)); do real_dest_module_location="$(find_actual_dest_module_location $module $count $1 $2)" echo $"" echo $"${dest_module_name[$count]}$module_suffix:" echo $" - Uninstallation" if [[ "${real_dest_module_location}" ]]; then echo $" - Deleting from: $install_tree/$1${real_dest_module_location}/" rm -f "$install_tree/$1${real_dest_module_location}/${dest_module_name[$count]}$module_uncompressed_suffix"* dir_to_remove="${real_dest_module_location#/}" while [ "${dir_to_remove}" != "${dir_to_remove#/}" ]; do dir_to_remove="${dir_to_remove#/}" done (if cd "$install_tree/$1"; then rpm -qf "${dir_to_remove}" >/dev/null 2>&1 || rmdir -p --ignore-fail-on-non-empty "${dir_to_remove}"; fi || true) else echo $" - Module was not found within $install_tree/$1/" fi echo $" - Original module" 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* ) ;; *) echo $" - Archived original module found in the DKMS tree" echo $" - Moving it to: $install_tree/$1${DEST_MODULE_LOCATION[$count]}/" mkdir -p "$install_tree/$1${DEST_MODULE_LOCATION[$count]}/" mv -f "$origmod" "$install_tree/$1${DEST_MODULE_LOCATION[$count]}/" 2>/dev/null ;; esac 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." fi done rm -f "$dkms_tree/$module/kernel-$1-$2" else echo $"This module version was INACTIVE for this kernel." fi # Run the post_remove script run_build_script post_remove "$post_remove" # Run depmod because we changed /lib/modules invoke_command "do_depmod $1" "depmod" background # 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 $"" echo $"Removing original_module from DKMS tree for kernel $1 ($2)" rm -rf "$dkms_tree/$module/original_module/$1/$2" 2>/dev/null [[ $(find $dkms_tree/$module/original_module/$1/* -maxdepth 0 -type d 2>/dev/null) ]] || rm -rf "$dkms_tree/$module/original_module/$1" elif [[ $was_active && -d $dkms_tree/$module/original_module/$1/$2/collisions ]]; then echo $"" echo $"Keeping directory $dkms_tree/$module/original_module/$1/$2/collisions/" echo $"for your reference purposes. Your kernel originally contained multiple" 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" } module_is_added_or_die() { is_module_added "$module" "$module_version" || die 3 \ $"The module/version combo: $module-$module_version is not located in the DKMS tree." } maybe_unbuild_module() { is_module_built "$module" "$module_version" "$1" "$2" || { echo $"Module $module $module_version is not built for kernel $1 ($2)."\ $"Skipping..." return 0 } do_unbuild "$1" "$2" } maybe_uninstall_module() { is_module_installed "$module" "$module_version" "$1" "$2" || { echo $"Module $module $module_version is not installed for kernel $1 ($2)."\ $"Skipping..." return 0 } do_uninstall "$1" "$2" } uninstall_module() { local i for ((i=0; i < ${#kernelver[@]}; i++)); do maybe_uninstall_module "${kernelver[$i]}" "${arch[$i]}" done } do_unbuild() { # Delete or "unbuild" the $kernel_version/$arch_used part of the tree rm -rf "$dkms_tree/$module/$module_version/$1/$2" [[ $(find $dkms_tree/$module/$module_version/$1/* -maxdepth 0 -type d 2>/dev/null) ]] || \ rm -rf "$dkms_tree/$module/$module_version/$1" } # Remove the build module, w/o removing/unregistering it. # This uninstalls any installed modules along the way unbuild_module() { local i for ((i=0; i < ${#kernelver[@]}; i++)); do maybe_uninstall_module "${kernelver[$i]}" "${arch[$i]}" maybe_unbuild_module "${kernelver[$i]}" "${arch[$i]}" done } # Unregister a DKMS module. This uninstalls any installed modules along the way. remove_module() { # Do --rpm_safe_upgrade check (exit out and don't do remove if inter-release RPM upgrade scenario occurs) if [[ $rpm_safe_upgrade ]]; then local pppid=$(awk '/PPid:/ {print $2}' /proc/$PPID/status) local time_stamp=$(ps -o lstart --no-headers -p $pppid 2>/dev/null) for lock_file in $tmp_location/dkms_rpm_safe_upgrade_lock.$pppid.*; do [[ -f $lock_file ]] || continue lock_head=$(head -n 1 $lock_file 2>/dev/null) lock_tail=$(tail -n 1 $lock_file 2>/dev/null) [[ $lock_head = $module-$module_version && $time_stamp && $lock_tail = $time_stamp ]] || continue rm -f $lock_file die 0 $"Remove cancelled because --rpm_safe_upgrade scenario detected." done fi local i for ((i=0; i < ${#kernelver[@]}; i++)); do maybe_uninstall_module "${kernelver[$i]}" "${arch[$i]}" maybe_unbuild_module "${kernelver[$i]}" "${arch[$i]}" done # Delete the $module_version part of the tree if no other $module_version/$kernel_version dirs exist if ! find $dkms_tree/$module/$module_version/* -maxdepth 0 -type d 2>/dev/null | grep -Eqv "(build|tarball|driver_disk|rpm|deb|source)$"; then echo $"Deleting module $module-$module_version completely from the DKMS tree." rm -rf "$dkms_tree/$module/$module_version" fi # 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 fi } # Given a kernel object, figure out which DKMS module it is from. find_module_from_ko() { local ko="$1" local basename_ko="${ko##*/}" local module local kernellink for kernellink in "$dkms_tree"/*/kernel-*; do [[ -L $kernellink ]] || continue module=${kernellink#$dkms_tree/} module=${module%/kernel-*} diff "$kernellink/module/${basename_ko}" "${ko}" >/dev/null 2>&1 || continue rest=$(readlink $kernellink) echo "$module/$rest" return 0 done return 1 } # Check to see if modules meeting the passed parameters are weak-installed. # This function's calling convention is different from the usual DKMS status # checking functions -- the kernel version we usually have is the one we are currently # running on, not necessarily the one we compiled the module for. module_status_weak() { # $1 = module, $2 = module version, $3 = kernel version weak installed to, # $4 = kernel arch, $5 = kernel version built for [ -z "$NO_WEAK_MODULES" ] || return 1 [[ $weak_modules ]] || return 1 local m v k a kern weak_ko mod installed_ko f ret=1 oifs=$IFS local -A already_found for weak_ko in "$install_tree/"*/weak-updates/*; do [[ -e $weak_ko ]] || continue [[ -L $weak_ko ]] && installed_ko="$(readlink -f "$weak_ko")" || continue IFS=/ read m v k a < <(IFS=$oifs find_module_from_ko "$weak_ko") || continue kern=${weak_ko#$install_tree/} kern=${kern%/weak-updates/*} [[ $m = ${1:-*} && $v = ${2:-*} && $k = ${5:-*} && $a = ${4:-*} && $kern = ${3:-*} ]] || continue already_found[$m/$v/$kern/$a/$k]+=${weak_ko##*/}" " done # Check to see that all ko's are present for each module for mod in ${!already_found[@]}; do IFS=/ read m v k a kern <<< "$mod" # ensure each module is weak linked for installed_ko in $(find $dkms_tree/$m/$v/$kern/$a/module -type f); do [[ ${already_found[$mod]} != *"$installed_ko"* ]] && continue 2 done ret=0 echo "installed-weak $mod" done return $ret } # Print the requested status lines for weak-installed modules. do_status_weak() { local mvka m v k a kern status while read status mvka; do IFS=/ read m v k a kern <<< "$mvka" echo "$m, $v, $k, $a: installed-weak from $kern" done < <(module_status_weak "$@") } # Spit out all the extra status information that people running DKMS are # interested in, but that the DKMS internals do not usually care about. module_status_built_extra() ( set_module_suffix "$3" read_conf "$3" "$4" "$dkms_tree/$1/$2/source/dkms.conf" 2>/dev/null [[ -d $dkms_tree/$1/original_module/$3/$4 ]] && echo -n " (original_module exists)" for ((count=0; count < ${#dest_module_name[@]}; count++)); do tree_mod=$(compressed_or_uncompressed "$dkms_tree/$1/$2/$3/$4/module" "${dest_module_name[$count]}") if ! [[ -n "$tree_mod" ]]; then echo -n " (WARNING! Missing some built modules!)" elif _is_module_installed "$@"; then real_dest="$(find_actual_dest_module_location "$1" $count "$3" "$4")" real_dest_mod=$(compressed_or_uncompressed "$install_tree/$3${real_dest}" "${dest_module_name[$count]}") if ! diff -q "$tree_mod" "$real_dest_mod" >/dev/null 2>&1; then echo -n " (WARNING! Diff between built and installed module!)" fi fi done ) # Return a list of all the modules that are either built or installed. # This and module_status do some juggling of $IFS to ensure that # we do not get word splitting where it would be inconvenient. module_status_built() { local ret=1 directory ka k a state oifs="$IFS" IFS='' for directory in "$dkms_tree/$1/$2/"${3:-+([0-9]).*}/${4:-*}; do IFS="$oifs" ka="${directory#$dkms_tree/$1/$2/}" k="${ka%/*}" a="${ka#*/}" is_module_built "$1" "$2" "$k" "$a" || continue ret=0 state="built" _is_module_installed "$1" "$2" "$k" "$a" && state="installed" echo "$state $1/$2/$k/$a" IFS='' done IFS="$oifs" return $ret } # Return the status of all modules that have been added, built, or installed. module_status() { local oifs="$IFS" IFS='' mv m v directory ret=1 for directory in "$dkms_tree/"${1:-*}/${2:-*}; do IFS="$oifs" mv="${directory#$dkms_tree/}" m="${mv%/*}" v="${mv#*/}" is_module_added "$m" "$v" || continue ret=0 module_status_built "$m" "$v" "$3" "$4" || echo "added $m/$v" IFS='' done IFS="$oifs" return $ret } # Print out the status in the format that people who call DKMS expect. # Internal callers should use the module_status functions, as their output # is easier to parse. do_status() { local status mvka m v k a # separate deprecation warnings from status output local tmpfile=$(mktemp_or_die) (module_status "$@") >"$tmpfile" while read status mvka; do IFS=/ read m v k a <<< "$mvka" case $status in added) echo "$m/$v: $status" ;; built|installed) echo -n "$m/$v, $k, $a: $status" module_status_built_extra "$m" "$v" "$k" "$a" echo ;; esac done < "$tmpfile" rm "$tmpfile" } # Show all our status in the format that external callers expect, even # though it is slightly harder to parse. show_status() { local j state_array if ((${#kernelver[@]} == 0)); then do_status "$module" "$module_version" "$kernelver" "$arch" do_status_weak "$module" "$module_version" "$kernelver" "$arch" else for ((j=0; j < ${#kernelver[@]}; j++)); do do_status "$module" "$module_version" "${kernelver[$j]}" "${arch[$j]}" do_status_weak "$module" "$module_version" "${kernelver[$j]}" "${arch[$j]}" done fi } make_tarball() { # Read the conf file read_conf_or_die "$kernelver" "$arch" local -r temp_dir_name=$(mktemp_or_die -d $tmp_location/dkms.XXXXXX) trap "rm -rf $temp_dir_name" EXIT mkdir -p $temp_dir_name/dkms_main_tree if [[ $source_only ]]; then kernel_version_list="source-only" else local i for ((i=0; i<${#kernelver[@]}; i++)); do local -r intree_module_dir="$dkms_tree/$module/$module_version/${kernelver[$i]}/${arch[$i]}" local -r temp_module_dir="$temp_dir_name/dkms_main_tree/${kernelver[$i]}" if ! [[ -d "$intree_module_dir" ]]; then die 6 $"No modules built for ${kernelver[$i]} (${arch[$i]})." \ $"Modules must already be in the built state before using mktarball." fi set_module_suffix "${kernelver[$i]}" echo "Marking modules for ${kernelver[$i]} (${arch[$i]}) for archiving..." if [[ ! $kernel_version_list ]]; then kernel_version_list="kernel${kernelver[$i]}-${arch[$i]}" else kernel_version_list="${kernel_version_list}-kernel${kernelver[$i]}-${arch[$i]}" fi mkdir -p "$temp_module_dir" cp -rf "$intree_module_dir" "$temp_module_dir" done fi local -r source_dir="$dkms_tree/$module/$module_version/source" # Copy the source_tree or make special binaries-only structure if [[ $binaries_only ]]; then local -r binary_only_dir="$temp_dir_name/dkms_binaries_only" echo $"" echo $"Creating tarball structure to specifically accomodate binaries." mkdir "$binary_only_dir" echo "$module" > "$binary_only_dir/PACKAGE_NAME" echo "$module_version" > "$binary_only_dir/PACKAGE_VERSION" [[ ! $conf ]] && conf="$source_dir/dkms.conf" cp -f $conf "$binary_only_dir/" 2>/dev/null else echo $"" echo $"Marking $source_dir for archiving..." mkdir -p $temp_dir_name/dkms_source_tree cp -rf $source_dir/* $temp_dir_name/dkms_source_tree fi if (( $(echo $kernel_version_list | wc -m | awk {'print $1'}) > 200 )); then kernel_version_list="manykernels" fi local tarball_name="$module-$module_version-$kernel_version_list.dkms.tar.gz" local tarball_dest="$dkms_tree/$module/$module_version/tarball/" if [[ $archive_location ]]; then tarball_name="${archive_location##*/}" if [[ ${archive_location%/*} != $archive_location ]]; then tarball_dest="${archive_location%/*}" fi fi echo $"" echo $"Tarball location: $tarball_dest/$tarball_name" if [[ ! -d $tarball_dest ]]; then if ! mkdir -p "$tarball_dest" 2>/dev/null; then die 9 $"Missing write permissions for $tarball_dest." fi fi [[ -w $tarball_dest ]] || die 9 $"Missing write permissions for $tarball_dest." if ! tar -C $temp_dir_name -caf $tarball_dest/$tarball_name . 2>/dev/null; then die 6 $"Failed to make tarball." fi } # A tiny helper function to make sure dkms.conf describes a valid package. get_pkginfo_from_conf() { [[ -f $1 && $1 = *dkms.conf ]] || return read_conf_or_die "$kernelver" "$arch" "$1" [[ $PACKAGE_NAME && $PACKAGE_VERSION ]] } # Unpack a DKMS tarball from a few different supported formats. # We expect $archive_location to have been passed either as a raw argument or # with --archive. load_tarball() { # Error out if $archive_location does not exist if [[ ! -e $archive_location ]]; then die 2 $"$archive_location does not exist." fi # If it is an .rpm file. install it with rpm, run an autoinstall, and then exit. if [[ $archive_location = *.rpm ]]; then if rpm -Uvh "$archive_location"; then autoinstall exit $? else die 9 $"Unable to install $archive_location using rpm." \ $"Check to ensure that your system can install .rpm files." fi fi # Untar it into $tmp_location local -r temp_dir_name=$(mktemp_or_die -d $tmp_location/dkms.XXXXXX) trap "rm -rf $temp_dir_name" EXIT tar -xaf $archive_location -C $temp_dir_name if [[ ! -d $temp_dir_name/dkms_main_tree ]]; then # Tarball was not generated from mktarball. # Just find the dkms.conf file and load the source. conf=$(find $temp_dir_name/ -name dkms.conf 2>/dev/null | head -n 1) if [[ ! $conf ]]; then die 3 $"Tarball does not appear to be a correctly formed DKMS archive. No dkms.conf found within it." fi add_source_tree "${conf%dkms.conf}" return fi # Make sure its a sane tarball. Sane ones will have one of the two # directories we test for. for loc in dkms_source_tree dkms_binaries_only ''; do if [[ ! $loc ]]; then die 7 $"No valid dkms.conf in dkms_source_tree or dkms_binaries_only." \ $"$archive_location is not a valid DKMS tarball." fi local conf="$temp_dir_name/$loc/dkms.conf" [[ -f $conf ]] || continue if ! get_pkginfo_from_conf "$conf"; then echo >&2 echo $"Malformed dkms.conf, refusing to load." >&2 continue fi if is_module_added "$PACKAGE_NAME" "$PACKAGE_VERSION" && \ [[ ! $force ]]; then die 8 $"$PACKAGE_NAME-$PACKAGE_VERSION is already added!" \ $"Aborting." fi # Success! break done module="$PACKAGE_NAME"; module_version="$PACKAGE_VERSION" echo $"" echo $"Loading tarball for $module-$module_version" case $loc in dkms_source_tree) add_source_tree "$temp_dir_name/dkms_source_tree" ;; dkms_binaries_only) #if there is a source tree on the system already, don't build a binaries stub if [[ ! -d $source_tree/$module-$module_version ]]; then local -r source_dir="$dkms_tree/$module/$module_version/source" echo $"Creating $source_dir" mkdir -p "$source_dir" echo $"Copying dkms.conf to $source_dir ..." cp -rf "$temp_dir_name/dkms_binaries_only/dkms.conf" "$source_dir" fi ;; esac # At this point, the source has been copied to the appropriate location # and registered with dkms, or a binary-only config has been noted. # Now, add any included precompiled modules. # Load precompiled modules. for directory in "$temp_dir_name/dkms_main_tree"/*/*; do [[ -d $directory ]] || continue local -r kernel_arch_to_load=${directory/*dkms_main_tree\/} local -r dkms_dir_location="$dkms_tree/$module/$module_version/$kernel_arch_to_load" if [[ -d $dkms_dir_location && ! $force ]]; then warn $"$dkms_dir_location already exists. Skipping..." else echo $"Loading $dkms_dir_location..." rm -rf $dkms_dir_location mkdir -p $dkms_dir_location cp -rf $directory/* $dkms_dir_location/ fi done [[ $loc != dkms_binaries_only ]] || [[ -d $source_tree/$module-$module_version ]] } run_match() { set_kernel_source_dir_and_kconfig "$kernelver" # Error if $template_kernel is unset if [[ ! $template_kernel ]]; then die 1 $"Invalid number of parameters passed." \ $"Usage: match --templatekernel= -k " \ $" or: match --templatekernel= -k " fi # Error out if $template_kernel = $kernel_version if [[ $template_kernel = $kernelver ]]; then die 2 $"The templatekernel and the specified kernel version are the same." fi # Read in the status of template_kernel local template_kernel_status=$(do_status '' '' $template_kernel $arch | grep ": installed") # If $module is set, grep the status only for that module if [[ $module ]]; then # Make sure that its installed in the first place if ! [[ -d $dkms_tree/$module/ ]]; then die 3 $"The module: $module is not located in the DKMS tree." fi template_kernel_status=$(echo "$template_kernel_status" | grep "^$module,") fi echo $"" echo $"Matching modules in kernel: $kernelver ($arch)" echo $"to the configuration of kernel: $template_kernel ($arch)" # Prepare the kernel just once but only if there is actual work to do if [[ ! $template_kernel_status ]]; then echo $"" echo $"There is nothing to be done for this match." return 0 fi prepare_kernel "$kernelver" "$arch" # Iterate over the kernel_status and match kernel to the template_kernel while read template_line; do template_module=$(echo "$template_line" | awk {'print $1'} | sed 's/,$//') template_version=$(echo "$template_line" | awk {'print $2'} | sed 's/,$//') # Print out a match header echo $"Module: $template_module" echo $"Version: $template_version" maybe_build_module "$template_module" "$template_version" "$kernelver" "$arch" maybe_install_module "$template_module" "$template_version" "$kernelver" "$arch" done < <(echo "$template_kernel_status") } report_build_problem() { # If apport is on the system, files a build problem if [ -x /usr/share/apport/apport ] && which python3 >/dev/null; then python3 /usr/share/apport/package-hooks/dkms_packages.py -m $module -v $module_version -k ${kernelver[0]} fi die "$@" } # Little helper function for reading args from the commandline. # it automatically handles -a b and -a=b variants, and returns 1 if # we need to shift $3. read_arg() { # $1 = arg name # $2 = arg value # $3 = arg parameter local rematch='^[^=]*=(.*)$' if [[ $2 =~ $rematch ]]; then read "$1" <<< "${BASH_REMATCH[1]}" else read "$1" <<< "$3" # There is no way to shift our callers args, so # return 1 to indicate they should do it instead. return 1 fi } # A couple of helper functions for parsing out our most common arguments. # This one allows you to pass -k kernel.version-extra/arch instead of # -k kernel-version.extra -a arch. # This makes it harder to pass mismatching numbers of kernel/arch pairs, because # they are all passed at the same time. parse_kernelarch(){ if [[ $1 =~ $mv_re ]]; then kernelver[${#kernelver[@]}]="${BASH_REMATCH[1]}" arch[${#arch[@]}]="${BASH_REMATCH[2]}" else kernelver[${#kernelver[@]}]="$1" fi } # This allows you to pass module and module_version information on the commandline # in a more convenient form. Instead of the mostly mandatory and annoying # -m module -v module_version, you can use either -m module/module_version, # or just a raw module/module_version with no -m parameter. # This vastly improves readability and discoverability of # commands on the commandline. parse_moduleversion(){ if [[ $1 =~ $mv_re ]]; then module="${BASH_REMATCH[1]}" module_version="${BASH_REMATCH[2]}" else module="$1" fi } check_root() { [[ $(id -u) = 0 ]] && return die 1 $"You must be root to use this command." } check_rw_dkms_tree() { [[ -w "$dkms_tree" ]] && return die 1 $"No write access to DKMS tree at ${dkms_tree}" } # Add a passed source tree to the default source location. # We will check the dkms.conf file to make sure it is valid # beforehand. add_source_tree() { local from=$(readlink -f $1) if ! [[ $from && -f $from/dkms.conf ]]; then die 9 $"$1 must contain a dkms.conf file!" fi check_root setup_kernels_arches if ! get_pkginfo_from_conf "$from/dkms.conf" ; then die 10 $"Malformed dkms.conf file. Cannot load source tree." fi module="$PACKAGE_NAME" module_version="$PACKAGE_VERSION" if [[ $force && -d $source_tree/$module-$module_version ]]; then echo >&2 echo $"Forcing install of $module-$module_version" rm -rf "$source_tree/$module-$module_version" fi # We are already installed, just return. case $from in "$source_tree/$module-$module_version") return ;; "$dkms_tree/$module/$version/source") return ;; "$dkms_tree/$module/$version/build") return ;; esac mkdir -p "$source_tree/$module-$module_version" cp -fr "$from"/* "$source_tree/$module-$module_version" } # This code used to be in dkms_autoinstaller. # Moving it into the main dkms script gets rid of a fair amount of duplicate # functionality, and makes it much easier to reinstall DKMS kernel modules # by hand if dkms_autoinstaller is not used. autoinstall() { local status mv mvka m v k a local progress next_depends local -a to_install=() local -a next_install=() local -a known_modules=() local -a installed_modules=() local -a skipped_modules=() local -a failed_modules=() local -A build_depends=() local -A latest=() # Walk through our list of installed and built modules, and create # a list of modules and their latest version. while read status mvka; do IFS='/' read m v k a <<< "$mvka" if [[ -z "${latest["$m"]}" ]]; then known_modules[${#known_modules[@]}]="$m" latest["$m"]="$v" elif [[ ("$(VER "$v")" > "$(VER "${latest["$m"]}")") ]]; then latest["$m"]="$v" fi done < <(module_status) # Walk through our list of known modules, and create # a list of modules that need to be reinstalled. for m in "${known_modules[@]}"; do v="${latest["$m"]}" # If the module is already installed or weak-installed, skip it. if _is_module_installed "$m" "$v" "$kernelver" "$arch"; then installed_modules[${#installed_modules[@]}]="$m" continue fi if module_status_weak "$m" "$v" "$kernelver" "$arch" >/dev/null; then installed_modules[${#installed_modules[@]}]="$m" continue fi # If the module does not want to be autoinstalled, skip it. read_conf_or_die "$kernelver" "$arch" "$dkms_tree/$m/$v/source/dkms.conf" if [[ ! $AUTOINSTALL ]]; then continue fi # Otherwise, autoinstall the latest version we have hanging around. to_install[${#to_install[@]}]="$m/$v" build_depends["$m"]="${BUILD_DEPENDS[@]}" done [[ $to_install ]] || return 0 while true; do progress=0 next_install=( ) # Step 1: Remove installed modules from all dependency lists. for m in ${!build_depends[@]}; do next_depends= for d in ${build_depends[$m]}; do for i in ${installed_modules[@]} ${skipped_modules[@]}; do [[ "$d" = "$i" ]] && continue 2 done next_depends+="$d " done build_depends[$m]="${next_depends%% }" done # Step 2: Install modules that have an empty dependency list. for mv in "${to_install[@]}"; do IFS=/ read m v <<< "$mv" if [[ -z "${build_depends[$m]}" ]]; then (module="$m" module_version="$v" kernelver="$kernelver" arch="$arch" install_module) status=$? if [ "$status" = 0 ]; then installed_modules[${#installed_modules[@]}]="$m" progress=$(($progress +1)) elif [ "$status" = 77 ]; then skipped_modules[${#skipped_modules[@]}]="$m" progress=$(($progress +1)) else failed_modules[${#failed_modules[@]}]="$m($status)" fi else next_install[${#next_install[@]}]="$mv" fi done wait # Step 3: Remove modules that install was attempted for # during Step 2 from the job queue. to_install=( "${next_install[@]}" ) # Step 4: Keep going if at least one module was installed during # this iteration. [[ "$progress" -gt 0 ]] || break; done if [[ "${#installed_modules[@]}" -gt 0 ]]; then echo "dkms autoinstall on $kernelver/$arch succeeded for ${installed_modules[@]}" fi if [[ "${#skipped_modules[@]}" -gt 0 ]]; then echo "dkms autoinstall on $kernelver/$arch was skipped for ${skipped_modules[@]}" fi if [[ "${#failed_modules[@]}" -gt 0 ]]; then echo "dkms autoinstall on $kernelver/$arch failed for ${failed_modules[@]}" fi for mv in "${to_install[@]}"; do IFS=/ read m v <<< "$mv" echo "$m/$v autoinstall failed due to missing dependencies: ${build_depends[$m]}" done if [[ "${#failed_modules[@]}" -gt 0 || "${#to_install[@]}" -gt 0 ]]; then die 11 $"One or more modules failed to install during autoinstall." \ $"Refer to previous errors for more information." fi } ############################# #### #### #### Program Starts Here #### #### #### ############################# # Set a standard path PATH="$PATH:/usr/lib/dkms" # Ensure files and directories we create are readable to anyone, # since we aim to build as a non-root user umask 022 # Unset environment variables that may interfere with the build unset CC CXX CFLAGS CXXFLAGS LDFLAGS # Set important variables current_kernel=$(uname -r) current_os=$(uname -s) running_distribution=$(distro_version) dkms_tree="/var/lib/dkms" source_tree="/usr/src" install_tree="/lib/modules" tmp_location=${TMPDIR:-/tmp} verbose="" symlink_modules="" # Check that we can write temporary files tmpfile=$(mktemp_or_die) echo "Hello, DKMS!" > "$tmpfile" if [ "$(cat "$tmpfile")" != "Hello, DKMS!" ]; then warn $"dkms will not function properly without some free space in \$TMPDIR ($tmp_location)." fi rm -f "$tmpfile" # These can come from the environment or the config file [[ ! ${ADDON_MODULES_DIR} && -e /etc/sysconfig/module-init-tools ]] && . /etc/sysconfig/module-init-tools addon_modules_dir="${ADDON_MODULES_DIR}" weak_modules="${WEAK_MODULES_BIN}" # Source in configuration not related to signing read_framework_conf $dkms_framework_nonsigning_variables # Clear out command line argument variables module="" module_version="" template_kernel="" conf="" kernel_config="" kconfig_fromcli="" archive_location="" kernel_source_dir="" ksourcedir_fromcli="" action="" force="" force_version_override="" binaries_only="" source_only="" all="" module_suffix="" module_uncompressed_suffix="" module_compressed_suffix="" rpm_safe_upgrade="" declare -a directive_array=() kernelver=() arch=() weak_modules='' last_mvka='' last_mvka_conf='' try_source_tree='' die_is_fatal="yes" [ -x /sbin/weak-modules ] && weak_modules='/sbin/weak-modules' [ -x /usr/lib/module-init-tools/weak-modules ] && weak_modules='/usr/lib/module-init-tools/weak-modules' no_depmod="" action_re='^(remove|(auto|un)?install|match|mktarball|(un)?build|add|status|ldtarball)$' # Parse command line arguments while (($# > 0)); do case $1 in --module*|-m) read_arg _mv "$1" "$2" || shift parse_moduleversion "$_mv" ;; -v) read_arg module_version "$1" "$2" || shift ;; --kernelver*|-k) read_arg _ka "$1" "$2" || shift parse_kernelarch "$_ka" ;; --templatekernel*) read_arg template_kernel "$1" "$2" || shift ;; -c) read_arg conf "$1" "$2" || shift ;; --quiet|-q) exec >/dev/null 2>&1 ;; --version|-V) echo $"#RELEASE_STRING#" exit 0 ;; --no-initrd) # This is an old option, consume and warn deprecated $"--no-initrd" ;; --no-clean-kernel) # This is an old option, consume and warn deprecated $"--no-clean-kernel" ;; --no-prepare-kernel) # This is an old option, consume and warn deprecated $"--no-prepare-kernel" ;; --binaries-only) binaries_only="binaries-only" ;; --source-only) source_only="source-only" ;; --force) force="true" ;; --force-version-override) force_version_override="true" ;; --all) all="true" ;; --verbose) verbose="true" ;; --rpm_safe_upgrade) rpm_safe_upgrade="true" ;; --dkmstree*) read_arg dkms_tree "$1" "$2" || shift ;; --sourcetree*) read_arg source_tree "$1" "$2" || shift ;; --installtree*) read_arg install_tree "$1" "$2" || shift ;; --symlink-modules) symlink_module="true" ;; --config*) read_arg kernel_config "$1" "$2" || shift kconfig_fromcli="true" ;; --archive*) read_arg archive_location "$1" "$2" || shift ;; --arch*|-a) read_arg _aa "$1" "$2" || shift arch[${#arch[@]}]="$_aa" ;; --kernelsourcedir*) read_arg kernel_source_dir "$1" "$2" || shift ksourcedir_fromcli="true" ;; --directive*) read_arg _da "$1" "$2" || shift directive_array[${#directive_array[@]}]="$_da" ;; --no-depmod) no_depmod="true" ;; --modprobe-on-install) modprobe_on_install="true" ;; --debug) export PS4='${BASH_SOURCE}@${LINENO}(${FUNCNAME[0]}): ' set -x ;; -j) read_arg parallel_jobs "$1" "$2" || shift ;; -*) error $" Unknown option: $1" show_usage exit 2 ;; *) if [[ $1 =~ $action_re ]]; then [[ $action ]] && die 4 $"Cannot specify more than one action." action="$1" # Add actions to the action list elif [[ -f $1 && $1 = *dkms.conf ]]; then try_source_tree="${1%dkms.conf}./" # Flag as a source tree elif [[ -d $1 && -f $1/dkms.conf ]]; then try_source_tree="$1" # ditto elif [[ -f $1 ]]; then archive_location="$1" # It is a file, assume it is an archive. elif [[ ! $module ]]; then parse_moduleversion "$1" # Assume it is a module/version pair. else warn $"I do not know how to handle $1." fi ;; esac shift done # Sanity checking # The <(cmd) idiom does not work if /proc is not mounted read line < <(echo "Hello, DKMS!") if [ "$line" != "Hello, DKMS!" ]; then warn $"dkms will not function properly if /proc is not mounted." fi # Error out if binaries-only is set and source-only is set if [[ $binaries_only && $source_only ]]; then die 8 $" You have specified both --binaries-only and --source-only." \ $"You cannot do this." fi # Error if # of arches doesn't match # of kernels if (( ${#kernelver[@]} != ${#arch[@]} && \ ${#arch[@]} > 1 )); then die 1 $" If more than one arch is specified on the command line, then there" \ $"must be an equal number of kernel versions also specified (1:1 relationship)." fi # Check that kernel version and all aren't both set simultaneously if [[ $kernelver && $all ]]; then die 2 $" You cannot specify a kernel version and also specify" \ $"--all on the command line." fi # Check that arch and all aren't both set simultaneously if [[ $arch && $all ]]; then die 3 $" You cannot specify an arch and also specify" \ $"--all on the command line." fi # 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 # Default to -j parallel_jobs=${parallel_jobs:-$(get_num_cpus)} # Make sure we're not passing -j0 to make; treat -j0 as just "-j" [[ "$parallel_jobs" = 0 ]] && parallel_jobs="" setup_kernels_arches "$action" case "$action" in remove | unbuild | uninstall) check_module_args $action module_is_added_or_die [[ $action = uninstall ]] && check_root || check_rw_dkms_tree ${action}_module ;; add | build | install) check_all_is_banned $action # TODO: fix/enable --all [[ $action = install ]] && check_root || check_rw_dkms_tree ${action}_module ;; autoinstall) check_root && autoinstall ;; match) check_root && have_one_kernel "match" && run_match ;; mktarball) check_module_args mktarball module_is_added_or_die make_tarball ;; status) show_status ;; ldtarball) # Make sure they're root if we're using --force if [[ $(id -u) != 0 ]] && [[ $force = true ]]; then die 1 $"You must be root to use this command with the --force option." fi load_tarball && add_module ;; *) error $"Unknown action specified: \"$action\"" show_usage ;; esac dkms-3.0.11/dkms.service000066400000000000000000000004341442250756100150610ustar00rootroot00000000000000[Unit] Description=Builds and install new kernel modules through DKMS Documentation=man:dkms(8) Before=network-pre.target graphical.target [Service] Type=oneshot RemainAfterExit=true ExecStart=/usr/sbin/dkms autoinstall --verbose --kernelver %v [Install] WantedBy=multi-user.target dkms-3.0.11/dkms_apport.py000077500000000000000000000077221442250756100154500ustar00rootroot00000000000000#!/usr/bin/env python3 # # Dynamic Kernel Module Support (DKMS) # Copyright (C) 2009 Dell, Inc. # by Mario Limonciello # # This program is free software; you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by # the Free Software Foundation; either version 2 of the License, or # (at your option) any later version. # # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the # GNU General Public License for more details. # # You should have received a copy of the GNU General Public License # along with this program; if not, write to the Free Software # Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA # import apport from apport.hookutils import * import sys import subprocess, optparse from datetime import datetime optparser = optparse.OptionParser('%prog [options]') optparser.add_option('-m', help="Specify the DKMS module to find the package for", action='store', type='string', dest='module') optparser.add_option('-v', help="Specify the DKMS version to find the package for", action='store', type='string', dest='version') optparser.add_option('-k', help="Specify the kernel version", action='store', type='string', dest='kernel') options=optparser.parse_args()[0] if not options.module or not options.version: sys.stderr.write('ERROR (dkms apport): both -m and -v are required\n') sys.exit(2) package=packaging.get_file_package('/usr/src/' + options.module + '-' + options.version) if package is None: sys.stderr.write('ERROR (dkms apport): binary package for %s: %s not found\n' % (options.module,options.version)) sys.exit(1) if options.kernel: # TODO: Ubuntu specific kernel_package = "linux-headers-" + options.kernel supported_kernel = True try: supported_kernel = apport.packaging.is_distro_package(kernel_package) except ValueError as e: if str(e) == 'package %s does not exist' % kernel_package: supported_kernel = False if not supported_kernel: sys.stderr.write('ERROR (dkms apport): kernel package %s is not supported\n' % (kernel_package)) sys.exit(1) make_log=os.path.join('/var','lib','dkms',options.module,options.version,'build','make.log') report = apport.Report('Package') try: version = packaging.get_version(package) except ValueError: version = '(not installed)' if version is None: version = '(not installed)' report['Package'] = '%s %s' % (package, version) try: report['SourcePackage'] = apport.packaging.get_source(package) except ValueError: sys.stderr.write('ERROR (dkms apport): unable to determine source package for %s\n' % package) sys.exit(3) if report['SourcePackage'] == 'fglrx-installer': fglrx_make_log = os.path.join('/var','lib','dkms',options.module,options.version,'build','make.sh.log') attach_file_if_exists(report, fglrx_make_log, 'FglrxBuildLog') report['PackageVersion'] = version report['Title'] = "%s %s: %s kernel module failed to build" % (package, version, options.module) attach_file_if_exists(report, make_log, 'DKMSBuildLog') if 'DKMSBuildLog' in report: this_year = str(datetime.today().year) if 'Segmentation fault' in report['DKMSBuildLog']: sys.stderr.write('ERROR (dkms apport): There was a segmentation fault when trying to build the module\n') sys.exit(1) for line in report['DKMSBuildLog'].split('\n'): if ': error:' in line: report['DuplicateSignature'] = 'dkms:%s:%s:%s' % (package, version, line.strip()) break if options.kernel: report['DKMSKernelVersion'] = options.kernel try: with apport.fileutils.make_report_file(report) as f: report.write(f) except (IOError, OSError) as e: apport.fatal('Cannot create report: ' + str(e)) dkms-3.0.11/dkms_autoinstaller000077500000000000000000000044531442250756100164000ustar00rootroot00000000000000#!/bin/sh # # dkms_autoinstaller - A service to automatically install DKMS modules for new kernels. # # chkconfig: 345 04 04 # description: Compiles and install kernel modules automatically for new \ # kernels at boot. ### BEGIN INIT INFO # Provides: dkms_autoinstaller dkms # Default-Start: 3 4 5 # Default-Stop: 0 1 2 6 # Required-Start: $local_fs # Required-Stop: $local_fs # Short-Description: DKMS kernel modules installer service # Description: A service to automatically install DKMS modules for new kernels. ### END INIT INFO if [ -f /lib/lsb/init-functions ]; then . /lib/lsb/init-functions elif [ -f /etc/rc.d/init.d/functions ]; then . /etc/rc.d/init.d/functions fi # We only have these functions on Debian/Ubuntu # so on other distros just stub them out if [ ! -f /etc/debian_version ]; then alias log_daemon_msg='/bin/echo -n' log_end_msg() { if [ "$1" = "0" ]; then echo " Done. "; else echo " Failed. "; fi; } alias log_action_msg=/bin/echo fi exec="/usr/sbin/dkms" prog=${exec##*/} test -f $exec || exit 0 [ -e /etc/sysconfig/$prog ] && . /etc/sysconfig/$prog uname_s=$(uname -s) _get_kernel_dir() { KVER=$1 case ${uname_s} in Linux) DIR="/lib/modules/$KVER/build" ;; GNU/kFreeBSD) DIR="/usr/src/kfreebsd-headers-$KVER/sys" ;; esac echo $DIR } _check_kernel_dir() { DIR=$(_get_kernel_dir $1) case ${uname_s} in Linux) test -e $DIR/include ;; GNU/kFreeBSD) test -e $DIR/kern && test -e $DIR/conf/kmod.mk ;; *) return 1 ;; esac return $? } case "$1" in start) if [ -n "$2" ]; then kernel="$2" else kernel=$(uname -r) fi if [ -f /etc/dkms/no-autoinstall ]; then log_action_msg "$prog: autoinstall for dkms modules has been disabled" elif ! _check_kernel_dir $kernel; then log_action_msg "$prog: autoinstall for kernel $kernel was skipped since the kernel headers for this kernel do not seem to be installed" else log_daemon_msg "$prog: running auto installation service for kernel $kernel" dkms autoinstall --kernelver $kernel log_end_msg $? fi ;; stop|restart|force-reload|status|reload) # There is no stop action, this and the 04 priority during stop is # added to make RHEL chkconfig happy. # Ignore others on debian/ubuntu too ;; *) echo "Usage: $0 {start}" exit 2 esac dkms-3.0.11/dkms_common.postinst000066400000000000000000000177251442250756100166670ustar00rootroot00000000000000#!/bin/sh # Copyright (C) 2002-2005 Flavio Stanchina # Copyright (C) 2005-2006 Aric Cyr # Copyright (C) 2007 Mario Limonciello # Copyright (C) 2009 Alberto Milone set -e [ -f /usr/share/debconf/confmodule ] && . /usr/share/debconf/confmodule uname_s=$(uname -s) _get_kernel_dir() { KVER=$1 case ${uname_s} in Linux) DIR="/lib/modules/$KVER/build" ;; GNU/kFreeBSD) DIR="/usr/src/kfreebsd-headers-$KVER/sys" ;; esac echo $DIR } _check_kernel_dir() { DIR=$(_get_kernel_dir $1) case ${uname_s} in Linux) test -e $DIR/include ;; GNU/kFreeBSD) test -e $DIR/kern && test -e $DIR/conf/kmod.mk ;; *) return 1 ;; esac return $? } # Check the existence of a kernel named as $1 _is_kernel_name_correct() { if [ -e "/lib/modules/$1" ]; then echo yes else echo no fi } # Get the most recent kernel on Debian based systems. This keeps # into account both the version and the ABI. If the current kernel # is the most recent kernel then the function will print a null string. _get_newest_kernel_debian() { NEWEST_KERNEL= NEWEST_VERSION= NEWEST_ABI= for kernel in /boot/config-*; do [ -f "$kernel" ] || continue KERNEL=${kernel#*-} KERNEL_VERSION=${KERNEL%%-*} ABI=${KERNEL#*-} ABI=${ABI%%-*} if [ -z "$NEWEST_KERNEL" ]; then # The 1st time get a version which is bigger than $1 COMPARE_TO=$1 else # Get the biggest version COMPARE_TO="$NEWEST_VERSION-$NEWEST_ABI" fi # if $kernel is greater than $COMPARE_TO if [ $(dpkg --compare-versions "$KERNEL_VERSION-$ABI" ge "$COMPARE_TO" && echo "yes" || \ echo "no") = "yes" ]; then NEWEST_KERNEL=$KERNEL NEWEST_VERSION=$KERNEL_VERSION NEWEST_ABI=$ABI fi done echo "$NEWEST_KERNEL" } # Get the most recent kernel in Rhel based systems. _get_newest_kernel_rhel() { rpm -q --qf="%{VERSION}-%{RELEASE}.%{ARCH}\n" --whatprovides kernel | tail -n 1 } # Get the newest kernel on Debian and Rhel based systems. get_newest_kernel() { NEWEST_KERNEL= # Try Debian first as rpm can be installed in Debian based distros if [ -e /usr/bin/dpkg ]; then # If DEB based CURRENT_VERSION=${CURRENT_KERNEL%%-*} CURRENT_ABI=${CURRENT_KERNEL#*-} CURRENT_FLAVOUR=${CURRENT_ABI#*-} CURRENT_ABI=${CURRENT_ABI%%-*} NEWEST_KERNEL=$(_get_newest_kernel_debian "$CURRENT_VERSION-$CURRENT_ABI") elif which rpm >>/dev/null 2>&1; then # If RPM based NEWEST_KERNEL=$(_get_newest_kernel_rhel) fi # Make sure that kernel name that we extracted corresponds to an installed # kernel if [ -n "$NEWEST_KERNEL" ] && [ $(_is_kernel_name_correct $NEWEST_KERNEL) = "no" ]; then NEWEST_KERNEL= fi echo $NEWEST_KERNEL } NAME=$1 VERSION=$2 TARBALL_ROOT=$3 ARCH=$4 UPGRADE=$5 if [ -z "$NAME" ] || [ -z "$VERSION" ]; then echo "Need NAME, and VERSION defined" echo "ARCH is optional" exit 1 fi if [ -f /etc/dkms/no-autoinstall ]; then echo "autoinstall for dkms modules has been disabled." exit 0 fi # read framework configuration options if [ -r /etc/dkms/framework.conf ]; then . /etc/dkms/framework.conf fi KERNELS=$(ls -v /lib/modules/ 2>/dev/null || true) CURRENT_KERNEL=$(uname -r) #We never want to keep an older version side by side to prevent conflicts if [ -e "/var/lib/dkms/$NAME/$VERSION" ]; then echo "Removing old $NAME-$VERSION DKMS files..." dkms remove -m $NAME -v $VERSION --all fi #Load new files, by source package and by tarball if [ -f "$TARBALL_ROOT/$NAME-$VERSION.dkms.tar.gz" ]; then if ! dkms ldtarball --archive "$TARBALL_ROOT/$NAME-$VERSION.dkms.tar.gz"; then echo "" echo "" echo "Unable to load DKMS tarball $TARBALL_ROOT/$NAME-$VERSION.dkms.tar.gz." echo "Common causes include: " echo " - You must be using DKMS 2.1.0.0 or later to support binaries only" echo " distribution specific archives." echo " - Corrupt distribution specific archive" echo "" echo "" exit 2 fi elif [ -d "/usr/src/$NAME-$VERSION" ]; then echo "Loading new $NAME-$VERSION DKMS files..." dkms add -m $NAME -v $VERSION > /dev/null fi # On 1st installation, let us look for a directory # in /lib/modules which matches $(uname -r). If none # is found it is possible that buildd is being used # and that uname -r is giving us the name of the # kernel used by the buildd machine. # # If this is the case we try to build the kernel # module for each kernel which has a directory in # /lib/modules. Furthermore we will have to tell # DKMS which architecture it should build the module # for (e.g. if the buildd machine is using a # 2.6.24-23-xen 64bit kernel). # # NOTE: if the headers are not installed then the # module won't be built, as usual # Here we look for the most recent kernel so that we can # build the module for it (in addition to doing it for the # current kernel. NEWEST_KERNEL=$(get_newest_kernel) if [ -z "$autoinstall_all_kernels" ]; then # If the current kernel is installed on the system or chroot if [ $(_is_kernel_name_correct $CURRENT_KERNEL) = "yes" ]; then if [ -n "$NEWEST_KERNEL" ] && [ ${CURRENT_KERNEL} != ${NEWEST_KERNEL} ]; then KERNELS="$CURRENT_KERNEL $NEWEST_KERNEL" else KERNELS=$CURRENT_KERNEL fi # The current kernel is not useful as it's not installed else echo "It is likely that $CURRENT_KERNEL belongs to a chroot's host" # Let's use only the newest kernel if this is not a first installation # otherwise build for all kernels if [ -n "$NEWEST_KERNEL" -a -n "$UPGRADE" ]; then KERNELS="$NEWEST_KERNEL" fi fi fi # Take care of displaying newline separated list echo "Building for $KERNELS" | tr '\n' ',' \ | sed -e 's/,/, /g; s/, $/\n/; s/, \([^,]\+\)$/ and \1/' if [ -n "$ARCH" ]; then if which lsb_release >/dev/null && [ $(lsb_release -s -i) = "Ubuntu" ]; then case $ARCH in amd64) ARCH="x86_64" ;; lpia|i?86) ARCH="i686" ;; esac fi echo "Building for architecture $ARCH" ARCH="-a $ARCH" fi for KERNEL in $KERNELS; do dkms_status=$(dkms status -m $NAME -v $VERSION -k $KERNEL $ARCH) if [ $(echo $KERNEL | grep -c "BOOT") -gt 0 ]; then echo "" echo "Module build and install for $KERNEL was skipped as " echo "it is a BOOT variant" continue fi #if the module isn't yet built, try to build it if [ $(echo $dkms_status | grep -c ": built") -eq 0 ]; then if [ ! -L /var/lib/dkms/$NAME/$VERSION/source ]; then echo "This package appears to be a binaries-only package" echo " you will not be able to build against kernel $KERNEL" echo " since the package source was not provided" continue fi if _check_kernel_dir $KERNEL; then echo "Building initial module for $KERNEL" set +e dkms build -m $NAME -v $VERSION -k $KERNEL $ARCH > /dev/null case $? in 77) set -e echo "Skipped." continue ;; 0) set -e echo "Done." ;; *) exit $? ;; esac dkms_status=$(dkms status -m $NAME -v $VERSION -k $KERNEL $ARCH) else echo "Module build for kernel $KERNEL was skipped since the" echo "kernel headers for this kernel do not seem to be installed." fi fi #if the module is built (either pre-built or just now), install it if [ $(echo $dkms_status | grep -c ": built") -eq 1 ] && [ $(echo $dkms_status | grep -c ": installed") -eq 0 ]; then dkms install -m $NAME -v $VERSION -k $KERNEL $ARCH fi done dkms-3.0.11/dkms_find-provides000077500000000000000000000045451442250756100162650ustar00rootroot00000000000000#!/bin/bash # heavily based upon find-suggests.ksyms by Andreas Gruenbacher . # with modifications by Michael Brown # # -- added module versioning info to modalias() symbols # -- removed code which inspects spec files. IFS=$'\n' print_modaliases() { declare class=$1 variants=$2 pos=$3 if [ -n "$variants" ]; then echo "${class:0:pos}[$variants]${class:pos+1}" else [ -z "$class" ] || echo "$class" fi } combine_modaliases() { declare tag class variants pos n read class while read tag; do for ((n=0; n<${#class}; n++)); do if [ "*" != "${class:n:1}" -a \ "${class:0:n}" = "${tag:0:n}" -a \ "${class:n+1}" = "${tag:n+1}" ] && ( [ -z "$pos" ] || [ $n = $pos ] ); then variants="${variants:-${class:n:1}}${tag:n:1}" pos=$n break fi done if [ $n -eq ${#class} ]; then print_modaliases "$class" "$variants" "$pos" variants= pos= class=$tag fi done print_modaliases "$class" "$variants" "$pos" } get_modinfo() { module=$1 # | head -n1 because some modules have *two* version tags. *cough*b44*cough* modver=$(/sbin/modinfo -F version "$module"| head -n1) modver=${modver// /_} # only add version tag if it has a version if [ -n "$modver" ]; then /sbin/modinfo -F alias "$module" \ | sed -nre "s,(.+),modalias(\\1) = $modver,p" else /sbin/modinfo -F alias "$module" \ | sed -nre "s,(.+),modalias(\\1),p" fi } tmp=${TMPDIR:-/tmp} TMPDIR=$(mktemp -d ${tmp}/dkms-findprovides-$$-$RANDOM-XXXXXX) trap "rm -rf $TMPDIR >/dev/null 2>&1" QUIT EXIT HUP INT TERM modlist= for cand in $(grep -E '(/lib/modules/.+\.ko$|tgz$|tbz$|tar\.(gz|bz2|xz)$)') $*; do if echo $cand | grep -q -E '/lib/modules/.+\.ko$' > /dev/null 2>&1; then modlist="$modlist $cand" fi [ -f $cand ] || continue opts=x if gzip -t $cand >/dev/null 2>&1; then opts=${opts}z elif bzip2 -t $cand >/dev/null 2>&1; then opts=${opts}j elif xz -t $cand >/dev/null 2>&1; then opts=${opts}J fi tar ${opts}f $cand -C $TMPDIR > /dev/null 2>&1 done for module in $(find $TMPDIR -name \*.ko) $modlist; do if echo $module | grep -q -E '.ko$' >/dev/null 2>&1; then # it is a straight module get_modinfo $module continue fi done \ | sort -u \ | combine_modaliases dkms-3.0.11/dkms_framework.conf000066400000000000000000000027661442250756100164350ustar00rootroot00000000000000# This configuration file modifies the behavior of DKMS (Dynamic Kernel Module # Support) and is sourced in by DKMS every time it is run. # Source Tree Location (default: /usr/src): # source_tree="/usr/src" # DKMS Tree Location (default: /var/lib/dkms): # dkms_tree="/var/lib/dkms" # Install Tree Location (default: /lib/modules): # install_tree="/lib/modules" # Temporary folder Location (default: /tmp): # tmp_location="/tmp" # Verbosity setting, will be active if set to a non-null value: # verbose="" # This creates symlinks from the install_tree into the dkms_tree instead of # copying the modules. This preserves some space on the costs of being less # safe. Symlinking will be active if set to a non-null value: # symlink_modules="" # Automatic installation and upgrade for all installed kernels if set to a # non-null value: # autoinstall_all_kernels="" # Location of the sign-file kernel binary. $kernelver can be used in path to # represent the target kernel version. (default: depends on distribution): # sign_file="/path/to/sign-file" # Location of the key and certificate files used for Secure boot. $kernelver # can be used in path to represent the target kernel version. # mok_signing_key can also be a "pkcs11:..." string for PKCS#11 engine, as # long as the sign_file program supports it. # (default: /var/lib/dkms): # mok_signing_key=/var/lib/dkms/mok.key # mok_certificate=/var/lib/dkms/mok.pub # Automatically modprobe the built modules upon successful installation: # modprobe_on_install="true" dkms-3.0.11/images/000077500000000000000000000000001442250756100140055ustar00rootroot00000000000000dkms-3.0.11/images/mok-key-1.png000066400000000000000000000116761442250756100162400ustar00rootroot00000000000000‰PNG  IHDR® ¦L‰ pHYsÄÄ•+pIDATxœíÝÉn+é}Æá‘Ôp†vOq^$«¬r[‚d•{ÈÞðBrYYIÛmwŸ>ƒD‹YÈPØI±(Eñ}ôâˆ"«>Ùü~ªjª. H5zîÏI @4)ѤD“M @4)ѤD“M @4)ѤD“M @4)ѤD“M @4)ѤD“M @4)ѤD“M @4)ѤD›ôÈÙ¸Æóú}Õ¸ª&'ÕÎ^W-ƵxòÁA_s¯Ca\Ísj^£ªùxr5o»ª³ªé¤~ÞÖuÕl 5öNÑÉÕŽÏ'o¯f“Q´³ÇÕÍëzÞœ 1>ègá­œÝ͛U‹vR§ó¶Æõí¼~<Ÿ¼¶¿k&µh_ ´ÂÞ)ÐÍšªf>kÏk:«yÕùéø|>oZÿ q:;x„Q#%y~“Åùhܵó·Uÿq^?¿jßU½©öÀkìû€Qý|rÚµíoþáWuòö¿Fã¿|wý?“æ‡Ï¯?b|ÐË|$IÙݸsúÏïûÓ?Îæ_~þæíbúiv5þû¿ùprþùìÓgóúa 5öN¦>L§õæì—磦{÷íßþÝošúzR¯¯F×CŒúé¨â¼q^u?k›E·øí¯~}v^_Ÿ\}ü4Õ7§è ¡w œœ~?ŸN>\OÏΧ‹YuuºµM7«î|ˆñì”ä´õiV_4õÇóÉ«æìß>N›jÞŸžÎ¯ÛûÞ;®¦ç5™œÔ—ó«y×Í«ªN¦íõépµ}ÌŸ{¼hÞÇx~³šÔÉ»Åô‹v~5úøÕéI;mæWׇ[cï8­o§õŸ³¶Õ›®[ŒO»öú»Iýå¼¾b|ÐK·Ëõ±ð'£r€€ç7©o¦Ó=9¯šŸ&³éìº&ŸNê³úÃ`kìiZ¿´¯Ûêf£«:­v:šÔ7³úãNQp@¤$‡`Z¿ŸÔ׳«nqÚΪ­MÚ·³úýpŸ ètYˆ& š€hR¢Iˆ& š€h.¢åØ\^þäË‹‹ŸÜxóå@+½]øí—ws;†íoß<à¡®£wyiÓ½—Û9øæ¿º7IoxàÊéù‘n×{;žo_÷­ÍËgC<ãðIØŸu3·xF@Õ'ãAk`Ë] ˤGåæpûíàû“âʃë÷o\¾å©æ× ‡¥ŸäˆõÊón­<\òà¶a;,/ÃI›ï¿ažóÑëç½3žå;ë'p€€csû^¿îHðýÉ`›ià‘Ç•×=ü©ÎQX7Çß9gâ©V´ná·_®üÖý—Çy¿¶ÿÍí›Ï¹?ž¾çdÀq“¡ óGß7ý§šA7xªyhÐùìÐΰ;´ñÀ‹æGëÎÁ‚—°îÚ¿–¶Ã·¶wÿ'}ÂŽ¹¿ú.|‡Álد³òyѰ)Ç`e÷ ·Ÿ`ÃAý'¹ÿ¾ã·ŸvãGe xB>< €ý´6üÎ}ø…´Yßñ}82pTn÷“/ßRÍÁË'´ï¶“ùÁõ®;ª}g}/rÛ|4ýþxîß¾›åålsNƺû¯Ϻño³ümî¿rT«©êû®ÐMjÒVwyÙUÕÅÅhR£¶Z;àÅ9¨Yð Ïjßó¬ùBÂÔkÏ< ÈÊä{Fwvì?ûx “€ 8×à M @4)ѤD“M @4)ѤD“M @4)ѤD“M @4)ѤD“M @4)ѤD“M @4)ѤD“M @4)ѤD“M @4)ѤD“M @4)ѤD“M @4)ѤD“M @4)ѤD“M @4)ѤD“M @4)ѤD“M @4)ѤD“M @4)ѤD“M @4)ѤD“M @4)ѤD“M @4)ѤD“M @4)ѤD“M @4)ѤD“M @4)ѤD“M @4)ѤD“M @4)ѤD“M @4)ѤD“M @4)ѤD“M @4)ѤD“M @4)ѤD“M @4)ѤD“M @4)ѤD“M @4)ѤD“M @4)ѤD“M @4)ѤD“M @4)ѤD“M @4)ѤD“M @4)ѤD“M @4)ѤD“M @4)ѤD“M @4)ѤD“M @4)ѤD“M @4)ѤD“M @4)ѤD“M @4)ѤD“M @4)ѤD“M @4)ѤD“M @4)ѤD“M @4)ѤD“M @4)ѤD“M @4)ѤD“mòÜà°\^Þ½åââ9Ʊ/·?ïÐ?æååamÉå'z»YÝ튖¿¼ó’»sãò—µ÷ìÐ^?{ø‰Û·›‹‹ÕïÔGf?o¯‡¶ ogÖ=?Å7+Z^ÝòHÌúëÚë‡ãc¯D;üIWÀÐì€ÿwyé7°aÙ¼p€ì`+·¿™Ý?¸¾òXï·o^õÊ…ÜφcÒZùØ;«î»ü•;Ã7,ÿÁ±m¹ý7Ü›¡>¸œå/ý­}Ë…oO¯×ϺûoXŃç:ôz]­ÛÎÕóÅ ½Ø+ÀVnߘîÓ]w¬·ïí›W}ÿÎëÆ³³usü#—ûð;ÿî»ü¾ÛÃö¹ÿÝ–sÇ6Ûçf }'³Ý&¿å—J¯×ÏÊû/oŸû°Íó¸ÛóµîõOË^VÛüÛäS½›Ô[ÛA æi-ÿhù=þþCúÒ+íuòü¡€8´ñÀJR€Õz½e¯¼ñÎq÷ÛßWÞÞká¹?å¼”÷ñççͳ¹¼[{ UlY+ÇÓwl;ü,ë²nû¼”×9¤OàÁ=Ëïæën_iÃAÙ§µrÊy)û ^Ê8÷¯ïëg·×Û~yÀpœ+´=„ „“<¥Ûÿ—k®Ê[wû!Ø0å<Õ°‡þñyó&è»ý‡¾?lI ð+O/ßpûíôyû&µ|`ûÛ×Y¾¯3í·|ÓÜp”wËñoãþ¹â}·Ãò€·YκçkÝ·vXΓxp½O¸ü¾¯Ÿ•gøoùúßfùÛ?ï÷GO«©êûÿ\7©I[ÝåeWU£IÚjUhèwÏ}¾;› „'‚áí{ž5s´Ž©x^öÌsÜ\AÀQY¹ÿö-ÿÁõnyYOëÎE°žŽŒਠýý\s€¹çÙy 8b@4)ѤD“M @4)ѤD“M @4)ѤD“M @4)ѤD“M @4)ѤD“M @4)ѤD“M @4)ѤD“M @4)ѤD“M @4)ѤD“M @4)ѤD“M @4)ѤD“M @4)ѤD“M @4)ѤD“M @4)ѤD“M @4)ѤD“M @4)ѤD“M @4)ѤD“M @4)ѤD“M @4)ѤD“M @4)ѤD“M @4)ѤD“M @4)ѤD“M @4)ѤD“M @4)ѤD“M @4)ѤD“M @4)ѤD“M @4)ѤD“M @4)ѤD“M @4)ѤD“M @4)ѤD“M @4)ѤD“M @4)ѤD“M @4)ѤD“M @4)ѤD“M @4)ѤD“M @4)ѤD“M @4)ѤD“M @4)ѤD“M @4)ѤD“M @4)ѤD“M @4)ѤD“M @4)ѤD›ôȨ­îæ7_·ÕI x¡LáM @4)ѤD“M @´.&ìçòòî-]à#—ð\îlŠÿ)nG{àãà‘ß+p;‘\\üéß÷ã`{{yù¨%o³êÇüf#<~;ì1ø^n˜Y8LÇ“CϵærŽÒs¦Àºcç+o_¾ñvgûýEÝYÈÅÅÚo-÷Ái¾×òŸJ¯íÓ÷öÍã_yðâeëÀ–šªYo9‰ÖCSÑ¥­»ýÁ•®ëƒ•3ßÊ1lóS<¸ümrcóûnŸ¶çƒÿÞðöÚtôÑMjÒVwyÙUÕÅÅhR£¶ÚáNïÛß^Ûåå^ðxËSi¯íÐw‹í¼…·œãcŸA€ãs<ç ™›_Ê×íEØÿÕ›ÇÀË%×¹y/³LÃÆÀËåÓ ÚKM¡?PèÉõð–÷_w·'ß>/nƒ°¥Á¯ ØðÁÃ}/Š»óÝuÇη<[~ÝòWêµüm²Íz½˜°¶Þ>ënwt`û¾‚`¬#ø8:ûN—z€`gvtÀ²¸Xþxƒ²K€x‰šþàVÜ^`™€hR¢Iˆ& š€hR¢Iˆ& ZïO×iW“W§ÿò~ö×o~ö»_ÿãÕµíäßÏÛ¯ÖT‘c8‚,²È&ÈbvY[’/$#7#N<ÓÓ×stá¥.Y¨¡æH¤DR¢¨‡üýp›¬zIUóÏ·ªHç¤UîzÀ“h9ä¦å›–@nZ¹i9ä¦å›–@nõ:WUQµñUDõ šÙID_E¿¥ÁÁêZÛ!OPE±ë!@´QF´U=n›.b1­ã‹&&³‡o¸FËËÁ÷ÑTGõ›ñ¬.cÐÌ>Vѵ1i‹ÁÓÏ¡÷\ÌæÚ¢Ûõ ¢oê¶MTñÓ6>Õo¦Ío‹:úæøáÛ­ÑònVDí¬9Šé,Úˆ£auÔ¶Eãÿ^δœ'( ¯Ù½º?*«®ißDüõQ|1n>DœFsùø W_G_Ôîiþê—þoþoYýâÃäoëâûw“wO9<¶ôš’ÍU“‡Ø½ï†ßÎÚOß¾é§×³qõ¯þôrpônvý¶ï¾á-/âr:ÓÑ•E÷á§öÏÿªˆÏë8—“§ žCçXOàyŒWà¸û¤)ú®ÿòÏ5:ŠÏGƒñÕu[ÆÇ›ÓÔ°FËÃïÚi}9™ŽŽ¦ý,ºöeSt³èŽž6x€]óZW ‰ëY¼/âÛ£ú¸ýÏ«iÅÅpØŽÛÿ½FËÇÓ£¨ëA|ÚŽÛ®k#"Óf2|ôõ¼ˆv× 5ÏcìÞ,ê|è§ï›v\^}64Ó¢O®½á-ÆO§ñ7³¦)ã´ëújØ5“¯ëøE_?aäð<ºõÞ` ¿£ ûØÙ½:~2þÁQD;*ëÙt6‰úz?›Å7ÝpeÓø²nNšèfå8†ÑLË:~2‹o×|“:À«ãµ ¯Á4¾ªãóÙ¸ë‡Í,šˆ²nÞÌâ«G?ØÍ©››–@nZ¹i9ä¦å›–@nZ¹yK%{îüüî%gg϶À'.jõÕÝ®hþ×;wíÎ…ó¿¾À8_­óóƒ¾ûóröÜíóøÙÙâ®å6O_Ôë_ÝüHd{™ûÁn™—Æ^5Õ„y9ä`Š ,c^ÎázàxóÙÙÝÏϵœù_·:o^qáŒgá™<>ËÎ$X¶ŠG÷?0žXùqû'8æå¨‡7ßœ0u§ ÷Øl9 Gò°›%¬[£Íê5Åûƒà~-¼þüãs?ä o²p<ë>η¿Þùö’y9‡bõyö¼ù+?e&}ÿ&ëî3ß`¥kÂýÚöá¿¶ñÀk¦åŠ…UÛU0n^ÌïÞÒ*VÌùÂñ¬;¶ î˲›,{|Òrš]¯ËQD¬þ¿~WGÝDw~ÞEÄÙYYGÙDã° M…ÇlØY¶ÈÎmxZlÑ}ì&å° Þ“l—~ö™—@nZ¹i9ä¦å›–@nZ¹i9ä¦å›–@nZ¹i9ä¦å›–@nZ¹i9ä¦å›–@nZ¹i9ä¦å›–@nZ¹i9ä¦å›–@nZ¹i9ä¦å›–@nZ¹i9ä¦å›–@nZ¹i9ä¦å›–@nZ¹i9ä¦å›–@nZ¹i9ä¦å›–@nZ¹i9ä¦å›–@nZ¹i9ä¦å›–@nZ¹i9ä¦å›–@nZ¹i9ä¦å›–@nZ¹i9ä¦å›–@nZ¹i9ä¦å›–@nZ¹i9ä¦å›–@nZ¹i9ä¦å›–@nZ¹i9ä¦å›–@nZ¹i9ä¦å›–@nZ¹i9ä¦å›–@nZ¹i9ä¦å›–@nZ¹i9ä¦å›–@nZ¹i9ä¦å›–@nZ¹i9ä¦å›–@nZ¹i9ä¦å›–@nZ¹i9ä¦å›–@nZ¹i9ä¦å›–@nZ¹i9ä¦å›–@nZ¹i9ä¦å›–@nZ¹i9ä¦å›–@nZ¹i9ä¦å›–@nZ¹i9ä¦å[½ëÀs銢¨Ši×ED]ƒ*NÛ˜ìh<ýŽÖ»¯Š­.½Œ£..ª˜F”u]_ º®3á!-goŒŠˆ¦«#†Í 5Ý·eqÝvíŽÆã®ç5ÛêÒ‹ˆ²ì£ÿ´ë»>"ú2úYD±«íÖàé†=QEÓ—ÓhßEtQÔ³ö:¢™õuµ£y•<¯mÿÛ裛DEôe}Ú5M=˜ö³²ÝòþxZΞè¢ëÛˈë¨>®+GM7‹è†í–çs¼Œvë¯ÉFå`ÚõEùI7½ˆ¸nf—U|¶å•ÂóÐröDeÃã·õÕÇ6¢ì&ߟκ¦ÚѼªu¼üYmûïØE]ÅU?Dœ.»é[ÇËÉBËÙmœF¼lN«AÓŽgñé ŽgqÑFµ£Ù7ûœÚè¶¼†ÙiýîbÒŸÖo›¦ìÇ¿ßD—[^/<-go\ŒŽºéøoþݯþáðäo»ÉOÊ¿îG¿wù“ŒfúC xÃluù_Ÿ^tãÙIüƒ®ú/1ûÃñOÿÛñÉÏ®¯ÌËÉAËÙƒÁdüÍIüüdx=»xûoþôÛ&Ž'ñ®« ȼüym÷¼‡*þÎ(&e|ùËÿðÉàèòMüÑÅÕocø.¦ÛÞÏ@ËÙ³Iﮢ‹Y?¨ê1®£lãÒ¼j_l÷µQÓ¨›èÕ0fíEŒëx×LÛ)ØL 7-€Ü´rÓrÈMË 7-€Ü´rÓrÈMË 7-€Ü|†+lÑùù?Ÿ=uQO\³¸½GÏ5˜Wr¿ 5órØ–›ìýЪù®o¶¨eÿé)K^×óv÷%G{LËa+nC~ÃÔØûØá…l)ç^%Z/íÎŽåù=ðggwHÏ_ùÎ\?½~x9÷^6žÕïÅ£ËyàþÞ3°ûØáEÍD_XÙû—Ï憎¼ûý[¶œuÇó¨;×_¶œîï÷ X‹–@nö±Î'‡Ü´°‹r³^ˆ¹/°%Z[qç<²ç ù¶?æ…?yfçë…ýPD¬þ?PWGÝDw~ÞEÄÙYYGÙDã¯ÃkÜ>~†ëÃïÝZø¶±Xô°‡—¿ì­h1÷޵…'®?º¿}­÷ž=ºügÿPØM½Æí‡Ã³áv¨åì Û'Oaûá5Øp;tî{£î£?‰7Óúëˆ8‰Ï'qQWÑ/¼v»äröCÅZ×o—l?ÝvÏIËÙE_ýºi¿mÞDDW}õ›hÚÍâ«÷æ[û¬-ÚõnÐn?[<7-gOÔ1ŒöçeŒ‡£ID”Q—íÏËèû~ñü¬%g/Týp­ë1X¸ý4q½ÂsÒröDSÿ“(š¦‹öêßGĸú—QFôutKšm×é^k×ÝíRÖ‹·ŸæWÛúã*®#¢ˆã¢¸îã5},§åð¢nã½bÅç¯?|ýæ]jó ™ÿ¯ËnµìòÕ-[oú%EDD]£›Š› µœ ŠˆÕÿìꨛèÎÏ»ˆ8;+ë(›hì¨çuXðÉá°²2¢‹"þâ/ÿ2"þÙŸüIô7þÅ®ÆAÙ°³æåQ•]ß½íûYUUQôGE Šòcë{îÉ@Ë¢íê(?FD3DD_ŽûGç’숨«¨¢*ÞöÝ ïUñ6ªˆºÚõ°`%^u²7ÎüR4}ǃø¦>é#bØþÛYûY×N}#-ˆ¾Ž¦™”q4™"¢¾‰IÔá[OIAË"š¾Žbå(Æ1²Ž¢iúÞ¬¯›–s ¾úÙßÈv»–;K^vùêKxvóÈK¾¡ï‰wðÅxÍœûƺ}ê?;Ûb–-yõ5¾L¢nŠxûP¼äç¾,»ƒçç+ CÂ!´nH­­¾¸¶Á>vøAŠ€ÝN ÷ÞSv¹Âãó´âüüÇgÿÛÜ9»ìò¸·Gz{!¹ª…ë]x †´îý¿Úê+]¶}áQðGg!ç`ÙÇΡ[V¦;—]>¤y«›—Eúéë½½áýÓßžrÏé} ÓËÖ+ä2órÝüÔs­[½¼-­t•™ôê«^ñÁ|bzW|¼Ò4à~&oNö~=_7zóHnãñ¼‹?p—_Ïã/̼r¸™=ÏÚ<¯BžÅcç÷ŠûÂ0/‡˜ÕIi9D$ ùçš½ª=íÛ°Ê|ùºWBË9Pó'o¯òì¿ðdï¸w7îí ^x«e—?°Þ;–­÷þåZ8˜Íîïêæ—³ÊÚ—­W¹!"Šu¾²«£n¢;?ï"â쬬£l¢ñ‚€WÅ{“æy4Væù×`ÃíÐf {KÈá@8öÊ‹}ðzh9ìñ†d;ä¦å›–@nŽ—s ¾/ùÙ6/üîÎ._} Ï5’Õoøô1l¶Þ§|‘ùÆ7‡\ÌË9P·Oñ·ß¡¹Õµ¬xùS®¹åÌÓh¼ì³,ðŠŸ#á-‡Oý+Øê‹à)ìc‡U OÜÁ{IËáw¾(óöIÿþ'/¼<^êãY^ïÂ_8žg9½úã0µÕƒºl/úÂÁ?úø¯¶Þ²‰î懛ߛèì¹$ [*‡nYî$^vùüåmT¾_Çû+]e<+Žsá·ž<ýqXq½ Óû@§—­×ŒœC`^Ρ›Ÿb®u«ö”¯#Ûl9«Ì¤W_ÚZ_Ú¶ñûâ+Ø3ZYŸë—½­îΙޯáÞÝŒj³—M«,ùáû; ö’}ìÒw‹Í»Ýá| ßðýðý=§åðO÷@RZ{ò?Jeo¬rMÍÙ{ZΚ?I{•gù…'uÇ\'n—³ðíR O®¾ùë½c~½ Ï·¿3ž J¶p›=«›_Î*kÆû y«oò]uÝùyggee¼*ÞƒÄSØ~Ø© ;+Û–@nZ¹i9ä¦å›–@nZ¹i9{¢*¦ª8º./šbTŬ®êAŒ#º%ÿàGuL뺫¢oÊî:Ú*êˆqU^íz\°ߓƞhûãˆã2ŠÓágM{ÝÆQôMÄ›"š…×ï_x|¼nM¼‰vÑ•Uœ«8n£m»ÂË>R0/gO ‹®¬bßµã¾m?Tq'WÊhþÛõxym¾‹“iUÖm3i'ãi\Tƒ~XxÉGæåì‰i_F;«¢Êf\vñ1®û">m—ÌËÍ·˜WÄgýõ7]×ŬªèÛYÛz†$ óröÄhtÅW££f<¾÷M\ Ú·Gñ6ªvñ?˜3ŠOêîèM´£úÝøº;:¾ˆøntt´ëqÁJ¼êdOL&MŒ>½3ë~Q ¯ùŸþáú×_¼ÿuq1\xýÆsæ”'¿ùí‡ëwGÔõÿk6ùû—×ÿ'†?›Œ'»¬DËÙ£²LßG|ñ¯ÿlRÆè*¾¯«£h¿j¢Xr ??ªãcTŸ5í—'ñI׳fT]LìÁ!Og쉾»Œ˜Åñ÷ãëÏ"¾‹£7ͬ,ãóåÇÅÍËùQŸv]'¯®êˆ:ŽšW}ÛFŒv=4xœ–³'¦7Ϲ×ï#ºˆObÑ9_ÕtÑFquúÃïã*"¦ž!I¹o›–@nZ¹i9ä¦å›–@nZ¹i9ä¦å›–@nZ¹i9ä¦å›–@nZ¹i9ä¦å›–@nZ¹i9ä¦å›–@nZ¹i9ä¦å›–@nZ¹i9ä¦å›–@nZ¹i9ä¦å›–@nZ¹i9ä¦å›–@nZ¹i9ä¦å›–@nZ¹i9ä¦å›–@nZ¹i9ä¦å›–@nZ¹i9ä¦å›–@nZ¹i9ä¦å›–@nZ¹i9ä¦å›–@nZ¹i9ä¦å›–@nZ¹i9ä¦å›–@nZ¹i9ä¦å›–@nZ¹i9ä¦å›–@nZ¹i9ä¦å›–@nZ¹i9ä¦å›–@nZ¹i9ä¦å›–@nZ¹i9ä¦å›–@nZ¹i9ä¦å›–@nZ¹i9ä¦å›–@nZ¹i9ä¦å›–@nZ¹i9ä¦å›–@nZ¹i9ä¦å›–@nZ¹i9ä¦å›–@nZ¹i9ä¦å›–@nZ¹i9ä¦å›–@nZ¹i9ä¦å›–@nZ¹i9ä¦å›–@nZ¹Õë\¹l¢»ùáæ÷&:¯`·”rÓrÈMË 7-€Ü´rÓrÈMË 7-€Ü´rÓrÈMË 7-€Ü´rÓrÈMË 7-€Ü´rÓrÈMË 7-€Ü´rÓrÈMË 7-€Ü´rÓrÈMË 7-€Ü´rÓrÈMË ·zõ«V1ì¢>þ÷‹Ù?>ýä·¿úï£kšú5Ÿ-¹… Ìëv=€WmR_•³ŸôÕ¬]\øÃ7£ÿz5ùƒ2¾ôÙ³ˆ8_u%å,ºQÄøÍ¨ºš\ôñæmùnÒ}ÓÄpáÕÛ5ÆÏþ«v=€W®ˆö¤|{Ù}qu4øürÖF «ÑÇvrüð ט—G9‰ââøø÷..o˸˜T&]e±øú]¿ÆÂÙwí²í€ÝpR}èºèã§—³áÉis5þmÏØòæg¿¹¾¸ŒxÑÃv2ýñ“è&Kn`&Æœ®Ùõ^¹ÓÉì˨Ñ´íÕåuÄi´ŸE\<|³uZÓáàítö]ÄwMÄ(ŠOëò¤hïMŸ…y9?¬·±œ&ê¾øl8è§Í‡ˆ*¢>mgý£Ç¬×zz½*º“*Þ÷E_};EMûuÄ`ós0¼¶xÌ×Ѧ×EU~ÒuQDQtuWÞlóØ«ï'í7uôo«ò(bZÑ÷ƒ(–œ¯Þ;o™9˶""¢,F]M×úbÚ÷&mSDÑÇû‡o¸FËÛöïE\eÑ÷'m;ŽAÑ7³"Þýtáõ•œy¥×vêú2Ši9uÓ.â8Š.ú²wß=|õö±_FDßõ7?ĬŒõ1ëcÙùÉö©ò£névÀ.úº›¶mÄ,ú"¢4ä±VËë5Ûì¬eæ­»ýš»¹FË›òl½eۥʜÆár€‡u+zÛïZ£åE¿ÞûÅ{ŸüÆœu·€C³ñÞËuŽ—?þ7XÎö°ë´¼XóÜ¥ÞñQ欻ýšM³¹FËû~Ýçb-çGëo?¬d–—Åz'³ùjæ­»ýš»¹F˵™§°ýl‰÷ @nZ¹i9ä¦å›–@nZ¹i9ä¶Îw«lopð^â»UúboÖòŸûýÆß’lË-ØË[3Ûô†k´|Vú@mØšM¿‚j–WÝÚp%ÀcÚØðXö-o‹éfë×oøFñuæå}µÙ:€Gµ›žÈ¾Î¼|ów¾Ûâsß 7-€Ü´rÓrÈMË ·ÿ0‹z<ãùIEND®B`‚dkms-3.0.11/images/mok-key-3.png000066400000000000000000000121321442250756100162260ustar00rootroot00000000000000‰PNG  IHDR£÷ ÁC pHYsÄÄ•+ IDATxœíÝYo[éyÀñçl$%ÛcÏL2À4ƒ´hÚ‹Þ4ýL Z èW(zÓA€ E>Vn´M2é’Lfñ¢…äÙzáԣȢǤ¹H~?øB¢y_ÿgyUDœTyè;¤ô™Ò@fJ™)=d¦ô™Ò@fJ™)=d¦ô™Ò@fJ™)=d¦ôY½þ"Ó*ª>>¨"¢n¢k#Æ*Æ­ÖÕ{òª(=ˆ>ʈ¾ªç}7DL#–u|»‹ED»Ù ×.}Ù<‹®šÕçm]FÓµ/ªúXôE³Ù`›FïÔl®/†C"Æ®ŽIßE÷ñbV?\v¿+껣ÍÖ·v釶ˆ(ú¶›Å²>b6©f}_t~C¸»ô¼ƒ²°¥ÈáÕ㬬†®ñ«Y|{Þ=xÝùæ+\w2¾]O†®ûù?ýè/š‡ÿ]Vß{¾øßºxöxñxãAÀ¶ô¥-N6W ¦.qxO'_µýû<——í¼ú‡¿9ofÛËG}<Ûl…k—¾ˆóå2L¿;+‹áùÇûƒŸñaÇór±Ù`›g‘xÞǸކ÷ºbÆÏ~ôãé,>œ6ó‹Ë¾Œ/§Çm`íÒ7“§ý²>_,§³åØÆ“±ìŠ¡a¶Ùn [ŠÜ]\¶ñ¤ˆ¯fõQ1ýÏ‹eÅÙdÒÏ7=v¾véçËYÔuï÷ó~úˆˆfÙ-&okÀVõ‡wš÷1¯:šçãòI×ÏË‹&M·,úùâbã®]úI|¼Œÿj»®ŒÃ0V“¡[|QÇ÷úøbãAÀ¶ ›\8 ¿W†£÷^-—ÿÑÌ"úiY·ËvõeŸ´ñå¦+\Ó2>«»ã.†¶œÇ$ºeYÇGm|µÑ¥ù·ˆ-Enƒe|^LJí|']]DYwÛø|ã»3Ñ2SzÈLé 3¥€Ì”2SzÈLé 3Â>œž~ýõÉÉ|{õö=èµ5¯º}Õ^Ýíê·×~„k7^ýöÚÏ»õx3ûô°?''¿ïܫڽºeG·Öí«¼ìôÕZ¿Jø«ñ_Û&xýEéáðRVðÍíöFéáV¸åE¼ñtp'8OvzzÉðo<á}m‘WnɃz¸=ìÓÃ!­š×vãùï×o_u¾|»®Í-Xk)àà”i³î‚Ûç€?ÜJ–rßww€u)=d¦ôp+äÛýµ[·„ÒÃáÉ!°;®²ƒýyýb¹·lüÕû_=¯ÿrU«>kvÕR«n{«wÕcS¨ˆX÷Wp¨£îb8="â䤬£ì¢sx¶aË•gÈLé 3¥€Ì”2SzÈLé 3¥€Ì”2SzÈLé 3¥€Ì”2SzÈLé 3¥€Ì”2SzÈLé 3¥€Ì”2SzÈLé 3¥€Ì”2SzÈLé 3¥€Ì”2SzÈLé 3¥€Ì”2SzÈLé 3¥€Ì”2SzÈLé 3¥€Ì”2SzÈLé 3¥€Ì”2SzÈLé 3¥€Ì”2SzÈLé 3¥€Ì”2SzÈLé 3¥€Ì”2SzÈLé 3¥€Ì”2SzÈLé 3¥€Ì”2SzÈLé 3¥€Ì”2SzÈLé 3¥€Ì”2SzÈLé 3¥€Ì”2SzÈLé 3¥€Ì”2SzÈLé 3¥€Ì”2SzÈLé 3¥€Ì”2SzÈLé 3¥€Ì”2SzÈLé 3¥€Ì”2SzÈLé 3¥€Ì”2SzÈLé 3¥€Ì”2SzÈLé 3¥€Ì”2SzÈLé 3¥€Ì”2SzÈLé 3¥€Ì”2SzÈLé 3¥€Ì”2SzÈLé 3¥€Ì”2SzÈLé 3¥€Ì”2SzÈLé 3¥€Ì”2SzÈLé 3¥€Ì”2SzÈLé 3¥€Ì”2SzÈLé 3¥€Ì”2SzÈLé 3¥€Ì”2SzÈLé 3¥€Ì”2SzÈLé 3¥€Ì”2SzÈLé 3¥€Ì”2SzÈLé 3¥€Ì”v©|1F³<Šb}Äòýòñ4."†ÿî››Ÿ‡I\¾W¼±hby\ÔQµQU_z´p'Õ‡¤6|gR¶Ëþ×ÿü¯U6ŸÎ›?oŸ}züpz´¬n¾{Œ{àa•qóópÖLç—ÏÊŸ¼7~º8ò÷÷iÜõŸDœïy„€ÒÃͪjÞ>›ýYÕUð×?{P—ËnÒŽ7ý¾íÔ—+¶l&e]Äó®üÕx|\_4ÅŸ´q6-§‹ûöÁ6(=ìмQÎçÃ{Ç“Åb1Œ_´]Ä,b±b‰ûuBmX±m3š2 ÃòÑñd臡«#†Åp¶çáAJ»4i‹å0ÆÓç“Ùô¸¨—³éƒËå²i›ïÞF¿çV+ž‡f¨«rŒòryYu/êrÚU‹h§{!$ ô°KÝq]Õ]ù»º9:»œ±¸<ŸF9mWžo¾_¿’íªcíƒeÛGùbŸô}TGGãüA }D»ßB÷ëmöm(Û(¢ŸöÝ8›ÍšjÒwÕ0,ê3Ѻ=ïÐV?]1™}XCÙ4ýe[Dýýš®Û¢ô°CeüfR>™GUÝÅØ·‹¦ŠeU^tãKܯ£÷ÝŠ· :.‹huYãØñÞ´<_ÆçÃðÁžG (=ìÐOæCD¼šk¿ì#b8¾oE_íæç¡‹ÉËÿÇ"bãb>D„ÌÃ&î×D_¸o”2SzÈLé 3¥€Ì̽‡[äô4"âääæowý¸»~¬ý< p}z¸KNO¿îåímcâåíâGVQz`ç®f^ìaϽ‡»d?ǽ÷vÖØ¥‡;ãÆóÜ×vޝî1ov¾ÿÆe·¸~`Ͻ‡;ãõ”¾JìËñÎGÅW%|»ëöIé?`×’qôî¼7ì(Ÿž®]î×Ù⎸ÍØ?¥‡;o‹ù<9ùý…|W×)Ïp§9z·ÈÕsáï>Ííêz€{Kéáv¹qrû[zýsu6ØPxÃÌ»?·g»[0ÀZ”n«Ÿ0sÕ«Ê^»Üîe€_ÿtš×׹ʪ~¿yýWoÿFï²¼‹"bÝMô¡Žº‹áôtˆˆ““²Ž²‹ÎF¼AîÂíî§Ëý¼Á [î¬<ïDŒá–3÷XÛ»ÏöFéµI;Ü!J;õ*‰§ø-oéÚóæ’AX›óô™Ò@fŽÞÃqze"ÜÉ»*?==}Ç5w…}z¸^fþäääe¡OßáCnß°ìéé黬¸…”î€W™ù­Ýqàí9zwÒŽboòQz¸Û®l¿zlÿäääÕÿ¾~ÌÿÚq‚«ÿûêÆ7¯çõ¯W8 Gïá»zòþÆ¿~ûÕS×2üz•W­gÝñ¤ô™£÷À–Ù‡[Eé-snnGïáN²ß ¼%¥‡;àÚì¶me~ן“ãsxà6Pz¸^Åþêìú«7¾~ÕÜ7®*V\e÷y¾ú¸7Îù_k<ÀNëÿÈ¡Žº‹áôtˆˆ““²Ž²‹ÎFÜäú…éÌÝóÚóæ÷Á–;+Ï™Ò@fJ™¹žvêôßò–*=1+´ãgßZv¿-&ãò[{ $ ô°Kíã!Æ(æc|4Ï¢|ñbXÔÕQ߯š"ssùÒê«o®«£ý‹¨.çý¤,G|6´ÓñÞÚ€íPzØ¡Yñd>¾ˆqŒbˆ˜VGM^-û±ŠöÆû÷qsù²Zõ<,û*¢ªŽ¦ýÙ$"bìǘÍÊóÁ¤¢hc,"Æ3”¾^³ÜfZsÕº¯€ûfëÝ\»ô]y²ÞÖrEç4=À› k~¢Ý7Y»ôŸÞõñ£OÉãŠu_?÷ÍÖ|®ž~ó+úÀë`ßÖ/}±æŒªÑyY®X÷õpßl;›k—~×}§Vz¾¶þë€w²véËb½)vþÀ W­ûú¸o¶Þ͵K¯Ü¼ ¯€=sÍd¦ô™Ò@fJ™)=d¦ô™Ò@fëÿ…›]ŒˆˆÛðnÆbýÊÞÒÁ?#/ÆnËCvfíÒ7ŽßÀδÛ^áÚ¥oK\;³í?¶vé«á'[ðÿúØòYòµKßËíŽøÚ¸å à×ß§«íŽx¥ßöäûõ÷é·¥°+>#2SzÈLé 3¥€Ì”2SzÈLé 3¥€Ì”2SzÈLé 3¥€Ì”2SzÈLé ³ÿFqY‘v½šþIEND®B`‚dkms-3.0.11/images/mok-key-4.png000066400000000000000000000115201442250756100162270ustar00rootroot00000000000000‰PNG  IHDR™ìÊ!ê pHYsÄÄ•+IDATxœíÝIo#éyÀñ§6’’z›{€‰N'‡\âC>SAŒò‚\bÀ0!ðÇòÅFÛã$¶Ç³ô¢…dm9Èn˪I-ñ‘~?èЪ&«Þîfó_o-Tq@Zå}¸-€Ü´rÓrÈMË 7-€Ü´rÓrÈMË ·zƒÇL«¨úø,¢Šˆº‰®Ý«·=8X«÷:äª(î{}”}UÏûnˆ˜F,ëøf‹ˆvÃ5¬oyÙ¼Š®šÕOæm]FÓµoªúXôEs»ÁÃ]½ss}1Ü÷ bìê˜ô]TñQofõ“e÷Û¢Ž±ÛÛpë[>´EDÑ·Ý,–mô³I5ëû¢ó€0˜–s ea_ûW³²ºþIÄ/fñÍy÷:â º“k¬aí#Êøf=ºî§ÿòƒ¿jžüoY}çõâWuñêùâù-Fw£/íSrsÕàš!îßËÉ—mÿÞóƒ'ãò¬Wÿôw'Íìy{ö´W®a}Ë‹8Y.ã`úíYY ¯?úûïý´ˆêØŸ—‹Û îÂà\·à}Œ°7<ëŠq?ýÁ§³ø`ÚÌOÏú2Þœ_¦¶‰õ-o&/ûe}²XNg˱!&cÙCÃìvƒ¸oöÙ]œµñ¢ˆ/gõ^1ýïÓeÅñdÒÏ7>þ½¾åóå,꺉÷úy? }DD³ì“Í÷`›úû©yãþµQGóz\¾èúyyúþ¤é–E?_œn¾†õ-ŸÄGËøŸ¶ëÊ8†±š Ýâó:¾ÓÇç·9Üa£û*aµ2cçþÕñárù_Í,¢Ÿ–u»lQŸ5ñq_l¼†u–ñiÝíw1´å<&Ñ-Ë:>lãËÍîMØ]öÙËø¬ŽÚù0Nº6ºˆ²îž´ñÙæŸçæNÈMË 7-€Ü´rÓrÈMË 7-€ÜÜ[ GG+nk+—Ö|Õòw¯êâƒo°†«V{'ëY¹Úw¬ó¸ôOsçÿ(ð˜—CÄ…Bn±W­ùº[üêžÇ]yöµ!û»_ýs½}îÛ—•{]ðÈi9¬`ò$¢å°šœGÄÑÑmçÁ›LÊÏ­œv_ŸÆéö7<¬üšÄÙ³âYÄ¢‰å~QGÕFDU}¹ýñëÕ÷=`•á[“²]ö¿ü×ÿ›²ùdÞüeûê“ý'Óér»›-£Z¹ü¸™ÎÏ^•??Yœ¼øÇø¤‰?íú#N¶; `Z»hVUóþ³Ùì/ªþ˺xþ½¿ýÉA].»ÉbÜîvËX½IYñº+ñýïïï×§MñgmOËébØîx€Mh9ì¢yÿ:¢œÏ‡gû“Åb1ŒOÞ´]Ä,¢Ýêv‡XçùДq0 ˧û“¡†®ŽÃñVlHËa'MÚb9Œñòõéd6Ý/êålzp¶\n9åÑD³ryÛ uUŽQž-ÏÊ¢îãM]N»jít»6 å°“ºýºª»ò·u³w|6cqv2r±ØêfÛ«Öß,Û>Ê7Ãø¢ï£ÚÛç1ôÛ>NlBËa' eEôÓ¾g³YSMú®†í†<"ê+®}ë¢+"&³Šb(›¦?k‹h¢ßòÙ{`3îIƒ]TƯgåIÄ^U1öí¢.¢­Ê­ß“ÖE½ò«Ž³:ºÅiY–cWijiyR–¿Úöx€M˜—Ã.âÅ|ˆˆvüÝÔwÙGİ¿ý-÷+—v19ÿÝq,"†1NçCD¼¿ýñë™—@nZ¹i9ä¦å›–@nZÁÑQ]ù-ð°i9<ú “–Ã"çði9äæsßà»4S?<¼§q[c^Çy§/]w¾üü+„‡‡HËáA1í†GHË 7-‡‡ÆÔ-€Ü´rsOÄÅ|Œçãq”oÞ ‹ºÚëû-o·¯V.®«½7ý›¨Îæý¤,žG|:´Ó1š-؈kß`ÍŠcÔ1ŽCÄ´Úk†¨–ý¸ííVÑ®üZöÃUµ7óƒðc?F=+ßÛöx€M˜—Ã.š/#š¦yڶˈ®?¢œFÕE»Ýí±z^uã¤?^D,†1šúyÛ óá¥÷ØþÂN*‹†¾m«h›²^ “z˜¶C·íÍŽ±ú|ytu³.æÓ²o‡Ó¡«"Š¨ËØúˆ€õ´vÒPDŒCÔÑQ·qQlÃWwÚ8˜Ì×ú1bŒÎI:Ø þ+@nZ¹i9ä¦å›–@nZ¹i9ä¦å›–@nZ¹i9ä¦å›–@nZ¹i9ä¦å›–@nZ¹i9ä¦å›–@nZ¹i9ä¦å›–@nZ¹i9ä¦å›–@nZ¹i9ä¦å›–@nZ¹i9ä¦å›–@nZ¹i9ä¦å›–@nZ¹i9ä¦å›–@nZ¹i9ä¦å›–@nZ¹i9ä¦å›–@nZ¹i9ä¦å›–@nZ¹i9ä¦å›–@nZ¹i9ä¦å›–@nZ¹i9ä¦å›–@nZ¹i9ä¦å›–@nZ¹i9ä¦å›–@nZ¹i9ä¦å›–@nZ¹i9ä¦å›–@nZ¹i9ä¦å›–@nZ¹i9ä¦å›–@nZ¹i9ä¦å›–@nZ¹i9ä¦å›–@nZ¹i9ä¦å›–@nZ¹i9ä¦å›–@nZ¹i9ä¦å›–@nZ¹i9ä¦å›–@nZ¹i9ä¦å›–@nZ¹i9ä¦å›–@nZ¹i9ä¦å›–@nZ¹i9ä¦å›–@nZ¹i9ä¦å›–@nZ¹i9ä¦å›–@nZ¹i9ä¦å›–@nZ¹i9ä¦å›–@nZ¹i9äVo𘲋áüçßw1Ø €!É›–@nZ¹i9ä¦å›–@nZ¹i9ä¦å›–@nZ¹i9ä¦å›–@nZ¹i9ä¦å›–@nZ¹i9ä¦å›–@nZ¹i9ä¦å›–@nZ¹i9ä¦å›–@nZ¹ÕkQÅdˆzoòŸÇíwžýö‡ÿñ"†®«>ëÞ¿âö¸h¸ïì´E}Z¶ŽU;LÏ^ÿù“éOß.ãÕæïžEÄÑš‡”m Óˆù“iuº8ãÉÓòùbø¢‹Éʇ÷×?_uߨqEôûåӓወÓYóÁIÛGLªé›~±·áÖÏË£\Dq¼·÷ãã&âiÇ‹êõb¨£,V?~7?_Õë€sÃdQ½†㣓v²ÐÎÿ¯"â[Þ}ñ›³ã“ˆ}1éË7ư¸â fb\0t÷=€w°h?º‰®èOOÎ"¢?âxÃçoÐòXNš§ËöeÄˈ.bÅ{u¹_ô«¦·a^Î4½Æ¯.ê±xÒŒËîuDÑMš÷úvÜüœõ&ﳧŰ_Å‹±‹bì—mDÑõŸG478†};€u>qº<+ªòÙ0DE1Ô}œnþü ®c¯^-ú/"êŸVå,bY1ŽMW\¯>ºn™ ®ze1†ˆè†q:Ëq|½è»"Š1^l¸†õ-ïûoEœe1Žû}?¦»¶ˆ'Ÿ\ùx%ç¢Ò¾À; cŲl¦ÃrˆØ‹bˆ±ãyÄË ×°É1ö“ˆ‡ñüÑ–Ó1Ú1®º>Ù1Uþ`¸òuÀ¹!ÆzXö}Dc1nòؤåõ5Ûìªe.ºîëà±¹}7×·¼+¯·J‡T¹ sºà݆uÚ¶Îú–ãõî}ò\÷õðØÜþèåç˯q‡|…×À–mÐòâš×.ÎrÁu_?Í­³¹¾åãxÝ÷b-ç®ÿúàzÖ·¼,®w1›­ÂE×}ý<6·ïæú–k3·áõ°mn€Ü´rÓrÈMË 7-€Ü´rÓrÈmƒŸ­ò5Œ«¯ãg«ŒÅŸÙÜÌ×ð¹o1Þþ§¤Û²¾å£ì°5í­×°¾åméµ`kný#¨Ö·¼~tÛWèã¶ç²×·¼/–·Üp¥ñ¶÷‡o0/«[n¸Jë Ù7˜—ßÁoÀ¶øÜ7ÈMË 7-€Ü´rÓrÈMË 7-€Ü´rÓrÈíÿn…Ý |éD·IEND®B`‚dkms-3.0.11/images/mok-key-5.png000066400000000000000000000127231442250756100162360ustar00rootroot00000000000000‰PNG  IHDRªCô« pHYsÄÄ•+…IDATxœíÝ[oëzØñgN$%ù´ŽÀj’ »-›æ¢Ÿ©€¢A ý¹z“A€ùX¹ÙAŽ;éNÖÚëàƒ$gæ^xE[‘EÛ¢)SÒóûA6Mμ²(þg櫈gdRï{ÀÇ&ÿŽü@:òéÈ?¤#ÿŽü@:òéÈ?¤#ÿŽü@:òéÈ?¤#ÿŽü@:òé´[=jÞD3ÆwMD´] ýaÄÔÄ´ÛÁÁFÏC>@Õ¾‡1F16írJÄÆˆÅ¬YŒc5øµá(vþùueó‘ýk§EÝ”a|ñ‹øb9¼Œ8Šád—«Øâ1u|ÑÎÊ0üõÿÙïwþ_Ýüìåê_ÚêÅãÕ㎠¶3Ö6CÙ^SœÅþ=ŸýØŸ<>z0­Ïúeó¿ÿûI·xÜŸ=ãÅ®V±Mþ«8Y¯ãhþÛ‹º*/¿úø×U|ÖÆá²^íjX°½bŠàuŒ[à <ª©LßþÙŸÏñÙ¼[žžu¼z}ÊÝNl“ÿnö|\·'«õ|±žú(1›ê¡*}”Å®†°6¹†8ëãI?.Úƒjþw§ë*ªãÙl\îî(û6ù_®Ѷ]|2.ÇRƈˆn=¬f;Ü*0î{Üi^ÇØ¿>Úè^Në'ø¬O?uú—«Ó®b›üÏâ«uüs? u•25³2¬¾oãgc|¿Ã‘ÁvÊ–og…ˆˆ:ügÿÚør½þÛn1Îë¶_÷«hϺøºv·Šë[Ç·íp8DéëeÌbX×m|ÙÇÛ^Eà¶°ùÈm°ŽïÚø¬_–i6ô1DÔíð ïvx±>ç¸@:òéÈ?¤#ÿŽü@:òéÈ?¤ã®pµgÏ®¸ñéÓ›ZË¥%oºý틺xç-–°i±;YΕ‹}Ë2ßr‡K?šÿP {ÿpµó¨<}zƒÙ´äë®ñÍ•]ù&¾÷w¶ÿü_ßü¾Î{þs¹rC x;ù‡÷b¸OäÞ—-€ˆxöìC÷¶ßg×ÿµ+wî/ŒyÿE—˜û‡w»8­~žœK“â›nž«¾¸ð+s¸Ãñ\Zþ•˹ò>o_…¹|øøìýÃ;lŠÜ¥¹çM·ßô\õŽáM§)ìd<›ºþß×®Æ\‹½x‡‹;ô×zÔ-±Ã‘|„oêöü¿Áý&ÿðn÷¯I[ï©ošYØÚë­«‹Ë¹ÿÛp É?d´EbÏ;}ñ±;Iõ¥Ë¼¹‘ñÎG×eîÞ—÷—ïÄûOð›Ý‡›#ÿð^îJû¯ûƼkÝÿ-åÞú ÿ@È?lrž–÷ÌÌÅû_tžÌóå\yiÞKÚtû&W¾áí÷¼r­Û¨‡lL—¨8låÆ;+ØÀMÑ~¸µœùì’KøÁ ÿÀ.é=Ü þ@:òéÈ?¤#ÿŽü@:òéÈ?¤#ÿŽü@:òéÈ?¤#ÿŽü@:òéÈ?¤#ÿŽü@:òéÈ?¤#ÿŽü@:òéÈ?¤#ÿŽü@:òéÈ?¤#ÿŽü@:òéÈ?¤#ÿŽü@:òéÈ?¤#ÿŽü@:òéÈ?¤#ÿŽü@:òéÈ?¤#ÿŽü@:òéÈ?¤#ÿŽü@:òéÈ?¤#ÿŽü@:òéÈ?¤#ÿŽü@:òéÈ?¤#ÿŽü@:òéÈ?¤#ÿŽü@:òéÈ?¤#ÿŽü@:òéÈ?¤#ÿŽü@:òéÈ?¤#ÿŽü@:òéÈ?¤#ÿŽü@:òéÈ?¤#ÿŽü@:òéÈ?¤#ÿŽü@:òéÈ?¤#ÿŽü@:òéÈ?¤#ÿŽü@:òéÈ?¤#ÿŽü@:òéÈ?¤#ÿŽü@:òéÈ?¤#ÿŽü@:òéÈ?¤#ÿŽü@:òéÈ?¤#ÿŽü@:òéÈ?¤#ÿŽü@:òéÈ?¤#ÿŽü@:òéÈ?¤#ÿŽü@:òéÈ?¤#ÿŽü@:òéÈ?¤#ÿŽü@:òéÈ?¤#ÿŽü@:òéÈ?¤#ÿŽü@:òéÈ?¤#ÿŽü@:òéÈ?¤#ÿŽü@:òéÈ?¤#ÿŽü@:òéÈ?¤#ÿŽüsïÔ/"¦èÖQÍbŒXR?žÇiDÙðÅ~mú¹ìçkgªG«.Ö‡UMMóã¾ÿ—`ÇÚ}v­üÖ¬î×ã?ýß¿ø¯u÷Ëe÷Ÿú¿<|0?X7Wß=¦<@.ªãêŸË¾wóåÙ‹úèëGÓ/W'Oþ×ÿüe¿3Œ_Gœì{h°KòÏ}³hšåøÝbñ›ñǶzü‡ÿíGm½fýtuæíþïW}Ë6¿fu[ÅË¡þÇ?ýÓÃÃö´«~·ãy=_y¢p¿È?÷Ír|Q/—åÑálµZ•éÁ«~ˆXD¬6<ÂØ>•[¶¶,]G¥¬ÎÊXÊÐF”U9Þ÷¸`ÇäŸ{gÖWë2Åó—§³Åü°j׋ùÑÙzÝõÝ•wïcüÈä¢.®þ¹ìKß•¶©§¨ÏÖguÕŽñª­çC³Š~¾ï¡Á.É?÷ÎpØ6íPÿºíŽÏ–S¬ÎNæQÏûs·~ ö©ßxTfOú£u?FýªLOÆ1šƒƒiyeŒè÷=2Ø%/|Ü;¥î£Šq>Ób±èšÙ84¥¬Ú §˜ yxü{›~.û2ÄPEÌŸUU©»n<ë«èb¼]'(À‡“î›:þuV?Y–ƒ¦bûU×ĺ©O‡òpÃ#üß§á–½ µqVE·:mëºLÓPÅ£y}²ŽïJùtßCƒ]º]¿xðáJà[>Nà6³÷Ovç}úô§?¿¹Ap«¨>ðáäÒ‘HÇÜ?ltqàâ!÷K³çÿtåí¯o¼tŸ+g.ÝÿÊ9þ·LL\ZÀ[Øû‡^Ÿ p)Õ畽ôO›nßdÓýÏÿü–U| {ÿð“íΨßtç]EúÊÃ7ºF ù‡Ÿ¼™Ï+wß_–s^`Óí—¦ÐÀ-!ÿpµwNÒŸßí¼ë›n¸mÌýÃÇpñü€½“¸žKGøßyû¹›>ðΜ“²»t^ý¹óÃþçÇð/Mœçöâ‘ÿM·¿¹äM÷Ÿñ\y€÷WElñRÚh‡(Ïž•ˆxú´n£b°1Á­âmrlÅë·Á?=¡ ù€täÒ‘HGþ Wýƒ\ª˜ö=„[mêÖeèbЍ›ªš"bˆ.Ú6†õ¾‡»$ÿËT5ûÂíÖ1Eß4³õòÕÁ¢ŽjÕÅÐSD·ï‘Á.É?$3ûÁ­Vw?–þd›Åü¨_—¶j§Rºö¨ú} vIþ!—6ª}áVú!âQUκ£(ÃPΪXOëˆÅ¾‡»$ÿËeßC¸Ýêª)Ý8-<ýþ`ñ8¢>ì>?þÙ)Ü3òÉÔæþߦ.Ÿ7Ññ«ƒE]5˨º“þûh›ö=2Ø)ù‡\êbïÿm¦x±h^5m5ž>ˆ8l»ÓaýM5}nçŸ{Fþ¹ç|,Þ%•©ÿ·ZUuÓŽ'g¿{¸øÅpúŸÇõóúÑ0~6Æûì’üsoù¬¿ ôÿíúˆ‡ßG|ñCÄ|U"´Ÿ{ÇUÿ ù€täÒ‘HGþ ù€täÒ‘`kQ£<ŽÕq°ïñïKþáŽyöìV\ʰêNê(15ôó³?úùYLM¥êNö=.ླྀê°©ÐÖÏKù¢_†ÐASÿºï„ƃ»ÀÞ?°ª”n>¯ª©ª¦j>¯Jé\Qî {ÿÀ6šfªÇƒÕêWMW"bµª»ø4ša÷=2à=È?°qg]úOª±‰ˆ*ƶ[Ÿõ“cŠp'øE¶Òvgýª®Úuùf]¾©«ö¬_EÛí{XÀ{±÷le#Úqê»æËˆ§>¢ ‡þᎰ÷wDsÒT}]}8óRÇ¢™·1[ßüŠ««¿Ú±žÍë¨ûÙi,ú.º¶ŽhŽo~<ÀØû‡;búzœ¾ïâä䴪겈oW«6b~ó+Þ°…Ñ·U¼šÇªïýM¬—¥‰ø*âÕÍ øPòwD)ÏÎ~Qâ¿,þõOþòÎÖÿ4?lêåêFWÛÆìÊÛ׋Åê´;˜}Uæ{vò–ñW?;;»Ñ±;#ÿpGtÿ°ºˆÏþÏÓïºê`9ýýãj~<=oúR»M¹òæz|þ°zøbúûEuÔOßF|¾¾©f§Óúó›° òwDÿ¸ÄÕrŠ/—ÓqÔ¯^•UÛÜøÉv?]Ôï²¶9x5¾Šæl9ÎêêqÄ·¥ŸOá̸œúwâz2EÓQ"æÍAW¢Y7~…Ý&ú+¿Öc)Ñ4óx=;0S´‹ú“›°öþánXNÏ#º®{Ø÷ëˆa<)QÏ£¢¿Ùõ–¸zï?Ú*¦Ùx¼ŠX•)ºöq?”eyîUpGÔU”2ö}}W·«2k˼/ÃM¯vŠ«çþch»X ±œ×c_NËÐDTÑÖqã#v@þáŽ(UÄT¢ˆ±DDÛÇéGùˆMS„¥ÓˆÙò§Íƒ)bŠÁ|"Ü ~W ù€täÒ‘HGþ ù€täÒ‘HGþ ù€täÒ‘HGþ ù€täÒ‘HGþ ù€täÒ‘HGþ ù€täÒ‘HGþ ù€täÒ‘HGþ ù€täÒ‘HGþ ù€täÒ‘HGþ ù€täÒ‘HGþ ù€täÒ‘HGþ ù€täÒ‘HGþ ù€täÒ‘HGþ ù€täÒ‘HGþ ù€täÒ‘HGþ ù€täÒ‘HGþ ù€täÒ‘HGþ ù€täÒ‘HGþ ù€täÒ‘HGþ ù€täÒ‘HGþ ù€täÒ‘HGþ ù€täÒ‘HGþ ù€täÒ‘HGþ ù€täÒ‘HGþ ù€täÒ‘HGþ ù€täÒ‘HGþ ù€täÒ‘HGþ ù€täÒ‘HGþ ù€täÒ‘HGþ ù€täÒ‘HGþ ù€täÒ‘HGþ ù€täÒ‘HGþ ù€täÒ‘HGþ ù€täÒ‘HGþ ù€täÒ‘HGþ ù€täÒ‘HGþ ù€täÒ‘HGþ ù€täÒi·zT=Dyý‡×¢Ø’€»B³ ù€täÒ‘HGþ ù€täÒ‘HGþ ù€täÒ‘HGþ ù€täÒ‘HGþ ù€täÒ‘HGþ ù€täÒ‘HGþ ù€täÒ‘HGþ ù€täÒi·xL³íÁìoŽû?8zôë?ÿù“(ÃÐþÃbøtÃ#ldpQÙ÷nµU{Z÷_NM_æÇg/ïÁü¯NW¿]Ç‹¾zVÏ®ý º2X>˜7§«ã)<¬¯ÊCÌ®¼ûø¡ƒä^iö=€[®Šñ°~xR~ˆ8]tŸôcĬ™¿W»ZÅ6{ÿQ¯¢:>8øüø¸‹xXÇñªy¹*mÔÕÕ÷/Ó‡ ‘{fÜô<àµ2[5/K‰)¾:ég‡GÃéòWc‰ˆýæø:⛳㓈'c5WëW_FYmx€ý=.(þGpË­úo£íb#ÆÓ“³ˆ£?8ÞÕ ¶Ê¬gÝÃuÿ<âyÄ1ê“¶>¬Æ«ó÷aïŸßè¶|Öd1D;UŸÎºi=¼Œh"†Y÷ÉØO;œLßî…ø´*‡M<™ª©ª¦qÝGTÃø}D·»qoÙx—ïcš¯Ïª¦~TJTQU¥ãt‡+ØêÌÿæÅjü!¢éaS/"ÖUÓÔEµá ÿÉ™Þ\°éy@DDÔÕ¼”ˆÊ4Ÿªõ4½\CÕOvµŠmò?Ž¿qRÕÕ4Žã2ºjú*TÓúÊû‹?Õ6ÞªLuT뺛—u‰8ˆªÄTOñ8âù®V±ÝÁÿ“ˆ˜ÊôúÑ×ó)ú)6Ñí`/¿Q6>Ox­ÄÔ–õ1Fô1UÓÛÛ忽fÎçÍE×}þdóº¹Mþ‡úéõàX/ ¦þÞ®\ÿŠ|×´Mþ«ézïãŸ\÷ ®ûüÈæ##Ýjî—ï<$Ï€}Û*ÿÕ5OÝšÌõrÁuŸ?ÙÜ|6·Éÿ4]÷å[þùë?رmò_W×;—Ï'þpÑuŸ?Ù|„nn“9çCxþì÷`@:òéÈ?¤#ÿŽü@:òéÈ?¤³ÕGþì|À¿¹¥ù3U[}Rð>nçUÿbv= àãÙ&ÿÃÿpcú›_Å6ùïkm€s󟌶Mþ›ò—;ðÚ7>ɾMþÇj½óq?™nümù[íýOÍÎǼ6Þü©ÿ[íýŒw$7ÅUÿ ù€täÒ‘HGþ ù€täÒ‘HGþ ù€täÒ‘HGþ ù€täÒ‘HGþ ù€täÒ‘HGþ ù€täÒ‘HGþ ÿ®„ûÇj»„¤IEND®B`‚dkms-3.0.11/images/mok-key-6.png000066400000000000000000000135151442250756100162370ustar00rootroot00000000000000‰PNG  IHDRõ;øÒà pHYsÄÄ•+ÿIDATxœíÝKocizØñç\HJ¥ª®¾ÌtÒÉÀH_QœN§Ý|ëýâãº>_D]Oâ‹nÞõ}1Y¶‹éöï#`—º}€gÍëû×D“÷Ãòó¶›—ç_N'í²èæ‹óí—0®ëÓøfÓ´mG}?TÓ¾]|WÇ/»ønäÈááõ£¯Û„ʰžý«ãëåò/&ݬ¬›e³ˆúb¿hâû­—0Æ2¾­ÛWmôM9i´Ë²Ž¯›øaüuðO‹÷…<ËøM_5ó~˜¶M´eݾnâ7ÛŽœó? ]€/ù:ù]½¦¯Ïá(W™¼ÿ¢î°ÞÕÕ­ŽDÂ7y´ x"Ì×áîž~A•^óux6L=O2_çE»åøôññõÕµœÕw:ŸÞrá·Œgí™·lŸMglZÅ'ϸe<±õvû-xIÌ×y¹n?>}y²ÕµBÜüÃÝ–³v$·»\ÂØ2Ý­d«¼9ø[×Úû¯nŸ›Q_û+kÇ3v;_ýxíÏ›ù:/ÈöóïU«w¾Ï û毌ݯ~‡•Ž:ü©íçjãgA×yAÖn_ñ¸|‹°º÷xG«Ø2íkÇ3vlwx,›~eÓö{¸®óÒÙ=»É-Âäþ—çȼޝCf|‘=°wº?¹Üe;ŒÝþ»¾?¹Þ\þ6KÞtÿÕÛ·ÿ6ËßþìEŸÄÇKSDŒz èë¨ÛèONúˆ8>.ë(Ûh½?¶¡¯ð)÷í¬»e8<&]vëÚ~x“uØ)×¹;§åðhÌ× ]€æu”]œ™oe±Û÷I]œ.£n£ŸTÓhºÓ˜×ñ¶]¶ž?†ˆv߃1tLNnýnsÐ]Te¼š.#bÖÿ·¾?¯¢›ï{`0ŠëÜ""Ú8jʳe4mó¡m>,£iʳ6Žö=.Ç|àREåUQGD”?FQ٠ϳ£ë¼\k/ ðKº®ÖrmÉ›nß~ nuƒ<æ¥m÷|€·}úègQUwùã4ú!ÂÙð<3öÃór]eàøx‡Û´äí×ø8‰½¬ãÕ¦xÌO–ÛôON¶ÆCmŸ¢XFq>ôGóˆùÐEq^ˇY:<óuøÉññ£Æì){™ŸCÓ QGm|èÊËÆuÔØÏs£ëðѳèÙÕÄ:½ûì– ÛÖÒuˆˆ89ùX‚«0\;p»éö¸±×zwQ¹­µë]{Ÿ; iìã]½Ûö+Ý´díQóOngQÇ×ac¥®lÞtûê‘éœÞìû¯÷êož:wŸÇûÉñÜ’á[š½i½¢a¾q×#ë{éÇŽVºÍ {ûUo¹1ï™á-ß ÀKc¾ϧ7“yyÒøÓ9ãïrKîb{^ÍÑoyÈOg;À¾˜¯Ã³q9«^= žÏ;’qíXûÍMqóFxiÌ×á#³=à¹ÓuøÉ³ˆú-ç©=©½ñ»°Í¼ßùƒeûÓ§Ë•—¯mô^$yv÷ÜÅrV¿5÷C`6 xËÏÛ‘s^&]‡ŸÈÀ'íô ð 쇇DëY¸çŽÈM×!"~ëË=¯pó“É×ÞõQ0·¯wí‡Ò¯σ·Þ~;¬Þmû¸nÚÓ¾vðŸÜþ¢ÎËa?Ý÷°`œz߀‡3ü¢¾›ÄÙÙyQ”ýA|»XÔ³ˆå†_˜<êðxâš²ˆ³X4ÍA3DËy_E|ñaß#ƒtDúþððíÅÅÿìã_ü¿ÿü§¿±ü?³WÕt¾¾ëm <@ž²þàÕâ|r8ý¦ŸýÅÅÙ?™ÇŸþòâbß‘tD&µl'_ý‡ãßLŠÃùð—o‹Ùéð®«Öß¿³+žÊx÷¦xóãð—ÅQ3|ñ³eû÷Åô|XþlßCƒtDš·} Q̇øz>œFùáC¿¨«Ã®ÛtIÿ¨Ããi««Ã݇¨.æÝ´,ÞF|Û7³ÁÁžçÍ‘ÇAñùu CD1«'}TËn¨¢Yûß¾ÇËÓ²ìú>ªêp1ˆº!êƒò‹} Æ1_'ùð.b2™¼išeDÛõQ΢jû¦Ú÷Ðxê"†iwºˆXôCLê·MÛÏûw^'y^<_I¤,¢ï»¦©¢™”õ¢ŸÖý¬éÛaãþvû«XÑ“8hc>+»¦?ïÛ*¢ˆºŒv߃1tDú"b裎ˆ®ˆº‰s—ª³µ¾‰óˆéü§÷CÄ­7<3ž²‡®@ºyè:ä¡ë‡®@ºyè:ä¡ë‡®@ºyè:ä¡ë‡®@ºyè:ä¡ë‡®@ºyè:ä¡ë‡®@ºyè:ä¡ë‡®@ºyè:ä¡ë‡®@ºyè:ä¡ë‡®@ºyè:ä¡ë‡®@ºyè:ä¡ë‡®@ºyè:ä¡ë‡®@ºyè:ä¡ë‡®@ºyè:ä¡ë‡®@ºyè:ä¡ë‡®@ºyè:ä¡ë‡®@ºyè:ä¡ë‡®@ºyè:ä¡ë‡®@ºyè:ä¡ë‡®@ºyè:ä¡ë‡®@ºyè:ä¡ë‡®@ºyè:ä¡ë‡®@ºyè:ä¡ë‡®@ºyè:ä¡ë‡®@ºyè:ä¡ë‡®@ºyè:ä¡ë‡®@ºyè:ä¡ë‡®@ºyè:ä¡ë‡®@ºyè:ä¡ë‡®@ºyè:ä¡ë‡®@ºyè:ä¡ë‡®@ºyè:ä¡ë‡®@ºyè:ä¡ë‡®@ºyè:ä¡ë‡®@ºyè:ä¡ë‡®@ºyè:ä¡ë‡®@ºyè:ä¡ë‡®@ºyè:ä¡ë‡®@ºyÔ#ï_¶Ñ_þáòç6zoà‰dÈC× ]€ÿÛ®ˆu½ýEÄß_œžE|ÑÓn±üñuô‹ ¿`†ÆŠ¾Ý÷ž¸£EómÔ“h»ˆîüì"â(º/#N·üý‘]åtòfÙ¼‹xÑFÌ¢ø¢._Ýú=îM˜¯óÑdôó àei£Š/§“aÙ¾¨"Úéä‹®¶?®=öuö¼è_UñùP E1tË&¢h»ï"&#—ÃKä}À§|ÃlyQTåg}EE_wq¾ýï<¾úqÑ}QÇð¦*"–EÃ0‰bÃyïƒóŸY±éy@DD”Ŭï#¢í‡ÙP,‡áý¢k‹(†ø|Ë%Œëz×ýÓˆ³¢,†áU×ÍcR mSÄëbX®½¿ª³ªô>àVýPF±,'³~ÙGFÑÇPñ6âÝ–K»þ,"†~¸üC4eÄlˆfˆMç9ÛïÊGýÆç —úê~ÙEtM Eİ}Ôcl×ë‘vö3«Æ>^šûws\×ÛòxÜâíveEëð:Àíú1·Î¸®øëÑŸ8ÇŠ±Ï€—æþ{5G_qÜàù°c#»^Œ<ïip<•cŸ?/ͽ³9®ëÃ0öuY×ùhüó€qÆu½,Æçk_X5öùðÒÜ¿›ãº®Ó܇çÀ®¹ðòÐuÈC× ]€`£á¾×Ÿœ¯Õ=×lÒÝû„ø‘óõ¸²ØŸ7yè:ä¡ë‡®@ºyè:ä¡ë‡®@ºyè:ä¡ë‡®@ºyü®…¦{ËÞ[IEND®B`‚dkms-3.0.11/kernel_install.d_dkms000077500000000000000000000002121442250756100167270ustar00rootroot00000000000000#!/bin/sh if [ "$1" = "add" ]; then /etc/kernel/postinst.d/dkms "$2" fi if [ "$1" = "remove" ]; then /etc/kernel/prerm.d/dkms "$2" fi dkms-3.0.11/kernel_postinst.d_dkms000077500000000000000000000021161442250756100171510ustar00rootroot00000000000000#!/bin/sh # We're passed the version of the kernel being installed inst_kern=$1 uname_s=$(uname -s) _get_kernel_dir() { KVER=$1 case ${uname_s} in Linux) DIR="/lib/modules/$KVER/build" ;; GNU/kFreeBSD) DIR="/usr/src/kfreebsd-headers-$KVER/sys" ;; esac echo "$DIR" } _check_kernel_dir() { DIR=$(_get_kernel_dir "$1") case ${uname_s} in Linux) test -e "$DIR/include" ;; GNU/kFreeBSD) test -e "$DIR/kern" && test -e "$DIR/conf/kmod.mk" ;; *) false ;; esac } case "${uname_s}" in Linux) header_pkg="linux-headers-$inst_kern" kernel="Linux" ;; GNU/kFreeBSD) header_pkg="kfreebsd-headers-$inst_kern" kernel="kFreeBSD" ;; esac if [ -x /usr/lib/dkms/dkms_autoinstaller ]; then exec /usr/lib/dkms/dkms_autoinstaller start "$inst_kern" fi if ! _check_kernel_dir "$inst_kern" ; then echo "dkms: WARNING: $kernel headers are missing, which may explain the above failures." >&2 echo " please install the $header_pkg package to fix this." >&2 fi dkms-3.0.11/kernel_prerm.d_dkms000077500000000000000000000010121442250756100164050ustar00rootroot00000000000000#!/bin/sh # We're passed the version of the kernel being removed inst_kern=$1 if command -v dkms > /dev/null; then dkms status -k "$inst_kern" 2>/dev/null | while IFS=",:/ " read -r name vers _ arch status; do [ "$status" = "installed" ] || continue echo "dkms: removing: $name $vers ($inst_kern) ($arch)" >&2 dkms remove -m "$name" -v "$vers" -k "$inst_kern" -a "$arch" done fi rmdir --ignore-fail-on-non-empty \ "/lib/modules/$inst_kern/updates/dkms" \ "/lib/modules/$inst_kern/updates" 2>/dev/null exit 0 dkms-3.0.11/lsb_release000077500000000000000000000370721442250756100147570ustar00rootroot00000000000000#!/bin/sh # # lsb_release - collect LSB conformance status about a system # # Copyright (C) 2000, 2002, 2004 Free Standards Group, Inc. # Originally by Dominique MASSONIE # # This program is free software; you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by # the Free Software Foundation; either version 2 of the License, or # (at your option) any later version. # # This program is distributed in the hope that it will be useful, but # WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU # General Public License for more details. # # You should have received a copy of the GNU General Public License # along with this program; if not, write to the Free Software # Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. # # * Changes in 2.0 # - Support LSB 2.0 module layout (Mats Wichmann) # The LSB_VERSION is now a colon-separated field of supported module versions # An /etc/lsb-release.d is searched for modules beyond the core. # Only the filenames in this directory is looked at, those names are added # to LSB_VERSION. This allows module support to be handled easily by # package install/removal without a need to edit lsb-release on the fly. # - Correct license: FSG == Free Standards Group, Inc. # # * Changes in 1.4 # - "awk" not needed anymore (Loic Lefort) # - fixed bug #121879 reported by Chris D. Faulhaber, # some shells doesn't support local variables # - fixed a bug when single parameter sets many args including -s # - function DisplayProgramVersion (undocumented) now exits script like Usage # - cosmetic changes in comments/outputs # # * Changes in 1.3 # - No changes in script, only in build infrastructure # # * Changes in 1.2 # - Fixed more bash'isms # - LSB_VERSION is no longer required in /etc/lsb-release file # # * Changes in 1.1 # - removed some bash-ism and typos # Notice: script remains broken with ash because of awk issues # - changed licence to FSG - "Free Software Group, Inc" # - fixed problem with --short single arg call # - changed Debian specifics, codename anticipates release num # # Description: # Collect information from sourceable /etc/lsb-release file (present on # LSB-compliant systems) : LSB_VERSION, DISTRIB_ID, DISTRIB_RELEASE, # DISTRIB_CODENAME, DISTRIB_DESCRIPTION (all optional) # Then (if needed) find and add names from /etc/lsb-release.d # Then (if needed) find and parse the /etc/[distro]-release file ############################################################################### # DECLARATIONS ############################################################################### # This script version SCRIPTVERSION="2.0" # Defines the data files INFO_ROOT="/etc" # directory of config files INFO_LSB_FILE="lsb-release" # where to get LSB version INFO_LSB_DIR="lsb-release.d" # where to get LSB addon modules INFO_DISTRIB_SUFFIX="release" # - ALTERNATE_DISTRIB_FILE="/etc/debian_version" # for Debian [based distrib] ALTERNATE_DISTRIB_NAME="Debian" # " CHECKFIRST="/etc/redhat-release" # check it before file search # Defines our exit codes EXIT_STATUS="0" # default = Ok :) ERROR_UNKNOWN="10" # unknown error ERROR_USER="1" # program misuse ERROR_PROGRAM="2" # internal error ERROR_NOANSWER="3" # all required info not available # typically non LSB compliant distro! # Defines our messages MSG_LSBVER="LSB Version:\t" MSG_DISTID="Distributor ID:\t" MSG_DISTDESC="Description:\t" MSG_DISTREL="Release:\t" MSG_DISTCODE="Codename:\t" MSG_NA="n/a" MSG_NONE="(none)" MSG_RESULT="" # contains the result in case short output selected # Description string delimiter DESCSTR_DELI="release" ############################################################################### # FUNCTIONS ############################################################################### # Display Program Version for internal use (needed by help2man) DisplayProgramVersion() { echo "FSG $(basename $0) v$SCRIPTVERSION" echo echo "Copyright (C) 2000, 2002, 2004 Free Standards Group, Inc." echo "This is free software; see the source for copying conditions. There\ is NO" echo "warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR\ PURPOSE." echo echo "Originally written by Dominique MASSONIE." exit $EXIT_STATUS } # defines the Usage for lsb_release Usage() { echo "FSG $(basename $0) v$SCRIPTVERSION prints certain LSB (Linux\ Standard Base) and" echo "Distribution information." echo echo "Usage: $(basename $0) [OPTION]..." echo "With no OPTION specified defaults to -v." echo echo "Options:" echo " -v, --version" echo " Display the version of the LSB specification against which the distribution is compliant." echo " -i, --id" echo " Display the string id of the distributor." echo " -d, --description" echo " Display the single line text description of the distribution." echo " -r, --release" echo " Display the release number of the distribution." echo " -c, --codename" echo " Display the codename according to the distribution release." echo " -a, --all" echo " Display all of the above information." echo " -s, --short" echo " Use short output format for information requested by other options (or version if none)." echo " -h, --help" echo " Display this message." exit $EXIT_STATUS } # Handles the enhanced args (i.e. --something) EnhancedGetopt() { getopt -T >/dev/null 2>&1 # is getopt the enhanced one ? if [ $? = 4 ] then # Yes, advanced args ALLOWED OPT=$(getopt -o acdhirsvp \ --long all,codename,description,help,id,release,short,version,program_version \ -n 'lsb_release' \ -- "$@") else # No, advanced args NOT allowed # convert (if needed) the enhanced options into basic ones MYARGS=$(echo "$@" | sed -e "/--/s/-\(-[[:alnum:]]\)[[:alnum:]]*/\1/g") OPT=$(getopt -o acdhirsvp \ -n 'lsb_release' \ -- "$MYARGS") fi if [ $? != 0 ] then exit $ERROR_PROGRAM fi NB_ARG="" # enabled if many args set in one parameter (i.e. -dris) eval set -- "$OPT" while true ; do case "$1" in -a|--all) ARG_A="y"; NB_ARG="y"; shift;; -c|--codename) ARG_C="y"; NB_ARG="y"; shift;; -d|--description) ARG_D="y"; NB_ARG="y"; shift;; -i|--id) ARG_I="y"; NB_ARG="y"; shift;; -r|--release) ARG_R="y"; NB_ARG="y"; shift;; -s|--short) ARG_S="y"; shift;; -v|--version) ARG_V="y"; NB_ARG="y"; shift;; -p|--program_version) DisplayProgramVersion;; -h|--help) Usage;; --) shift; break;; *) EXIT_STATUS=$ERROR_USER Usage;; esac done } # Get/Init LSB infos (maybe Distrib infos too) GetLSBInfo() { # if we found LSB_VERSION, continue to look in directory if [ -d "$INFO_ROOT/$INFO_LSB_DIR" ] then for tag in "$INFO_ROOT/$INFO_LSB_DIR/"* do LSB_VERSION=$LSB_VERSION:$(basename $tag) done fi } # Get the whole distrib information string (from ARG $1 file) InitDistribInfo() { ## Notice: Debian has a debian_version file ## (at least) Mandrake has two files, a mandrake and a redhat one FILENAME=$1 # CHECKFIRST or finds' result in GetDistribInfo() or "" if [ -z "$FILENAME" ] then if [ -f "$ALTERNATE_DISTRIB_FILE" ] then # For Debian only [ -z "$DISTRIB_ID" ] && DISTRIB_ID="$ALTERNATE_DISTRIB_NAME" [ -z "$DISTRIB_RELEASE" ] \ && DISTRIB_RELEASE=$(cat $ALTERNATE_DISTRIB_FILE) [ -z "$DISTRIB_CODENAME" ] && [ "$DISTRIB_RELEASE" = "2.1" ] \ && DISTRIB_CODENAME="Slink" [ -z "$DISTRIB_CODENAME" ] && [ "$DISTRIB_RELEASE" = "2.2" ] \ && DISTRIB_CODENAME="Potato" # [ -z "$DISTRIB_CODENAME" ] && [ "$DISTRIB_RELEASE" = "2.3" ] \ # && DISTRIB_CODENAME="Woody" [ -z "$DISTRIB_CODENAME" ] && DISTRIB_CODENAME=$DISTRIB_RELEASE # build the DISTRIB_DESCRIPTION string (never need to be parsed) [ -z "$DISTRIB_DESCRIPTION" ] \ && DISTRIB_DESCRIPTION="$DISTRIB_ID $DESCSTR_DELI $DISTRIB_REL\ EASE ($DISTRIB_CODENAME)" else # Only for nothing known compliant distrib :( [ -z "$DISTRIB_ID" ] && DISTRIB_ID=$MSG_NA [ -z "$DISTRIB_RELEASE" ] && DISTRIB_RELEASE=$MSG_NA [ -z "$DISTRIB_CODENAME" ] && DISTRIB_CODENAME=$MSG_NA [ -z "$DISTRIB_DESCRIPTION" ] && DISTRIB_DESCRIPTION=$MSG_NONE EXIT_STATUS=$ERROR_NOANSWER fi else NO="" # is Description string syntax correct ? if [ -z "$DISTRIB_DESCRIPTION" ] \ || [ -n "$(echo $DISTRIB_DESCRIPTION | \ sed -e "s/.*$DESCSTR_DELI.*//")" ] then TMP_DISTRIB_DESC=$(head -n 1 $FILENAME 2>/dev/null) [ -z "$DISTRIB_DESCRIPTION" ] \ && DISTRIB_DESCRIPTION=$TMP_DISTRIB_DESC else TMP_DISTRIB_DESC=$DISTRIB_DESCRIPTION fi if [ -z "$TMP_DISTRIB_DESC" ] # head or lsb-release init then # file contains no data DISTRIB_DESCRIPTION=$MSG_NONE NO="y" else # Do simple check [ -n "$(echo $TMP_DISTRIB_DESC | \ sed -e "s/.*$DESCSTR_DELI.*//")" ] \ && NO="y" fi if [ -n "$NO" ] then # does not contain "release" delimiter [ -z "$DISTRIB_ID" ] && DISTRIB_ID=$MSG_NA [ -z "$DISTRIB_RELEASE" ] && DISTRIB_RELEASE=$MSG_NA [ -z "$DISTRIB_CODENAME" ] && DISTRIB_CODENAME=$MSG_NA fi fi } # Check missing and requested infos, then find the file and get infos GetDistribInfo() { NO="" # /etc/lsb-release data are enough to reply what is requested? [ -n "$ARG_D" ] && [ -z "$DISTRIB_DESCRIPTION" ] && NO="y" [ -z "$NO" ] && [ -n "$ARG_I" ] && [ -z "$DISTRIB_ID" ] && NO="y" [ -z "$NO" ] && [ -n "$ARG_R" ] && [ -z "$DISTRIB_RELEASE" ] && NO="y" [ -z "$NO" ] && [ -n "$ARG_C" ] && [ -z "$DISTRIB_CODENAME" ] && NO="y" if [ -n "$NO" ] then if [ ! -f "$CHECKFIRST" ] then CHECKFIRST=$(find $INFO_ROOT/ -maxdepth 1 \ -name \*$INFO_DISTRIB_SUFFIX \ -and ! -name $INFO_LSB_FILE \ -and -type f \ 2>/dev/null \ | head -n 1 ) # keep one of the files found (if many) fi InitDistribInfo $CHECKFIRST fi } # Display version of LSB against which distribution is compliant DisplayVersion() { if [ -z "$ARG_S" ] then echo -e "$MSG_LSBVER$LSB_VERSION" # at least "n/a" else MSG_RESULT="$MSG_RESULT${MSG_RESULT:+ }$LSB_VERSION" fi } # Display string id of distributor ( i.e. a single word! ) DisplayID() { if [ -z "$DISTRIB_ID" ] then ## Linux could be part of the distro name (i.e. Turbolinux) or a separate word ## set before, after... ## also expect a delimiter ( i.e. "release" ) if [ -n "$(echo $TMP_DISTRIB_DESC | sed "s/.*$DESCSTR_DELI.*//")" ] then DISTRIB_ID=$MSG_NA else DISTRIB_ID=$(echo " $TMP_DISTRIB_DESC" \ | sed -e "s/[[:blank:]][Ll][Ii][Nn][Uu][Xx][[:blank:]]/ /g" \ -e "s/\(.*\)[[:blank:]]$DESCSTR_DELI.*/\1/" -e "s/[[:blank:]]//g") fi fi if [ -z "$ARG_S" ] then echo -e "$MSG_DISTID$DISTRIB_ID" else MSG_RESULT="$MSG_RESULT${MSG_RESULT:+ }$DISTRIB_ID" fi } # Diplay single line text description of distribution DisplayDescription() { if [ -z "$DISTRIB_DESCRIPTION" ] then # should not be empty since GetDistribInfo called on Initialization ! EXIT_STATUS=$ERROR_PROGRAM fi if [ -z "$ARG_S" ] then echo -e "$MSG_DISTDESC$DISTRIB_DESCRIPTION" else MSG_RESULT="$MSG_RESULT${MSG_RESULT:+ }\"$DISTRIB_DESCRIPTION\"" fi } # Display release number of distribution. DisplayRelease() { if [ -z "$DISTRIB_RELEASE" ] then # parse the "$DISTRIB_DESCRIPTION" string DISTRIB_RELEASE=$(echo "$TMP_DISTRIB_DESC" | \ sed -e "s/.*$DESCSTR_DELI[[:blank:]]*\([[:digit:]][[:graph:]]*\).*/\1/" ) [ "$DISTRIB_RELEASE" = "$TMP_DISTRIB_DESC" ] \ || [ -z "$DISTRIB_RELEASE" ] \ && DISTRIB_RELEASE=$MSG_NA fi if [ -z "$ARG_S" ] then echo -e "$MSG_DISTREL$DISTRIB_RELEASE" else MSG_RESULT="$MSG_RESULT${MSG_RESULT:+ }$DISTRIB_RELEASE" fi } # Display codename according to distribution version. DisplayCodename() { if [ -z "$DISTRIB_CODENAME" ] then # parse the "$DISTRIB_DESCRIPTION" string DISTRIB_CODENAME=$(echo "$TMP_DISTRIB_DESC" | \ sed -e "s/.*$DESCSTR_DELI.*(\(.*\)).*/\1/") [ "$DISTRIB_CODENAME" = "$TMP_DISTRIB_DESC" ] \ || [ -z "$DISTRIB_CODENAME" ] \ && DISTRIB_CODENAME=$MSG_NA fi if [ -z "$ARG_S" ] then echo -e "$MSG_DISTCODE$(echo "$DISTRIB_CODENAME" | \ tr -d "[:blank:]")" # Remove blanks else MSG_RESULT="$MSG_RESULT${MSG_RESULT:+ }$(echo "$DISTRIB_CODENAME" | \ tr -d "[:blank:]")" fi } ############################################################################### # MAIN ############################################################################### # Check if any prog argument if [ -z "$1" ] then ARG_V="y" # default set to Display LSB Version (not Usage) else EnhancedGetopt "$@" # Parse program args if [ -n "$ARG_S" ] && [ -z "$NB_ARG" ] then ARG_V="y" # set also default for --short when single arg fi fi # Update args to All if requested if [ -n "$ARG_A" ] then [ -z "$ARG_C" ] && ARG_C="y" [ -z "$ARG_D" ] && ARG_D="y" [ -z "$ARG_I" ] && ARG_I="y" [ -z "$ARG_R" ] && ARG_R="y" [ -z "$ARG_V" ] && ARG_V="y" fi # Initialization GetLSBInfo GetDistribInfo # Display requested infos (order as follow) [ -n "$ARG_V" ] && DisplayVersion [ -n "$ARG_I" ] && DisplayID [ -n "$ARG_D" ] && DisplayDescription [ -n "$ARG_R" ] && DisplayRelease [ -n "$ARG_C" ] && DisplayCodename [ -n "$ARG_S" ] && echo "$MSG_RESULT" exit $EXIT_STATUS dkms-3.0.11/run_test.sh000077500000000000000000002002361442250756100147450ustar00rootroot00000000000000#!/bin/bash # Test that dkms works properly set -eu # Change the to base directory cd "$(dirname -- "$0")" # To use a specific kernel version, use the environment variable KERNEL_VER KERNEL_VER="${KERNEL_VER:-$(uname -r)}" KERNEL_ARCH="$(uname -m)" echo "Using kernel ${KERNEL_VER}/${KERNEL_ARCH}" # debconf can trigger at random points, in the testing process. Where a bunch of # the frontends cannot work in our CI. Just opt for the noninteractive one. export DEBIAN_FRONTEND=noninteractive # Avoid output variations due to parallelism export parallel_jobs=1 # Temporary files, directories, and modules created during tests TEST_MODULES=( "dkms_test" "dkms_failing_test" "dkms_dependencies_test" "dkms_multiver_test" "dkms_nover_test" "dkms_emptyver_test" "dkms_nover_update_test" "dkms_conf_test" "dkms_build_exclusive_test" "dkms_build_exclusive_dependencies_test" ) TEST_TMPDIRS=( "/usr/src/dkms_test-1.0/" "/usr/src/dkms_failing_test-1.0/" "/usr/src/dkms_dependencies_test-1.0" "/usr/src/dkms_multiver_test-1.0" "/usr/src/dkms_multiver_test-2.0" "/usr/src/dkms_nover_test-1.0" "/usr/src/dkms_emptyver_test-1.0" "/usr/src/dkms_nover_update_test-1.0" "/usr/src/dkms_nover_update_test-2.0" "/usr/src/dkms_nover_update_test-3.0" "/usr/src/dkms_conf_test-1.0" "/usr/src/dkms_build_exclusive_test-1.0" "/usr/src/dkms_build_exclusive_dependencies_test-1.0" "/tmp/dkms_test_dir_${KERNEL_VER}/" ) TEST_TMPFILES=( "/tmp/dkms_test_private_key" "/tmp/dkms_test_certificate" "/tmp/dkms_test_kconfig" "/etc/dkms/framework.conf.d/dkms_test_framework.conf" "test_cmd_output.log" "test_cmd_stdout.log" "test_cmd_stderr.log" "test_cmd_expected_output.log" ) SIGNING_MESSAGE="" declare -i NO_SIGNING_TOOL if [ "$#" = 1 ] && [ "$1" = "--no-signing-tool" ]; then echo 'Ignore signing tool errors' NO_SIGNING_TOOL=1 else NO_SIGNING_TOOL=0 fi # Some helpers dkms_status_grep_dkms_module() { local module_name="$1" (dkms status | grep "^${module_name}/") || true } clean_dkms_env() { local found_module for module in ${TEST_MODULES[@]}; do found_module="$(dkms_status_grep_dkms_module ${module})" if [[ -n "$found_module" ]] ; then dkms remove ${module}/1.0 >/dev/null fi rm -rf "/var/lib/dkms/${module}/" rm -f "/lib/modules/${KERNEL_VER}/${expected_dest_loc}/${module}.ko${mod_compression_ext}" done for dir in "${TEST_TMPDIRS[@]}"; do rm -rf "$dir" done for file in "${TEST_TMPFILES[@]}"; do rm -f "$file" done } check_no_dkms_test() { local found_module for module in ${TEST_MODULES[@]}; do found_module="$(dkms_status_grep_dkms_module ${module})" if [[ -n "$found_module" ]] ; then echo >&2 "Error: module ${module} is still in DKMS tree" exit 1 fi if [[ -d "/var/lib/dkms/${module}" ]]; then echo >&2 "Error: directory /var/lib/dkms/${module} still exists" exit 1 fi if [[ -f "/lib/modules/${KERNEL_VER}/${expected_dest_loc}/${module}.ko${mod_compression_ext}" ]]; then echo >&2 "Error: file /lib/modules/${KERNEL_VER}/${expected_dest_loc}/${module}.ko${mod_compression_ext} still exists" exit 1 fi done for dir in "${TEST_TMPDIRS[@]}"; do if [[ -d "$dir" ]]; then echo >&2 "Error: directory ${dir} still exists" exit 1 fi done for file in "${TEST_TMPFILES[@]}"; do if [[ -f "$file" ]]; then echo >&2 "Error: file ${file} still exists" exit 1 fi done } cert_serial() { local ver="$(openssl version)" # Some systems in CI test are still using ancient versions of openssl program. if [[ "$ver" = "OpenSSL 1.0."* ]] || [[ "$ver" = "OpenSSL 0."* ]]; then openssl x509 -text -inform DER -in "$1" -noout | grep -A 1 'X509v3 Subject Key Identifier' | tail -n 1 | tr 'a-z' 'A-Z' | tr -d ' :' else openssl x509 -serial -inform DER -in "$1" -noout | tr 'a-z' 'A-Z' | sed 's/^SERIAL=//' fi } set_signing_message() { # $1: module name # $2: module version # $3: module file name if not the same as $1 if (( NO_SIGNING_TOOL == 0 )); then SIGNING_MESSAGE="Signing module /var/lib/dkms/$1/$2/build/${3:-$1}.ko"$'\n' fi } run_status_with_expected_output() { local module=$1 cat > test_cmd_expected_output.log if dkms_status_grep_dkms_module "${module}" > test_cmd_output.log 2>&1 ; then if ! diff -U3 test_cmd_expected_output.log test_cmd_output.log ; then echo >&2 "Error: unexpected output from: dkms_status_grep_dkms_module for ${module}" return 1 fi rm test_cmd_expected_output.log test_cmd_output.log else echo "Error: dkms status for ${module} returned status $?" cat test_cmd_output.log rm test_cmd_expected_output.log test_cmd_output.log return 1 fi } genericize_expected_output() { local output_log=$1 # "depmod..." lines can have multiple points. Replace them, to be able to compare sed -i 's/\([^.]\)\.\.\.\.*$/\1.../' ${output_log} # On CentOS, weak-modules is executed. Drop it from the output, to be more generic sed -i '/^Adding any weak-modules$/d' ${output_log} sed -i '/^Removing any linked weak-modules$/d' ${output_log} # "depmod..." lines are missing when uninstalling modules on CentOS. Remove them to be more generic if [[ $# -ge 2 && "$2" =~ uninstall|unbuild|remove ]] ; then sed -i '/^depmod\.\.\.$/d' ${output_log} fi # Signing related output. Drop it from the output, to be more generic if (( NO_SIGNING_TOOL == 0 )); then sed -i '/^EFI variables are not supported on this system/d' ${output_log} sed -i '/^\/sys\/firmware\/efi\/efivars not found, aborting./d' ${output_log} sed -i '/^Sign command:/d' ${output_log} sed -i '/^Signing key:/d' ${output_log} sed -i '/^Public certificate (MOK):/d' ${output_log} sed -i '/^Certificate or key are missing, generating them using update-secureboot-policy...$/d' ${output_log} sed -i '/^Certificate or key are missing, generating self signed certificate for MOK...$/d' ${output_log} else sed -i "/^The kernel is be built without module signing facility, modules won't be signed$/d" ${output_log} sed -i "/^Binary .* not found, modules won't be signed$/d" ${output_log} # Uncomment the following line to run this script with --no-signing-tool on platforms where the sign-file tool exists # sed -i '/^Signing module \/var\/lib\/dkms\/dkms_test\/1.0\/build\/dkms_test.ko$/d' ${output_log} fi # OpenSSL non-critical errors while signing. Remove them to be more generic sed -i '/^At main.c:/d' ${output_log} sed -i '/^- SSL error:/d' ${output_log} # Apport related error that can occur in the CI. Drop from the output to be more generic sed -i "/^python3: can't open file '\/usr\/share\/apport\/package-hooks\/dkms_packages.py'\: \[Errno 2\] No such file or directory$/d" ${output_log} sed -i "/^ERROR (dkms apport): /d" ${output_log} } run_with_expected_output() { run_with_expected_error 0 "$@" } run_with_expected_error() { local expected_error_code="$1" local dkms_command="$3" local output_log=test_cmd_output.log local expected_output_log=test_cmd_expected_output.log local error_code=0 shift cat > ${expected_output_log} stdbuf -o L -e L "$@" > ${output_log} 2>&1 || error_code=$? if [[ "${error_code}" != "${expected_error_code}" ]] ; then echo "Error: command '$*' returned status ${error_code} instead of expected ${expected_error_code}" cat ${output_log} rm ${expected_output_log} ${output_log} return 1 fi genericize_expected_output ${output_log} ${dkms_command} if ! diff -U3 ${expected_output_log} ${output_log} ; then echo >&2 "Error: unexpected output from: $*" rm ${expected_output_log} ${output_log} return 1 fi rm ${expected_output_log} ${output_log} } # sig_hashalgo itself may show bogus value if kmod version < 26 kmod_broken_hashalgo() { local -ri kmod_ver=$(kmod --version | grep version | cut -f 3 -d ' ') (( kmod_ver < 26 )) } # Compute the expected destination module location os_id="$(sed -n 's/^ID\s*=\s*\(.*\)$/\1/p' /etc/os-release | tr -d '"')" mod_compression_ext= case "${os_id}" in centos | fedora | rhel | ovm | almalinux) expected_dest_loc=extra mod_compression_ext=.xz ;; sles | suse | opensuse) expected_dest_loc=updates ;; arch | debian | ubuntu) expected_dest_loc=updates/dkms ;; alpine) expected_dest_loc=kernel/extra mod_compression_ext=.gz ;; *) echo >&2 "Error: unknown Linux distribution ID ${os_id}" exit 1 ;; esac echo 'Preparing a clean test environment' clean_dkms_env echo 'Test framework file hijacking' mkdir -p /etc/dkms/framework.conf.d/ cp test/framework/hijacking.conf /etc/dkms/framework.conf.d/dkms_test_framework.conf run_with_expected_output dkms status -m dkms_test << EOF EOF rm /etc/dkms/framework.conf.d/dkms_test_framework.conf ############################################################################ ### Testing dkms on a regular module ### ############################################################################ echo 'Adding the test module by version (expected error)' run_with_expected_error 2 dkms add -m dkms_test -v 1.0 << EOF Error! Could not find module source directory. Directory: /usr/src/dkms_test-1.0 does not exist. EOF echo 'Adding the test module by directory' run_with_expected_output dkms add test/dkms_test-1.0 << EOF Creating symlink /var/lib/dkms/dkms_test/1.0/source -> /usr/src/dkms_test-1.0 EOF run_status_with_expected_output 'dkms_test' << EOF dkms_test/1.0: added EOF if ! [[ -d /usr/src/dkms_test-1.0 ]] ; then echo >&2 'Error: directory /usr/src/dkms_test-1.0 was not created' exit 1 fi echo 'Adding the test module again (expected error)' run_with_expected_error 3 dkms add test/dkms_test-1.0 << EOF Error! DKMS tree already contains: dkms_test-1.0 You cannot add the same module/version combo more than once. EOF echo 'Adding the test module by version (expected error)' run_with_expected_error 3 dkms add -m dkms_test -v 1.0 << EOF Error! DKMS tree already contains: dkms_test-1.0 You cannot add the same module/version combo more than once. EOF echo 'Building the test module' set_signing_message "dkms_test" "1.0" run_with_expected_output dkms build -k "${KERNEL_VER}" -m dkms_test -v 1.0 << EOF Building module: Cleaning build area... make -j1 KERNELRELEASE=${KERNEL_VER} -C /lib/modules/${KERNEL_VER}/build M=/var/lib/dkms/dkms_test/1.0/build... ${SIGNING_MESSAGE}Cleaning build area... EOF run_status_with_expected_output 'dkms_test' << EOF dkms_test/1.0, ${KERNEL_VER}, ${KERNEL_ARCH}: built EOF echo 'Building the test module again' run_with_expected_output dkms build -k "${KERNEL_VER}" -m dkms_test -v 1.0 << EOF Module dkms_test/1.0 already built for kernel ${KERNEL_VER} (${KERNEL_ARCH}), skip. You may override by specifying --force. EOF run_status_with_expected_output 'dkms_test' << EOF dkms_test/1.0, ${KERNEL_VER}, ${KERNEL_ARCH}: built EOF if (( NO_SIGNING_TOOL == 0 )); then echo 'Building the test module with bad sign_file path in framework file' cp test/framework/bad_sign_file_path.conf /etc/dkms/framework.conf.d/dkms_test_framework.conf run_with_expected_output dkms build -k "${KERNEL_VER}" -m dkms_test -v 1.0 --force << EOF Binary /no/such/file not found, modules won't be signed Building module: Cleaning build area... make -j1 KERNELRELEASE=${KERNEL_VER} -C /lib/modules/${KERNEL_VER}/build M=/var/lib/dkms/dkms_test/1.0/build... Cleaning build area... EOF echo 'Building the test module with bad mok_signing_key path in framework file' cp test/framework/bad_key_file_path.conf /etc/dkms/framework.conf.d/dkms_test_framework.conf run_with_expected_output dkms build -k "${KERNEL_VER}" -m dkms_test -v 1.0 --force << EOF Key file /no/such/path.key not found and can't be generated, modules won't be signed Building module: Cleaning build area... make -j1 KERNELRELEASE=${KERNEL_VER} -C /lib/modules/${KERNEL_VER}/build M=/var/lib/dkms/dkms_test/1.0/build... Cleaning build area... EOF echo 'Building the test module with bad mok_certificate path in framework file' cp test/framework/bad_cert_file_path.conf /etc/dkms/framework.conf.d/dkms_test_framework.conf run_with_expected_output dkms build -k "${KERNEL_VER}" -m dkms_test -v 1.0 --force << EOF Certificate file /no/such/path.crt not found and can't be generated, modules won't be signed Building module: Cleaning build area... make -j1 KERNELRELEASE=${KERNEL_VER} -C /lib/modules/${KERNEL_VER}/build M=/var/lib/dkms/dkms_test/1.0/build... Cleaning build area... EOF rm /tmp/dkms_test_private_key echo 'Building the test module with path contains variables in framework file' mkdir "/tmp/dkms_test_dir_${KERNEL_VER}/" cp test/framework/variables_in_path.conf /etc/dkms/framework.conf.d/dkms_test_framework.conf run_with_expected_output dkms build -k "${KERNEL_VER}" -m dkms_test -v 1.0 --force << EOF Building module: Cleaning build area... make -j1 KERNELRELEASE=${KERNEL_VER} -C /lib/modules/${KERNEL_VER}/build M=/var/lib/dkms/dkms_test/1.0/build... ${SIGNING_MESSAGE}Cleaning build area... EOF rm -r "/tmp/dkms_test_dir_${KERNEL_VER}/" BUILT_MODULE_PATH="/var/lib/dkms/dkms_test/1.0/${KERNEL_VER}/${KERNEL_ARCH}/module/dkms_test.ko${mod_compression_ext}" CURRENT_HASH="$(modinfo -F sig_hashalgo "${BUILT_MODULE_PATH}")" echo 'Building the test module using a different hash algorithm' if kmod_broken_hashalgo; then echo 'Current kmod has broken hash algorithm code. Skipping...' elif [[ "${CURRENT_HASH}" == "unknown" ]]; then echo 'Current kmod reports unknown hash algorithm. Skipping...' else cp test/framework/temp_key_cert.conf /etc/dkms/framework.conf.d/dkms_test_framework.conf if [[ "${CURRENT_HASH}" == "sha512" ]]; then ALTER_HASH="sha256" else ALTER_HASH="sha512" fi echo "CONFIG_MODULE_SIG_HASH=\"${ALTER_HASH}\"" > /tmp/dkms_test_kconfig run_with_expected_output dkms build -k "${KERNEL_VER}" -m dkms_test -v 1.0 --config /tmp/dkms_test_kconfig --force << EOF Building module: Cleaning build area... make -j1 KERNELRELEASE=${KERNEL_VER} -C /lib/modules/${KERNEL_VER}/build M=/var/lib/dkms/dkms_test/1.0/build... ${SIGNING_MESSAGE}Cleaning build area... EOF run_with_expected_output sh -c "modinfo -F sig_hashalgo '${BUILT_MODULE_PATH}'" << EOF ${ALTER_HASH} EOF rm /tmp/dkms_test_kconfig fi rm /etc/dkms/framework.conf.d/dkms_test_framework.conf fi cp test/framework/temp_key_cert.conf /etc/dkms/framework.conf.d/dkms_test_framework.conf echo 'Building the test module again by force' run_with_expected_output dkms build -k "${KERNEL_VER}" -m dkms_test -v 1.0 --force << EOF Building module: Cleaning build area... make -j1 KERNELRELEASE=${KERNEL_VER} -C /lib/modules/${KERNEL_VER}/build M=/var/lib/dkms/dkms_test/1.0/build... ${SIGNING_MESSAGE}Cleaning build area... EOF run_status_with_expected_output 'dkms_test' << EOF dkms_test/1.0, ${KERNEL_VER}, ${KERNEL_ARCH}: built EOF if (( NO_SIGNING_TOOL == 0 )); then echo 'Extracting serial number from the certificate' MODULE_SERIAL="$(cert_serial /tmp/dkms_test_certificate)" fi echo 'Installing the test module' run_with_expected_output dkms install -k "${KERNEL_VER}" -m dkms_test -v 1.0 << EOF dkms_test.ko${mod_compression_ext}: Running module version sanity check. - Original module - No original module exists within this kernel - Installation - Installing to /lib/modules/${KERNEL_VER}/${expected_dest_loc}/ depmod... EOF run_status_with_expected_output 'dkms_test' << EOF dkms_test/1.0, ${KERNEL_VER}, ${KERNEL_ARCH}: installed EOF echo 'Installing the test module again' run_with_expected_output dkms install -k "${KERNEL_VER}" -m dkms_test -v 1.0 << EOF Module dkms_test/1.0 already installed on kernel ${KERNEL_VER} (${KERNEL_ARCH}), skip. You may override by specifying --force. EOF run_status_with_expected_output 'dkms_test' << EOF dkms_test/1.0, ${KERNEL_VER}, ${KERNEL_ARCH}: installed EOF if ! [[ -f "/lib/modules/${KERNEL_VER}/${expected_dest_loc}/dkms_test.ko${mod_compression_ext}" ]] ; then echo >&2 "Error: module not found in /lib/modules/${KERNEL_VER}/${expected_dest_loc}/dkms_test.ko${mod_compression_ext}" exit 1 fi echo 'Installing the test module again by force' run_with_expected_output dkms install -k "${KERNEL_VER}" -m dkms_test -v 1.0 --force << EOF Module dkms_test-1.0 for kernel ${KERNEL_VER} (${KERNEL_ARCH}). Before uninstall, this module version was ACTIVE on this kernel. dkms_test.ko${mod_compression_ext}: - Uninstallation - Deleting from: /lib/modules/${KERNEL_VER}/${expected_dest_loc}/ - Original module - No original module was found for this module on this kernel. - Use the dkms install command to reinstall any previous module version. depmod... dkms_test.ko${mod_compression_ext}: Running module version sanity check. - Original module - No original module exists within this kernel - Installation - Installing to /lib/modules/${KERNEL_VER}/${expected_dest_loc}/ depmod... EOF run_status_with_expected_output 'dkms_test' << EOF dkms_test/1.0, ${KERNEL_VER}, ${KERNEL_ARCH}: installed EOF echo 'Checking modinfo' run_with_expected_output sh -c "modinfo /lib/modules/${KERNEL_VER}/${expected_dest_loc}/dkms_test.ko${mod_compression_ext} | head -n 4" << EOF filename: /lib/modules/${KERNEL_VER}/${expected_dest_loc}/dkms_test.ko${mod_compression_ext} version: 1.0 description: A Simple dkms test module license: GPL EOF if (( NO_SIGNING_TOOL == 0 )); then echo 'Checking module signature' SIG_KEY="$(modinfo -F sig_key "/lib/modules/${KERNEL_VER}/${expected_dest_loc}/dkms_test.ko${mod_compression_ext}" | tr -d ':')" SIG_HASH="$(modinfo -F sig_hashalgo "/lib/modules/${KERNEL_VER}/${expected_dest_loc}/dkms_test.ko${mod_compression_ext}")" if kmod_broken_hashalgo; then echo 'Current kmod has broken hash algorithm code. Skipping...' elif [[ "${SIG_HASH}" == "unknown" ]]; then echo 'Current kmod reports unknown hash algorithm. Skipping...' elif [[ ! "${SIG_KEY}" ]]; then echo >&2 "Error: module was not signed" exit 1 else run_with_expected_output sh -c "echo '${SIG_KEY}'" << EOF ${MODULE_SERIAL} EOF fi fi echo 'Uninstalling the test module' run_with_expected_output dkms uninstall -k "${KERNEL_VER}" -m dkms_test -v 1.0 << EOF Module dkms_test-1.0 for kernel ${KERNEL_VER} (${KERNEL_ARCH}). Before uninstall, this module version was ACTIVE on this kernel. dkms_test.ko${mod_compression_ext}: - Uninstallation - Deleting from: /lib/modules/${KERNEL_VER}/${expected_dest_loc}/ - Original module - No original module was found for this module on this kernel. - Use the dkms install command to reinstall any previous module version. EOF run_status_with_expected_output 'dkms_test' << EOF dkms_test/1.0, ${KERNEL_VER}, ${KERNEL_ARCH}: built EOF if [[ -e "/lib/modules/${KERNEL_VER}/${expected_dest_loc}/dkms_test.ko${mod_compression_ext}" ]] ; then echo >&2 "Error: module not removed in /lib/modules/${KERNEL_VER}/${expected_dest_loc}/dkms_test.ko${mod_compression_ext}" exit 1 fi echo 'Uninstalling the test module again' run_with_expected_output dkms uninstall -k "${KERNEL_VER}" -m dkms_test -v 1.0 << EOF Module dkms_test 1.0 is not installed for kernel ${KERNEL_VER} (${KERNEL_ARCH}). Skipping... EOF run_status_with_expected_output 'dkms_test' << EOF dkms_test/1.0, ${KERNEL_VER}, ${KERNEL_ARCH}: built EOF echo 'Unbuilding the test module' run_with_expected_output dkms unbuild -k "${KERNEL_VER}" -m dkms_test -v 1.0 << EOF Module dkms_test 1.0 is not installed for kernel ${KERNEL_VER} (${KERNEL_ARCH}). Skipping... EOF run_status_with_expected_output 'dkms_test' << EOF dkms_test/1.0: added EOF echo 'Unbuilding the test module again' run_with_expected_output dkms unbuild -k "${KERNEL_VER}" -m dkms_test -v 1.0 << EOF Module dkms_test 1.0 is not installed for kernel ${KERNEL_VER} (${KERNEL_ARCH}). Skipping... Module dkms_test 1.0 is not built for kernel ${KERNEL_VER} (${KERNEL_ARCH}). Skipping... EOF run_status_with_expected_output 'dkms_test' << EOF dkms_test/1.0: added EOF echo 'Removing the test module' run_with_expected_output dkms remove -k "${KERNEL_VER}" -m dkms_test -v 1.0 << EOF Module dkms_test 1.0 is not installed for kernel ${KERNEL_VER} (${KERNEL_ARCH}). Skipping... Module dkms_test 1.0 is not built for kernel ${KERNEL_VER} (${KERNEL_ARCH}). Skipping... Deleting module dkms_test-1.0 completely from the DKMS tree. EOF run_status_with_expected_output 'dkms_test' << EOF EOF if ! [[ -d /usr/src/dkms_test-1.0 ]] ; then echo >&2 'Error: directory /usr/src/dkms_test-1.0 was removed' exit 1 fi echo 'Adding the test module by version' run_with_expected_output dkms add -m dkms_test -v 1.0 << EOF Creating symlink /var/lib/dkms/dkms_test/1.0/source -> /usr/src/dkms_test-1.0 EOF run_status_with_expected_output 'dkms_test' << EOF dkms_test/1.0: added EOF echo 'Removing the test module' run_with_expected_output dkms remove --all -m dkms_test -v 1.0 << EOF Deleting module dkms_test-1.0 completely from the DKMS tree. EOF run_status_with_expected_output 'dkms_test' << EOF EOF echo 'Installing the test module by version (combining add, build, install)' run_with_expected_output dkms install -k "${KERNEL_VER}" -m dkms_test -v 1.0 << EOF Creating symlink /var/lib/dkms/dkms_test/1.0/source -> /usr/src/dkms_test-1.0 Building module: Cleaning build area... make -j1 KERNELRELEASE=${KERNEL_VER} -C /lib/modules/${KERNEL_VER}/build M=/var/lib/dkms/dkms_test/1.0/build... ${SIGNING_MESSAGE}Cleaning build area... dkms_test.ko${mod_compression_ext}: Running module version sanity check. - Original module - No original module exists within this kernel - Installation - Installing to /lib/modules/${KERNEL_VER}/${expected_dest_loc}/ depmod... EOF run_status_with_expected_output 'dkms_test' << EOF dkms_test/1.0, ${KERNEL_VER}, ${KERNEL_ARCH}: installed EOF if ! [[ -f "/lib/modules/${KERNEL_VER}/${expected_dest_loc}/dkms_test.ko${mod_compression_ext}" ]] ; then echo >&2 "Error: module not found in /lib/modules/${KERNEL_VER}/${expected_dest_loc}/dkms_test.ko${mod_compression_ext}" exit 1 fi echo 'Checking modinfo' run_with_expected_output sh -c "modinfo /lib/modules/${KERNEL_VER}/${expected_dest_loc}/dkms_test.ko${mod_compression_ext} | head -n 4" << EOF filename: /lib/modules/${KERNEL_VER}/${expected_dest_loc}/dkms_test.ko${mod_compression_ext} version: 1.0 description: A Simple dkms test module license: GPL EOF if (( NO_SIGNING_TOOL == 0 )); then echo 'Checking module signature' SIG_KEY="$(modinfo -F sig_key "/lib/modules/${KERNEL_VER}/${expected_dest_loc}/dkms_test.ko${mod_compression_ext}" | tr -d ':')" SIG_HASH="$(modinfo -F sig_hashalgo "/lib/modules/${KERNEL_VER}/${expected_dest_loc}/dkms_test.ko${mod_compression_ext}")" if kmod_broken_hashalgo; then echo 'Current kmod has broken hash algorithm code. Skipping...' elif [[ "${SIG_HASH}" == "unknown" ]]; then echo 'Current kmod reports unknown hash algorithm. Skipping...' elif [[ ! "${SIG_KEY}" ]]; then # kmod may not be linked with openssl and thus can't extract the key from module echo >&2 "Error: modules was not signed, or key is unknown" exit 1 else run_with_expected_output sh -c "echo '${SIG_KEY}'" << EOF ${MODULE_SERIAL} EOF fi fi echo 'Removing the test module with --all' run_with_expected_output dkms remove --all -m dkms_test -v 1.0 << EOF Module dkms_test-1.0 for kernel ${KERNEL_VER} (${KERNEL_ARCH}). Before uninstall, this module version was ACTIVE on this kernel. dkms_test.ko${mod_compression_ext}: - Uninstallation - Deleting from: /lib/modules/${KERNEL_VER}/${expected_dest_loc}/ - Original module - No original module was found for this module on this kernel. - Use the dkms install command to reinstall any previous module version. Deleting module dkms_test-1.0 completely from the DKMS tree. EOF run_status_with_expected_output 'dkms_test' << EOF EOF if [[ -e "/lib/modules/${KERNEL_VER}/${expected_dest_loc}/dkms_test.ko${mod_compression_ext}" ]] ; then echo >&2 "Error: module not removed in /lib/modules/${KERNEL_VER}/${expected_dest_loc}/dkms_test.ko${mod_compression_ext}" exit 1 fi echo 'Removing /usr/src/dkms_test-1.0' rm -r /usr/src/dkms_test-1.0 echo 'Building the test module by config file (combining add, build)' run_with_expected_output dkms build -k "${KERNEL_VER}" test/dkms_test-1.0/dkms.conf << EOF Creating symlink /var/lib/dkms/dkms_test/1.0/source -> /usr/src/dkms_test-1.0 Building module: Cleaning build area... make -j1 KERNELRELEASE=${KERNEL_VER} -C /lib/modules/${KERNEL_VER}/build M=/var/lib/dkms/dkms_test/1.0/build... ${SIGNING_MESSAGE}Cleaning build area... EOF run_status_with_expected_output 'dkms_test' << EOF dkms_test/1.0, ${KERNEL_VER}, ${KERNEL_ARCH}: built EOF echo "Running dkms autoinstall" run_with_expected_output dkms autoinstall -k "${KERNEL_VER}" << EOF dkms_test.ko${mod_compression_ext}: Running module version sanity check. - Original module - No original module exists within this kernel - Installation - Installing to /lib/modules/${KERNEL_VER}/${expected_dest_loc}/ depmod... dkms autoinstall on ${KERNEL_VER}/${KERNEL_ARCH} succeeded for dkms_test EOF echo "Running dkms autoinstall for a kernel without headers installed (expected error)" run_with_expected_error 11 dkms autoinstall -k "${KERNEL_VER}-noheaders" << EOF Error! Your kernel headers for kernel ${KERNEL_VER}-noheaders cannot be found at /lib/modules/${KERNEL_VER}-noheaders/build or /lib/modules/${KERNEL_VER}-noheaders/source. Please install the linux-headers-${KERNEL_VER}-noheaders package or use the --kernelsourcedir option to tell DKMS where it's located. dkms autoinstall on ${KERNEL_VER}-noheaders/x86_64 failed for dkms_test(1) Error! One or more modules failed to install during autoinstall. Refer to previous errors for more information. EOF echo 'Removing the test module with --all' run_with_expected_output dkms remove --all -m dkms_test -v 1.0 << EOF Module dkms_test-1.0 for kernel ${KERNEL_VER} (${KERNEL_ARCH}). Before uninstall, this module version was ACTIVE on this kernel. dkms_test.ko${mod_compression_ext}: - Uninstallation - Deleting from: /lib/modules/${KERNEL_VER}/${expected_dest_loc}/ - Original module - No original module was found for this module on this kernel. - Use the dkms install command to reinstall any previous module version. Deleting module dkms_test-1.0 completely from the DKMS tree. EOF run_status_with_expected_output 'dkms_test' << EOF EOF echo 'Removing temporary files' if (( NO_SIGNING_TOOL == 0 )); then rm /tmp/dkms_test_private_key /tmp/dkms_test_certificate fi rm /etc/dkms/framework.conf.d/dkms_test_framework.conf echo 'Removing /usr/src/dkms_test-1.0' rm -r /usr/src/dkms_test-1.0 echo 'Checking that the environment is clean again' check_no_dkms_test ############################################################################ ### Testing malformed/borderline dkms.conf ### ############################################################################ abspwd=$(readlink -f $(pwd)) echo 'Testing dkms add of source tree without dkms.conf (expected error)' run_with_expected_error 1 dkms add ${abspwd}/test/dkms_conf_test_no_conf << EOF Error! Arguments and are not specified. Usage: add / or add -m / or add -m -v EOF echo 'Testing dkms add with empty dkms.conf (expected error)' run_with_expected_error 8 dkms add test/dkms_conf_test_empty << EOF dkms.conf: Error! No 'PACKAGE_NAME' directive specified. dkms.conf: Error! No 'PACKAGE_VERSION' directive specified. dkms.conf: Warning! Zero modules specified. Error! Bad conf file. File: ${abspwd}/test/dkms_conf_test_empty/dkms.conf does not represent a valid dkms.conf file. EOF echo 'Testing dkms.conf with invalid values (expected error)' run_with_expected_error 8 dkms add test/dkms_conf_test_invalid << EOF dkms.conf: Error! No 'BUILT_MODULE_NAME' directive specified for record #0. dkms.conf: Error! 'DEST_MODULE_NAME' directive ends in '.o' or '.ko' in record #0. dkms.conf: Error! Directive 'DEST_MODULE_LOCATION' does not begin with '/kernel', '/updates', or '/extra' in record #0. dkms.conf: Error! 'BUILT_MODULE_NAME' directive ends in '.o' or '.ko' in record #1. dkms.conf: Error! No 'DEST_MODULE_LOCATION' directive specified for record #1. dkms.conf: Error! Directive 'DEST_MODULE_LOCATION' does not begin with '/kernel', '/updates', or '/extra' in record #1. Error! Bad conf file. File: ${abspwd}/test/dkms_conf_test_invalid/dkms.conf does not represent a valid dkms.conf file. EOF echo 'Testing dkms.conf defining zero modules' run_with_expected_output dkms add test/dkms_conf_test_zero_modules << EOF dkms.conf: Warning! Zero modules specified. dkms.conf: Warning! Zero modules specified. Creating symlink /var/lib/dkms/dkms_conf_test/1.0/source -> /usr/src/dkms_conf_test-1.0 EOF run_with_expected_output dkms remove --all -m dkms_conf_test -v 1.0 << EOF Deleting module dkms_conf_test-1.0 completely from the DKMS tree. EOF echo 'Testing add/build/install of a test module building zero kernel modules' run_with_expected_output dkms install -k "${KERNEL_VER}" -m dkms_conf_test -v 1.0 << EOF dkms.conf: Warning! Zero modules specified. Creating symlink /var/lib/dkms/dkms_conf_test/1.0/source -> /usr/src/dkms_conf_test-1.0 Building module: Cleaning build area... make -j1 KERNELRELEASE=${KERNEL_VER} -C /lib/modules/${KERNEL_VER}/build M=/var/lib/dkms/dkms_conf_test/1.0/build... Cleaning build area... depmod... EOF run_status_with_expected_output 'dkms_conf_test' << EOF dkms.conf: Warning! Zero modules specified. dkms_conf_test/1.0, ${KERNEL_VER}, ${KERNEL_ARCH}: installed EOF run_with_expected_output dkms remove --all -m dkms_conf_test -v 1.0 << EOF dkms.conf: Warning! Zero modules specified. dkms.conf: Warning! Zero modules specified. Module dkms_conf_test-1.0 for kernel ${KERNEL_VER} (${KERNEL_ARCH}). Before uninstall, this module version was ACTIVE on this kernel. Deleting module dkms_conf_test-1.0 completely from the DKMS tree. EOF echo 'Removing /usr/src/dkms_conf_test-1.0' rm -r /usr/src/dkms_conf_test-1.0 echo 'Testing dkms.conf with defaulted BUILT_MODULE_NAME' run_with_expected_output dkms add test/dkms_conf_test_defaulted_BUILT_MODULE_NAME << EOF Creating symlink /var/lib/dkms/dkms_conf_test/1.0/source -> /usr/src/dkms_conf_test-1.0 EOF echo 'Building test module without source (expected error)' run_with_expected_error 8 dkms build -k "${KERNEL_VER}" -m dkms_conf_test -v 1.0 << EOF Error! The directory /var/lib/dkms/dkms_conf_test/1.0/source does not appear to have module source located within it. Build halted. EOF run_status_with_expected_output 'dkms_conf_test' << EOF dkms_conf_test/1.0: added EOF run_with_expected_output dkms remove --all -m dkms_conf_test -v 1.0 << EOF Deleting module dkms_conf_test-1.0 completely from the DKMS tree. EOF echo 'Removing /usr/src/dkms_conf_test-1.0' rm -r /usr/src/dkms_conf_test-1.0 echo 'Checking that the environment is clean again' check_no_dkms_test ############################################################################ ### Testing dkms on a module with multiple versions ### ############################################################################ echo 'Adding the multiver test modules by directory' run_with_expected_output dkms add test/dkms_multiver_test/1.0 << EOF Creating symlink /var/lib/dkms/dkms_multiver_test/1.0/source -> /usr/src/dkms_multiver_test-1.0 EOF run_status_with_expected_output 'dkms_multiver_test' << EOF dkms_multiver_test/1.0: added EOF if ! [[ -d /usr/src/dkms_multiver_test-1.0 ]] ; then echo >&2 'Error: directory /usr/src/dkms_multiver_test-1.0 was not created' exit 1 fi run_with_expected_output dkms add test/dkms_multiver_test/2.0 << EOF Creating symlink /var/lib/dkms/dkms_multiver_test/2.0/source -> /usr/src/dkms_multiver_test-2.0 EOF run_status_with_expected_output 'dkms_multiver_test' << EOF dkms_multiver_test/1.0: added dkms_multiver_test/2.0: added EOF if ! [[ -d /usr/src/dkms_multiver_test-1.0 ]] ; then echo >&2 'Error: directory /usr/src/dkms_multiver_test-2.0 was not created' exit 1 fi echo 'Building the multiver test modules' set_signing_message "dkms_multiver_test" "1.0" run_with_expected_output dkms build -k "${KERNEL_VER}" -m dkms_multiver_test -v 1.0 << EOF Building module: Cleaning build area... make -j1 KERNELRELEASE=${KERNEL_VER} -C /lib/modules/${KERNEL_VER}/build M=/var/lib/dkms/dkms_multiver_test/1.0/build... ${SIGNING_MESSAGE}Cleaning build area... EOF run_status_with_expected_output 'dkms_multiver_test' << EOF dkms_multiver_test/1.0, ${KERNEL_VER}, ${KERNEL_ARCH}: built dkms_multiver_test/2.0: added EOF set_signing_message "dkms_multiver_test" "2.0" run_with_expected_output dkms build -k "${KERNEL_VER}" -m dkms_multiver_test -v 2.0 << EOF Building module: Cleaning build area... make -j1 KERNELRELEASE=${KERNEL_VER} -C /lib/modules/${KERNEL_VER}/build M=/var/lib/dkms/dkms_multiver_test/2.0/build... ${SIGNING_MESSAGE}Cleaning build area... EOF run_status_with_expected_output 'dkms_multiver_test' << EOF dkms_multiver_test/1.0, ${KERNEL_VER}, ${KERNEL_ARCH}: built dkms_multiver_test/2.0, ${KERNEL_VER}, ${KERNEL_ARCH}: built EOF echo 'Installing the multiver test modules' run_with_expected_output dkms install -k "${KERNEL_VER}" -m dkms_multiver_test -v 1.0 << EOF dkms_multiver_test.ko${mod_compression_ext}: Running module version sanity check. - Original module - No original module exists within this kernel - Installation - Installing to /lib/modules/${KERNEL_VER}/${expected_dest_loc}/ depmod... EOF run_status_with_expected_output 'dkms_multiver_test' << EOF dkms_multiver_test/1.0, ${KERNEL_VER}, ${KERNEL_ARCH}: installed dkms_multiver_test/2.0, ${KERNEL_VER}, ${KERNEL_ARCH}: built EOF run_with_expected_output dkms install -k "${KERNEL_VER}" -m dkms_multiver_test -v 2.0 << EOF dkms_multiver_test.ko${mod_compression_ext}: Running module version sanity check. - Original module - This kernel never originally had a module by this name - Installation - Installing to /lib/modules/${KERNEL_VER}/${expected_dest_loc}/ depmod... EOF run_status_with_expected_output 'dkms_multiver_test' << EOF dkms_multiver_test/1.0, ${KERNEL_VER}, ${KERNEL_ARCH}: built dkms_multiver_test/2.0, ${KERNEL_VER}, ${KERNEL_ARCH}: installed EOF run_with_expected_error 6 dkms install -k "${KERNEL_VER}" -m dkms_multiver_test -v 1.0 << EOF dkms_multiver_test.ko${mod_compression_ext}: Running module version sanity check. Error! Module version 1.0 for dkms_multiver_test.ko${mod_compression_ext} is not newer than what is already found in kernel ${KERNEL_VER} (2.0). You may override by specifying --force. Error! Installation aborted. EOF run_status_with_expected_output 'dkms_multiver_test' << EOF dkms_multiver_test/1.0, ${KERNEL_VER}, ${KERNEL_ARCH}: built dkms_multiver_test/2.0, ${KERNEL_VER}, ${KERNEL_ARCH}: installed EOF echo 'Uninstalling the multiver test modules' run_with_expected_output dkms uninstall -k "${KERNEL_VER}" -m dkms_multiver_test -v 1.0 << EOF Module dkms_multiver_test 1.0 is not installed for kernel ${KERNEL_VER} (${KERNEL_ARCH}). Skipping... EOF run_status_with_expected_output 'dkms_multiver_test' << EOF dkms_multiver_test/1.0, ${KERNEL_VER}, ${KERNEL_ARCH}: built dkms_multiver_test/2.0, ${KERNEL_VER}, ${KERNEL_ARCH}: installed EOF run_with_expected_output dkms uninstall -k "${KERNEL_VER}" -m dkms_multiver_test -v 2.0 << EOF Module dkms_multiver_test-2.0 for kernel ${KERNEL_VER} (${KERNEL_ARCH}). Before uninstall, this module version was ACTIVE on this kernel. dkms_multiver_test.ko${mod_compression_ext}: - Uninstallation - Deleting from: /lib/modules/${KERNEL_VER}/${expected_dest_loc}/ - Original module - No original module was found for this module on this kernel. - Use the dkms install command to reinstall any previous module version. EOF run_status_with_expected_output 'dkms_multiver_test' << EOF dkms_multiver_test/1.0, ${KERNEL_VER}, ${KERNEL_ARCH}: built dkms_multiver_test/2.0, ${KERNEL_VER}, ${KERNEL_ARCH}: built EOF if [[ -e "/lib/modules/${KERNEL_VER}/${expected_dest_loc}/dkms_multiver_test.ko${mod_compression_ext}" ]] ; then echo >&2 "Error: module not removed in /lib/modules/${KERNEL_VER}/${expected_dest_loc}/dkms_multiver_test.ko${mod_compression_ext}" exit 1 fi echo 'Unbuilding the multiver test modules' run_with_expected_output dkms unbuild -k "${KERNEL_VER}" -m dkms_multiver_test -v 1.0 << EOF Module dkms_multiver_test 1.0 is not installed for kernel ${KERNEL_VER} (${KERNEL_ARCH}). Skipping... EOF run_status_with_expected_output 'dkms_multiver_test' << EOF dkms_multiver_test/1.0: added dkms_multiver_test/2.0, ${KERNEL_VER}, ${KERNEL_ARCH}: built EOF run_with_expected_output dkms unbuild -k "${KERNEL_VER}" -m dkms_multiver_test -v 2.0 << EOF Module dkms_multiver_test 2.0 is not installed for kernel ${KERNEL_VER} (${KERNEL_ARCH}). Skipping... EOF run_status_with_expected_output 'dkms_multiver_test' << EOF dkms_multiver_test/1.0: added dkms_multiver_test/2.0: added EOF echo 'Removing the multiver test modules' run_with_expected_output dkms remove -k "${KERNEL_VER}" -m dkms_multiver_test -v 1.0 << EOF Module dkms_multiver_test 1.0 is not installed for kernel ${KERNEL_VER} (${KERNEL_ARCH}). Skipping... Module dkms_multiver_test 1.0 is not built for kernel ${KERNEL_VER} (${KERNEL_ARCH}). Skipping... Deleting module dkms_multiver_test-1.0 completely from the DKMS tree. EOF run_status_with_expected_output 'dkms_multiver_test' << EOF dkms_multiver_test/2.0: added EOF run_with_expected_output dkms remove -k "${KERNEL_VER}" -m dkms_multiver_test -v 2.0 << EOF Module dkms_multiver_test 2.0 is not installed for kernel ${KERNEL_VER} (${KERNEL_ARCH}). Skipping... Module dkms_multiver_test 2.0 is not built for kernel ${KERNEL_VER} (${KERNEL_ARCH}). Skipping... Deleting module dkms_multiver_test-2.0 completely from the DKMS tree. EOF run_status_with_expected_output 'dkms_multiver_test' << EOF EOF echo 'Removing /usr/src/dkms_multiver_test-1.0 /usr/src/dkms_multiver_test-2.0' rm -r /usr/src/dkms_multiver_test-1.0 /usr/src/dkms_multiver_test-2.0 ############################################################################ ### Testing dkms operations ... ############################################################################ echo 'Adding the nover/emptyver test modules by directory' run_with_expected_output dkms add test/dkms_nover_test << EOF Creating symlink /var/lib/dkms/dkms_nover_test/1.0/source -> /usr/src/dkms_nover_test-1.0 EOF run_status_with_expected_output 'dkms_nover_test' << EOF dkms_nover_test/1.0: added EOF if ! [[ -d /usr/src/dkms_nover_test-1.0 ]] ; then echo >&2 'Error: directory /usr/src/dkms_nover_test-1.0 was not created' exit 1 fi run_with_expected_output dkms add test/dkms_emptyver_test << EOF Creating symlink /var/lib/dkms/dkms_emptyver_test/1.0/source -> /usr/src/dkms_emptyver_test-1.0 EOF run_status_with_expected_output 'dkms_emptyver_test' << EOF dkms_emptyver_test/1.0: added EOF if ! [[ -d /usr/src/dkms_emptyver_test-1.0 ]] ; then echo >&2 'Error: directory /usr/src/dkms_emptyver_test-1.0 was not created' exit 1 fi echo 'Building the nover/emptyver test modules' set_signing_message "dkms_nover_test" "1.0" run_with_expected_output dkms build -k "${KERNEL_VER}" -m dkms_nover_test -v 1.0 << EOF Building module: Cleaning build area... make -j1 KERNELRELEASE=${KERNEL_VER} -C /lib/modules/${KERNEL_VER}/build M=/var/lib/dkms/dkms_nover_test/1.0/build... ${SIGNING_MESSAGE}Cleaning build area... EOF run_status_with_expected_output 'dkms_nover_test' << EOF dkms_nover_test/1.0, ${KERNEL_VER}, ${KERNEL_ARCH}: built EOF set_signing_message "dkms_emptyver_test" "1.0" run_with_expected_output dkms build -k "${KERNEL_VER}" -m dkms_emptyver_test -v 1.0 << EOF Building module: Cleaning build area... make -j1 KERNELRELEASE=${KERNEL_VER} -C /lib/modules/${KERNEL_VER}/build M=/var/lib/dkms/dkms_emptyver_test/1.0/build... ${SIGNING_MESSAGE}Cleaning build area... EOF run_status_with_expected_output 'dkms_emptyver_test' << EOF dkms_emptyver_test/1.0, ${KERNEL_VER}, ${KERNEL_ARCH}: built EOF echo 'Installing the nover/emptyver test modules' run_with_expected_output dkms install -k "${KERNEL_VER}" -m dkms_nover_test -v 1.0 << EOF dkms_nover_test.ko${mod_compression_ext}: Running module version sanity check. - Original module - No original module exists within this kernel - Installation - Installing to /lib/modules/${KERNEL_VER}/${expected_dest_loc}/ depmod... EOF run_status_with_expected_output 'dkms_nover_test' << EOF dkms_nover_test/1.0, ${KERNEL_VER}, ${KERNEL_ARCH}: installed EOF run_with_expected_output dkms install -k "${KERNEL_VER}" -m dkms_emptyver_test -v 1.0 << EOF dkms_emptyver_test.ko${mod_compression_ext}: Running module version sanity check. - Original module - No original module exists within this kernel - Installation - Installing to /lib/modules/${KERNEL_VER}/${expected_dest_loc}/ depmod... EOF run_status_with_expected_output 'dkms_emptyver_test' << EOF dkms_emptyver_test/1.0, ${KERNEL_VER}, ${KERNEL_ARCH}: installed EOF echo 'Uninstalling the nover/emptyver test modules' run_with_expected_output dkms uninstall -k "${KERNEL_VER}" -m dkms_nover_test -v 1.0 << EOF Module dkms_nover_test-1.0 for kernel ${KERNEL_VER} (${KERNEL_ARCH}). Before uninstall, this module version was ACTIVE on this kernel. dkms_nover_test.ko${mod_compression_ext}: - Uninstallation - Deleting from: /lib/modules/${KERNEL_VER}/${expected_dest_loc}/ - Original module - No original module was found for this module on this kernel. - Use the dkms install command to reinstall any previous module version. EOF run_status_with_expected_output 'dkms_nover_test' << EOF dkms_nover_test/1.0, ${KERNEL_VER}, ${KERNEL_ARCH}: built EOF if [[ -e "/lib/modules/${KERNEL_VER}/${expected_dest_loc}/dkms_nover_test.ko${mod_compression_ext}" ]] ; then echo >&2 "Error: module not removed in /lib/modules/${KERNEL_VER}/${expected_dest_loc}/dkms_nover_test.ko${mod_compression_ext}" exit 1 fi run_with_expected_output dkms uninstall -k "${KERNEL_VER}" -m dkms_emptyver_test -v 1.0 << EOF Module dkms_emptyver_test-1.0 for kernel ${KERNEL_VER} (${KERNEL_ARCH}). Before uninstall, this module version was ACTIVE on this kernel. dkms_emptyver_test.ko${mod_compression_ext}: - Uninstallation - Deleting from: /lib/modules/${KERNEL_VER}/${expected_dest_loc}/ - Original module - No original module was found for this module on this kernel. - Use the dkms install command to reinstall any previous module version. EOF run_status_with_expected_output 'dkms_emptyver_test' << EOF dkms_emptyver_test/1.0, ${KERNEL_VER}, ${KERNEL_ARCH}: built EOF if [[ -e "/lib/modules/${KERNEL_VER}/${expected_dest_loc}/dkms_emptyver_test.ko${mod_compression_ext}" ]] ; then echo >&2 "Error: module not removed in /lib/modules/${KERNEL_VER}/${expected_dest_loc}/dkms_emptyver_test.ko${mod_compression_ext}" exit 1 fi echo 'Unbuilding the nover/emptyver test modules' run_with_expected_output dkms unbuild -k "${KERNEL_VER}" -m dkms_nover_test -v 1.0 << EOF Module dkms_nover_test 1.0 is not installed for kernel ${KERNEL_VER} (${KERNEL_ARCH}). Skipping... EOF run_status_with_expected_output 'dkms_nover_test' << EOF dkms_nover_test/1.0: added EOF run_with_expected_output dkms unbuild -k "${KERNEL_VER}" -m dkms_emptyver_test -v 1.0 << EOF Module dkms_emptyver_test 1.0 is not installed for kernel ${KERNEL_VER} (${KERNEL_ARCH}). Skipping... EOF run_status_with_expected_output 'dkms_emptyver_test' << EOF dkms_emptyver_test/1.0: added EOF echo 'Removing the nover/emptyver test modules' run_with_expected_output dkms remove -k "${KERNEL_VER}" -m dkms_nover_test -v 1.0 << EOF Module dkms_nover_test 1.0 is not installed for kernel ${KERNEL_VER} (${KERNEL_ARCH}). Skipping... Module dkms_nover_test 1.0 is not built for kernel ${KERNEL_VER} (${KERNEL_ARCH}). Skipping... Deleting module dkms_nover_test-1.0 completely from the DKMS tree. EOF run_status_with_expected_output 'dkms_nover_test' << EOF EOF run_with_expected_output dkms remove -k "${KERNEL_VER}" -m dkms_emptyver_test -v 1.0 << EOF Module dkms_emptyver_test 1.0 is not installed for kernel ${KERNEL_VER} (${KERNEL_ARCH}). Skipping... Module dkms_emptyver_test 1.0 is not built for kernel ${KERNEL_VER} (${KERNEL_ARCH}). Skipping... Deleting module dkms_emptyver_test-1.0 completely from the DKMS tree. EOF run_status_with_expected_output 'dkms_emptyver_test' << EOF EOF echo 'Removing /usr/src/dkms_nover_test-1.0 /usr/src/dkms_emptyver_test-1.0' rm -r /usr/src/dkms_nover_test-1.0 /usr/src/dkms_emptyver_test-1.0 echo 'Adding the nover update test modules 1.0 by directory' run_with_expected_output dkms add test/dkms_nover_update_test/1.0 << EOF Creating symlink /var/lib/dkms/dkms_nover_update_test/1.0/source -> /usr/src/dkms_nover_update_test-1.0 EOF run_status_with_expected_output 'dkms_nover_update_test' << EOF dkms_nover_update_test/1.0: added EOF if ! [[ -d /usr/src/dkms_nover_update_test-1.0 ]] ; then echo >&2 'Error: directory /usr/src/dkms_nover_update_test-1.0 was not created' exit 1 fi echo 'Installing the nover update test 1.0 modules' set_signing_message "dkms_nover_update_test" "1.0" run_with_expected_output dkms install -k "${KERNEL_VER}" -m dkms_nover_update_test -v 1.0 << EOF Building module: Cleaning build area... make -j1 KERNELRELEASE=${KERNEL_VER} -C /lib/modules/${KERNEL_VER}/build M=/var/lib/dkms/dkms_nover_update_test/1.0/build... ${SIGNING_MESSAGE}Cleaning build area... dkms_nover_update_test.ko${mod_compression_ext}: Running module version sanity check. - Original module - No original module exists within this kernel - Installation - Installing to /lib/modules/${KERNEL_VER}/${expected_dest_loc}/ depmod... EOF run_status_with_expected_output 'dkms_nover_update_test' << EOF dkms_nover_update_test/1.0, ${KERNEL_VER}, ${KERNEL_ARCH}: installed EOF echo 'Adding the nover update test modules 2.0 by directory' run_with_expected_output dkms add test/dkms_nover_update_test/2.0 << EOF Creating symlink /var/lib/dkms/dkms_nover_update_test/2.0/source -> /usr/src/dkms_nover_update_test-2.0 EOF run_status_with_expected_output 'dkms_nover_update_test' << EOF dkms_nover_update_test/1.0, ${KERNEL_VER}, ${KERNEL_ARCH}: installed dkms_nover_update_test/2.0: added EOF if ! [[ -d /usr/src/dkms_nover_update_test-2.0 ]] ; then echo >&2 'Error: directory /usr/src/dkms_nover_update_test-2.0 was not created' exit 1 fi echo 'Installing the nover update test 2.0 modules' set_signing_message "dkms_nover_update_test" "2.0" run_with_expected_output dkms install -k "${KERNEL_VER}" -m dkms_nover_update_test -v 2.0 << EOF Building module: Cleaning build area... make -j1 KERNELRELEASE=${KERNEL_VER} -C /lib/modules/${KERNEL_VER}/build M=/var/lib/dkms/dkms_nover_update_test/2.0/build... ${SIGNING_MESSAGE}Cleaning build area... dkms_nover_update_test.ko${mod_compression_ext}: Running module version sanity check. - Original module - This kernel never originally had a module by this name - Installation - Installing to /lib/modules/${KERNEL_VER}/${expected_dest_loc}/ depmod... EOF run_status_with_expected_output 'dkms_nover_update_test' << EOF dkms_nover_update_test/1.0, ${KERNEL_VER}, ${KERNEL_ARCH}: built dkms_nover_update_test/2.0, ${KERNEL_VER}, ${KERNEL_ARCH}: installed EOF echo 'Adding the nover update test modules 3.0 by directory' run_with_expected_output dkms add test/dkms_nover_update_test/3.0 << EOF Creating symlink /var/lib/dkms/dkms_nover_update_test/3.0/source -> /usr/src/dkms_nover_update_test-3.0 EOF run_status_with_expected_output 'dkms_nover_update_test' << EOF dkms_nover_update_test/1.0, ${KERNEL_VER}, ${KERNEL_ARCH}: built dkms_nover_update_test/2.0, ${KERNEL_VER}, ${KERNEL_ARCH}: installed dkms_nover_update_test/3.0: added EOF if ! [[ -d /usr/src/dkms_nover_update_test-3.0 ]] ; then echo >&2 'Error: directory /usr/src/dkms_nover_update_test-3.0 was not created' exit 1 fi echo 'Building the nover update test 3.0 modules' set_signing_message "dkms_nover_update_test" "3.0" run_with_expected_output dkms build -k "${KERNEL_VER}" -m dkms_nover_update_test -v 3.0 << EOF Building module: Cleaning build area... make -j1 KERNELRELEASE=${KERNEL_VER} -C /lib/modules/${KERNEL_VER}/build M=/var/lib/dkms/dkms_nover_update_test/3.0/build... ${SIGNING_MESSAGE}Cleaning build area... EOF run_status_with_expected_output 'dkms_nover_update_test' << EOF dkms_nover_update_test/1.0, ${KERNEL_VER}, ${KERNEL_ARCH}: built dkms_nover_update_test/2.0, ${KERNEL_VER}, ${KERNEL_ARCH}: installed dkms_nover_update_test/3.0, ${KERNEL_VER}, ${KERNEL_ARCH}: built EOF MODULE_PATH_2="/var/lib/dkms/dkms_nover_update_test/2.0/${KERNEL_VER}/${KERNEL_ARCH}/module/dkms_nover_update_test.ko${mod_compression_ext}" MODULE_PATH_3="/var/lib/dkms/dkms_nover_update_test/3.0/${KERNEL_VER}/${KERNEL_ARCH}/module/dkms_nover_update_test.ko${mod_compression_ext}" if ! modinfo "${MODULE_PATH_3}" | grep -q '^srcversion:' && ! diff "${MODULE_PATH_2}" "${MODULE_PATH_3}" &>/dev/null; then # On debian, no srcversion in modinfo's output, the installation will always succeed echo 'Notice: Skip installation test on this platform' else echo 'Installing the nover update test 3.0 modules (expected error)' set_signing_message "dkms_nover_update_test" "3.0" run_with_expected_error 6 dkms install -k "${KERNEL_VER}" -m dkms_nover_update_test -v 3.0 << EOF dkms_nover_update_test.ko${mod_compression_ext}: Running module version sanity check. Module version for dkms_nover_update_test.ko${mod_compression_ext} exactly matches what is already found in kernel ${KERNEL_VER}. DKMS will not replace this module. You may override by specifying --force. Error! Installation aborted. EOF run_status_with_expected_output 'dkms_nover_update_test' << EOF dkms_nover_update_test/1.0, ${KERNEL_VER}, ${KERNEL_ARCH}: built dkms_nover_update_test/2.0, ${KERNEL_VER}, ${KERNEL_ARCH}: installed dkms_nover_update_test/3.0, ${KERNEL_VER}, ${KERNEL_ARCH}: built EOF fi echo 'Removing the nover update test modules' run_with_expected_output dkms remove -k "${KERNEL_VER}" -m dkms_nover_update_test -v 3.0 << EOF Module dkms_nover_update_test 3.0 is not installed for kernel ${KERNEL_VER} (${KERNEL_ARCH}). Skipping... Deleting module dkms_nover_update_test-3.0 completely from the DKMS tree. EOF run_with_expected_output dkms remove -k "${KERNEL_VER}" -m dkms_nover_update_test -v 2.0 << EOF Module dkms_nover_update_test-2.0 for kernel ${KERNEL_VER} (${KERNEL_ARCH}). Before uninstall, this module version was ACTIVE on this kernel. dkms_nover_update_test.ko${mod_compression_ext}: - Uninstallation - Deleting from: /lib/modules/${KERNEL_VER}/${expected_dest_loc}/ - Original module - No original module was found for this module on this kernel. - Use the dkms install command to reinstall any previous module version. Deleting module dkms_nover_update_test-2.0 completely from the DKMS tree. EOF run_with_expected_output dkms remove -k "${KERNEL_VER}" -m dkms_nover_update_test -v 1.0 << EOF Module dkms_nover_update_test 1.0 is not installed for kernel ${KERNEL_VER} (${KERNEL_ARCH}). Skipping... Deleting module dkms_nover_update_test-1.0 completely from the DKMS tree. EOF run_status_with_expected_output 'dkms_nover_update_test' << EOF EOF echo 'Removing /usr/src/dkms_nover_update_test-{1,2,3}.0' rm -r /usr/src/dkms_nover_update_test-{1,2,3}.0 echo 'Checking that the environment is clean' check_no_dkms_test ############################################################################ ### Testing dkms autoinstall ### ############################################################################ echo 'Running autoinstall error testing' echo 'Adding failing test module by directory' run_with_expected_output dkms add test/dkms_failing_test-1.0 << EOF Creating symlink /var/lib/dkms/dkms_failing_test/1.0/source -> /usr/src/dkms_failing_test-1.0 EOF echo 'Running autoinstall with failing test module (expected error)' run_with_expected_error 11 dkms autoinstall -k "${KERNEL_VER}" << EOF Building module: Cleaning build area... make -j1 KERNELRELEASE=${KERNEL_VER} all...(bad exit status: 2) Error! Bad return status for module build on kernel: ${KERNEL_VER} (${KERNEL_ARCH}) Consult /var/lib/dkms/dkms_failing_test/1.0/build/make.log for more information. dkms autoinstall on ${KERNEL_VER}/${KERNEL_ARCH} failed for dkms_failing_test(10) Error! One or more modules failed to install during autoinstall. Refer to previous errors for more information. EOF echo 'Adding test module with dependencies on failing test module by directory' run_with_expected_output dkms add test/dkms_dependencies_test-1.0 << EOF Creating symlink /var/lib/dkms/dkms_dependencies_test/1.0/source -> /usr/src/dkms_dependencies_test-1.0 EOF echo 'Running autoinstall with failing test module and test module with dependencies on the failing module (expected error)' run_with_expected_error 11 dkms autoinstall -k "${KERNEL_VER}" << EOF Building module: Cleaning build area... make -j1 KERNELRELEASE=${KERNEL_VER} all...(bad exit status: 2) Error! Bad return status for module build on kernel: ${KERNEL_VER} (${KERNEL_ARCH}) Consult /var/lib/dkms/dkms_failing_test/1.0/build/make.log for more information. dkms autoinstall on ${KERNEL_VER}/${KERNEL_ARCH} failed for dkms_failing_test(10) dkms_dependencies_test/1.0 autoinstall failed due to missing dependencies: dkms_failing_test Error! One or more modules failed to install during autoinstall. Refer to previous errors for more information. EOF echo 'Removing failing test module' run_with_expected_output dkms remove -k "${KERNEL_VER}" -m dkms_failing_test -v 1.0 << EOF Module dkms_failing_test 1.0 is not installed for kernel ${KERNEL_VER} (${KERNEL_ARCH}). Skipping... Module dkms_failing_test 1.0 is not built for kernel ${KERNEL_VER} (${KERNEL_ARCH}). Skipping... Deleting module dkms_failing_test-1.0 completely from the DKMS tree. EOF echo 'Removing /usr/src/dkms_failing_test-1.0' rm -r /usr/src/dkms_failing_test-1.0 echo 'Running autoinstall with test module with missing dependencies (expected error)' run_with_expected_error 11 dkms autoinstall -k "${KERNEL_VER}" << EOF dkms_dependencies_test/1.0 autoinstall failed due to missing dependencies: dkms_failing_test Error! One or more modules failed to install during autoinstall. Refer to previous errors for more information. EOF echo 'Removing test module with dependencies' run_with_expected_output dkms remove -k "${KERNEL_VER}" -m dkms_dependencies_test -v 1.0 << EOF Module dkms_dependencies_test 1.0 is not installed for kernel ${KERNEL_VER} (${KERNEL_ARCH}). Skipping... Module dkms_dependencies_test 1.0 is not built for kernel ${KERNEL_VER} (${KERNEL_ARCH}). Skipping... Deleting module dkms_dependencies_test-1.0 completely from the DKMS tree. EOF echo 'Removing /usr/src/dkms_dependencies_test-1.0' rm -r /usr/src/dkms_dependencies_test-1.0 echo 'Checking that the environment is clean again' check_no_dkms_test ############################################################################ ### Testing BUILD_EXCLUSIVE_* ### ############################################################################ echo 'Running tests with BUILD_EXCLUSIVE_* modules' set_signing_message "dkms_test" "1.0" echo 'Adding the build-exclusive test module by directory' run_with_expected_output dkms add test/dkms_build_exclusive_test-1.0 << EOF Creating symlink /var/lib/dkms/dkms_build_exclusive_test/1.0/source -> /usr/src/dkms_build_exclusive_test-1.0 EOF run_status_with_expected_output 'dkms_build_exclusive_test' << EOF dkms_build_exclusive_test/1.0: added EOF if ! [[ -d /usr/src/dkms_build_exclusive_test-1.0 ]] ; then echo >&2 'Error: directory /usr/src/dkms_build_exclusive_test-1.0 was not created' return 1 fi # Should this really fail? echo '(Not) building the build-exclusive test module' run_with_expected_error 77 dkms build -k "${KERNEL_VER}" -m dkms_build_exclusive_test -v 1.0 << EOF Error! The /var/lib/dkms/dkms_build_exclusive_test/1.0/${KERNEL_VER}/${KERNEL_ARCH}/dkms.conf for module dkms_build_exclusive_test includes a BUILD_EXCLUSIVE directive which does not match this kernel/arch/config. This indicates that it should not be built. EOF run_status_with_expected_output 'dkms_build_exclusive_test' << EOF dkms_build_exclusive_test/1.0: added EOF echo "Running dkms autoinstall (1 x skip)" run_with_expected_output dkms autoinstall -k "${KERNEL_VER}" << EOF Error! The /var/lib/dkms/dkms_build_exclusive_test/1.0/${KERNEL_VER}/${KERNEL_ARCH}/dkms.conf for module dkms_build_exclusive_test includes a BUILD_EXCLUSIVE directive which does not match this kernel/arch/config. This indicates that it should not be built. dkms autoinstall on ${KERNEL_VER}/${KERNEL_ARCH} was skipped for dkms_build_exclusive_test EOF run_status_with_expected_output 'dkms_build_exclusive_test' << EOF dkms_build_exclusive_test/1.0: added EOF echo 'Adding the test module by directory' run_with_expected_output dkms add test/dkms_test-1.0 << EOF Creating symlink /var/lib/dkms/dkms_test/1.0/source -> /usr/src/dkms_test-1.0 EOF run_status_with_expected_output 'dkms_test' << EOF dkms_test/1.0: added EOF echo "Running dkms autoinstall (1 x skip, 1 x pass)" run_with_expected_output dkms autoinstall -k "${KERNEL_VER}" << EOF Error! The /var/lib/dkms/dkms_build_exclusive_test/1.0/${KERNEL_VER}/${KERNEL_ARCH}/dkms.conf for module dkms_build_exclusive_test includes a BUILD_EXCLUSIVE directive which does not match this kernel/arch/config. This indicates that it should not be built. Building module: Cleaning build area... make -j1 KERNELRELEASE=${KERNEL_VER} -C /lib/modules/${KERNEL_VER}/build M=/var/lib/dkms/dkms_test/1.0/build... ${SIGNING_MESSAGE}Cleaning build area... dkms_test.ko${mod_compression_ext}: Running module version sanity check. - Original module - No original module exists within this kernel - Installation - Installing to /lib/modules/${KERNEL_VER}/${expected_dest_loc}/ depmod... dkms autoinstall on ${KERNEL_VER}/${KERNEL_ARCH} succeeded for dkms_test dkms autoinstall on ${KERNEL_VER}/${KERNEL_ARCH} was skipped for dkms_build_exclusive_test EOF run_status_with_expected_output 'dkms_build_exclusive_test' << EOF dkms_build_exclusive_test/1.0: added EOF run_status_with_expected_output 'dkms_test' << EOF dkms_test/1.0, ${KERNEL_VER}, ${KERNEL_ARCH}: installed EOF echo 'Unbuilding the test module' run_with_expected_output dkms unbuild -k "${KERNEL_VER}" -m dkms_test -v 1.0 << EOF Module dkms_test-1.0 for kernel ${KERNEL_VER} (${KERNEL_ARCH}). Before uninstall, this module version was ACTIVE on this kernel. dkms_test.ko${mod_compression_ext}: - Uninstallation - Deleting from: /lib/modules/${KERNEL_VER}/${expected_dest_loc}/ - Original module - No original module was found for this module on this kernel. - Use the dkms install command to reinstall any previous module version. EOF run_status_with_expected_output 'dkms_test' << EOF dkms_test/1.0: added EOF echo 'Adding failing test module by directory' run_with_expected_output dkms add test/dkms_failing_test-1.0 << EOF Creating symlink /var/lib/dkms/dkms_failing_test/1.0/source -> /usr/src/dkms_failing_test-1.0 EOF echo "Running dkms autoinstall (1 x skip, 1 x fail, 1 x pass) (expected error)" run_with_expected_error 11 dkms autoinstall -k "${KERNEL_VER}" << EOF Error! The /var/lib/dkms/dkms_build_exclusive_test/1.0/${KERNEL_VER}/${KERNEL_ARCH}/dkms.conf for module dkms_build_exclusive_test includes a BUILD_EXCLUSIVE directive which does not match this kernel/arch/config. This indicates that it should not be built. Building module: Cleaning build area... make -j1 KERNELRELEASE=${KERNEL_VER} all...(bad exit status: 2) Error! Bad return status for module build on kernel: ${KERNEL_VER} (${KERNEL_ARCH}) Consult /var/lib/dkms/dkms_failing_test/1.0/build/make.log for more information. Building module: Cleaning build area... make -j1 KERNELRELEASE=${KERNEL_VER} -C /lib/modules/${KERNEL_VER}/build M=/var/lib/dkms/dkms_test/1.0/build... ${SIGNING_MESSAGE}Cleaning build area... dkms_test.ko${mod_compression_ext}: Running module version sanity check. - Original module - No original module exists within this kernel - Installation - Installing to /lib/modules/${KERNEL_VER}/${expected_dest_loc}/ depmod... dkms autoinstall on ${KERNEL_VER}/${KERNEL_ARCH} succeeded for dkms_test dkms autoinstall on ${KERNEL_VER}/${KERNEL_ARCH} was skipped for dkms_build_exclusive_test dkms autoinstall on ${KERNEL_VER}/${KERNEL_ARCH} failed for dkms_failing_test(10) Error! One or more modules failed to install during autoinstall. Refer to previous errors for more information. EOF echo 'Removing failing test module' run_with_expected_output dkms remove -k "${KERNEL_VER}" -m dkms_failing_test -v 1.0 << EOF Module dkms_failing_test 1.0 is not installed for kernel ${KERNEL_VER} (${KERNEL_ARCH}). Skipping... Module dkms_failing_test 1.0 is not built for kernel ${KERNEL_VER} (${KERNEL_ARCH}). Skipping... Deleting module dkms_failing_test-1.0 completely from the DKMS tree. EOF echo 'Removing /usr/src/dkms_failing_test-1.0' rm -r /usr/src/dkms_failing_test-1.0 echo 'Removing the test module' run_with_expected_output dkms remove --all -m dkms_test -v 1.0 << EOF Module dkms_test-1.0 for kernel ${KERNEL_VER} (${KERNEL_ARCH}). Before uninstall, this module version was ACTIVE on this kernel. dkms_test.ko${mod_compression_ext}: - Uninstallation - Deleting from: /lib/modules/${KERNEL_VER}/${expected_dest_loc}/ - Original module - No original module was found for this module on this kernel. - Use the dkms install command to reinstall any previous module version. Deleting module dkms_test-1.0 completely from the DKMS tree. EOF run_status_with_expected_output 'dkms_test' << EOF EOF echo 'Removing /usr/src/dkms_test-1.0' rm -r /usr/src/dkms_test-1.0 echo 'Adding the build-exclusive dependencies test module by directory' run_with_expected_output dkms add test/dkms_build_exclusive_dependencies_test-1.0 << EOF Creating symlink /var/lib/dkms/dkms_build_exclusive_dependencies_test/1.0/source -> /usr/src/dkms_build_exclusive_dependencies_test-1.0 EOF run_status_with_expected_output 'dkms_build_exclusive_dependencies_test' << EOF dkms_build_exclusive_dependencies_test/1.0: added EOF if ! [[ -d /usr/src/dkms_build_exclusive_dependencies_test-1.0 ]] ; then echo >&2 'Error: directory /usr/src/dkms_build_exclusive_dependencies_test-1.0 was not created' return 1 fi echo "Running dkms autoinstall (2 x skip, with dependency)" run_with_expected_output dkms autoinstall -k "${KERNEL_VER}" << EOF Error! The /var/lib/dkms/dkms_build_exclusive_test/1.0/${KERNEL_VER}/${KERNEL_ARCH}/dkms.conf for module dkms_build_exclusive_test includes a BUILD_EXCLUSIVE directive which does not match this kernel/arch/config. This indicates that it should not be built. Error! The /var/lib/dkms/dkms_build_exclusive_dependencies_test/1.0/${KERNEL_VER}/${KERNEL_ARCH}/dkms.conf for module dkms_build_exclusive_dependencies_test includes a BUILD_EXCLUSIVE directive which does not match this kernel/arch/config. This indicates that it should not be built. dkms autoinstall on ${KERNEL_VER}/${KERNEL_ARCH} was skipped for dkms_build_exclusive_test dkms_build_exclusive_dependencies_test EOF run_status_with_expected_output 'dkms_build_exclusive_test' << EOF dkms_build_exclusive_test/1.0: added EOF run_status_with_expected_output 'dkms_build_exclusive_dependencies_test' << EOF dkms_build_exclusive_dependencies_test/1.0: added EOF echo 'Removing the build-exclusive dependencies test module' run_with_expected_output dkms remove --all -m dkms_build_exclusive_dependencies_test -v 1.0 << EOF Deleting module dkms_build_exclusive_dependencies_test-1.0 completely from the DKMS tree. EOF run_status_with_expected_output 'dkms_build_exclusive_dependencies_test' << EOF EOF echo 'Removing /usr/src/dkms_build_exclusive_dependencies_test-1.0' rm -r /usr/src/dkms_build_exclusive_dependencies_test-1.0 echo 'Removing the build-exclusive test module' run_with_expected_output dkms remove --all -m dkms_build_exclusive_test -v 1.0 << EOF Deleting module dkms_build_exclusive_test-1.0 completely from the DKMS tree. EOF run_status_with_expected_output 'dkms_build_exclusive_test' << EOF EOF echo 'Removing /usr/src/dkms_build_exclusive_test-1.0' rm -r /usr/src/dkms_build_exclusive_test-1.0 echo 'Checking that the environment is clean again' check_no_dkms_test echo 'All tests successful :)' dkms-3.0.11/test/000077500000000000000000000000001442250756100135175ustar00rootroot00000000000000dkms-3.0.11/test/README000066400000000000000000000000621442250756100143750ustar00rootroot00000000000000A sample module and framework files to test dkms. dkms-3.0.11/test/dkms_build_exclusive_dependencies_test-1.0/000077500000000000000000000000001442250756100237645ustar00rootroot00000000000000dkms-3.0.11/test/dkms_build_exclusive_dependencies_test-1.0/Makefile000066400000000000000000000000701442250756100254210ustar00rootroot00000000000000all: @echo ERROR: This module fails to build. @exit 1 dkms-3.0.11/test/dkms_build_exclusive_dependencies_test-1.0/dkms.conf000066400000000000000000000003111442250756100255640ustar00rootroot00000000000000PACKAGE_NAME="dkms_build_exclusive_dependencies_test" PACKAGE_VERSION="1.0" BUILD_DEPENDS="dkms_build_exclusive_test" DEST_MODULE_LOCATION="/updates/dkms" BUILD_EXCLUSIVE_ARCH="none" AUTOINSTALL="yes" dkms-3.0.11/test/dkms_build_exclusive_test-1.0/000077500000000000000000000000001442250756100212565ustar00rootroot00000000000000dkms-3.0.11/test/dkms_build_exclusive_test-1.0/Makefile000066400000000000000000000000701442250756100227130ustar00rootroot00000000000000all: @echo ERROR: This module fails to build. @exit 1 dkms-3.0.11/test/dkms_build_exclusive_test-1.0/dkms.conf000066400000000000000000000002221442250756100230570ustar00rootroot00000000000000PACKAGE_NAME="dkms_build_exclusive_test" PACKAGE_VERSION="1.0" DEST_MODULE_LOCATION="/updates/dkms" BUILD_EXCLUSIVE_ARCH="none" AUTOINSTALL="yes" dkms-3.0.11/test/dkms_conf_test_defaulted_BUILT_MODULE_NAME/000077500000000000000000000000001442250756100233425ustar00rootroot00000000000000dkms-3.0.11/test/dkms_conf_test_defaulted_BUILT_MODULE_NAME/dkms.conf000066400000000000000000000001361442250756100251470ustar00rootroot00000000000000PACKAGE_NAME="dkms_conf_test" PACKAGE_VERSION="1.0" DEST_MODULE_LOCATION="/updates-dkms-test" dkms-3.0.11/test/dkms_conf_test_empty/000077500000000000000000000000001442250756100177375ustar00rootroot00000000000000dkms-3.0.11/test/dkms_conf_test_empty/dkms.conf000066400000000000000000000000001442250756100215320ustar00rootroot00000000000000dkms-3.0.11/test/dkms_conf_test_invalid/000077500000000000000000000000001442250756100202275ustar00rootroot00000000000000dkms-3.0.11/test/dkms_conf_test_invalid/dkms.conf000066400000000000000000000002531442250756100220340ustar00rootroot00000000000000PACKAGE_NAME="dkms_conf_test" PACKAGE_VERSION="1.0" DEST_MODULE_NAME[0]="bar.ko" DEST_MODULE_LOCATION="/wrong/path" BUILT_MODULE_NAME[1]="bar.o" DEST_MODULE_NAME[1]="foo" dkms-3.0.11/test/dkms_conf_test_no_conf/000077500000000000000000000000001442250756100202225ustar00rootroot00000000000000dkms-3.0.11/test/dkms_conf_test_no_conf/.placeholder000066400000000000000000000000001442250756100224730ustar00rootroot00000000000000dkms-3.0.11/test/dkms_conf_test_zero_modules/000077500000000000000000000000001442250756100213105ustar00rootroot00000000000000dkms-3.0.11/test/dkms_conf_test_zero_modules/Makefile000066400000000000000000000000001442250756100227360ustar00rootroot00000000000000dkms-3.0.11/test/dkms_conf_test_zero_modules/dkms.conf000066400000000000000000000001061442250756100231120ustar00rootroot00000000000000PACKAGE_NAME="dkms_conf_test" PACKAGE_VERSION="1.0" AUTOINSTALL="yes" dkms-3.0.11/test/dkms_dependencies_test-1.0/000077500000000000000000000000001442250756100205165ustar00rootroot00000000000000dkms-3.0.11/test/dkms_dependencies_test-1.0/Makefile000066400000000000000000000000741442250756100221570ustar00rootroot00000000000000all: @echo ERROR: This module should never build. @exit 1 dkms-3.0.11/test/dkms_dependencies_test-1.0/dkms.conf000066400000000000000000000003241442250756100223220ustar00rootroot00000000000000PACKAGE_NAME="dkms_dependencies_test" PACKAGE_VERSION="1.0" BUILT_MODULE_NAME="dkms_dependencies_test" BUILD_DEPENDS="dkms_failing_test" MAKE="make all" AUTOINSTALL="yes" DEST_MODULE_LOCATION="/kernel/extra" dkms-3.0.11/test/dkms_emptyver_test/000077500000000000000000000000001442250756100174475ustar00rootroot00000000000000dkms-3.0.11/test/dkms_emptyver_test/Makefile000066400000000000000000000002501442250756100211040ustar00rootroot00000000000000obj-m += dkms_emptyver_test.o all: make -C /lib/modules/$(shell uname -r)/build M=$(PWD) modules clean: make -C /lib/modules/$(shell uname -r)/build M=$(PWD) clean dkms-3.0.11/test/dkms_emptyver_test/dkms.conf000066400000000000000000000002301442250756100212470ustar00rootroot00000000000000PACKAGE_NAME="dkms_emptyver_test" PACKAGE_VERSION="1.0" BUILT_MODULE_NAME="dkms_emptyver_test" AUTOINSTALL="yes" DEST_MODULE_LOCATION="/kernel/extra" dkms-3.0.11/test/dkms_emptyver_test/dkms_emptyver_test.c000066400000000000000000000007301442250756100235430ustar00rootroot00000000000000#include #include #include MODULE_LICENSE("GPL"); MODULE_DESCRIPTION("A Simple dkms test module with empty version"); static int __init dkms_test_init(void) { printk(KERN_INFO "DKMS Test Module - Loaded\n"); return 0; } static void __exit dkms_test_cleanup(void) { printk(KERN_INFO "Cleaning up after dkms test module.\n"); } module_init(dkms_test_init); module_exit(dkms_test_cleanup); MODULE_VERSION(""); dkms-3.0.11/test/dkms_failing_test-1.0/000077500000000000000000000000001442250756100175015ustar00rootroot00000000000000dkms-3.0.11/test/dkms_failing_test-1.0/Makefile000066400000000000000000000000701442250756100211360ustar00rootroot00000000000000all: @echo ERROR: This module fails to build. @exit 1 dkms-3.0.11/test/dkms_failing_test-1.0/dkms.conf000066400000000000000000000002471442250756100213110ustar00rootroot00000000000000PACKAGE_NAME="dkms_failing_test" PACKAGE_VERSION="1.0" BUILT_MODULE_NAME="dkms_failing_test" MAKE="make all" AUTOINSTALL="yes" DEST_MODULE_LOCATION="/kernel/extra" dkms-3.0.11/test/dkms_multiver_test/000077500000000000000000000000001442250756100174435ustar00rootroot00000000000000dkms-3.0.11/test/dkms_multiver_test/1.0/000077500000000000000000000000001442250756100177415ustar00rootroot00000000000000dkms-3.0.11/test/dkms_multiver_test/1.0/Makefile000066400000000000000000000002501442250756100213760ustar00rootroot00000000000000obj-m += dkms_multiver_test.o all: make -C /lib/modules/$(shell uname -r)/build M=$(PWD) modules clean: make -C /lib/modules/$(shell uname -r)/build M=$(PWD) clean dkms-3.0.11/test/dkms_multiver_test/1.0/dkms.conf000066400000000000000000000002051442250756100215430ustar00rootroot00000000000000PACKAGE_NAME="dkms_multiver_test" PACKAGE_VERSION="1.0" BUILT_MODULE_NAME="dkms_multiver_test" DEST_MODULE_LOCATION="/kernel/extra" dkms-3.0.11/test/dkms_multiver_test/1.0/dkms_multiver_test.c000066400000000000000000000010311442250756100240240ustar00rootroot00000000000000#include #include #include #define DKMS_TEST_VER "1.0" MODULE_LICENSE("GPL"); MODULE_DESCRIPTION("A Simple dkms multiver test module"); static int __init dkms_test_init(void) { printk(KERN_INFO "DKMS MultiVer Test Module -%s Loaded\n",DKMS_TEST_VER); return 0; } static void __exit dkms_test_cleanup(void) { printk(KERN_INFO "Cleaning up after dkms multiver test module.\n"); } module_init(dkms_test_init); module_exit(dkms_test_cleanup); MODULE_VERSION(DKMS_TEST_VER); dkms-3.0.11/test/dkms_multiver_test/2.0/000077500000000000000000000000001442250756100177425ustar00rootroot00000000000000dkms-3.0.11/test/dkms_multiver_test/2.0/Makefile000066400000000000000000000002501442250756100213770ustar00rootroot00000000000000obj-m += dkms_multiver_test.o all: make -C /lib/modules/$(shell uname -r)/build M=$(PWD) modules clean: make -C /lib/modules/$(shell uname -r)/build M=$(PWD) clean dkms-3.0.11/test/dkms_multiver_test/2.0/dkms.conf000066400000000000000000000002051442250756100215440ustar00rootroot00000000000000PACKAGE_NAME="dkms_multiver_test" PACKAGE_VERSION="2.0" BUILT_MODULE_NAME="dkms_multiver_test" DEST_MODULE_LOCATION="/kernel/extra" dkms-3.0.11/test/dkms_multiver_test/2.0/dkms_multiver_test.c000066400000000000000000000010311442250756100240250ustar00rootroot00000000000000#include #include #include #define DKMS_TEST_VER "2.0" MODULE_LICENSE("GPL"); MODULE_DESCRIPTION("A Simple dkms multiver test module"); static int __init dkms_test_init(void) { printk(KERN_INFO "DKMS MultiVer Test Module -%s Loaded\n",DKMS_TEST_VER); return 0; } static void __exit dkms_test_cleanup(void) { printk(KERN_INFO "Cleaning up after dkms multiver test module.\n"); } module_init(dkms_test_init); module_exit(dkms_test_cleanup); MODULE_VERSION(DKMS_TEST_VER); dkms-3.0.11/test/dkms_nover_test/000077500000000000000000000000001442250756100167255ustar00rootroot00000000000000dkms-3.0.11/test/dkms_nover_test/Makefile000066400000000000000000000002451442250756100203660ustar00rootroot00000000000000obj-m += dkms_nover_test.o all: make -C /lib/modules/$(shell uname -r)/build M=$(PWD) modules clean: make -C /lib/modules/$(shell uname -r)/build M=$(PWD) clean dkms-3.0.11/test/dkms_nover_test/dkms.conf000066400000000000000000000002221442250756100205260ustar00rootroot00000000000000PACKAGE_NAME="dkms_nover_test" PACKAGE_VERSION="1.0" BUILT_MODULE_NAME="dkms_nover_test" AUTOINSTALL="yes" DEST_MODULE_LOCATION="/kernel/extra" dkms-3.0.11/test/dkms_nover_test/dkms_nover_test.c000066400000000000000000000007011442250756100222750ustar00rootroot00000000000000#include #include #include MODULE_LICENSE("GPL"); MODULE_DESCRIPTION("A Simple dkms test module with no version"); static int __init dkms_test_init(void) { printk(KERN_INFO "DKMS Test Module - Loaded\n"); return 0; } static void __exit dkms_test_cleanup(void) { printk(KERN_INFO "Cleaning up after dkms test module.\n"); } module_init(dkms_test_init); module_exit(dkms_test_cleanup); dkms-3.0.11/test/dkms_nover_update_test/000077500000000000000000000000001442250756100202675ustar00rootroot00000000000000dkms-3.0.11/test/dkms_nover_update_test/1.0/000077500000000000000000000000001442250756100205655ustar00rootroot00000000000000dkms-3.0.11/test/dkms_nover_update_test/1.0/Makefile000066400000000000000000000002541442250756100222260ustar00rootroot00000000000000obj-m += dkms_nover_update_test.o all: make -C /lib/modules/$(shell uname -r)/build M=$(PWD) modules clean: make -C /lib/modules/$(shell uname -r)/build M=$(PWD) clean dkms-3.0.11/test/dkms_nover_update_test/1.0/dkms.conf000066400000000000000000000006301442250756100223710ustar00rootroot00000000000000 PACKAGE_NAME="dkms_nover_update_test" PACKAGE_VERSION="1.0" BUILT_MODULE_NAME="dkms_nover_update_test" # MAKE="make -C /lib/modules/${kernelver}/build SUBDIRS=${dkms_tree}/${PACKAGE_NAME}/${PACKAGE_VERSION}/build modules" # CLEAN="make -C /lib/modules/${kernelver}/build SUBDIRS=${dkms_tree}/${PACKAGE_NAME}/${PACKAGE_VERSION}/build M=$PWD clean" AUTOINSTALL="yes" DEST_MODULE_LOCATION="/kernel/extra" dkms-3.0.11/test/dkms_nover_update_test/1.0/dkms_nover_update_test.c000066400000000000000000000007011442250756100254770ustar00rootroot00000000000000#include #include #include MODULE_LICENSE("GPL"); MODULE_DESCRIPTION("A Simple dkms test module with no version"); static int __init dkms_test_init(void) { printk(KERN_INFO "DKMS Test Module - Loaded\n"); return 0; } static void __exit dkms_test_cleanup(void) { printk(KERN_INFO "Cleaning up after dkms test module.\n"); } module_init(dkms_test_init); module_exit(dkms_test_cleanup); dkms-3.0.11/test/dkms_nover_update_test/2.0/000077500000000000000000000000001442250756100205665ustar00rootroot00000000000000dkms-3.0.11/test/dkms_nover_update_test/2.0/Makefile000066400000000000000000000002541442250756100222270ustar00rootroot00000000000000obj-m += dkms_nover_update_test.o all: make -C /lib/modules/$(shell uname -r)/build M=$(PWD) modules clean: make -C /lib/modules/$(shell uname -r)/build M=$(PWD) clean dkms-3.0.11/test/dkms_nover_update_test/2.0/dkms.conf000066400000000000000000000006301442250756100223720ustar00rootroot00000000000000 PACKAGE_NAME="dkms_nover_update_test" PACKAGE_VERSION="2.0" BUILT_MODULE_NAME="dkms_nover_update_test" # MAKE="make -C /lib/modules/${kernelver}/build SUBDIRS=${dkms_tree}/${PACKAGE_NAME}/${PACKAGE_VERSION}/build modules" # CLEAN="make -C /lib/modules/${kernelver}/build SUBDIRS=${dkms_tree}/${PACKAGE_NAME}/${PACKAGE_VERSION}/build M=$PWD clean" AUTOINSTALL="yes" DEST_MODULE_LOCATION="/kernel/extra" dkms-3.0.11/test/dkms_nover_update_test/2.0/dkms_nover_update_test.c000066400000000000000000000007021442250756100255010ustar00rootroot00000000000000#include #include #include MODULE_LICENSE("GPL"); MODULE_DESCRIPTION("A Simple dkms test module with no version!"); static int __init dkms_test_init(void) { printk(KERN_INFO "DKMS Test Module - Loaded\n"); return 0; } static void __exit dkms_test_cleanup(void) { printk(KERN_INFO "Cleaning up after dkms test module.\n"); } module_init(dkms_test_init); module_exit(dkms_test_cleanup); dkms-3.0.11/test/dkms_nover_update_test/3.0/000077500000000000000000000000001442250756100205675ustar00rootroot00000000000000dkms-3.0.11/test/dkms_nover_update_test/3.0/Makefile000066400000000000000000000002541442250756100222300ustar00rootroot00000000000000obj-m += dkms_nover_update_test.o all: make -C /lib/modules/$(shell uname -r)/build M=$(PWD) modules clean: make -C /lib/modules/$(shell uname -r)/build M=$(PWD) clean dkms-3.0.11/test/dkms_nover_update_test/3.0/dkms.conf000066400000000000000000000006301442250756100223730ustar00rootroot00000000000000 PACKAGE_NAME="dkms_nover_update_test" PACKAGE_VERSION="3.0" BUILT_MODULE_NAME="dkms_nover_update_test" # MAKE="make -C /lib/modules/${kernelver}/build SUBDIRS=${dkms_tree}/${PACKAGE_NAME}/${PACKAGE_VERSION}/build modules" # CLEAN="make -C /lib/modules/${kernelver}/build SUBDIRS=${dkms_tree}/${PACKAGE_NAME}/${PACKAGE_VERSION}/build M=$PWD clean" AUTOINSTALL="yes" DEST_MODULE_LOCATION="/kernel/extra" dkms-3.0.11/test/dkms_nover_update_test/3.0/dkms_nover_update_test.c000066400000000000000000000007021442250756100255020ustar00rootroot00000000000000#include #include #include MODULE_LICENSE("GPL"); MODULE_DESCRIPTION("A Simple dkms test module with no version!"); static int __init dkms_test_init(void) { printk(KERN_INFO "DKMS Test Module - Loaded\n"); return 0; } static void __exit dkms_test_cleanup(void) { printk(KERN_INFO "Cleaning up after dkms test module.\n"); } module_init(dkms_test_init); module_exit(dkms_test_cleanup); dkms-3.0.11/test/dkms_test-1.0/000077500000000000000000000000001442250756100160105ustar00rootroot00000000000000dkms-3.0.11/test/dkms_test-1.0/Makefile000066400000000000000000000002371442250756100174520ustar00rootroot00000000000000obj-m += dkms_test.o all: make -C /lib/modules/$(shell uname -r)/build M=$(PWD) modules clean: make -C /lib/modules/$(shell uname -r)/build M=$(PWD) clean dkms-3.0.11/test/dkms_test-1.0/dkms.conf000066400000000000000000000002061442250756100176130ustar00rootroot00000000000000PACKAGE_NAME="dkms_test" PACKAGE_VERSION="1.0" BUILT_MODULE_NAME="dkms_test" AUTOINSTALL="yes" DEST_MODULE_LOCATION="/kernel/extra" dkms-3.0.11/test/dkms_test-1.0/dkms_test.c000066400000000000000000000007761442250756100201630ustar00rootroot00000000000000#include #include #include #define DKMS_TEST_VER "1.0" MODULE_LICENSE("GPL"); MODULE_DESCRIPTION("A Simple dkms test module"); static int __init dkms_test_init(void) { printk(KERN_INFO "DKMS Test Module -%s Loaded\n",DKMS_TEST_VER); return 0; } static void __exit dkms_test_cleanup(void) { printk(KERN_INFO "Cleaning up after dkms test module.\n"); } module_init(dkms_test_init); module_exit(dkms_test_cleanup); MODULE_VERSION(DKMS_TEST_VER); dkms-3.0.11/test/framework/000077500000000000000000000000001442250756100155145ustar00rootroot00000000000000dkms-3.0.11/test/framework/bad_cert_file_path.conf000066400000000000000000000003221442250756100221360ustar00rootroot00000000000000# The key file will be generated by openssl. Use a temporary path to avoid corrupting the default private key file on the system mok_signing_key="/tmp/dkms_test_private_key" mok_certificate="/no/such/path.crt" dkms-3.0.11/test/framework/bad_key_file_path.conf000066400000000000000000000000441442250756100217720ustar00rootroot00000000000000mok_signing_key="/no/such/path.key" dkms-3.0.11/test/framework/bad_sign_file_path.conf000066400000000000000000000000321442250756100221370ustar00rootroot00000000000000sign_file="/no/such/file" dkms-3.0.11/test/framework/hijacking.conf000066400000000000000000000000611442250756100203070ustar00rootroot00000000000000do_status() { echo "do_status() is hijacked!" } dkms-3.0.11/test/framework/temp_key_cert.conf000066400000000000000000000001321442250756100212110ustar00rootroot00000000000000mok_signing_key="/tmp/dkms_test_private_key" mok_certificate="/tmp/dkms_test_certificate" dkms-3.0.11/test/framework/variables_in_path.conf000066400000000000000000000002531442250756100220350ustar00rootroot00000000000000sign_file="/lib/modules/${kernelver}/build/scripts/sign-file" mok_signing_key="/tmp/dkms_test_dir_${kernelver}/key" mok_certificate="/tmp/dkms_test_dir_${kernelver}/cert"