-
Notifications
You must be signed in to change notification settings - Fork 47
/
linux.sh
104 lines (95 loc) · 3.76 KB
/
linux.sh
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
# For build.sh
mode_name="std"
package_base="linux"
mode_desc="Select and use the packages for the default linux kernel"
# pkgrel for default ZFS packages
pkgrel="1"
# pkgrel for GIT packages
pkgrel_git="1"
zfs_git_commit=""
zfs_git_url="https://github.com/zfsonlinux/zfs.git"
# Version for RC packages
pkgrel_rc="1"
header="\
# Maintainer: Jan Houben <jan@nexttrex.de>
# Contributor: Jesus Alvarez <jeezusjr at gmail dot com>
#
# This PKGBUILD was generated by the archzfs build scripts located at
#
# http://github.com/archzfs/archzfs
#
# ! WARNING !
#
# The archzfs packages are kernel modules, so these PKGBUILDS will only work with the kernel package they target. In this
# case, the archzfs-linux packages will only work with the default linux package! To have a single PKGBUILD target many
# kernels would make for a cluttered PKGBUILD!
#
# If you have a custom kernel, you will need to change things in the PKGBUILDS. If you would like to have AUR or archzfs repo
# packages for your favorite kernel package built using the archzfs build tools, submit a request in the Issue tracker on the
# archzfs github page.
#"
get_kernel_options() {
msg "Checking the online package database for the latest x86_64 linux kernel version..."
if ! get_webpage "https://www.archlinux.org/packages/core/x86_64/linux/" "(?<=<h2>linux )[\d\w\.-]+(?=</h2>)"; then
exit 1
fi
kernel_version=${webpage_output}
kernel_version_full=$(kernel_version_full ${kernel_version})
kernel_version_pkgver=$(kernel_version_no_hyphen ${kernel_version})
kernel_version_major=${kernel_version%-*}
# convert 1.2.3.arch4-5 to 1.2.3-arch4-5
kernel_mod_path=\${_kernelver/.arch/-arch}
linux_depends="\"linux=\${_kernelver}\""
linux_headers_depends="\"linux-headers=\${_kernelver}\""
}
update_linux_pkgbuilds() {
get_kernel_options
pkg_list=("zfs-linux")
archzfs_package_group="archzfs-linux"
zfs_pkgver=${zol_version}
zfs_pkgrel=${pkgrel}
zfs_conflicts="'zfs-linux-git' 'zfs-linux-rc' 'spl-linux'"
zfs_pkgname="zfs-linux"
zfs_utils_pkgname="zfs-utils=\${_zfsver}"
# Paths are relative to build.sh
zfs_pkgbuild_path="packages/${kernel_name}/${zfs_pkgname}"
zfs_src_target="https://github.com/zfsonlinux/zfs/releases/download/zfs-\${_zfsver}/zfs-\${_zfsver}.tar.gz"
zfs_workdir="\${srcdir}/zfs-\${_zfsver}"
zfs_replaces='replaces=("spl-linux")'
}
# update_linux_rc_pkgbuilds() {
# get_kernel_options
# pkg_list=("zfs-linux-rc")
# archzfs_package_group="archzfs-linux-rc"
# zfs_pkgver=${zol_rc_version/-/_}
# zfs_pkgrel=${pkgrel_rc}
# zfs_conflicts="'zfs-linux' 'zfs-linux-git' 'spl-linux'"
# zfs_pkgname="zfs-linux-rc"
# zfs_utils_pkgname="zfs-utils-rc=\${_zfsver}"
# zfs_src_hash=${zfs_rc_src_hash}
# Paths are relative to build.sh
# zfs_pkgbuild_path="packages/${kernel_name}/${zfs_pkgname}"
# zfs_src_target="https://github.com/zfsonlinux/zfs/releases/download/zfs-\${_zfsver/_/-}/zfs-\${_zfsver/_/-}.tar.gz"
# zfs_workdir="\${srcdir}/zfs-\${_zfsver/_rc*/}"
# }
update_linux_git_pkgbuilds() {
get_kernel_options
pkg_list=("zfs-linux-git")
archzfs_package_group="archzfs-linux-git"
zfs_pkgver="" # Set later by call to git_calc_pkgver
zfs_pkgrel=${pkgrel_git}
zfs_conflicts="'zfs-linux' 'spl-linux-git' 'spl-linux'"
zfs_pkgname="zfs-linux-git"
zfs_pkgbuild_path="packages/${kernel_name}/${zfs_pkgname}"
zfs_replaces='replaces=("spl-linux-git")'
zfs_src_hash="SKIP"
zfs_makedepends="\"git\""
zfs_workdir="\${srcdir}/zfs"
if have_command "update"; then
git_check_repo
git_calc_pkgver
fi
zfs_utils_pkgname="zfs-utils-git=\${_zfsver}"
zfs_set_commit="_commit='${latest_zfs_git_commit}'"
zfs_src_target="git+${zfs_git_url}#commit=\${_commit}"
}