| 1 | |
| 2 | #include <linux/unistd.h>
|
| 3 | #include <linux/kernel.h>
|
| 4 | #include <linux/fs.h>
|
| 5 | #include <linux/initrd.h>
|
| 6 |
|
| 7 | #include "do_mounts.h"
|
| 8 |
|
| 9 | unsigned long initrd_start, initrd_end;
|
| 10 | int initrd_below_start_ok;
|
| 11 | static int __initdata mount_initrd = 1;
|
| 12 |
|
| 13 | phys_addr_t phys_initrd_start __initdata;
|
| 14 | unsigned long phys_initrd_size __initdata;
|
| 15 |
|
| 16 | static int __init no_initrd(char *str)
|
| 17 | {
|
| 18 | pr_warn("noinitrd option is deprecated and will be removed soon\n");
|
| 19 | mount_initrd = 0;
|
| 20 | return 1;
|
| 21 | }
|
| 22 |
|
| 23 | __setup("noinitrd", no_initrd);
|
| 24 |
|
| 25 | static int __init early_initrdmem(char *p)
|
| 26 | {
|
| 27 | phys_addr_t start;
|
| 28 | unsigned long size;
|
| 29 | char *endp;
|
| 30 |
|
| 31 | start = memparse(p, &endp);
|
| 32 | if (*endp == ',') {
|
| 33 | size = memparse(endp + 1, NULL);
|
| 34 |
|
| 35 | phys_initrd_start = start;
|
| 36 | phys_initrd_size = size;
|
| 37 | }
|
| 38 | return 0;
|
| 39 | }
|
| 40 | early_param("initrdmem", early_initrdmem);
|
| 41 |
|
| 42 | static int __init early_initrd(char *p)
|
| 43 | {
|
| 44 | return early_initrdmem(p);
|
| 45 | }
|
| 46 | early_param("initrd", early_initrd);
|
| 47 |
|
| 48 | void __init initrd_load(void)
|
| 49 | {
|
| 50 | if (mount_initrd) {
|
| 51 | create_dev("/dev/ram", Root_RAM0);
|
| 52 | |
| 53 | * Load the initrd data into /dev/ram0.
|
| 54 |
|
| 55 | if (rd_load_image()) {
|
| 56 | pr_warn("using deprecated initrd support, will be removed in January 2027; "
|
| 57 | "use initramfs instead or (as a last resort) /sys/firmware/initrd; "
|
| 58 | "see section \"Workaround\" in "
|
| 59 | "https://lore.kernel.org/lkml/[email protected]\n");
|
| 60 | }
|
| 61 | }
|
| 62 | init_unlink("/initrd.image");
|
| 63 | }
|