unsigned long image_size = 0;
unsigned long dram_base;
/* addr/point and size pairs for memory management*/
- unsigned long initrd_addr;
+ unsigned long initrd_addr = 0;
unsigned long initrd_size = 0;
unsigned long fdt_addr = 0; /* Original DTB */
unsigned long fdt_size = 0;
if (!fdt_addr)
pr_efi("Generating empty DTB\n");
- max_addr = efi_get_max_initrd_addr(dram_base, image_addr);
- status = efi_load_initrd_dev_path(&initrd_addr, &initrd_size, max_addr);
- if (status == EFI_SUCCESS) {
- pr_efi("Loaded initrd from LINUX_EFI_INITRD_MEDIA_GUID device path\n");
- } else if (status == EFI_NOT_FOUND) {
- status = efi_load_initrd(image, &initrd_addr, &initrd_size,
- ULONG_MAX, max_addr);
- if (status == EFI_SUCCESS)
- pr_efi("Loaded initrd from command line option\n");
+ if (!noinitrd()) {
+ max_addr = efi_get_max_initrd_addr(dram_base, image_addr);
+ status = efi_load_initrd_dev_path(&initrd_addr, &initrd_size,
+ max_addr);
+ if (status == EFI_SUCCESS) {
+ pr_efi("Loaded initrd from LINUX_EFI_INITRD_MEDIA_GUID device path\n");
+ } else if (status == EFI_NOT_FOUND) {
+ status = efi_load_initrd(image, &initrd_addr, &initrd_size,
+ ULONG_MAX, max_addr);
+ if (status == EFI_SUCCESS)
+ pr_efi("Loaded initrd from command line option\n");
+ }
+ if (status != EFI_SUCCESS)
+ pr_efi_err("Failed to load initrd!\n");
}
- if (status != EFI_SUCCESS)
- pr_efi_err("Failed to load initrd!\n");
efi_random_get_seed();
static bool __efistub_global efi_nochunk;
static bool __efistub_global efi_nokaslr;
+static bool __efistub_global efi_noinitrd;
static bool __efistub_global efi_quiet;
static bool __efistub_global efi_novamap;
static bool __efistub_global efi_nosoftreserve;
{
return efi_nokaslr;
}
+bool __pure noinitrd(void)
+{
+ return efi_noinitrd;
+}
bool __pure is_quiet(void)
{
return efi_quiet;
efi_nokaslr = true;
} else if (!strcmp(param, "quiet")) {
efi_quiet = true;
+ } else if (!strcmp(param, "noinitrd")) {
+ efi_noinitrd = true;
} else if (!strcmp(param, "efi") && val) {
efi_nochunk = parse_option_str(val, "nochunk");
efi_novamap = parse_option_str(val, "novamap");
if (status != EFI_SUCCESS)
goto fail2;
- status = efi_load_initrd(image, &ramdisk_addr, &ramdisk_size,
- hdr->initrd_addr_max,
- above4g ? ULONG_MAX : hdr->initrd_addr_max);
- if (status != EFI_SUCCESS)
- goto fail2;
- hdr->ramdisk_image = ramdisk_addr & 0xffffffff;
- hdr->ramdisk_size = ramdisk_size & 0xffffffff;
- boot_params->ext_ramdisk_image = (u64)ramdisk_addr >> 32;
- boot_params->ext_ramdisk_size = (u64)ramdisk_size >> 32;
+ if (!noinitrd()) {
+ status = efi_load_initrd(image, &ramdisk_addr, &ramdisk_size,
+ hdr->initrd_addr_max,
+ above4g ? ULONG_MAX
+ : hdr->initrd_addr_max);
+ if (status != EFI_SUCCESS)
+ goto fail2;
+ hdr->ramdisk_image = ramdisk_addr & 0xffffffff;
+ hdr->ramdisk_size = ramdisk_size & 0xffffffff;
+ boot_params->ext_ramdisk_image = (u64)ramdisk_addr >> 32;
+ boot_params->ext_ramdisk_size = (u64)ramdisk_size >> 32;
+ }
efi_stub_entry(handle, sys_table, boot_params);
/* not reached */
{
unsigned long bzimage_addr = (unsigned long)startup_32;
struct setup_header *hdr = &boot_params->hdr;
- unsigned long max_addr = hdr->initrd_addr_max;
- unsigned long initrd_addr, initrd_size;
efi_status_t status;
unsigned long cmdline_paddr;
- if (hdr->xloadflags & XLF_CAN_BE_LOADED_ABOVE_4G)
- max_addr = ULONG_MAX;
-
sys_table = sys_table_arg;
/* Check if we were booted by the EFI firmware */
* permit an initrd loaded from the LINUX_EFI_INITRD_MEDIA_GUID device
* path to supersede it.
*/
- status = efi_load_initrd_dev_path(&initrd_addr, &initrd_size, max_addr);
- if (status == EFI_SUCCESS) {
- hdr->ramdisk_image = (u32)initrd_addr;
- hdr->ramdisk_size = (u32)initrd_size;
- boot_params->ext_ramdisk_image = (u64)initrd_addr >> 32;
- boot_params->ext_ramdisk_size = (u64)initrd_size >> 32;
- } else if (status != EFI_NOT_FOUND) {
- efi_printk("efi_load_initrd_dev_path() failed!\n");
- goto fail;
+ if (!noinitrd()) {
+ unsigned long addr, size;
+ unsigned long max_addr = hdr->initrd_addr_max;
+
+ if (hdr->xloadflags & XLF_CAN_BE_LOADED_ABOVE_4G)
+ max_addr = ULONG_MAX;
+
+ status = efi_load_initrd_dev_path(&addr, &size, max_addr);
+ if (status == EFI_SUCCESS) {
+ hdr->ramdisk_image = (u32)addr;
+ hdr->ramdisk_size = (u32)size;
+ boot_params->ext_ramdisk_image = (u64)addr >> 32;
+ boot_params->ext_ramdisk_size = (u64)size >> 32;
+ } else if (status != EFI_NOT_FOUND) {
+ efi_printk("efi_load_initrd_dev_path() failed!\n");
+ goto fail;
+ }
}
/*