1 |
|
# Copyright 1999-2025 Gentoo Authors
|
|
1 |
# Copyright 2020-2025 Gentoo Authors
|
2 |
2 |
# Distributed under the terms of the GNU General Public License v2
|
3 |
3 |
|
4 |
4 |
EAPI=8
|
5 |
5 |
|
6 |
|
DESCRIPTION="Symlinks and syncs browser profile dirs to RAM"
|
7 |
|
HOMEPAGE="https://wiki.archlinux.org/title/Profile-sync-daemon"
|
8 |
|
SRC_URI="https://github.com/graysky2/${PN}/archive/v${PV}.tar.gz -> ${P}.tar.gz"
|
9 |
|
|
10 |
|
LICENSE="MIT"
|
11 |
|
SLOT="0"
|
12 |
|
KEYWORDS="amd64 x86"
|
13 |
|
|
14 |
|
RDEPEND="
|
15 |
|
app-shells/bash
|
16 |
|
net-misc/rsync[xattr]
|
17 |
|
sys-apps/systemd
|
|
6 |
KERNEL_IUSE_MODULES_SIGN=1
|
|
7 |
|
|
8 |
inherit git-r3 kernel-build toolchain-funcs
|
|
9 |
|
|
10 |
# https://koji.fedoraproject.org/koji/packageinfo?packageID=8
|
|
11 |
CONFIG_VER=5.10.12
|
|
12 |
CONFIG_HASH=836165dd2dff34e4f2c47ca8f9c803002c1e6530
|
|
13 |
GENTOO_CONFIG_VER=g16
|
|
14 |
|
|
15 |
DESCRIPTION="Linux kernel built from vanilla upstream sources"
|
|
16 |
HOMEPAGE="
|
|
17 |
https://wiki.gentoo.org/wiki/Project:Distribution_Kernel
|
|
18 |
https://www.kernel.org/
|
|
19 |
"
|
|
20 |
SRC_URI+="
|
|
21 |
https://github.com/projg2/gentoo-kernel-config/archive/${GENTOO_CONFIG_VER}.tar.gz
|
|
22 |
-> gentoo-kernel-config-${GENTOO_CONFIG_VER}.tar.gz
|
|
23 |
amd64? (
|
|
24 |
https://src.fedoraproject.org/rpms/kernel/raw/${CONFIG_HASH}/f/kernel-x86_64-fedora.config
|
|
25 |
-> kernel-x86_64-fedora.config.${CONFIG_VER}
|
|
26 |
)
|
|
27 |
arm64? (
|
|
28 |
https://src.fedoraproject.org/rpms/kernel/raw/${CONFIG_HASH}/f/kernel-aarch64-fedora.config
|
|
29 |
-> kernel-aarch64-fedora.config.${CONFIG_VER}
|
|
30 |
)
|
|
31 |
ppc64? (
|
|
32 |
https://src.fedoraproject.org/rpms/kernel/raw/${CONFIG_HASH}/f/kernel-ppc64le-fedora.config
|
|
33 |
-> kernel-ppc64le-fedora.config.${CONFIG_VER}
|
|
34 |
)
|
|
35 |
x86? (
|
|
36 |
https://src.fedoraproject.org/rpms/kernel/raw/${CONFIG_HASH}/f/kernel-i686-fedora.config
|
|
37 |
-> kernel-i686-fedora.config.${CONFIG_VER}
|
|
38 |
)
|
|
39 |
"
|
|
40 |
|
|
41 |
EGIT_REPO_URI=(
|
|
42 |
https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git/
|
|
43 |
https://github.com/gregkh/linux/
|
|
44 |
)
|
|
45 |
EGIT_BRANCH="linux-${PV/.9999/.y}"
|
|
46 |
|
|
47 |
LICENSE="GPL-2"
|
|
48 |
IUSE="debug hardened"
|
|
49 |
REQUIRED_USE="arm? ( savedconfig )"
|
|
50 |
|
|
51 |
BDEPEND="
|
|
52 |
debug? ( dev-util/pahole )
|
|
53 |
"
|
|
54 |
PDEPEND="
|
|
55 |
>=virtual/dist-kernel-$(ver_cut 1-2)
|
|
56 |
"
|
|
57 |
|
|
58 |
QA_FLAGS_IGNORED="
|
|
59 |
usr/src/linux-.*/scripts/gcc-plugins/.*.so
|
|
60 |
usr/src/linux-.*/vmlinux
|
18 |
61 |
"
|
19 |
62 |
|
20 |
|
src_install() {
|
21 |
|
emake DESTDIR="${D}" COMPRESS_MAN=0 install
|
|
63 |
src_unpack() {
|
|
64 |
git-r3_src_unpack
|
|
65 |
default
|
22 |
66 |
}
|
23 |
67 |
|
24 |
|
pkg_postinst() {
|
25 |
|
local replacing
|
26 |
|
for replacing in ${REPLACING_VERSIONS}; do
|
27 |
|
if [[ $(ver_cut 1 "${replacing}") -eq 5 ]]; then
|
28 |
|
ewarn "${PN}-6 and later dropped OpenRC and /etc/psd.conf support"
|
29 |
|
ewarn "See https://github.com/graysky2/profile-sync-daemon#note-for-version-6"
|
30 |
|
break
|
|
68 |
src_prepare() {
|
|
69 |
default
|
|
70 |
|
|
71 |
local biendian=false
|
|
72 |
|
|
73 |
# prepare the default config
|
|
74 |
case ${ARCH} in
|
|
75 |
arm | hppa)
|
|
76 |
> .config || die
|
|
77 |
;;
|
|
78 |
amd64)
|
|
79 |
cp "${DISTDIR}/kernel-x86_64-fedora.config.${CONFIG_VER}" .config || die
|
|
80 |
;;
|
|
81 |
arm64)
|
|
82 |
cp "${DISTDIR}/kernel-aarch64-fedora.config.${CONFIG_VER}" .config || die
|
|
83 |
biendian=true
|
|
84 |
;;
|
|
85 |
ppc)
|
|
86 |
# assume powermac/powerbook defconfig
|
|
87 |
# we still package.use.force savedconfig
|
|
88 |
cp "${WORKDIR}/${MY_P}/arch/powerpc/configs/pmac32_defconfig" .config || die
|
|
89 |
;;
|
|
90 |
ppc64)
|
|
91 |
cp "${DISTDIR}/kernel-ppc64le-fedora.config.${CONFIG_VER}" .config || die
|
|
92 |
biendian=true
|
|
93 |
;;
|
|
94 |
x86)
|
|
95 |
cp "${DISTDIR}/kernel-i686-fedora.config.${CONFIG_VER}" .config || die
|
|
96 |
;;
|
|
97 |
*)
|
|
98 |
die "Unsupported arch ${ARCH}"
|
|
99 |
;;
|
|
100 |
esac
|
|
101 |
|
|
102 |
local myversion="-dist"
|
|
103 |
use hardened && myversion+="-hardened"
|
|
104 |
echo "CONFIG_LOCALVERSION=\"${myversion}\"" > "${T}"/version.config || die
|
|
105 |
local dist_conf_path="${WORKDIR}/gentoo-kernel-config-${GENTOO_CONFIG_VER}"
|
|
106 |
|
|
107 |
local merge_configs=(
|
|
108 |
"${T}"/version.config
|
|
109 |
"${dist_conf_path}"/base.config
|
|
110 |
)
|
|
111 |
use debug || merge_configs+=(
|
|
112 |
"${dist_conf_path}"/no-debug.config
|
|
113 |
)
|
|
114 |
if use hardened; then
|
|
115 |
merge_configs+=( "${dist_conf_path}"/hardened-base.config )
|
|
116 |
|
|
117 |
tc-is-gcc && merge_configs+=( "${dist_conf_path}"/hardened-gcc-plugins.config )
|
|
118 |
|
|
119 |
if [[ -f "${dist_conf_path}/hardened-${ARCH}.config" ]]; then
|
|
120 |
merge_configs+=( "${dist_conf_path}/hardened-${ARCH}.config" )
|
31 |
121 |
fi
|
32 |
|
done
|
|
122 |
fi
|
|
123 |
|
|
124 |
# this covers ppc64 and aarch64_be only for now
|
|
125 |
if [[ ${biendian} == true && $(tc-endian) == big ]]; then
|
|
126 |
merge_configs+=( "${dist_conf_path}/big-endian.config" )
|
|
127 |
fi
|
|
128 |
|
|
129 |
use secureboot && merge_configs+=( "${dist_conf_path}/secureboot.config" )
|
|
130 |
|
|
131 |
# 5.10 series: No ZBOOT, disable explicitly to not confuse the eclass
|
|
132 |
echo "# CONFIG_EFI_ZBOOT is not set" > "${dist_conf_path}/secureboot.config" || die
|
|
133 |
|
|
134 |
kernel-build_merge_configs "${merge_configs[@]}"
|
33 |
135 |
}
|