install-files: Replace symlinks into linux-bootwrapper package with files
In linux version 4.17.6-1, the bootwrapper executables for PowerPC
architectures were moved to a separate binary package and the
linux-image package contains symlinks to (and a dependency on) that.
The d-i build process needs these files and expects them to be part of
the kernel-image udeb, so replace the symlinks with the target files.
Ben Hutchings
5 years ago
44 | 44 | } |
45 | 45 | |
46 | 46 | my $sourcedir; |
47 | my $bootwrapper_sourcedir; | |
47 | 48 | if (defined $fixsourcedir) { |
48 | 49 | $sourcedir = $fixsourcedir; |
49 | 50 | } |
58 | 59 | } |
59 | 60 | else { |
60 | 61 | $sourcedir = "debian/linux-image-$installedname"; |
62 | ($bootwrapper_sourcedir) = grep {-d} | |
63 | "debian/linux-bootwrapper-$kernelversion"; | |
61 | 64 | } |
62 | 65 | # Set SOURCEDIR for copy-modules |
63 | 66 | $ENV{SOURCEDIR} = $sourcedir; |
126 | 129 | # for certain subarchitectures. This is powerpc-specific at the |
127 | 130 | # moment. |
128 | 131 | if (-d "$sourcedir/usr/lib/linux-image-$kernelversion-$flavour") { |
132 | my $installdir = | |
133 | "debian/kernel-image-$kernelversion-$flavour-di" . | |
134 | "/usr/lib/linux-image-$installedname"; | |
135 | ||
129 | 136 | doit("install", "-d", |
130 | 137 | "debian/kernel-image-$kernelversion-$flavour-di/usr/lib"); |
131 | 138 | doit("cp", "-a", |
132 | 139 | "$sourcedir/usr/lib/linux-image-$kernelversion-$flavour", |
133 | "debian/kernel-image-$kernelversion-$flavour-di/usr/lib/linux-image-$installedname"); | |
140 | $installdir); | |
141 | ||
142 | # Replace symlinks into linux-bootwrapper with the target | |
143 | # files, rather than building yet another udeb. | |
144 | if (defined($bootwrapper_sourcedir)) { | |
145 | opendir(my $dh, $installdir) | |
146 | or die "opendir: $installdir: $!"; | |
147 | for my $name (readdir($dh)) { | |
148 | my $fullname = "$installdir/$name"; | |
149 | my $target = readlink($fullname); | |
150 | next unless defined($target) && | |
151 | $target eq "../linux-bootwrapper-$kernelversion/$name"; | |
152 | unlink($fullname) | |
153 | or die "unlink: $fullname: $!"; | |
154 | doit("cp", "-a", | |
155 | $bootwrapper_sourcedir . | |
156 | "/usr/lib/linux-bootwrapper-$kernelversion/$name", | |
157 | $fullname); | |
158 | } | |
159 | closedir($dh); | |
160 | } | |
134 | 161 | } |
135 | 162 | |
136 | 163 | doit("kernel-wedge", "copy-modules", $kernelversion, $flavour, $installedname); |