mirror of
https://github.com/chromebrew/chromebrew.git
synced 2026-01-11 00:18:06 -05:00
Get linux headers patched for Chrome os using git directly from google (#6553)
* test get headers via git * add = * add = * remove git dir before archiving * remove git dir before archiving * add container check * add container check * rubocop changes * Add binaries
This commit is contained in:
@@ -3,37 +3,47 @@ require 'package'
|
||||
class Linux_sources < Package
|
||||
description 'Sources for the Linux kernel'
|
||||
homepage 'https://kernel.org/'
|
||||
version '4.14'
|
||||
case ARCH
|
||||
when 'aarch64', 'armv7l', 'x86_64'
|
||||
@_ver = '4.14'
|
||||
version "#{@_ver}-1"
|
||||
when 'i686'
|
||||
@_ver = '3.8'
|
||||
version @_ver
|
||||
end
|
||||
# Only check for kernel version if not in container.
|
||||
unless File.exist?('/.dockerenv')
|
||||
@KERNEL_VERSION = `uname -r`.chomp.reverse.split('.', 2).collect(&:reverse)[1]
|
||||
@ver = @KERNEL_VERSION.between?(@KERNEL_VERSION, '5.15') ? @ver : @KERNEL_VERSION
|
||||
version @ver
|
||||
end
|
||||
license 'GPL-2'
|
||||
compatibility 'all'
|
||||
source_url 'https://www.kernel.org/pub/linux/kernel/v4.x/linux-4.14.tar.xz'
|
||||
source_sha256 'f81d59477e90a130857ce18dc02f4fbe5725854911db1e7ba770c7cd350f96a7'
|
||||
source_url 'https://chromium.googlesource.com/chromiumos/third_party/kernel.git'
|
||||
git_hashtag "chromeos-#{@_ver}"
|
||||
|
||||
binary_url ({
|
||||
aarch64: 'https://gitlab.com/api/v4/projects/26210301/packages/generic/linux_sources/4.14_armv7l/linux_sources-4.14-chromeos-armv7l.tar.xz',
|
||||
armv7l: 'https://gitlab.com/api/v4/projects/26210301/packages/generic/linux_sources/4.14_armv7l/linux_sources-4.14-chromeos-armv7l.tar.xz',
|
||||
i686: 'https://gitlab.com/api/v4/projects/26210301/packages/generic/linux_sources/4.14_i686/linux_sources-4.14-chromeos-i686.tar.xz',
|
||||
x86_64: 'https://gitlab.com/api/v4/projects/26210301/packages/generic/linux_sources/4.14_x86_64/linux_sources-4.14-chromeos-x86_64.tar.xz',
|
||||
binary_url({
|
||||
aarch64: 'https://gitlab.com/api/v4/projects/26210301/packages/generic/linux_sources/4.14-1_armv7l/linux_sources-4.14-1-chromeos-armv7l.tpxz',
|
||||
armv7l: 'https://gitlab.com/api/v4/projects/26210301/packages/generic/linux_sources/4.14-1_armv7l/linux_sources-4.14-1-chromeos-armv7l.tpxz',
|
||||
i686: 'https://gitlab.com/api/v4/projects/26210301/packages/generic/linux_sources/3.8_i686/linux_sources-3.8-chromeos-i686.tpxz',
|
||||
x86_64: 'https://gitlab.com/api/v4/projects/26210301/packages/generic/linux_sources/4.14-1_x86_64/linux_sources-4.14-1-chromeos-x86_64.tpxz'
|
||||
})
|
||||
binary_sha256 ({
|
||||
aarch64: '7dfea20067015e59a2b4b1006b0beddaa6873a01470cee8007647d990da5bf57',
|
||||
armv7l: '7dfea20067015e59a2b4b1006b0beddaa6873a01470cee8007647d990da5bf57',
|
||||
i686: 'fae80d1d113eb4e2d9bc84daee4b398c2064730234df74b09edfc85fb9a696b4',
|
||||
x86_64: '3051229ae81224a038795eecd6d21dfd9dad2c5f8711137016bb8a4bb28852c9',
|
||||
binary_sha256({
|
||||
aarch64: 'c9b3116f83033215bf7f925a433bcea906067006d8c4c3f9747a279d729d4db0',
|
||||
armv7l: 'c9b3116f83033215bf7f925a433bcea906067006d8c4c3f9747a279d729d4db0',
|
||||
i686: '2e8cf6b96bfb2f1f65809123696799244ac20b3a7a6b516d00d9f09a0b682266',
|
||||
x86_64: '5dc236576f40cbf6926b4b5f9241ed7e9e3e7db8f2b26643316a2ce1f08a4a02'
|
||||
})
|
||||
|
||||
def self.install
|
||||
linux_src_dir = CREW_DEST_PREFIX + '/src/linux'
|
||||
pdir = 'chromiumos-overlay/sys-kernel/linux-headers/files'
|
||||
# Download Linux kernel header patches
|
||||
system 'git', 'clone', '--depth=1', '-b', 'release-R75-12105.B',
|
||||
'https://chromium.googlesource.com/chromiumos/overlays/chromiumos-overlay.git'
|
||||
# Remove a/ and b/ path prefixes on patches so they can be applied with -Np0
|
||||
system "sed -i -e 's,a/,,g' -e 's,b/,,g' #{pdir}/*.patch"
|
||||
system "for file in #{pdir}/*.patch; do patch -Np0 -i \${file}; done"
|
||||
# Remove Chromium OS overlay so it isn't included in the source tree
|
||||
FileUtils.rm_rf 'chromiumos-overlay'
|
||||
ENV['CREW_FHS_NONCOMPLIANCE_ONLY_ADVISORY'] = '1'
|
||||
warn_level = $VERBOSE
|
||||
$VERBOSE = nil
|
||||
load "#{CREW_LIB_PATH}lib/const.rb"
|
||||
$VERBOSE = warn_level
|
||||
linux_src_dir = "#{CREW_DEST_PREFIX}/src/linux"
|
||||
FileUtils.mkdir_p(linux_src_dir)
|
||||
FileUtils.rm_rf('.git')
|
||||
FileUtils.cp_r('.', linux_src_dir)
|
||||
Dir.chdir(linux_src_dir) do
|
||||
system 'make', 'defconfig'
|
||||
|
||||
@@ -3,34 +3,53 @@ require 'package'
|
||||
class Linuxheaders < Package
|
||||
description 'Linux headers for Chrome OS.'
|
||||
homepage 'https://kernel.org/'
|
||||
version '4.14'
|
||||
# KERNEL_VERSION = %x[uname -r].chomp.reverse.split('.',2).collect(&:reverse)[1]
|
||||
case ARCH
|
||||
when 'aarch64', 'armv7l', 'x86_64'
|
||||
@_ver = '4.14'
|
||||
version "#{@_ver}-1"
|
||||
when 'i686'
|
||||
@_ver = '3.8'
|
||||
version @_ver
|
||||
end
|
||||
# Only check for kernel version if not in container.
|
||||
unless File.exist?('/.dockerenv')
|
||||
@KERNEL_VERSION = `uname -r`.chomp.reverse.split('.', 2).collect(&:reverse)[1]
|
||||
@ver = @KERNEL_VERSION.between?(@KERNEL_VERSION, '5.15') ? @ver : @KERNEL_VERSION
|
||||
version @ver
|
||||
end
|
||||
license 'GPL-2'
|
||||
compatibility 'all'
|
||||
source_url 'SKIP'
|
||||
|
||||
binary_url ({
|
||||
aarch64: 'https://gitlab.com/api/v4/projects/26210301/packages/generic/linuxheaders/4.14_armv7l/linuxheaders-4.14-chromeos-armv7l.tar.xz',
|
||||
armv7l: 'https://gitlab.com/api/v4/projects/26210301/packages/generic/linuxheaders/4.14_armv7l/linuxheaders-4.14-chromeos-armv7l.tar.xz',
|
||||
i686: 'https://gitlab.com/api/v4/projects/26210301/packages/generic/linuxheaders/3.18_i686/linuxheaders-3.18-chromeos-i686.tar.xz',
|
||||
x86_64: 'https://gitlab.com/api/v4/projects/26210301/packages/generic/linuxheaders/4.14_x86_64/linuxheaders-4.14-chromeos-x86_64.tar.xz',
|
||||
binary_url({
|
||||
aarch64: 'https://gitlab.com/api/v4/projects/26210301/packages/generic/linuxheaders/4.14-1_armv7l/linuxheaders-4.14-1-chromeos-armv7l.tpxz',
|
||||
armv7l: 'https://gitlab.com/api/v4/projects/26210301/packages/generic/linuxheaders/4.14-1_armv7l/linuxheaders-4.14-1-chromeos-armv7l.tpxz',
|
||||
i686: 'https://gitlab.com/api/v4/projects/26210301/packages/generic/linuxheaders/3.8_i686/linuxheaders-3.8-chromeos-i686.tpxz',
|
||||
x86_64: 'https://gitlab.com/api/v4/projects/26210301/packages/generic/linuxheaders/4.14-1_x86_64/linuxheaders-4.14-1-chromeos-x86_64.tpxz'
|
||||
})
|
||||
binary_sha256 ({
|
||||
aarch64: '4960ced072202049c4f90350ebfa6b13a3fe6750ae8a1f0d79c63ad976b66391',
|
||||
armv7l: '4960ced072202049c4f90350ebfa6b13a3fe6750ae8a1f0d79c63ad976b66391',
|
||||
i686: 'df0178926e599e8a6bb54a74c7c7cda734751e007a2bbb2e59f17a8fb3d4489f',
|
||||
x86_64: '1cbc54cf8c1af9996039c5aec487ed3f047c9c870341b08418c0d93fb40233a0',
|
||||
binary_sha256({
|
||||
aarch64: '75f253ac2cf0dd785ea8d9cdf9430d23d601ccc372e9f7afa95523a28273a340',
|
||||
armv7l: '75f253ac2cf0dd785ea8d9cdf9430d23d601ccc372e9f7afa95523a28273a340',
|
||||
i686: 'c16afcd95ebcffac67a026b724da19f498003ea80c13c87aeb613f09d412bb91',
|
||||
x86_64: '5d58b327ca9bab5630f0df387a3036125e1f367e6c43cd551f4734ee3e634073'
|
||||
})
|
||||
|
||||
depends_on 'linux_sources' => :build
|
||||
|
||||
def self.install
|
||||
linux_src_dir = CREW_PREFIX + '/src/linux'
|
||||
ENV['CREW_FHS_NONCOMPLIANCE_ONLY_ADVISORY'] = '1'
|
||||
warn_level = $VERBOSE
|
||||
$VERBOSE = nil
|
||||
load "#{CREW_LIB_PATH}lib/const.rb"
|
||||
$VERBOSE = warn_level
|
||||
linux_src_dir = "#{CREW_PREFIX}/src/linux"
|
||||
Dir.chdir(linux_src_dir) do
|
||||
system 'make',
|
||||
'headers_install',
|
||||
"INSTALL_HDR_PATH=#{CREW_DEST_PREFIX}"
|
||||
end
|
||||
Dir.chdir(CREW_DEST_PREFIX + '/include') do
|
||||
Dir.chdir("#{CREW_DEST_PREFIX}/include") do
|
||||
system "for file in \$(find . -not -type d -name '.*'); do
|
||||
rm \${file};
|
||||
done"
|
||||
|
||||
Reference in New Issue
Block a user