Re: [PATCH] [RFC] initrd/initramfs: extracted common code to init_rootfs.c file

From: Randy Dunlap
Date: Mon Jul 16 2018 - 13:08:24 EST


On 07/16/2018 01:12 AM, Vasyl Vavrychuk wrote:
> Extracted from initramfs to common place code that sits on top of
> iniramfs and initrd and initializes one or another depending on
> configuration.
>
> Signed-off-by: Vasyl Vavrychuk <vvavrychuk@xxxxxxxxx>

Just nits here...

> ---
> init/Makefile | 5 +-
> init/default_rootfs.c | 52 ++++++++++++++++
> init/do_mounts_initrd.c | 2 -
> init/init_rootfs.c | 162 ++++++++++++++++++++++++++++++++++++++++++++++++
> init/initramfs.c | 156 +---------------------------------------------
> init/initramfs.h | 4 ++
> init/noinitramfs.c | 52 ----------------
> 7 files changed, 222 insertions(+), 211 deletions(-)

Does this change save us anything? More source code. How about
object code?


> create mode 100644 init/default_rootfs.c
> create mode 100644 init/init_rootfs.c
> create mode 100644 init/initramfs.h
> delete mode 100644 init/noinitramfs.c
>

> diff --git a/init/default_rootfs.c b/init/default_rootfs.c
> new file mode 100644
> index 0000000..f4bad84
> --- /dev/null
> +++ b/init/default_rootfs.c
> @@ -0,0 +1,52 @@
> +/*
> + * init/noinitramfs.c

wrong source file name.


> diff --git a/init/initramfs.h b/init/initramfs.h
> new file mode 100644
> index 0000000..3ecad6f
> --- /dev/null
> +++ b/init/initramfs.h
> @@ -0,0 +1,4 @@
> +// SPDX-License-Identifier: GPL-2.0
> +#include <linux/init.h>
> +
> +char * __init initramfs_unpack_to_rootfs(char *buf, unsigned long len);

Unfortunately, the format for SPDX identifiers in C header files is thus:

/* SPDX-License-Identifier: <SPDX License Expression> */

according to Documentation/process/license-rules.rst.


thanks,
--
~Randy