[PATCH RESEND 54/62] init: arm, x86: deal with some references to initrd

Askar Safin
2025-09-14T04:00:09Z

...in comments and printk

Signed-off-by: Askar Safin <safinaskar@gmail.com>
---
arch/arm/mm/init.c | 2 +-
arch/x86/kernel/setup.c | 10 +++++-----
arch/x86/mm/init.c | 2 +-
init/initramfs.c | 18 +++++++++---------
init/main.c | 12 ++++++------
5 files changed, 22 insertions(+), 22 deletions(-)

diff --git a/arch/arm/mm/init.c b/arch/arm/mm/init.c
index ae5921db626e..04ba9b385e24 100644
--- a/arch/arm/mm/init.c
+++ b/arch/arm/mm/init.c
@@ -445,7 +445,7 @@ void free_initramfs_mem(unsigned long start, unsigned long end)
end = round_up(end, PAGE_SIZE);

poison_init_mem((void *)start, PAGE_ALIGN(end) - start);
- free_reserved_area((void *)start, (void *)end, -1, "initrd");
+ free_reserved_area((void *)start, (void *)end, -1, "initramfs");
}
#endif

diff --git a/arch/x86/kernel/setup.c b/arch/x86/kernel/setup.c
index 3b88d156ed39..65670e0f59c0 100644
--- a/arch/x86/kernel/setup.c
+++ b/arch/x86/kernel/setup.c
@@ -325,19 +325,19 @@ static void __init relocate_initrd(void)
u64 relocated_ramdisk = memblock_phys_alloc_range(area_size, PAGE_SIZE, 0,
PFN_PHYS(max_pfn_mapped));
if (!relocated_ramdisk)
- panic("Cannot find place for new RAMDISK of size %lld\n",
+ panic("Cannot find place for new INITRAMFS of size %lld\n",
ramdisk_size);

virt_external_initramfs_start = relocated_ramdisk + PAGE_OFFSET;
virt_external_initramfs_end = virt_external_initramfs_start + ramdisk_size;
- printk(KERN_INFO "Allocated new RAMDISK: [mem %#010llx-%#010llx]\n",
+ printk(KERN_INFO "Allocated new INITRAMFS: [mem %#010llx-%#010llx]\n",
relocated_ramdisk, relocated_ramdisk + ramdisk_size - 1);

ret = copy_from_early_mem((void *)virt_external_initramfs_start, ramdisk_image, ramdisk_size);
if (ret)
- panic("Copy RAMDISK failed\n");
+ panic("Copy INITRAMFS failed\n");

- printk(KERN_INFO "Move RAMDISK from [mem %#010llx-%#010llx] to"
+ printk(KERN_INFO "Move INITRAMFS from [mem %#010llx-%#010llx] to"
" [mem %#010llx-%#010llx]\n",
ramdisk_image, ramdisk_image + ramdisk_size - 1,
relocated_ramdisk, relocated_ramdisk + ramdisk_size - 1);
@@ -370,7 +370,7 @@ static void __init reserve_initrd(void)

virt_external_initramfs_start = 0;

- printk(KERN_INFO "RAMDISK: [mem %#010llx-%#010llx]\n", ramdisk_image,
+ printk(KERN_INFO "INITRAMFS: [mem %#010llx-%#010llx]\n", ramdisk_image,
ramdisk_end - 1);

if (pfn_range_is_mapped(PFN_DOWN(ramdisk_image),
diff --git a/arch/x86/mm/init.c b/arch/x86/mm/init.c
index b7c45004f999..51b632f7fd21 100644
--- a/arch/x86/mm/init.c
+++ b/arch/x86/mm/init.c
@@ -992,7 +992,7 @@ void __init free_initramfs_mem(unsigned long start, unsigned long end)
* - relocate_initrd()
* So here We can do PAGE_ALIGN() safely to get partial page to be freed
*/
- free_init_pages("initrd", start, PAGE_ALIGN(end));
+ free_init_pages("initramfs", start, PAGE_ALIGN(end));
}
#endif

diff --git a/init/initramfs.c b/init/initramfs.c
index d52314b17c25..348cfcc4c95e 100644
--- a/init/initramfs.c
+++ b/init/initramfs.c
@@ -643,7 +643,7 @@ void __init reserve_initramfs_mem(void)
return;
/*
* Round the memory region to page boundaries as per free_initramfs_mem()
- * This allows us to detect whether the pages overlapping the initrd
+ * This allows us to detect whether the pages overlapping the initramfs
* are in use, but more importantly, reserves the entire set of pages
* as we don't want these pages allocated for other purposes.
*/
@@ -652,26 +652,26 @@ void __init reserve_initramfs_mem(void)
size = round_up(size, PAGE_SIZE);

if (!memblock_is_region_memory(start, size)) {
- pr_err("INITRD: 0x%08llx+0x%08lx is not a memory region",
+ pr_err("INITRAMFS: 0x%08llx+0x%08lx is not a memory region",
(u64)start, size);
goto disable;
}

if (memblock_is_region_reserved(start, size)) {
- pr_err("INITRD: 0x%08llx+0x%08lx overlaps in-use memory region\n",
+ pr_err("INITRAMFS: 0x%08llx+0x%08lx overlaps in-use memory region\n",
(u64)start, size);
goto disable;
}

memblock_reserve(start, size);
- /* Now convert initrd to virtual addresses */
+ /* Now convert initramfs to virtual addresses */
virt_external_initramfs_start = (unsigned long)__va(phys_external_initramfs_start);
virt_external_initramfs_end = virt_external_initramfs_start + phys_external_initramfs_size;
initramfs_below_start_ok = 1;

return;
disable:
- pr_cont(" - disabling initrd\n");
+ pr_cont(" - disabling initramfs\n");
virt_external_initramfs_start = 0;
virt_external_initramfs_end = 0;
}
@@ -686,7 +686,7 @@ void __weak __init free_initramfs_mem(unsigned long start, unsigned long end)
#endif

free_reserved_area((void *)start, (void *)end, POISON_FREE_INITMEM,
- "initrd");
+ "initramfs");
}

#ifdef CONFIG_CRASH_RESERVE
@@ -696,14 +696,14 @@ static bool __init kexec_free_initramfs(void)
unsigned long crashk_end = (unsigned long)__va(crashk_res.end);

/*
- * If the initrd region is overlapped with crashkernel reserved region,
+ * If the initramfs region is overlapped with crashkernel reserved region,
* free only memory that is not part of crashkernel region.
*/
if (virt_external_initramfs_start >= crashk_end || virt_external_initramfs_end <= crashk_start)
return false;

/*
- * Initialize initrd memory region since the kexec boot does not do.
+ * Initialize initramfs memory region since the kexec boot does not do.
*/
memset((void *)virt_external_initramfs_start, 0, virt_external_initramfs_end - virt_external_initramfs_start);
if (virt_external_initramfs_start < crashk_start)
@@ -740,7 +740,7 @@ static void __init do_populate_rootfs(void *unused, async_cookie_t cookie)
security_initramfs_populated();

/*
- * If the initrd region is overlapped with crashkernel reserved region,
+ * If the initramfs region is overlapped with crashkernel reserved region,
* free only memory that is not part of crashkernel region.
*/
if (!retain_initramfs && virt_external_initramfs_start && !kexec_free_initramfs()) {
diff --git a/init/main.c b/init/main.c
index c535e0613df8..4212efb33e77 100644
--- a/init/main.c
+++ b/init/main.c
@@ -276,7 +276,7 @@ static void * __init get_boot_config_from_initramfs(size_t *_size)

data = (char *)virt_external_initramfs_end - BOOTCONFIG_MAGIC_LEN;
/*
- * Since Grub may align the size of initrd to 4, we must
+ * Since Grub may align the size of initramfs to 4, we must
* check the preceding 3 bytes as well.
*/
for (i = 0; i < 4; i++) {
@@ -293,7 +293,7 @@ static void * __init get_boot_config_from_initramfs(size_t *_size)

data = ((void *)hdr) - size;
if ((unsigned long)data < virt_external_initramfs_start) {
- pr_err("bootconfig size %d is greater than initrd size %ld\n",
+ pr_err("bootconfig size %d is greater than initramfs size %ld\n",
size, virt_external_initramfs_end - virt_external_initramfs_start);
return NULL;
}
@@ -303,7 +303,7 @@ static void * __init get_boot_config_from_initramfs(size_t *_size)
return NULL;
}

- /* Remove bootconfig from initramfs/initrd */
+ /* Remove bootconfig from initramfs */
virt_external_initramfs_end = (unsigned long)data;
if (_size)
*_size = size;
@@ -421,7 +421,7 @@ static void __init setup_boot_config(void)

/* Cut out the bootconfig data even if we have no bootconfig option */
data = get_boot_config_from_initramfs(&size);
- /* If there is no bootconfig in initrd, try embedded one. */
+ /* If there is no bootconfig in initramfs, try embedded one. */
if (!data)
data = xbc_get_embedded_bootconfig(&size);

@@ -478,7 +478,7 @@ static void __init exit_boot_config(void)

static void __init setup_boot_config(void)
{
- /* Remove bootconfig data from initrd */
+ /* Remove bootconfig data from initramfs */
get_boot_config_from_initramfs(NULL);
}

@@ -1049,7 +1049,7 @@ void start_kernel(void)
#ifdef CONFIG_BLK_DEV_INITRD
if (virt_external_initramfs_start && !initramfs_below_start_ok &&
page_to_pfn(virt_to_page((void *)virt_external_initramfs_start)) < min_low_pfn) {
- pr_crit("initrd overwritten (0x%08lx < 0x%08lx) - disabling it.\n",
+ pr_crit("initramfs overwritten (0x%08lx < 0x%08lx) - disabling it.\n",
page_to_pfn(virt_to_page((void *)virt_external_initramfs_start)),
min_low_pfn);
virt_external_initramfs_start = 0;
--
2.47.2