Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux
1
fork

Configure Feed

Select the types of activity you want to include in your feed.

initramfs: add default_cpio_list, and delete -d option support

When CONFIG_INITRAMFS_SOURCE is empty, the Makefile passes the -d
option to gen_initramfs.sh to create the default initramfs, which
contains /dev, /dev/console, and /root.

This commit simplifies the default behavior; remove the -d option,
and add the default cpio list.

Signed-off-by: Masahiro Yamada <masahiroy@kernel.org>

+7 -17
+1 -1
usr/Makefile
··· 25 25 26 26 hostprogs-y := gen_init_cpio 27 27 ramfs-input := $(if $(filter-out "",$(CONFIG_INITRAMFS_SOURCE)), \ 28 - $(shell echo $(CONFIG_INITRAMFS_SOURCE)),-d) 28 + $(shell echo $(CONFIG_INITRAMFS_SOURCE)),$(srctree)/$(src)/default_cpio_list) 29 29 ramfs-args := \ 30 30 $(if $(CONFIG_INITRAMFS_ROOT_UID), -u $(CONFIG_INITRAMFS_ROOT_UID)) \ 31 31 $(if $(CONFIG_INITRAMFS_ROOT_GID), -g $(CONFIG_INITRAMFS_ROOT_GID))
+6
usr/default_cpio_list
··· 1 + # SPDX-License-Identifier: GPL-2.0-only 2 + # This is a very simple, default initramfs 3 + 4 + dir /dev 0755 0 0 5 + nod /dev/console 0600 0 0 c 5 1 6 + dir /root 0700 0 0
-16
usr/gen_initramfs.sh
··· 28 28 <cpio_source> File list or directory for cpio archive. 29 29 If <cpio_source> is a .cpio file it will be used 30 30 as direct input to initramfs. 31 - -d Output the default cpio list. 32 31 33 32 All options except -o and -l may be repeated and are interpreted 34 33 sequentially and immediately. -u and -g states are preserved across ··· 40 41 # $1 - field number; rest is argument string 41 42 field() { 42 43 shift $1 ; echo $1 43 - } 44 - 45 - default_initramfs() { 46 - cat <<-EOF >> ${output} 47 - # This is a very simple, default initramfs 48 - 49 - dir /dev 0755 0 0 50 - nod /dev/console 0600 0 0 c 5 1 51 - dir /root 0700 0 0 52 - # file /kinit usr/kinit/kinit 0755 0 0 53 - # slink /init kinit 0755 0 0 54 - EOF 55 44 } 56 45 57 46 filetype() { ··· 249 262 root_gid="$1" 250 263 [ "$root_gid" = "-1" ] && root_gid=$(id -g || echo 0) 251 264 shift 252 - ;; 253 - "-d") # display default initramfs list 254 - default_initramfs 255 265 ;; 256 266 "-h") 257 267 usage