----- Forwarded message from Russell Dill <russ@rcment.net> -----
Date: Wed, 19 Jul 2000 14:20:56 -0700
From: Russell Dill <russ@rcment.net>
To: phoenix@minion.de
Subject: prompt_rootdisk=3D patch
I ran into a problem trying to boot simple minix floppies, it always
wanted a second disk, even though everything I had easily fit on one. I
didn't want to use a ramdisk, because I was doing a simple memory (along
with other things that required the use of the kernel). The VFS: Insert
root floppy and press ENTER wasn't acceptable to me because I wanted the
disks to run unattended. I made a quick patch that adds prompt_rootdisk=3D
to the kernel command line. The default value is 1, which is the current
behavior.
I think the option makes logical sense and I don't see any cons to
adding it to the linux kernel.
Russ Dill
Russ.Dill@asu.edu
anyway, here is the diff, its against a slightly patched 2.2.16, so
there may be a few offsets:
--- linux/fs/super.c.russ Tue Jul 18 15:21:03 2000
+++ linux/fs/super.c Tue Jul 18 15:41:19 2000
@@ -1178,6 +1178,7 @@
#ifdef CONFIG_BLK_DEV_RAM=09
extern int rd_doload;
#endif =09
+ extern root_prompt;
floppy_eject();
#ifndef CONFIG_BLK_DEV_RAM
printk(KERN_NOTICE "(Warning, this kernel has no ramdisk
support)\n");
@@ -1187,7 +1188,7 @@
rd_load_secondary();
else
#endif =09
- {
+ if (root_prompt) {
printk(KERN_NOTICE "VFS: Insert root floppy and press ENTER\n");
wait_for_keypress();
}
--- linux/init/main.c.russ Tue Jul 18 15:21:48 2000
+++ linux/init/main.c Tue Jul 18 15:40:58 2000
@@ -295,6 +295,7 @@
extern int initrd_archive;
#endif
#endif CONFIG_BLK_DEV_RAM
+static void prompt_rootdisk(char *str, int *ints);
#ifdef CONFIG_ISDN_DRV_ICN
extern void icn_setup(char *str, int *ints);
#endif
@@ -431,6 +432,8 @@
#endif
#endif
=20
+int root_prompt =3D 1; /* 1 =3D prompt for root disk, 0 =3D don't prompt =
*/
+
int root_mountflags =3D MS_RDONLY;
char *execute_command =3D NULL;
=20
@@ -744,6 +747,8 @@
#endif
#endif
=20
+ { "prompt_rootdisk=3D", prompt_rootdisk },
+
#ifdef CONFIG_CTC
{ "ctc=3D", ctc_setup } ,
#endif
@@ -1151,6 +1156,12 @@
rd_size =3D ints[1];
}
#endif
+
+static void __init prompt_rootdisk(char *str, int *ints)
+{
+ if (ints[0] > 0 && ints[1] >=3D 0)
+ root_prompt =3D ints[1] & 1;
+}
=20
static int __init checksetup(char *line)
{
--- linux/Documentation/kernel-parameters.txt.russ Tue Jul 18 15:52:58
2000
+++ linux/Documentation/kernel-parameters.txt Tue Jul 18 15:51:15 2000
@@ -291,6 +291,9 @@
prompt_ramdisk=3D [RAM] Whether to prompt for ramdisk before loading
its contents into memory.
=20
+ prompt_rootdisk=3D [HW] Whether to prompt for rootdisk before
mounting
+ it (option only applies when booting from floppy).
+
pt. [PARIDE]
=20
ramdisk=3D [RAM]
----- End forwarded message -----
--------------------------------------------------------------
Christian Zander ** N=F6ckersberg 76 ** 45257 Essen ** Germany
email: phoenix@minion.de * www: www.minion.de * icq: 5322926
--------------------------------------------------------------
--ibTvN161/egqYuK8
Content-Type: application/pgp-signature
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.0.2 (GNU/Linux)
Comment: For info see http://www.gnupg.org
iD8DBQE5dhyeY28vJpqNKtcRAW2LAJwL//v3ds977sPtRy8C/YC4T7BP7gCeLupJ
hXPa6s4kgohpc98DvEQ2ceI=
=czpT
-----END PGP SIGNATURE-----
--ibTvN161/egqYuK8--
-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.rutgers.edu
Please read the FAQ at http://www.tux.org/lkml/