Skip to content

Commit c837699

Browse files
author
Christoph Hellwig
committed
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 <[email protected]>. Signed-off-by: Christoph Hellwig <[email protected]> Acked-by: Linus Torvalds <[email protected]>
1 parent 7e0adbf commit c837699

File tree

9 files changed

+12
-94
lines changed

9 files changed

+12
-94
lines changed

arch/arm/kernel/atags_parse.c

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -91,8 +91,6 @@ __tagtable(ATAG_VIDEOTEXT, parse_tag_videotext);
9191
static int __init parse_tag_ramdisk(const struct tag *tag)
9292
{
9393
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;
9694

9795
if (tag->u.ramdisk.size)
9896
rd_size = tag->u.ramdisk.size;

arch/sh/kernel/setup.c

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -290,8 +290,6 @@ void __init setup_arch(char **cmdline_p)
290290

291291
#ifdef CONFIG_BLK_DEV_RAM
292292
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);
295293
#endif
296294

297295
if (!MOUNT_ROOT_RDONLY)

arch/sparc/kernel/setup_32.c

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -353,8 +353,6 @@ void __init setup_arch(char **cmdline_p)
353353
ROOT_DEV = old_decode_dev(root_dev);
354354
#ifdef CONFIG_BLK_DEV_RAM
355355
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);
358356
#endif
359357

360358
prom_setsync(prom_sync_me);

arch/sparc/kernel/setup_64.c

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -659,8 +659,6 @@ void __init setup_arch(char **cmdline_p)
659659
ROOT_DEV = old_decode_dev(root_dev);
660660
#ifdef CONFIG_BLK_DEV_RAM
661661
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);
664662
#endif
665663

666664
task_thread_info(&init_task)->kregs = &fake_swapper_regs;

arch/x86/kernel/setup.c

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -870,8 +870,6 @@ void __init setup_arch(char **cmdline_p)
870870

