Lucas De Marchi | 4002d77 | 2015-02-02 22:26:06 -0200 | [diff] [blame] | 1 | #!/bin/bash |
| 2 | |
| 3 | set -e |
| 4 | |
| 5 | MODULE_PLAYGROUND=$1 |
| 6 | ROOTFS=$2 |
| 7 | |
| 8 | declare -A map |
| 9 | map=( |
| 10 | ["test-depmod/search-order-simple/lib/modules/4.4.4/kernel/crypto/"]="mod-simple.ko" |
| 11 | ["test-depmod/search-order-simple/lib/modules/4.4.4/updates/"]="mod-simple.ko" |
Lucas De Marchi | 8dddac5 | 2015-02-02 22:35:02 -0200 | [diff] [blame] | 12 | ["test-depmod/search-order-same-prefix/lib/modules/4.4.4/foo/"]="mod-simple.ko" |
| 13 | ["test-depmod/search-order-same-prefix/lib/modules/4.4.4/foobar/"]="mod-simple.ko" |
Lucas De Marchi | d9ab7ab | 2015-02-09 14:07:31 -0200 | [diff] [blame] | 14 | ["test-depmod/detect-loop/lib/modules/4.4.4/kernel/mod-loop-a.ko"]="mod-loop-a.ko" |
| 15 | ["test-depmod/detect-loop/lib/modules/4.4.4/kernel/mod-loop-b.ko"]="mod-loop-b.ko" |
| 16 | ["test-depmod/detect-loop/lib/modules/4.4.4/kernel/mod-loop-c.ko"]="mod-loop-c.ko" |
| 17 | ["test-depmod/detect-loop/lib/modules/4.4.4/kernel/mod-loop-d.ko"]="mod-loop-d.ko" |
| 18 | ["test-depmod/detect-loop/lib/modules/4.4.4/kernel/mod-loop-e.ko"]="mod-loop-e.ko" |
Lucas De Marchi | 450c1f0 | 2015-02-03 00:24:33 -0200 | [diff] [blame] | 19 | ["test-dependencies/lib/modules/4.0.20-kmod/kernel/fs/foo/"]="mod-foo-b.ko" |
| 20 | ["test-dependencies/lib/modules/4.0.20-kmod/kernel/"]="mod-foo-c.ko" |
| 21 | ["test-dependencies/lib/modules/4.0.20-kmod/kernel/lib/"]="mod-foo-a.ko" |
| 22 | ["test-dependencies/lib/modules/4.0.20-kmod/kernel/fs/"]="mod-foo.ko" |
Lucas De Marchi | 1669be8 | 2015-02-03 05:17:10 -0200 | [diff] [blame] | 23 | ["test-init/"]="mod-simple.ko" |
| 24 | ["test-remove/"]="mod-simple.ko" |
Lucas De Marchi | eeb6270 | 2015-02-10 09:30:49 -0200 | [diff] [blame] | 25 | ["test-modprobe/show-depends/lib/modules/4.4.4/kernel/mod-loop-a.ko"]="mod-loop-a.ko" |
| 26 | ["test-modprobe/show-depends/lib/modules/4.4.4/kernel/mod-loop-b.ko"]="mod-loop-b.ko" |
| 27 | ["test-modprobe/show-depends/lib/modules/4.4.4/kernel/mod-simple.ko"]="mod-simple.ko" |
Lucas De Marchi | 1e12824 | 2015-02-10 21:45:09 -0200 | [diff] [blame] | 28 | ["test-modprobe/softdep-loop/lib/modules/4.4.4/kernel/mod-loop-a.ko"]="mod-loop-a.ko" |
| 29 | ["test-modprobe/softdep-loop/lib/modules/4.4.4/kernel/mod-loop-b.ko"]="mod-loop-b.ko" |
Lucas De Marchi | 621ac88 | 2015-02-11 02:50:06 -0200 | [diff] [blame^] | 30 | ["test-modprobe/install-cmd-loop/lib/modules/4.4.4/kernel/mod-loop-a.ko"]="mod-loop-a.ko" |
| 31 | ["test-modprobe/install-cmd-loop/lib/modules/4.4.4/kernel/mod-loop-b.ko"]="mod-loop-b.ko" |
Lucas De Marchi | a1a1369 | 2015-02-10 22:01:42 -0200 | [diff] [blame] | 32 | ["test-modprobe/force/lib/modules/4.4.4/kernel/"]="mod-simple.ko" |
Lucas De Marchi | 33c1185 | 2015-02-10 22:11:25 -0200 | [diff] [blame] | 33 | ["test-modprobe/oldkernel/lib/modules/3.3.3/kernel/"]="mod-simple.ko" |
| 34 | ["test-modprobe/oldkernel-force/lib/modules/3.3.3/kernel/"]="mod-simple.ko" |
Lucas De Marchi | bf0b87f | 2015-02-10 22:19:53 -0200 | [diff] [blame] | 35 | ["test-modprobe/alias-to-none/lib/modules/4.4.4/kernel/"]="mod-simple.ko" |
Lucas De Marchi | 4002d77 | 2015-02-02 22:26:06 -0200 | [diff] [blame] | 36 | ) |
| 37 | |
| 38 | for k in ${!map[@]}; do |
| 39 | dst=${ROOTFS}/$k |
| 40 | src=${MODULE_PLAYGROUND}/${map[$k]} |
| 41 | |
Lucas De Marchi | d9ab7ab | 2015-02-09 14:07:31 -0200 | [diff] [blame] | 42 | if test "${dst: -1}" = "/"; then |
| 43 | install -d $dst |
| 44 | install -t $dst $src |
| 45 | else |
| 46 | install -D $src $dst |
| 47 | fi |
Lucas De Marchi | 4002d77 | 2015-02-02 22:26:06 -0200 | [diff] [blame] | 48 | done |