Whamcloud - gitweb
LU-14535 quota: get all quota info in LFS
[fs/lustre-release.git] / lustre-dkms_post-build.sh
1 #!/bin/bash
2 # SPDX-License-Identifier: GPL-2.0
3
4 #
5 # This file is part of Lustre, http://www.lustre.org/
6 #
7 # lustre-dkms_post-build.sh
8 #
9 # Script run after dkms build
10 #
11
12 #
13 # $1 : $module
14 # $2 : $module_version
15 # $3 : $kernelver
16 # $4 : $kernel_source_dir
17 # $5 : $arch
18 # $6 : $source_tree
19 # $7 : $dkms_tree
20 #
21 # This script ensure that ALL Lustre kernel modules that have been built
22 # during DKMS build step of lustre[-client]-dkms module will be moved in
23 # DKMS vault/repository, and this before the build directory content will be
24 # trashed.
25 # This is required because dkms.conf file is only sourced at the very
26 # beginning of the DKMS build step when its content has to be on-target
27 # customized during pre_build script. This can lead to incomplete list
28 # of built Lustre kernel modules then to be saved for next DKMS install step.
29 #
30
31 #
32 # Use this place to also save config.log that has been generated during
33 # pre_build.
34 # $7/$1/$2/$3/$5/log repository should have already been created to save
35 # make.log and $kernel_config
36 #
37
38 mkdir -p "$7/$1/$2/$3/$5/log"
39 cp -f "$7/$1/$2/build/config.log" "$7/$1/$2/$3/$5/log/config.log" 2>/dev/null
40 cp -f "$7/$1/$2/build/config.h" \
41     "$7/$1/$2/build/Module.symvers" \
42     "$7/$1/$2/$3/$5/" 2> /dev/null
43
44 case $1 in
45     lustre-zfs|lustre-all)
46         # To satisfy the content of lustre-osd-zfs-mount install these scripts:
47         for script in statechange-lustre.sh \
48                       vdev_attach-lustre.sh \
49                       vdev_clear-lustre.sh \
50                       vdev_remove-lustre.sh
51         do
52                 install -D -m 0755 lustre/scripts/${script} /etc/zfs/zed.d/${script}
53         done
54         ;;
55 esac