Skip to content

Commit

Permalink
add build deb
Browse files Browse the repository at this point in the history
  • Loading branch information
Zeno-sole committed Aug 26, 2023
1 parent c960c91 commit b4f5532
Show file tree
Hide file tree
Showing 12 changed files with 120 additions and 14 deletions.
1 change: 0 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -83,7 +83,6 @@ modules.order
#
# Debian directory (make deb-pkg)
#
/debian/

#
# Snap directory (make snap-pkg)
Expand Down
1 change: 1 addition & 0 deletions debian/arch
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
amd64
5 changes: 5 additions & 0 deletions debian/changelog
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
linux-upstream (6.4.9-g9e5249bf7de3-8) apricot; urgency=low

* Custom built Linux kernel.

-- LiChengGang <lichenggang@uniontech.com> Sun, 27 Aug 2023 00:22:56 +0800
36 changes: 36 additions & 0 deletions debian/control
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
Source: linux-upstream
Section: kernel
Priority: optional
Maintainer: LiChengGang <lichenggang@uniontech.com>
Rules-Requires-Root: no
Build-Depends: zstd, bc, debhelper, rsync, kmod, cpio, bison, flex, libelf-dev:native, libssl-dev:native
Homepage: https://www.kernel.org/

Package: linux-image-6.4.9
Architecture: amd64 arm64
Description: Linux kernel, version 6.4.9
This package contains the Linux kernel, modules and corresponding other
files, version: 6.4.9.

Package: linux-libc-dev
Section: devel
Provides: linux-kernel-headers
Architecture: amd64 arm64
Description: Linux support headers for userspace development
This package provides userspaces headers from the Linux kernel. These headers
are used by the installed headers for GNU glibc and other system libraries.
Multi-Arch: same

Package: linux-headers-6.4.9
Architecture: amd64 arm64
Description: Linux kernel headers for 6.4.9 on amd64
This package provides kernel header files for 6.4.9 on amd64
.
This is useful for people who need to build external modules

Package: linux-image-6.4.9-dbg
Section: debug
Architecture: amd64 arm64
Description: Linux kernel debugging symbols for 6.4.9
This package will come in handy if you need to debug the kernel. It provides
all the necessary debug symbols for the kernel and its modules.
16 changes: 16 additions & 0 deletions debian/copyright
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
This is a packaged upstream version of the Linux kernel.

The sources may be found at most Linux archive sites, including:
https://www.kernel.org/pub/linux/kernel

Copyright: 1991 - 2018 Linus Torvalds and others.

The git repository for mainline kernel development is at:
git://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git

This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation; version 2 dated June, 1991.

