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
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
|
package kernel-source {
description = "unpatched Linux kernel source tree";
website = "https://kernel.org";
exclude = true;
version# = "6.18.48";
output = remoteTar {
url = "https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git/"+
"snapshot/linux-"+version+".tar.gz";
checksum = "XzcqKk0ODA4tTjl5tVQdckuLHVnITGalDH_EIYUC8WHimc7O6bbews-vFRHUK01m";
compress = gzip;
};
}
package kernel-headers {
description = "an installation of kernel headers";
website = "https://kernel.org";
source = kernel-source;
files = {
// updated manually for API changes
"version.h";
};
toyboxEarly = true;
exec = make {
defaults = false;
configure = nil;
make = [
"-f /usr/src/kernel-headers/Makefile",
"O=/tmp/kbuild",
"LLVM=1",
`HOSTLDFLAGS="${LDFLAGS:-''}"`,
"INSTALL_HDR_PATH=/work/system",
"headers_install",
];
check = nil;
install = `
cat \
/usr/src/version.h > \
/work/system/include/linux/version.h
`;
};
checksum = arch {
default = "";
amd64 = "uwTZX3iLp6iPsR0-F0Jz2aUviLMMqv4xGQHoKeemo2HrNLD7fDlIDqqYT--i_5HJ";
arm64 = "A9EWzTGEChVLJVm5BP1GzpibdUddXUN2hIjAGkD-KQr5sc6RuEeIQle8VAiAYUqp";
riscv64 = "IB1oG3tEAN15wjYl8S5ekYXVFYN7-rb3m2f1Kdi58dGqnrIBTG2r1qb1utb5D1lb";
};
inputs = [ rsync ];
}
package kernel {
description = "the generic Rosa OS linux kernel";
website = "https://kernel.org";
anitya = 389470;
source = kernel-source;
patches = [ "dml-frame_warn_limit.patch" ];
files = {
".config": arch {
amd64 = "amd64.config";
arm64 = "arm64.config";
riscv64 = "riscv64.config";
};
".installkernel": "installkernel";
".depmod": "depmod";
};
env = [
"PATH=/system/sbin",
];
early = `
install -Dm0400 \
/usr/src/.config \
/tmp/kbuild/.config
install -Dm0500 \
/usr/src/.installkernel \
/sbin/installkernel
`;
exclusive = true;
exec = make {
defaults = false;
configure = nil;
// Build, install, and boot kernel before running kselftest on it.
check = nil;
make = [
"-f /usr/src/kernel/Makefile",
"O=/tmp/kbuild",
"LLVM=1",
"KBUILD_BUILD_VERSION='1-Rosa'",
"KBUILD_BUILD_TIMESTAMP='2106-02-07 06:28:15 UTC'",
"KBUILD_BUILD_USER=kbuild",
"KBUILD_BUILD_HOST=localhost",
"all",
];
install = `
# kernel is not aware of kmod moduledir
install -Dm0500 \
/usr/src/.depmod \
/sbin/depmod
make \
` + jobsFlagE + ` \
` + loadFlagE + ` \
-f /usr/src/kernel/Makefile \
O=/tmp/kbuild \
LLVM=1 \
INSTALL_PATH=/work \
install \
INSTALL_MOD_PATH=/work/system \
DEPMOD=/sbin/depmod \
modules_install
rm -v "/work/system/lib/modules/$(make -f /usr/src/kernel/Makefile kernelversion)/build"
`;
};
inputs = [
flex,
bison,
m4,
tar,
perl,
bc,
sed,
awk,
coreutils,
diffutils,
bash,
python,
xz,
gzip,
kmod,
elfutils,
util-linux,
kernel-headers,
];
}
package gen_init_cpio {
description = "a program in the kernel source tree for creating initramfs archive";
source = kernel-source;
enterSource = true;
exec = generic {
chdir = false;
build = `
mkdir -p /work/system/bin/
cc -o /work/system/bin/gen_init_cpio usr/gen_init_cpio.c
`;
};
}
|