]> git.proxmox.com Git - mirror_ubuntu-bionic-kernel.git/blame - debian/scripts/sub-flavour
x86/speculation/mds: Add mitigation control for MDS
[mirror_ubuntu-bionic-kernel.git] / debian / scripts / sub-flavour
CommitLineData
0d34a427
LO
1#!/bin/bash
2
3. debian/debian.env
4
5echo "SUB_PROCESS $FROM => $TO"
6
7export from_pkg="linux-image-$ABI_RELEASE-$FROM"
8export to_pkg="linux-image-$ABI_RELEASE-$TO"
9
10from_moddir="debian/$from_pkg/lib/modules/$ABI_RELEASE-$FROM"
11to_moddir="debian/$to_pkg/lib/modules/$ABI_RELEASE-$FROM"
12
13install -d "debian/$to_pkg/boot"
14install -m644 debian/$from_pkg/boot/config-$ABI_RELEASE-$FROM \
15 debian/$to_pkg/boot/
16install -m600 debian/$from_pkg/boot/{vmlinuz,System.map}-$ABI_RELEASE-$FROM \
17 debian/$to_pkg/boot/
18
19#
20# Print some warnings if there are files in the sub-flavours list
21# that do not actually exist.
22#
23cat ${DEBIAN}/sub-flavours/$TO.list | while read line
24do
25(
26 cd debian/$from_pkg/lib/modules/$ABI_RELEASE-$FROM/kernel;
27 #
28 # If its a wildcard, then check that there are files that match.
29 #
30 if echo "$line" | grep '\*' > /dev/null
31 then
32 if [ `eval find "$line" -name '*.ko' 2>/dev/null|wc -l` -lt 1 ]
33 then
34 echo SUB_INST Warning - No files in $line
35 fi
36 #
37 # Else it should be a single file reference.
38 #
39 elif [ ! -f "$line" ]
40 then
41 echo SUB_INST Warning - could not find "$line"
42 fi
43)
44done
45
46cat ${DEBIAN}/sub-flavours/$TO.list | while read line; do
47 (
48 cd debian/$from_pkg/lib/modules/$ABI_RELEASE-$FROM/kernel;
49 if echo "$line" | grep '\*' > /dev/null
50 then
51 eval find "$line" -name '*.ko' 2>/dev/null || true
52 elif [ -f "$line" ]
53 then
54 echo "$line"
55 fi
56 );
57done | while read mod; do
58 echo "SUB_INST checking: $mod"
59 fromdir="/lib/modules/$ABI_RELEASE-$FROM/"
60 egrep "^($fromdir)?kernel/$mod:" \
61 $from_moddir/modules.dep | sed -e "s|^$fromdir||" -e 's/://' -e 's/ /\n/g' | \
62 while read m; do
63 m="${fromdir}$m"
64 test -f debian/$to_pkg/$m && continue
65 echo "SUB_INST installing: $m"
66 install -D -m644 debian/$from_pkg/$m \
67 debian/$to_pkg/$m
68 done
69done