On Debian GNU/Linux systems, the complete text of the GNU General Public
License version 2 can be found in `/usr/share/common-licenses/GPL-2'.
1 change: 1 addition & 0 deletions debian/files
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
linux-upstream_6.4.9-g9e5249bf7de3-8_source.buildinfo kernel optional
32 changes: 32 additions & 0 deletions debian/rules
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
#!/usr/bin/make -f

srctree ?= .
KERNELRELEASE = 6.4.9
DEB_HOST_ARCH ?= $(shell dpkg-architecture -qDEB_HOST_ARCH 2>/dev/null)
ifneq (,$(filter amd64,$(DEB_HOST_ARCH)))
BUILD_ARCH = x86
else
BUILD_ARCH = ${DEB_HOST_ARCH}
endif

.PHONY: clean build build-arch build-indep binary binary-arch binary-indep

build-indep:
build-arch:
ifneq (,$(filter amd64,$(DEB_HOST_ARCH)))
$(MAKE) -f $(srctree)/Makefile ARCH=${BUILD_ARCH} KERNELRELEASE=$(KERNELRELEASE) $(shell $(srctree)/scripts/package/deb-build-option) deepin_desktop_common_defconfig all
else ifneq (,$(filter arm64,$(DEB_HOST_ARCH)))
$(MAKE) -f $(srctree)/Makefile ARCH=${BUILD_ARCH} KERNELRELEASE=$(KERNELRELEASE) $(shell $(srctree)/scripts/package/deb-build-option) deepin_arm_desktop_defconfig all
endif

build: build-arch

binary-indep:
binary-arch: build-arch
$(MAKE) -f $(srctree)/Makefile ARCH=${BUILD_ARCH} KERNELRELEASE=$(KERNELRELEASE) intdeb-pkg

clean:
rm -rf debian/files debian/linux-*
$(MAKE) -f $(srctree)/Makefile ARCH=${BUILD_ARCH} clean

binary: binary-arch
1 change: 1 addition & 0 deletions debian/source/format
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
1.0
2 changes: 2 additions & 0 deletions debian/source/local-options
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
diff-ignore
extend-diff-ignore = .*
2 changes: 1 addition & 1 deletion scripts/package/builddeb
Original file line number Diff line number Diff line change
Expand Up @@ -101,7 +101,7 @@ deploy_libc_headers () {

# move asm headers to /usr/include/<libc-machine>/asm to match the structure
# used by Debian-based distros (to support multi-arch)
host_arch=$(dpkg-architecture -a$(cat debian/arch) -qDEB_HOST_MULTIARCH)
host_arch=$(dpkg-architecture -qDEB_HOST_MULTIARCH)
mkdir $pdir/usr/include/$host_arch
mv $pdir/usr/include/asm $pdir/usr/include/$host_arch/
}
Expand Down
35 changes: 24 additions & 11 deletions scripts/package/mkdebian
Original file line number Diff line number Diff line change
Expand Up @@ -89,7 +89,7 @@ gen_source ()
{
mkdir -p debian/source

echo "3.0 (quilt)" > debian/source/format
echo "1.0" > debian/source/format

{
echo "diff-ignore"
Expand Down Expand Up @@ -175,7 +175,7 @@ else
echo >&2 "Install lsb-release or set \$KDEB_CHANGELOG_DIST explicitly"
fi

echo $debarch > debian/arch
#echo $debarch > debian/arch
extra_build_depends=", $(if_enabled_echo CONFIG_UNWINDER_ORC libelf-dev:native)"
extra_build_depends="$extra_build_depends, $(if_enabled_echo CONFIG_SYSTEM_TRUSTED_KEYRING libssl-dev:native)"

Expand Down Expand Up @@ -215,11 +215,11 @@ Section: kernel
Priority: optional
Maintainer: $maintainer
Rules-Requires-Root: no
Build-Depends: bc, debhelper, rsync, kmod, cpio, bison, flex $extra_build_depends
Build-Depends: zstd, bc, debhelper, rsync, kmod, cpio, bison, flex, libelf-dev:native, libssl-dev:native
Homepage: https://www.kernel.org/
Package: $packagename-$version
Architecture: $debarch
Architecture: amd64 arm64
Description: Linux kernel, version $version
This package contains the Linux kernel, modules and corresponding other
files, version: $version.
Expand All @@ -231,7 +231,7 @@ cat <<EOF >> debian/control
Package: linux-libc-dev
Section: devel
Provides: linux-kernel-headers
Architecture: $debarch
Architecture: amd64 arm64
Description: Linux support headers for userspace development
This package provides userspaces headers from the Linux kernel. These headers
are used by the installed headers for GNU glibc and other system libraries.
Expand All @@ -242,7 +242,7 @@ if is_enabled CONFIG_MODULES; then
cat <<EOF >> debian/control
Package: linux-headers-$version
Architecture: $debarch
Architecture: amd64 arm64
Description: Linux kernel headers for $version on $debarch
This package provides kernel header files for $version on $debarch
.
Expand All @@ -256,7 +256,7 @@ cat <<EOF >> debian/control
Package: linux-image-$version-dbg
Section: debug
Architecture: $debarch
Architecture: amd64 arm64
Description: Linux kernel debugging symbols for $version
This package will come in handy if you need to debug the kernel. It provides
all the necessary debug symbols for the kernel and its modules.
Expand All @@ -268,26 +268,39 @@ cat <<EOF > debian/rules
srctree ?= .
KERNELRELEASE = ${KERNELRELEASE}
DEB_HOST_ARCH ?= \$(shell dpkg-architecture -qDEB_HOST_ARCH 2>/dev/null)
ifneq (,\$(filter amd64,\$(DEB_HOST_ARCH)))
BUILD_ARCH = x86
else
BUILD_ARCH = \${DEB_HOST_ARCH}
endif
.PHONY: clean build build-arch build-indep binary binary-arch binary-indep
build-indep:
build-arch:
\$(MAKE) -f \$(srctree)/Makefile ARCH=${ARCH} \
ifneq (,\$(filter amd64,\$(DEB_HOST_ARCH)))
\$(MAKE) -f \$(srctree)/Makefile ARCH=\${BUILD_ARCH} \
KERNELRELEASE=\$(KERNELRELEASE) \
\$(shell \$(srctree)/scripts/package/deb-build-option) \
deepin_desktop_common_defconfig all
else ifneq (,\$(filter arm64,\$(DEB_HOST_ARCH)))
\$(MAKE) -f \$(srctree)/Makefile ARCH=\${BUILD_ARCH} \
KERNELRELEASE=\$(KERNELRELEASE) \
\$(shell \$(srctree)/scripts/package/deb-build-option) \
olddefconfig all
deepin_arm_desktop_defconfig all
endif
build: build-arch
binary-indep:
binary-arch: build-arch
\$(MAKE) -f \$(srctree)/Makefile ARCH=${ARCH} \
\$(MAKE) -f \$(srctree)/Makefile ARCH=\${BUILD_ARCH} \
KERNELRELEASE=\$(KERNELRELEASE) intdeb-pkg
clean:
rm -rf debian/files debian/linux-*
\$(MAKE) -f \$(srctree)/Makefile ARCH=${ARCH} clean
\$(MAKE) -f \$(srctree)/Makefile ARCH=\${BUILD_ARCH} clean
binary: binary-arch
EOF
Expand Down
2 changes: 1 addition & 1 deletion scripts/setlocalversion
Original file line number Diff line number Diff line change
Expand Up @@ -76,7 +76,7 @@ scm_version()
# If only the short version is requested, don't bother
# running further git commands
if $short; then
echo "+"
# echo "+"
return
fi
# If we are past the tagged commit, we pretty print it.
Expand Down

0 comments on commit b4f5532

Please sign in to comment.