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

initrd: remove support for multiple floppies

Remove the special handling for multiple floppies in the initrd code.
No one should be using floppies for booting these days. (famous last
words..)

Includes a spelling fix from Colin Ian King <colin.king@canonical.com>.

Signed-off-by: Christoph Hellwig <hch@lst.de>
Acked-by: Linus Torvalds <torvalds@linux-foundation.org>

+12 -94
-2
arch/arm/kernel/atags_parse.c
··· 91 91 static int __init parse_tag_ramdisk(const struct tag *tag) 92 92 { 93 93 rd_image_start = tag->u.ramdisk.start; 94 - rd_doload = (tag->u.ramdisk.flags & 1) == 0; 95 - rd_prompt = (tag->u.ramdisk.flags & 2) == 0; 96 94 97 95 if (tag->u.ramdisk.size) 98 96 rd_size = tag->u.ramdisk.size;
-2
arch/sh/kernel/setup.c
··· 290 290 291 291 #ifdef CONFIG_BLK_DEV_RAM 292 292 rd_image_start = RAMDISK_FLAGS & RAMDISK_IMAGE_START_MASK; 293 - rd_prompt = ((RAMDISK_FLAGS & RAMDISK_PROMPT_FLAG) != 0); 294 - rd_doload = ((RAMDISK_FLAGS & RAMDISK_LOAD_FLAG) != 0); 295 293 #endif 296 294 297 295 if (!MOUNT_ROOT_RDONLY)
-2
arch/sparc/kernel/setup_32.c
··· 353 353 ROOT_DEV = old_decode_dev(root_dev); 354 354 #ifdef CONFIG_BLK_DEV_RAM 355 355 rd_image_start = ram_flags & RAMDISK_IMAGE_START_MASK; 356 - rd_prompt = ((ram_flags & RAMDISK_PROMPT_FLAG) != 0); 357 - rd_doload = ((ram_flags & RAMDISK_LOAD_FLAG) != 0); 358 356 #endif 359 357 360 358 prom_setsync(prom_sync_me);
-2
arch/sparc/kernel/setup_64.c
··· 659 659 ROOT_DEV = old_decode_dev(root_dev); 660 660 #ifdef CONFIG_BLK_DEV_RAM 661 661 rd_image_start = ram_flags & RAMDISK_IMAGE_START_MASK; 662 - rd_prompt = ((ram_flags & RAMDISK_PROMPT_FLAG) != 0); 663 - rd_doload = ((ram_flags & RAMDISK_LOAD_FLAG) != 0); 664 662 #endif 665 663 666 664 task_thread_info(&init_task)->kregs = &fake_swapper_regs;
-2
arch/x86/kernel/setup.c
··· 870 870 871 871 #ifdef CONFIG_BLK_DEV_RAM 872 872 rd_image_start = boot_params.hdr.ram_size & RAMDISK_IMAGE_START_MASK; 873 - rd_prompt = ((boot_params.hdr.ram_size & RAMDISK_PROMPT_FLAG) != 0); 874 - rd_doload = ((boot_params.hdr.ram_size & RAMDISK_LOAD_FLAG) != 0); 875 873 #endif 876 874 #ifdef CONFIG_EFI 877 875 if (!strncmp((char *)&boot_params.efi_info.efi_loader_signature,
-6
include/linux/initrd.h
··· 2 2 3 3 #define INITRD_MINOR 250 /* shouldn't collide with /dev/ram* too soon ... */ 4 4 5 - /* 1 = load ramdisk, 0 = don't load */ 6 - extern int rd_doload; 7 - 8 - /* 1 = prompt for ramdisk, 0 = don't prompt */ 9 - extern int rd_prompt; 10 - 11 5 /* starting block # of image */ 12 6 extern int rd_image_start; 13 7
+7 -62
init/do_mounts.c
··· 28 28 29 29 #include "do_mounts.h" 30 30 31 - int __initdata rd_doload; /* 1 = load RAM disk, 0 = don't load */ 32 - 33 31 int root_mountflags = MS_RDONLY | MS_SILENT; 34 32 static char * __initdata root_device_name; 35 33 static char __initdata saved_root_name[64]; ··· 37 39 38 40 static int __init load_ramdisk(char *str) 39 41 { 40 - rd_doload = simple_strtol(str,NULL,0) & 3; 42 + pr_warn("ignoring the deprecated load_ramdisk= option\n"); 41 43 return 1; 42 44 } 43 45 __setup("load_ramdisk=", load_ramdisk); ··· 551 553 } 552 554 #endif 553 555 554 - #if defined(CONFIG_BLK_DEV_RAM) || defined(CONFIG_BLK_DEV_FD) 555 - void __init change_floppy(char *fmt, ...) 556 - { 557 - struct termios termios; 558 - char buf[80]; 559 - char c; 560 - int fd; 561 - va_list args; 562 - va_start(args, fmt); 563 - vsprintf(buf, fmt, args); 564 - va_end(args); 565 - fd = ksys_open("/dev/root", O_RDWR | O_NDELAY, 0); 566 - if (fd >= 0) { 567 - ksys_ioctl(fd, FDEJECT, 0); 568 - ksys_close(fd); 569 - } 570 - printk(KERN_NOTICE "VFS: Insert %s and press ENTER\n", buf); 571 - fd = ksys_open("/dev/console", O_RDWR, 0); 572 - if (fd >= 0) { 573 - ksys_ioctl(fd, TCGETS, (long)&termios); 574 - termios.c_lflag &= ~ICANON; 575 - ksys_ioctl(fd, TCSETSF, (long)&termios); 576 - ksys_read(fd, &c, 1); 577 - termios.c_lflag |= ICANON; 578 - ksys_ioctl(fd, TCSETSF, (long)&termios); 579 - ksys_close(fd); 580 - } 581 - } 582 - #endif 583 - 584 556 void __init mount_root(void) 585 557 { 586 558 #ifdef CONFIG_ROOT_NFS 587 559 if (ROOT_DEV == Root_NFS) { 588 - if (mount_nfs_root()) 589 - return; 590 - 591 - printk(KERN_ERR "VFS: Unable to mount root fs via NFS, trying floppy.\n"); 592 - ROOT_DEV = Root_FD0; 560 + if (!mount_nfs_root()) 561 + printk(KERN_ERR "VFS: Unable to mount root fs via NFS.\n"); 562 + return; 593 563 } 594 564 #endif 595 565 #ifdef CONFIG_CIFS_ROOT 596 566 if (ROOT_DEV == Root_CIFS) { 597 - if (mount_cifs_root()) 598 - return; 599 - 600 - printk(KERN_ERR "VFS: Unable to mount root fs via SMB, trying floppy.\n"); 601 - ROOT_DEV = Root_FD0; 602 - } 603 - #endif 604 - #ifdef CONFIG_BLK_DEV_FD 605 - if (MAJOR(ROOT_DEV) == FLOPPY_MAJOR) { 606 - /* rd_doload is 2 for a dual initrd/ramload setup */ 607 - if (rd_doload==2) { 608 - if (rd_load_disk(1)) { 609 - ROOT_DEV = Root_RAM1; 610 - root_device_name = NULL; 611 - } 612 - } else 613 - change_floppy("root floppy"); 567 + if (!mount_cifs_root()) 568 + printk(KERN_ERR "VFS: Unable to mount root fs via SMB.\n"); 569 + return; 614 570 } 615 571 #endif 616 572 #ifdef CONFIG_BLOCK ··· 583 631 */ 584 632 void __init prepare_namespace(void) 585 633 { 586 - int is_floppy; 587 - 588 634 if (root_delay) { 589 635 printk(KERN_INFO "Waiting %d sec before mounting root device...\n", 590 636 root_delay); ··· 624 674 msleep(5); 625 675 async_synchronize_full(); 626 676 } 627 - 628 - is_floppy = MAJOR(ROOT_DEV) == FLOPPY_MAJOR; 629 - 630 - if (is_floppy && rd_doload && rd_load_disk(0)) 631 - ROOT_DEV = Root_RAM0; 632 677 633 678 mount_root(); 634 679 out:
-1
init/do_mounts.h
··· 9 9 #include <linux/major.h> 10 10 #include <linux/root_dev.h> 11 11 12 - void change_floppy(char *fmt, ...); 13 12 void mount_block_root(char *name, int flags); 14 13 void mount_root(void); 15 14 extern int root_mountflags;
+5 -15
init/do_mounts_rd.c
··· 15 15 #include <linux/decompress/generic.h> 16 16 17 17 18 - int __initdata rd_prompt = 1;/* 1 = prompt for RAM disk, 0 = don't prompt */ 19 - 20 18 static int __init prompt_ramdisk(char *str) 21 19 { 22 - rd_prompt = simple_strtol(str,NULL,0) & 1; 20 + pr_warn("ignoring the deprecated prompt_ramdisk= option\n"); 23 21 return 1; 24 22 } 25 23 __setup("prompt_ramdisk=", prompt_ramdisk); ··· 176 178 int res = 0; 177 179 int in_fd, out_fd; 178 180 unsigned long rd_blocks, devblocks; 179 - int nblocks, i, disk; 181 + int nblocks, i; 180 182 char *buf = NULL; 181 183 unsigned short rotate = 0; 182 184 decompress_fn decompressor = NULL; ··· 241 243 242 244 printk(KERN_NOTICE "RAMDISK: Loading %dKiB [%ld disk%s] into ram disk... ", 243 245 nblocks, ((nblocks-1)/devblocks)+1, nblocks>devblocks ? "s" : ""); 244 - for (i = 0, disk = 1; i < nblocks; i++) { 246 + for (i = 0; i < nblocks; i++) { 245 247 if (i && (i % devblocks == 0)) { 246 - pr_cont("done disk #%d.\n", disk++); 248 + pr_cont("done disk #1.\n"); 247 249 rotate = 0; 248 250 if (ksys_close(in_fd)) { 249 251 printk("Error closing the disk.\n"); 250 252 goto noclose_input; 251 253 } 252 - change_floppy("disk #%d", disk); 253 - in_fd = ksys_open(from, O_RDONLY, 0); 254 - if (in_fd < 0) { 255 - printk("Error opening disk.\n"); 256 - goto noclose_input; 257 - } 258 - printk("Loading disk #%d... ", disk); 254 + break; 259 255 } 260 256 ksys_read(in_fd, buf, BLOCK_SIZE); 261 257 ksys_write(out_fd, buf, BLOCK_SIZE); ··· 276 284 277 285 int __init rd_load_disk(int n) 278 286 { 279 - if (rd_prompt) 280 - change_floppy("root floppy disk to be loaded into RAM disk"); 281 287 create_dev("/dev/root", ROOT_DEV); 282 288 create_dev("/dev/ram", MKDEV(RAMDISK_MAJOR, n)); 283 289 return rd_load_image("/dev/root");