Skip to content
Snippets Groups Projects
Commit 67b24bfa authored by Ruben Rodriguez's avatar Ruben Rodriguez
Browse files

linux: re-enable udeb building

parent fb2e8b9b
No related branches found
No related tags found
No related merge requests found
Showing
with 185 additions and 0 deletions
# Do udebs if not disabled in the arch-specific makefile
binary-udebs: binary-debs
@echo Debug: $@
ifeq ($(disable_d_i),)
@$(MAKE) --no-print-directory -f $(DROOT)/rules DEBIAN=$(DEBIAN) \
do-binary-udebs
endif
do-binary-udebs: linux_udeb_name=$(shell if echo $(src_pkg_name)|egrep -q '(linux-lts|linux-hwe)'; then echo $(src_pkg_name); else echo linux; fi)
do-binary-udebs: debian/control
@echo Debug: $@
dh_testdir
dh_testroot
# unpack the kernels into a temporary directory
mkdir -p debian/d-i-${arch}
imagelist=$$(cat $(CURDIR)/$(DEBIAN)/d-i/kernel-versions | grep ^${arch} | gawk '{print $$3}') && \
for f in $$imagelist; do \
i=$(release)-$(abinum)-$$f; \
for f in \
../linux-image-$$i\_$(release)-$(revision)_${arch}.deb \
../linux-image-unsigned-$$i\_$(release)-$(revision)_${arch}.deb \
../linux-modules-$$i\_$(release)-$(revision)_${arch}.deb \
../linux-modules-extra-$$i\_$(release)-$(revision)_${arch}.deb; \
do \
[ -f $$f ] && dpkg -x $$f debian/d-i-${arch}; \
done; \
/sbin/depmod -b debian/d-i-${arch} $$i; \
done
# kernel-wedge will error if no modules unless this is touched
touch $(DEBIAN)/d-i/no-modules
touch $(CURDIR)/$(DEBIAN)/d-i/ignore-dups
export KW_DEFCONFIG_DIR=$(CURDIR)/$(DEBIAN)/d-i && \
export KW_CONFIG_DIR=$(CURDIR)/$(DEBIAN)/d-i && \
export SOURCEDIR=$(CURDIR)/debian/d-i-${arch} && \
kernel-wedge install-files $(release)-$(abinum) && \
kernel-wedge check
# Build just the udebs
dilist=$$(dh_listpackages -s | grep "\-di$$") && \
[ -z "$dilist" ] || \
for i in $$dilist; do \
dh_fixperms -p$$i; \
$(lockme) dh_gencontrol -p$$i; \
dh_builddeb -p$$i; \
done
# Generate the meta-udeb dependancy lists.
@gawk ' \
/^Package:/ { \
package=$$2; flavour=""; parch="" } \
(/Package-Type: udeb/ && package !~ /^$(linux_udeb_name)-udebs-/) { \
match(package, "'$(release)'-'$(abinum)'-(.*)-di", bits); \
flavour = bits[1]; \
} \
(/^Architecture:/ && $$0 " " ~ / '$(arch)'/) { \
parch=$$0; \
} \
(flavour != "" && parch != "") { \
udebs[flavour] = udebs[flavour] package ", "; \
flavour=""; parch=""; \
} \
END { \
for (flavour in udebs) { \
package="$(linux_udeb_name)-udebs-" flavour; \
file="debian/" package ".substvars"; \
print("udeb:Depends=" udebs[flavour]) > file; \
metas="'$(builddir)'/udeb-meta-packages"; \
print(package) >metas \
} \
} \
' <$(CURDIR)/debian/control
@while read i; do \
$(lockme) dh_gencontrol -p$$i; \
dh_builddeb -p$$i; \
done <$(builddir)/udeb-meta-packages
--- a/debian/rules 2022-10-22 11:16:58.933510340 -0400
+++ b/debian/rules 2022-10-18 15:38:19.000000000 -0400
@@ -125,12 +135,19 @@
dh_testroot
dh_clean
+ # d-i stuff
+ rm -rf $(DEBIAN)/d-i-$(arch)
+ # Generated on the fly.
+ rm -f $(DEBIAN)/d-i/firmware/$(arch)/kernel-image
+
# normal build junk
rm -rf $(DEBIAN)/abi/$(release)-$(revision)
rm -rf $(builddir)
rm -f $(stampdir)/stamp-*
rm -rf $(DEBIAN)/linux-*
+ # This gets rid of the d-i packages in control
+ cp -f $(DEBIAN)/control.stub $(DROOT)/control
cp $(DEBIAN)/changelog debian/changelog
# Install the copyright information.
@@ -180,7 +197,6 @@
$(DEBIAN)/control.stub: \
$(DROOT)/scripts/control-create \
$(control_files) \
- $(DROOT)/control.d/flavour-module.stub \
$(DEBIAN)/changelog \
$(wildcard $(DEBIAN)/control.d/* $(DEBIAN)/sub-flavours/*.vars)
for i in $(control_files); do \
@@ -205,7 +221,13 @@
.PHONY: debian/control
debian/control: $(DEBIAN)/control.stub
+ echo "# placebo control.stub for kernel-wedge flow change" >debian/control.stub
cp $(DEBIAN)/control.stub debian/control
+ export KW_DEFCONFIG_DIR=$(DEBIAN)/d-i && \
+ export KW_CONFIG_DIR=$(DEBIAN)/d-i && \
+ LANG=C kernel-wedge gen-control $(release)-$(abinum) | \
+ perl -f $(DROOT)/scripts/misc/kernel-wedge-arch.pl $(arch) \
+ >>$(CURDIR)/debian/control
debian/canonical-certs.pem: $(wildcard $(DROOT)/certs/*-all.pem) $(wildcard $(DROOT)/certs/*-$(arch).pem) $(wildcard $(DEBIAN)/certs/*-all.pem) $(wildcard $(DEBIAN)/certs/*-$(arch).pem)
for cert in $(sort $(notdir $^)); \
--- a/debian/rules.d/2-binary-arch.mk 2022-10-22 11:16:58.937510259 -0400
+++ b/debian/rules.d/2-binary-arch.mk 2022-10-18 15:38:19.000000000 -0400
@@ -178,12 +176,14 @@
$(pkgdir)/boot/config-$(abi_release)-$*
install -m600 $(builddir)/build-$*/System.map \
$(pkgdir)/boot/System.map-$(abi_release)-$*
-
-ifeq ($(do_dtbs),true)
- $(build_cd) $(kmake) $(build_O) $(conc_level) dtbs_install \
- INSTALL_DTBS_PATH=$(pkgdir)/lib/firmware/$(abi_release)-$*/device-tree
-endif
-
+ if [ "$(filter true,$(do_dtbs))" ]; then \
+ $(build_cd) $(kmake) $(build_O) $(conc_level) dtbs_install \
+ INSTALL_DTBS_PATH=$(pkgdir)/lib/firmware/$(abi_release)-$*/device-tree; \
+ ( cd $(pkgdir)/lib/firmware/$(abi_release)-$*/ && find device-tree -print ) | \
+ while read dtb_file; do \
+ echo "$$dtb_file ?" >> $(DEBIAN)/d-i/firmware/$(arch)/kernel-image; \
+ done; \
+ fi
ifeq ($(no_dumpfile),)
makedumpfile -g $(pkgdir)/boot/vmcoreinfo-$(abi_release)-$* \
-x $(builddir)/build-$*/vmlinux
#
# Place the names of udeb modules into this directory that require
# runtime firmware.
#
#
# Place the names of udeb modules into this directory that require
# runtime firmware.
#
#include <nic-modules>
#include <scsi-modules>
#
# Place the names of udeb modules into this directory that require
# runtime firmware.
#
#include <nic-modules>
#include <scsi-modules>
#
# Place the names of udeb modules into this directory that require
# runtime firmware.
#
#
# Place the names of udeb modules into this directory that require
# runtime firmware.
#
#include <nic-modules>
#include <scsi-modules>
#
# Place the names of udeb modules into this directory that require
# runtime firmware.
#
#include <nic-modules>
#include <scsi-modules>
#
# Place the names of udeb modules into this directory that require
# runtime firmware.
#
#include <nic-modules>
#include <scsi-modules>
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment