blob: e1f9c9b207e3bc209a2326cdd4ca107d9bbbf7f0 [file] [log] [blame]
Leopold Schabel5c80aca2019-10-22 15:48:58 +02001genrule(
2 name = "image",
3 srcs = [
4 "@linux_kernel//:all",
Hendrik Hofstadt0d7c91e2019-10-23 21:44:47 +02005 "@//core/cmd/init",
6 "@//core/build/utils",
Leopold Schabel5c80aca2019-10-22 15:48:58 +02007 "initramfs.list",
8 "linux-smalltown.config",
9 ],
10 outs = [
11 "bzImage",
12 ],
13 cmd = """
14 DIR=external/linux_kernel
15
16 mkdir $$DIR/.bin
17
18 cp $(location linux-smalltown.config) $$DIR/.config
Hendrik Hofstadt0d7c91e2019-10-23 21:44:47 +020019 cp $(location @//core/cmd/init) $$DIR/.bin/init
20 cp $(locations @//core/build/utils) $$DIR/.bin/
Leopold Schabel5c80aca2019-10-22 15:48:58 +020021 cp $(location initramfs.list) $$DIR/initramfs.list
22
Leopold Schabelf08704a2019-11-06 12:34:53 +000023 (cd $$DIR && make -j $$(nproc)) >/dev/null
Leopold Schabel5c80aca2019-10-22 15:48:58 +020024
25 cp $$DIR/arch/x86/boot/bzImage $(RULEDIR)
26 """,
27 visibility = ["//visibility:public"],
28)