Skip to content

Commit e873fb9

Browse files
committed
kbuild: doc: remove the description about shipped files
The use of shipped files is discouraged in the upstream kernel these days. [1] Downstream Makefiles have the freedom to use shipped files or other options to handle binaries, but this should not be advertised in the upstream document. [1]: https://lore.kernel.org/all/CAHk-=wgSEi_ZrHdqr=20xv+d6dr5G895CbOAi8ok+7-CQUN=fQ@mail.gmail.com/ Signed-off-by: Masahiro Yamada <masahiroy@kernel.org> Reviewed-by: Nicolas Schier <n.schier@avm.de>
1 parent 803d505 commit e873fb9

File tree

2 files changed

+3
-33
lines changed

2 files changed

+3
-33
lines changed

Documentation/kbuild/makefiles.rst

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1665,6 +1665,5 @@ Credits
16651665
TODO
16661666
====
16671667

1668-
- Describe how kbuild supports shipped files with _shipped.
16691668
- Generating offset header files.
16701669
- Add more variables to chapters 7 or 9?

Documentation/kbuild/modules.rst

Lines changed: 3 additions & 32 deletions
Original file line numberDiff line numberDiff line change
@@ -152,7 +152,6 @@ module 8123.ko, which is built from the following files::
152152
8123_if.c
153153
8123_if.h
154154
8123_pci.c
155-
8123_bin.o_shipped <= Binary blob
156155

157156
Shared Makefile
158157
---------------
@@ -170,7 +169,7 @@ Shared Makefile
170169
ifneq ($(KERNELRELEASE),)
171170
# kbuild part of makefile
172171
obj-m := 8123.o
173-
8123-y := 8123_if.o 8123_pci.o 8123_bin.o
172+
8123-y := 8123_if.o 8123_pci.o
174173

175174
else
176175
# normal makefile
@@ -179,10 +178,6 @@ Shared Makefile
179178
default:
180179
$(MAKE) -C $(KDIR) M=$$PWD
181180

182-
# Module specific targets
183-
genbin:
184-
echo "X" > 8123_bin.o_shipped
185-
186181
endif
187182

188183
The check for KERNELRELEASE is used to separate the two parts
@@ -204,43 +199,19 @@ Separate Kbuild File and Makefile
204199

205200
--> filename: Kbuild
206201
obj-m := 8123.o
207-
8123-y := 8123_if.o 8123_pci.o 8123_bin.o
202+
8123-y := 8123_if.o 8123_pci.o
208203

209204
--> filename: Makefile
210205
KDIR ?= /lib/modules/`uname -r`/build
211206

212207
default:
213208
$(MAKE) -C $(KDIR) M=$$PWD
214209

215-
# Module specific targets
216-
genbin:
217-
echo "X" > 8123_bin.o_shipped
218-
219210
The split in example 2 is questionable due to the simplicity of
220211
each file; however, some external modules use makefiles
221212
consisting of several hundred lines, and here it really pays
222213
off to separate the kbuild part from the rest.
223214

224-
Binary Blobs
225-
------------
226-
227-
Some external modules need to include an object file as a blob.
228-
kbuild has support for this, but requires the blob file to be
229-
named <filename>_shipped. When the kbuild rules kick in, a copy
230-
of <filename>_shipped is created with _shipped stripped off,
231-
giving us <filename>. This shortened filename can be used in
232-
the assignment to the module.
233-
234-
Throughout this section, 8123_bin.o_shipped has been used to
235-
build the kernel module 8123.ko; it has been included as
236-
8123_bin.o::
237-
238-
8123-y := 8123_if.o 8123_pci.o 8123_bin.o
239-
240-
Although there is no distinction between the ordinary source
241-
files and the binary file, kbuild will pick up different rules
242-
when creating the object file for the module.
243-
244215
Building Multiple Modules
245216
-------------------------
246217

@@ -301,7 +272,7 @@ Single Subdirectory
301272
obj-m := 8123.o
302273

303274
ccflags-y := -I $(src)/include
304-
8123-y := 8123_if.o 8123_pci.o 8123_bin.o
275+
8123-y := 8123_if.o 8123_pci.o
305276

306277
Several Subdirectories
307278
----------------------

0 commit comments

Comments
 (0)