Skip to content

Commit

Permalink
Merge remote-tracking branch 'upstream/master'
Browse files Browse the repository at this point in the history
  • Loading branch information
donboll committed Sep 7, 2018
2 parents d4b919b + a910776 commit dd05d6e
Show file tree
Hide file tree
Showing 57 changed files with 8,746 additions and 1,433 deletions.
63 changes: 51 additions & 12 deletions Makefile
Original file line number Diff line number Diff line change
@@ -1,24 +1,54 @@
.ONESHELL:
SHELL = /bin/bash
.SHELLFLAGS += -e

KVERSION_SHORT ?= 3.16.0-5
KVERSION_SHORT ?= 4.9.0-7
KVERSION ?= $(KVERSION_SHORT)-amd64
KERNEL_VERSION ?= 3.16.51
KERNEL_SUBVERSION ?= 3+deb8u1
KERNEL_VERSION ?= 4.9.110
KERNEL_SUBVERSION ?= 3+deb9u2
kernel_procure_method ?= build

MAIN_TARGET = linux-headers-$(KVERSION_SHORT)-common_$(KERNEL_VERSION)-$(KERNEL_SUBVERSION)_amd64.deb
DERIVED_TARGETS = linux-headers-$(KVERSION)_$(KERNEL_VERSION)-$(KERNEL_SUBVERSION)_amd64.deb \
linux-image-$(KVERSION)_$(KERNEL_VERSION)-$(KERNEL_SUBVERSION)_amd64.deb
LINUX_HEADER_COMMON = linux-headers-$(KVERSION_SHORT)-common_$(KERNEL_VERSION)-$(KERNEL_SUBVERSION)_all.deb
LINUX_HEADER_AMD64 = linux-headers-$(KVERSION)_$(KERNEL_VERSION)-$(KERNEL_SUBVERSION)_amd64.deb
LINUX_IMAGE = linux-image-$(KVERSION)_$(KERNEL_VERSION)-$(KERNEL_SUBVERSION)_amd64.deb

MAIN_TARGET = $(LINUX_HEADER_COMMON)
DERIVED_TARGETS = $(LINUX_HEADER_AMD64) $(LINUX_IMAGE)

ifneq ($(kernel_procure_method), build)
# Downloading kernel

LINUX_HEADER_COMMON_URL = "https://sonicstorage.blob.core.windows.net/packages/kernel-public/linux-headers-4.9.0-7-common_4.9.110-3+deb9u2_all.deb?sv=2015-04-05&sr=b&sig=LlKqKecY6MDSwFMTxpKErh7FX1Lrvse2yVt3niYnhds%3D&se=2128-02-24T04%3A47%3A48Z&sp=r"

LINUX_HEADER_AMD64_URL = "https://sonicstorage.blob.core.windows.net/packages/kernel-public/linux-headers-4.9.0-7-amd64_4.9.110-3+deb9u2_amd64.deb?sv=2015-04-05&sr=b&sig=SfQLjiBPPMcRUOmBPvXq2%2F6SsW3ul9%2FlaROplXdGij0%3D&se=2128-02-24T04%3A48%3A38Z&sp=r"

LINUX_IMAGE_URL = "https://sonicstorage.blob.core.windows.net/packages/kernel-public/linux-image-4.9.0-7-amd64_4.9.110-3+deb9u2_amd64.deb?sv=2015-04-05&sr=b&sig=PNKGpLjELZem0IacUMM1jU%2Ft5ujoVvUb9JzxrUhE1Wk%3D&se=2128-02-24T04%3A48%3A57Z&sp=r"

$(addprefix $(DEST)/, $(MAIN_TARGET)): $(DEST)/% :
# Obtaining the Debian kernel packages
rm -rf $(BUILD_DIR)
wget --no-use-server-timestamps -O $(LINUX_HEADER_COMMON) $(LINUX_HEADER_COMMON_URL)
wget --no-use-server-timestamps -O $(LINUX_HEADER_AMD64) $(LINUX_HEADER_AMD64_URL)
wget --no-use-server-timestamps -O $(LINUX_IMAGE) $(LINUX_IMAGE_URL)