871871
#ifdef CONFIG_BLK_DEV_RAM
872872
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);
875873
#endif
876874
#ifdef CONFIG_EFI
877875
if (!strncmp((char *)&boot_params.efi_info.efi_loader_signature,

include/linux/initrd.h

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -2,12 +2,6 @@
22

33
#define INITRD_MINOR 250 /* shouldn't collide with /dev/ram* too soon ... */
44

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-
115
/* starting block # of image */
126
extern int rd_image_start;
137

init/do_mounts.c

Lines changed: 7 additions & 62 deletions
Original file line numberDiff line numberDiff line change
@@ -28,8 +28,6 @@
2828

2929
#include "do_mounts.h"
3030

31-
int __initdata rd_doload; /* 1 = load RAM disk, 0 = don't load */
32-
3331
int root_mountflags = MS_RDONLY | MS_SILENT;
3432
static char * __initdata root_device_name;
3533
static char __initdata saved_root_name[64];
@@ -39,7 +37,7 @@ dev_t ROOT_DEV;
3937

4038
static int __init load_ramdisk(char *str)
4139
{
42-
rd_doload = simple_strtol(str,NULL,0) & 3;
40+
pr_warn("ignoring the deprecated load_ramdisk= option\n");
4341
return 1;
4442
}
4543
__setup("load_ramdisk=", load_ramdisk);
@@ -553,66 +551,20 @@ static int __init mount_cifs_root(void)
553551
}
554552
#endif
555553

556-
#if defined(CONFIG_BLK_DEV_RAM) || defined(CONFIG_BLK_DEV_FD)
557-
void __init change_floppy(char *fmt, ...)
558-
{
559-
struct termios termios;
560-
char buf[80];
561-
char c;
562-
int fd;
563-
va_list args;
564-
va_start(args, fmt);
565-
vsprintf(buf, fmt, args);
566-
va_end(args);
567-
fd = ksys_open("/dev/root", O_RDWR | O_NDELAY, 0);
568-
if (fd >= 0) {
569-
ksys_ioctl(fd, FDEJECT, 0);
570-
ksys_close(fd);
571-
}
572-
printk(KERN_NOTICE "VFS: Insert %s and press ENTER\n", buf);
573-
fd = ksys_open("/dev/console", O_RDWR, 0);
574-
if (fd >= 0) {
575-
ksys_ioctl(fd, TCGETS, (long)&termios);
576-
termios.c_lflag &= ~ICANON;
577-
ksys_ioctl(fd, TCSETSF, (long)&termios);
578-
ksys_read(fd, &c, 1);
579-
termios.c_lflag |= ICANON;
580-
ksys_ioctl(fd, TCSETSF, (long)&termios);
581-
ksys_close(fd);
582-
}
583-
}
584-
#endif
585-
586554
void __init mount_root(void)
587555
{
588556
#ifdef CONFIG_ROOT_NFS
589557
if (ROOT_DEV == Root_NFS) {
590-
if (mount_nfs_root())
591-
return;
592-
593-
printk(KERN_ERR "VFS: Unable to mount root fs via NFS, trying floppy.\n");
594-
ROOT_DEV = Root_FD0;
558+
if (!mount_nfs_root())
559+
printk(KERN_ERR "VFS: Unable to mount root fs via NFS.\n");
560+
return;
595561
}
596562
#endif
597563
#ifdef CONFIG_CIFS_ROOT
598564
if (ROOT_DEV == Root_CIFS) {
599-
if (mount_cifs_root())
600-
return;
601-
602-
printk(KERN_ERR "VFS: Unable to mount root fs via SMB, trying floppy.\n");
603-
ROOT_DEV = Root_FD0;
604-
}
605-
#endif
606-
#ifdef CONFIG_BLK_DEV_FD
607-
if (MAJOR(ROOT_DEV) == FLOPPY_MAJOR) {
608-
/* rd_doload is 2 for a dual initrd/ramload setup */
609-
if (rd_doload==2) {
610-
if (rd_load_disk(1)) {
611-
ROOT_DEV = Root_RAM1;
612-
root_device_name = NULL;
613-
}
614-
} else
615-
change_floppy("root floppy");
565+
if (!mount_cifs_root())
566+
printk(KERN_ERR "VFS: Unable to mount root fs via SMB.\n");
567+
return;
616568
}
617569
#endif
618570
#ifdef CONFIG_BLOCK
@@ -631,8 +583,6 @@ void __init mount_root(void)
631583
*/
632584
void __init prepare_namespace(void)
633585
{
634-
int is_floppy;
635-
636586
if (root_delay) {
637587
printk(KERN_INFO "Waiting %d sec before mounting root device...\n",
638588
root_delay);
@@ -675,11 +625,6 @@ void __init prepare_namespace(void)
675625
async_synchronize_full();
676626
}
677627

678-
is_floppy = MAJOR(ROOT_DEV) == FLOPPY_MAJOR;
679-
680-
if (is_floppy && rd_doload && rd_load_disk(0))
681-
ROOT_DEV = Root_RAM0;
682-
683628
mount_root();
684629
out:
685630
devtmpfs_mount();

init/do_mounts.h

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,6 @@
99
#include <linux/major.h>
1010
#include <linux/root_dev.h>
1111

12-
void change_floppy(char *fmt, ...);
1312
void mount_block_root(char *name, int flags);
1413
void mount_root(void);
1514
extern int root_mountflags;

init/do_mounts_rd.c

Lines changed: 5 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -15,11 +15,9 @@
1515
#include <linux/decompress/generic.h>
1616

1717

18-
int __initdata rd_prompt = 1;/* 1 = prompt for RAM disk, 0 = don't prompt */
19-
2018
static int __init prompt_ramdisk(char *str)
2119
{
22-
rd_prompt = simple_strtol(str,NULL,0) & 1;
20+
pr_warn("ignoring the deprecated prompt_ramdisk= option\n");
2321
return 1;
2422
}
2523
__setup("prompt_ramdisk=", prompt_ramdisk);
@@ -178,7 +176,7 @@ int __init rd_load_image(char *from)
178176
int res = 0;
179177
int in_fd, out_fd;
180178
unsigned long rd_blocks, devblocks;
181-
int nblocks, i, disk;
179+
int nblocks, i;
182180
char *buf = NULL;
183181
unsigned short rotate = 0;
184182
decompress_fn decompressor = NULL;
@@ -243,21 +241,15 @@ int __init rd_load_image(char *from)
243241

244242
printk(KERN_NOTICE "RAMDISK: Loading %dKiB [%ld disk%s] into ram disk... ",
245243
nblocks, ((nblocks-1)/devblocks)+1, nblocks>devblocks ? "s" : "");
246-
for (i = 0, disk = 1; i < nblocks; i++) {
244+
for (i = 0; i < nblocks; i++) {
247245
if (i && (i % devblocks == 0)) {
248-
pr_cont("done disk #%d.\n", disk++);
246+
pr_cont("done disk #1.\n");
249247
rotate = 0;
250248
if (ksys_close(in_fd)) {
251249
printk("Error closing the disk.\n");
252250
goto noclose_input;
253251
}
254-
change_floppy("disk #%d", disk);
255-
in_fd = ksys_open(from, O_RDONLY, 0);
256-
if (in_fd < 0) {
257-
printk("Error opening disk.\n");
258-
goto noclose_input;
259-
}
260-
printk("Loading disk #%d... ", disk);
252+
break;
261253
}
262254
ksys_read(in_fd, buf, BLOCK_SIZE);
263255
ksys_write(out_fd, buf, BLOCK_SIZE);
@@ -284,8 +276,6 @@ int __init rd_load_image(char *from)
284276

285277
int __init rd_load_disk(int n)
286278
{
287-
if (rd_prompt)
288-
change_floppy("root floppy disk to be loaded into RAM disk");
289279
create_dev("/dev/root", ROOT_DEV);
290280
create_dev("/dev/ram", MKDEV(RAMDISK_MAJOR, n));
291281
return rd_load_image("/dev/root");

0 commit comments

Comments
 (0)