Home Home > GIT Browse > packaging
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMichal Suchanek <msuchanek@suse.de>2019-03-15 00:32:22 +0100
committerMichal Suchanek <msuchanek@suse.de>2019-03-15 22:13:09 +0100
commita5ee24ef3f8a2258918ea18049f6fdc385ce8087 (patch)
tree895b29cdc21b6f86f8b7100cdedc1e34185792c2
parent5568093d5dbacaeb60b6e0f7f4bbe384b586b82a (diff)
Remove the previous subpackage infrastructure.
This partially reverts commit 9b3ca32c11854156b2f950ff5e26131377d8445e ("Add kernel-subpackage-build.spec (FATE#326579).")
-rw-r--r--rpm/kernel-binary.spec.in11
-rw-r--r--rpm/kernel-source.spec.in11
-rw-r--r--rpm/kernel-spec-macros13
-rw-r--r--rpm/kernel-subpackage-build.spec.in219
-rw-r--r--rpm/kernel-subpackage.conf0
-rwxr-xr-xrpm/mkspec42
-rw-r--r--rpm/subpackage-names.conf3
7 files changed, 14 insertions, 285 deletions
diff --git a/rpm/kernel-binary.spec.in b/rpm/kernel-binary.spec.in
index bdf5440857..002662f174 100644
--- a/rpm/kernel-binary.spec.in
+++ b/rpm/kernel-binary.spec.in
@@ -91,7 +91,6 @@ BuildRequires: openssl
BuildRequires: pesign-obs-integration
# for objtool
BuildRequires: libelf-devel
-# BEGIN BINARY DEPS
Provides: %name = %version-%source_rel
# bnc#901925
Provides: %name-%version-%source_rel
@@ -104,7 +103,7 @@ Provides: multiversion(kernel)
# obsolete the -base subpackage from SLE11, so that the base files are not
# owned by multiple packages now. The dependency is not correct wrt openSUSE
# 11.2 - 11.4, but we primarily care about the supported upgrade path.
-Obsoletes: kernel-%build_flavor-base < 3.1
+Obsoletes: %name-base < 3.1
Recommends: kernel-firmware
# The following is copied to the -base subpackage as well
# BEGIN COMMON DEPS
@@ -174,6 +173,7 @@ Provides: kernel-%build_flavor-base-srchash-@COMMIT_FULL@
Provides: kernel-srchash-@COMMIT_FULL@
# END COMMON DEPS
Provides: %name-srchash-@COMMIT_FULL@
+@PROVIDES_OBSOLETES@
@PROVIDES_OBSOLETES_BASE@
%obsolete_rebuilds %name
@SOURCES@
@@ -193,8 +193,6 @@ BuildArch: i686
# These files are found in the kernel-source package:
@NOSOURCE@
-# END BINARY DEPS
-@PROVIDES_OBSOLETES@
# The following KMPs have been integrated into the kernel package,
# grouped by the last product that contained them.
@@ -598,7 +596,7 @@ fi
for sub in '' '-extra'; do
case "$sub" in
- '-base' | '') base_package=1 ;;
+ '') base_package=1 ;;
*) base_package=0 ;;
esac
for script in preun postun pre post devel-pre devel-post; do
@@ -609,9 +607,10 @@ for sub in '' '-extra'; do
sed -e "s:@KERNELRELEASE@:%kernelrelease:g" \
-e "s:@IMAGE@:$image:g" \
-e "s:@FLAVOR""@:%build_flavor:g" \
- -e "s:@SUBPACKAGE""@:%name$sub:g" \
+ -e "s:@SUBPACKAGE@:%name$sub:g" \
-e "s:@BASE_PACKAGE@:$base_package:g" \
-e "s:@RPM_VERSION_RELEASE@:%version-%release:g" \
+ -e "s:@RPM_TARGET_CPU@:%_target_cpu:g" \
-e "s:@CPU_ARCH_FLAVOR@:%cpu_arch_flavor:g" \
-e "s:@SRCVARIANT@:%variant:g" \
%_sourcedir/$script.sh > %my_builddir/$script$sub.sh
diff --git a/rpm/kernel-source.spec.in b/rpm/kernel-source.spec.in
index 6ec617b14d..2f5eb5f22a 100644
--- a/rpm/kernel-source.spec.in
+++ b/rpm/kernel-source.spec.in
@@ -98,13 +98,10 @@ Source75: release-projects
Source76: check-module-license
Source77: klp-symbols
Source78: modules.fips
-Source79: kernel-subpackage-build.spec.in
-Source80: kernel-subpackage.conf
-Source81: subpackage-names.conf
-Source82: splitflist
-Source83: mergedep
-Source84: moddep
-Source85: modflist
+Source79: splitflist
+Source80: mergedep
+Source81: moddep
+Source82: modflist
Source100: config.tar.bz2
Source101: config.addon.tar.bz2
Source102: patches.arch.tar.bz2
diff --git a/rpm/kernel-spec-macros b/rpm/kernel-spec-macros
index 18055affcc..9832601f49 100644
--- a/rpm/kernel-spec-macros
+++ b/rpm/kernel-spec-macros
@@ -10,25 +10,20 @@
%define using_buildservice 0%(echo %disturl | grep -q '^obs://build\.[^.]*suse\.' && echo 1)
%endif
-# allow override in kernel-subpackage
-%if %{?kernel_spec_release:0}%{!?kernel_spec_release:1}
-%define kernel_spec_release %release
-%endif
-
# source_rel is the package release string, without the rebuild counter
# generated by the build service. If the release string has a non-digit
# suffix, we keep that suffix and strip the rightmost digit component.
# This is used in KOTD builds: 2.1.g1234567 -> 2.g1234567
# In PTF projects, there is no rebuild counter, so we leave the release
# string intact.
-%define source_rel %kernel_spec_release
+%define source_rel %release
%define obsolete_rebuilds() %nil
%if %using_buildservice && ! 0%{?is_ptf}
-%define source_rel %(echo %kernel_spec_release | sed -r 's/\\.[0-9]+($|\\.[^.]*[^.0-9][^.]*$)/\\1/')
+%define source_rel %(echo %release | sed -r 's/\\.[0-9]+($|\\.[^.]*[^.0-9][^.]*$)/\\1/')
# If the rebuild counter is > 1, obsolete all previous rebuilds (boo#867595)
%define obsolete_rebuilds() %( %{verbose:set -x} \
- set -- $(echo %kernel_spec_release | sed -rn 's/(.*\\.)([0-9]+)($|\\.[^.]*[^.0-9][^.]*$)/\\1 \\2 \\3/p') \
- if test -n "$2" && test "$2" -gt 99; then echo "warning: Rebuild counter too high in %kernel_spec_release" >&2; exit 0; fi \
+ set -- $(echo %release | sed -rn 's/(.*\\.)([0-9]+)($|\\.[^.]*[^.0-9][^.]*$)/\\1 \\2 \\3/p') \
+ if test -n "$2" && test "$2" -gt 99; then echo "warning: Rebuild counter too high in %release" >&2; exit 0; fi \
seq 1 $(($2-1)) | sed "s/.*/Obsoletes: %1 = %version-$1&$3/" \
)
%endif
diff --git a/rpm/kernel-subpackage-build.spec.in b/rpm/kernel-subpackage-build.spec.in
deleted file mode 100644
index e605695cae..0000000000
--- a/rpm/kernel-subpackage-build.spec.in
+++ /dev/null
@@ -1,219 +0,0 @@
-#
-# spec file for package kernel-@FLAVOR@ subpackage builds
-#
-# Copyright (c) @YEAR@ SUSE LINUX GmbH, Nuernberg, Germany.
-#
-# All modifications and additions to the file contributed by third parties
-# remain the property of their copyright owners, unless otherwise agreed
-# upon. The license for this file, and modifications and additions to the
-# file, is the same license as for the pristine package itself (unless the
-# license for the pristine package is not an Open Source License, in which
-# case the license is the MIT License). An "Open Source License" is a
-# license that conforms to the Open Source Definition (Version 1.9)
-# published by the Open Source Initiative.
-
-# Please submit bugfixes or comments via http://bugs.opensuse.org/
-#
-# needssslcertforbuild
-
-
-%define srcversion @SRCVERSION@
-%define patchversion @PATCHVERSION@
-%define variant @VARIANT@%{nil}
-%define vanilla_only @VANILLA_ONLY@
-
-%define rpm_kver %(rpm -q --qf '%%{VERSION}' kernel-%build_flavor)
-%define rpm_krel %(rpm -q --qf '%%{RELEASE}' kernel-%build_flavor)
-%define kernel_spec_release %rpm_krel
-
-%include %_sourcedir/kernel-spec-macros
-
-%define build_flavor @FLAVOR@
-%define build_default ("%build_flavor" == "default")
-%define build_vanilla ("%build_flavor" == "vanilla")
-
-%define cpu_arch_flavor %cpu_arch/%build_flavor
-
-# Force bzip2 instead of lzma compression to
-# 1) allow install on older dist versions, and
-# 2) decrease build times (bsc#962356)
-#%define _binary_payload w9.bzdio
-# Do not recompute the build-id of vmlinux in find-debuginfo.sh (bsc#964063)
-%undefine _unique_build_ids
-%define _no_recompute_build_ids 1
-# prevent usr/lib/debug/boot/vmlinux-4.12.14-11.10-default-4.12.14-11.10.ppc64le.debug
-%undefine _unique_debug_names
-
-# define %extrasummary, %extradescription, and %modules
-# %extrasummary appended to package summary
-# %extradescription appended to package description
-# %modules is list of modules to include in the package (if they exist)
-%include %_sourcedir/kernel-subpackage.conf
-
-Name: kernel-%build_flavor-@SUBPACKAGE@
-BuildRequires: coreutils
-BuildRequires: device-mapper
-BuildRequires: dracut
-BuildRequires: kmod
-BuildRequires: kernel-%build_flavor-srchash-@COMMIT_FULL@
-BuildRequires: kernel-%build_flavor-devel
-BuildRequires: util-linux
-ExclusiveArch: @ARCHS@
-Summary: %(rpm -q --qf '%%{SUMMARY}' kernel-%build_flavor) %extrasummary
-URL: %(rpm -q --qf '%%{URL}' kernel-%build_flavor)
-Group: %(rpm -q --qf '%%{GROUP}' kernel-%build_flavor)
-License: GPL-2.0
-Version: %rpm_kver
-Release: %rpm_krel.<RELEASE>
-Provides: %name(%_target) = %version-%rpm_krel
-@BINARY_DEPS@
-
-%description
-%(rpm -q --qf '%%{DESCRIPTION}' kernel-%build_flavor)
-%extradescription
-
-This is a subpackage of kernel-%build_flavor. Development files are in
-kernel-%build_flavor-devel and sources in kernel-source-%variant.
-
-%prep
-
-%build
-
-%install
-set -o pipefail
-install -d -m 0755 $RPM_BUILD_ROOT/boot
-
-chmod 755 %_sourcedir/splitflist
-%_sourcedir/splitflist kernel-%build_flavor kernel.flist kernel-ghost.flist
-echo Missing files:
-cat kernel-ghost.flist
-
-# The scripts need to be regenerated here. Eventually we should get rid of
-# base_package and use one script.
-%ifarch %ix86 x86_64
- image=vmlinuz
-%endif
-%ifarch ppc ppc64 ppc64le
- image=vmlinux
-%endif
-%ifarch s390 s390x
- image=image
-%endif
-%ifarch %arm
- image=zImage
-%endif
-%ifarch aarch64
- image=Image
-%endif
-
-certs=($(rpm -ql kernel-%build_flavor | grep ^/etc/uefi/certs/ ||:))
-
-for sub in '-@SUBPACKAGE@'; do
- base_package=1 # should use for any package name
- for script in preun postun pre post; do
- if test %build_flavor = "zfcpdump"; then
- : >%_builddir/$script.sh
- continue
- fi
- sed -e "s:@KERNELRELEASE@:%kernelrelease:g" \
- -e "s:@IMAGE@:$image:g" \
- -e "s:@FLAVOR""@:%build_flavor:g" \
- -e "s:@SUBPACKAGE""@:%name:g" \
- -e "s:@BASE_PACKAGE@:$base_package:g" \
- -e "s:@RPM_VERSION_RELEASE@:%version-%release:g" \
- -e "s:@CPU_ARCH_FLAVOR@:%cpu_arch_flavor:g" \
- -e "s:@SRCVARIANT@:%variant:g" \
- %_sourcedir/$script.sh > %_builddir/$script.sh
- if test "$base_package" -eq 1 -a "${#certs[@]}" -gt 0; then
- case "$script" in
- preun | postun | post)
- # Copy the respective scriptlet from kernel-cert-subpackage
- sed "1,/^%%$script / d; /^%%[^%%]/,\$ d; s:@CERTS@:${certs[*]}:g" \
- %_sourcedir/kernel-cert-subpackage \
- >>"%_builddir/$script.sh"
- esac
- fi
- # Do an exit 0 at the end of each scriptlet. If the last real command
- # in the scriptlet (e.g. update-bootloader call, see bnc#809617)
- # returns an error, we do not want to amplify the damage by leaving
- # the system in an inconsistent state.
- echo "exit 0" >>"%_builddir/$script.sh"
- done
-done
-
-[ -z "$(rpm -q --triggers kernel-%build_flavor)" ] # not handled
-
-KREL=$(cat kernel.flist | grep ^/lib/modules | { sort -r ||: ;} | head -n 1 | sed -e s,^/lib/modules/,, -e 's,/.*,,')
-
-chmod 755 %_sourcedir/mergedep
-%_sourcedir/mergedep $KREL > modules.dep
-
-echo "%{?modules}" | tr ', ' '\n\n' > request-modules
-
-chmod 755 %_sourcedir/moddep
-%_sourcedir/moddep modules.dep request-modules modules
-
-chmod 755 %_sourcedir/modflist
-%_sourcedir/modflist kernel.flist modules modules.flist
-cat kernel.flist | grep -v ^/lib/modules >> modules.flist
-[ -d /lib/modules/$KREL/vdso ] && echo /lib/modules/$KREL/vdso >> modules.flist ||:
-echo /lib/modules/$KREL/modules.* | tr ' ' '\n' >> modules.flist
-
-tar -C / -cf- -T modules.flist | tar -C $RPM_BUILD_ROOT -xvf-
-
-moderr="$(/usr/sbin/depmod -b $RPM_BUILD_ROOT -e -F /boot/System.map-$KREL $KREL 2>&1 > /dev/null)"
-
-if [ "$moderr" ] ; then
-echo Picked modules have errors:
-echo $moderr
-exit 1
-fi
-
-echo "%defattr(-,root,root)" > subpackage.flist
-cat kernel.flist | grep -v ^/lib/modules >> subpackage.flist
-echo /lib/modules/$KREL >> subpackage.flist
-cat kernel-ghost.flist | sed -e 's/^/%ghost /' >> subpackage.flist
-
-cat kernel-ghost.flist | while read ghost ; do
- case $ghost in
- /boot/image-%build_flavor | /boot/vmlinux-%build_flavor | /boot/vmlinuz-%build_flavor | \
- /boot/Image-%build_flavor | /boot/initrd-%build_flavor)
- ln -s $(basename $ghost -%build_flavor)-$KREL $RPM_BUILD_ROOT$ghost
- ;;
- /boot/vmlinux | /boot/vmlinuz | /boot/Image | /boot/image | /boot/initrd)
- ln -s $ghost-$KREL $RPM_BUILD_ROOT$ghost
- ;;
- /boot/vmlinux-$KREL)
- [ -f /boot/vmlinux-$KREL.gz ] && gunzip -dc < /boot/vmlinux-$KREL.gz > vmlinux-$KREL
- size="$(ls -l vmlinux-$KREL | sed -e 's/^\([^ ]* \)\{4\}//' -e 's/ .*//')"
- dd if=/dev/zero bs=1 count="$size" of=$RPM_BUILD_ROOT$ghost
- ;;
- /boot/initrd-$KREL | /boot/initrd-$KREL-kdump)
- # Create a dummy initrd with roughly the size the real one will have.
- # That way, YaST will know that this package requires some additional
- # space in /boot.
- dd if=/dev/zero of=$RPM_BUILD_ROOT$ghost \
- bs=1024 seek=2047 count=1
- chmod 0600 $RPM_BUILD_ROOT$ghost
- ;;
- /lib/modules/$KREL/modules.*)
- [ -f $RPM_BUILD_ROOT$ghost ]
- ;;
- *)
- echo Missing file "$ghost" not handled.
- exit 1;
- ;;
- esac
-done
-
-%preun -f preun.sh
-
-%postun -f postun.sh
-
-%pre -f pre.sh
-
-%post -f post.sh
-
-%files -f subpackage.flist
-
-%changelog
diff --git a/rpm/kernel-subpackage.conf b/rpm/kernel-subpackage.conf
deleted file mode 100644
index e69de29bb2..0000000000
--- a/rpm/kernel-subpackage.conf
+++ /dev/null
diff --git a/rpm/mkspec b/rpm/mkspec
index 81028b2e26..4467462c44 100755
--- a/rpm/mkspec
+++ b/rpm/mkspec
@@ -20,8 +20,6 @@ my %flavor_archs = parse_config_conf();
# subset to include in kernel-syms
my %syms_flavor_archs = parse_config_conf("syms");
-my %subpackages = parse_subpackages();
-
my %all_archs = parse_config_conf("needs_updating");
my @all_archs;
for my $flavor (keys(%all_archs)) {
@@ -156,17 +154,6 @@ for my $flavor (sort keys(%flavor_archs)) {
KMP_DEFINITIONS => $kmp_definitions,
%obsolete_macros
);
- for my $subpackage (@{$subpackages{$flavor}}) {
- do_spec('subpackage-build', "kernel-$flavor-$subpackage.spec", %macros,
- FLAVOR => $flavor,
- SUMMARY => $summary,
- SUBPACKAGE => $subpackage,
- DESCRIPTION => $description,
- ARCHS => join(" ", arch2rpm(@{$flavor_archs{$flavor}})),
- BINARY_DEPS => $templates{binary_deps},
- %obsolete_macros
- );
- }
}
# kernel-source.spec
do_spec('source', "kernel-source$variant.spec", %macros);
@@ -240,27 +227,6 @@ copy_changes();
exit 0;
-sub parse_subpackages {
- my %subpackage_names = ();
- my $file = "$dir/subpackage-names.conf";
- open my $config, $file or return %subpackage_names;
- while(my $line = <$config>) {
- $line !~ /^#/ or next;
- chomp($line);
- my @flavor = split(/:/, $line);
- if($#flavor != 1) {
- print "Malformed line in $file: $line\n";
- next;
- }
- my @subpackages = grep { $_ =~ /./ } split(/[ \t]+/, $flavor[1]);
- $flavor[0] =~ s/^\s+|\s+$//g;
- @subpackages = map { s/^\s+|\s+$//g ; $_ } @subpackages;
- @{$subpackage_names{$flavor[0]}} = @subpackages;
- }
- print "Subpackages:\n";
- print "$_:" . join(",", @{$subpackage_names{$_}}) . "\n" for (sort(keys %subpackage_names));
- return %subpackage_names;
-}
sub parse_config_conf {
my @symbols = @_;
@@ -286,7 +252,7 @@ sub parse_config_conf {
sub read_spec_templates {
my %res;
- for my $template (qw(binary source syms docs obs-build obs-qa subpackage-build)) {
+ for my $template (qw(binary source syms docs obs-build obs-qa)) {
xopen(my $fh, '<', "$dir/kernel-$template.spec.in");
local $/ = undef;
$res{$template} = <$fh>;
@@ -298,12 +264,6 @@ sub read_spec_templates {
print STDERR "warning: Expected # BEGIN COMMON DEPS in kernel-binary.spec.in\n";
$res{common_deps} = "";
}
- if ($res{$template} =~ /^# BEGIN BINARY DEPS\n?(.*)^# END BINARY DEPS/ms) {
- $res{binary_deps} = $1;
- } else {
- print STDERR "warning: Expected # BINARY COMMON DEPS in kernel-binary.spec.in\n";
- $res{binary_deps} = "";
- }
if ($res{$template} =~ s/^# BEGIN KMP\n?(.*)^# END KMP/\@KMP_DEFINITIONS\@/ms) {
$res{kmp} = $1;
} else {
diff --git a/rpm/subpackage-names.conf b/rpm/subpackage-names.conf
deleted file mode 100644
index 1a421b7a68..0000000000
--- a/rpm/subpackage-names.conf
+++ /dev/null
@@ -1,3 +0,0 @@
-# flavor: subpckages space separated
-default: base
-rt: base