ifneq ($(DEST),)
mv $(DERIVED_TARGETS) $* $(DEST)/
endif

$(addprefix $(DEST)/, $(DERIVED_TARGETS)): $(DEST)/% : $(DEST)/$(MAIN_TARGET)

else
# Building kernel

DSC_FILE = linux_$(KERNEL_VERSION)-$(KERNEL_SUBVERSION).dsc
ORIG_FILE = linux_$(KERNEL_VERSION).orig.tar.xz
DEBIAN_FILE = linux_$(KERNEL_VERSION)-$(KERNEL_SUBVERSION).debian.tar.xz
URL = http://security.debian.org/debian-security/pool/updates/main/l/linux
BUILD_DIR=linux-$(KERNEL_VERSION)

DSC_FILE_URL = "https://sonicstorage.blob.core.windows.net/packages/$(DSC_FILE)?sv=2015-04-05&sr=b&sig=FzpIoc5gzw9oj09C0ifOaCTMo6K%2BP0WadjFgprGe508%3D&se=2117-12-17T19%3A52%3A55Z&sp=r"
DEBIAN_FILE_URL = "https://sonicstorage.blob.core.windows.net/packages/$(DEBIAN_FILE)?sv=2015-04-05&sr=b&sig=E65G0WdVW4FrpDQxmKqjuKjur2QM%2BycXy5NbVtmBYlY%3D&se=2117-12-17T19%3A54%3A03Z&sp=r"
ORIG_FILE_URL = "https://sonicstorage.blob.core.windows.net/packages/$(ORIG_FILE)?sv=2015-04-05&sr=b&sig=f%2BXBexkqVW9nru%2FwjT%2FNUwToUP3uMRnokIpuZa9AbHk%3D&se=2117-12-17T19%3A54%3A25Z&sp=r"
DSC_FILE_URL = "$(URL)/$(DSC_FILE)"
DEBIAN_FILE_URL = "$(URL)/$(DEBIAN_FILE)"
ORIG_FILE_URL = "$(URL)/$(ORIG_FILE)"

$(addprefix $(DEST)/, $(MAIN_TARGET)): $(DEST)/% :
# Obtaining the Debian kernel source
Expand All @@ -32,9 +62,11 @@ $(addprefix $(DEST)/, $(MAIN_TARGET)): $(DEST)/% :
pushd $(BUILD_DIR)
git init
git add -f *
git commit -qm "check in all loose files and diffs"

# patch debian changelog and update kernel package version
git am ../patch/changelog.patch
# patching anything that could affect following configuration generation.
stg init
stg import -s ../patch/preconfig/series

# re-generate debian/rules.gen, requires kernel-wedge
debian/bin/gencontrol.py
Expand All @@ -44,11 +76,16 @@ $(addprefix $(DEST)/, $(MAIN_TARGET)): $(DEST)/% :

# Applying patches and configuration changes
git add debian/build/build_amd64_none_amd64/.config -f
git add debian/config.defines.dump -f
git add debian/control -f
git commit -m "unmodified debian source"
stg init

# Learning new git repo head (above commit) by calling stg repair.
stg repair
stg import -s ../patch/series

# Building a custom kernel from Debian kernel source
DO_DOCS=False fakeroot make -f debian/rules -j $(shell nproc) binary-indep
fakeroot make -f debian/rules.gen -j $(shell nproc) binary-arch_amd64_none
popd

Expand All @@ -57,3 +94,5 @@ ifneq ($(DEST),)
endif

$(addprefix $(DEST)/, $(DERIVED_TARGETS)): $(DEST)/% : $(DEST)/$(MAIN_TARGET)

endif # building kernel
Loading

0 comments on commit dd05d6e

Please sign in to comment.