2013-06-06 23:54:13 +02:00
|
|
|
################################################################################
|
2007-07-08 21:22:18 +02:00
|
|
|
#
|
2018-04-01 07:08:20 +02:00
|
|
|
# Build a kernel with an integrated initial ramdisk filesystem based on cpio.
|
2007-07-08 21:22:18 +02:00
|
|
|
#
|
2013-06-06 23:54:13 +02:00
|
|
|
################################################################################
|
2007-07-08 21:22:18 +02:00
|
|
|
|
2011-09-06 23:16:09 +02:00
|
|
|
# The generic fs infrastructure isn't very useful here.
|
2017-11-12 18:45:42 +01:00
|
|
|
#
|
|
|
|
# The initramfs image does not actually build an image; its only purpose is:
|
|
|
|
# 1- to ensure rootfs.cpio is generated,
|
|
|
|
# 2- to then rebuild the kernel with rootfs.cpio as initramfs
|
|
|
|
#
|
|
|
|
# Note: ordering of the dependencies is not guaranteed here, but in
|
|
|
|
# linux/linux.mk, via the linux-rebuild-with-initramfs rule, which depends
|
|
|
|
# on the rootfs-cpio filesystem rule.
|
|
|
|
#
|
|
|
|
# Note: the trick here is that we directly depend on rebuilding the Linux
|
|
|
|
# kernel image (which itself depends on the rootfs-cpio rule), while we
|
|
|
|
# advertise that our dependency is on the rootfs-cpio rule, which is
|
|
|
|
# cleaner in the dependency graph.
|
2011-07-20 16:30:14 +02:00
|
|
|
|
2017-11-12 18:45:42 +01:00
|
|
|
rootfs-initramfs: linux-rebuild-with-initramfs
|
2010-04-20 16:31:01 +02:00
|
|
|
|
2011-09-06 23:16:09 +02:00
|
|
|
rootfs-initramfs-show-depends:
|
2017-11-12 18:45:42 +01:00
|
|
|
@echo rootfs-cpio
|
2007-07-08 21:22:18 +02:00
|
|
|
|
2015-04-12 18:37:46 +02:00
|
|
|
.PHONY: rootfs-initramfs rootfs-initramfs-show-depends
|
|
|
|
|
2011-09-06 23:16:09 +02:00
|
|
|
ifeq ($(BR2_TARGET_ROOTFS_INITRAMFS),y)
|
2014-03-06 21:55:34 +01:00
|
|
|
TARGETS_ROOTFS += rootfs-initramfs
|
2011-09-06 23:16:09 +02:00
|
|
|
endif
|
fs/initramfs: fix show-info
The initramfs is not a reall filesystem, so it does not use the
$(rootfs) infrastructure.
As a consequence, the usual rootfs-related variables are not set,
especially the name, type, and dependencies of the (non-)filesystem.
Yet, it is present in the list of rootfs to build, and thus we end
up including it in the output of show-info. But the missing variables
yield an incorrect json:
"": {
"type": "",
"virtual": false,
"version": "",
"licenses": "",
"dl_dir": "",
"install_target": ,
"install_staging": ,
"install_images": ,
"downloads": [ ],
"dependencies": [ ],
"reverse_dependencies": [ ]
},
First, the object key is empty; second, the install_target,
install_staging, and install_images values are empty, which is not
valid (if they were null, that be OK though). Third, this is clearly
the layout of a 'package' entry, not that of a 'rootfs' entry.
An option to fix that would be to actually make use of the rootfs
infra. However, that would mean doing a lot of work for nothing
(there is actually nothing to do, yet the infra would still do a lot
of preparatory and clean up work).
The alternative is pretty simple: declare and set the variables as if
it were a real filesystem, so that show-info can filter it to the
proper layout and can spit out appropriate content (even if fake).
The third option would be to teach show-info (and its internal
implementation, the macro json-info) to ignore specific cases, like
no-name items, or replace empty values with null, or whatnots. This
again would be quite a lot of work for a single occurence.
So we go for the simple faked variables.
We add linux as a dependency, so that the graph-depends also properly
represent the dependency chain, which ends up with something liKe:
ALL
|
v
rootfs-initramfs
| |
v v
linux rootfs-cpio
which is pretty fitting in the end.
Reported-by: Thomas De Schampheleire <patrickdepinguin@gmail.com>
Signed-off-by: Yann E. MORIN <yann.morin.1998@free.fr>
Tested-by: Thomas De Schampheleire <thomas.de_schampheleire@nokia.com>
Signed-off-by: Thomas Petazzoni <thomas.petazzoni@bootlin.com>
2020-03-16 22:55:36 +01:00
|
|
|
|
|
|
|
# Not using the rootfs infra, so fake the variables
|
|
|
|
ROOTFS_INITRAMFS_NAME = rootfs-initramfs
|
|
|
|
ROOTFS_INITRAMFS_TYPE = rootfs
|
|
|
|
ROOTFS_INITRAMFS_DEPENDENCIES = rootfs-cpio linux
|