summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorGuillaume Cottenceau <gc@mandriva.com>2001-04-10 14:42:20 +0000
committerGuillaume Cottenceau <gc@mandriva.com>2001-04-10 14:42:20 +0000
commit38c2a8304a3b850380b3a50a475890dac572d448 (patch)
tree60908907b3867923ffcb401c023a1d003eed7451
parent63406ea20641483abf5163c3070f6bdda058b0f4 (diff)
downloaddrakx-38c2a8304a3b850380b3a50a475890dac572d448.tar
drakx-38c2a8304a3b850380b3a50a475890dac572d448.tar.gz
drakx-38c2a8304a3b850380b3a50a475890dac572d448.tar.bz2
drakx-38c2a8304a3b850380b3a50a475890dac572d448.tar.xz
drakx-38c2a8304a3b850380b3a50a475890dac572d448.zip
- honour quiet mode at boot time
- fake modprobe to shut up kmod
-rw-r--r--mdk-stage1/mkinitrd_helper/Makefile2
-rw-r--r--mdk-stage1/mkinitrd_helper/mkinitrd_helper.c37
2 files changed, 33 insertions, 6 deletions
diff --git a/mdk-stage1/mkinitrd_helper/Makefile b/mdk-stage1/mkinitrd_helper/Makefile
index 985229ba0..1fa6a345a 100644
--- a/mdk-stage1/mkinitrd_helper/Makefile
+++ b/mdk-stage1/mkinitrd_helper/Makefile
@@ -18,7 +18,7 @@ top_dir = ..
include $(top_dir)/Makefile.common
-VERSION = 1.1.0
+VERSION = 1.1.1
DEFS = -DVERSION=\"$(VERSION)\"
diff --git a/mdk-stage1/mkinitrd_helper/mkinitrd_helper.c b/mdk-stage1/mkinitrd_helper/mkinitrd_helper.c
index 8d4c60b19..67be7c340 100644
--- a/mdk-stage1/mkinitrd_helper/mkinitrd_helper.c
+++ b/mdk-stage1/mkinitrd_helper/mkinitrd_helper.c
@@ -40,6 +40,7 @@
#include "insmod.h"
+int quiet = 0;
void vlog_message(const char * s, va_list args)
{
@@ -105,7 +106,8 @@ static void insmod_(const char * parm)
#ifdef DEBUG
printf("insmod %s options %s\n", mod_name, options);
#endif
- printf("[] Loading module %s\n", mod_name);
+ if (!quiet)
+ printf("[] Loading module %s\n", mod_name);
if (insmod_call(mod_name, options))
perror("insmod failed");
@@ -123,7 +125,8 @@ static void mount_(const char * parm)
#ifdef DEBUG
printf("mounting %s on %s as type %s\n", dev, location, fs);
#endif
- printf("[] Mounting device containing loopback root filesystem\n");
+ if (!quiet)
+ printf("[] Mounting device containing loopback root filesystem\n");
flags = MS_MGC_VAL;
@@ -169,7 +172,8 @@ static void set_loop_(const char * parm)
#ifdef DEBUG
printf("set_looping %s with %s\n", device, file);
#endif
- printf("[] Setting up loopback file %s\n", file);
+ if (!quiet)
+ printf("[] Setting up loopback file %s\n", file);
if ((ffd = open(file, O_RDWR)) < 0) {
perror("set_loop, opening file in rw");
@@ -218,7 +222,8 @@ static void raidautorun_(const char * parm)
parse_parms(parm, &device, NULL, NULL);
- printf("[] Calling raid autorun for %s\n", device);
+ if (!quiet)
+ printf("[] Calling raid autorun for %s\n", device);
fd = open(device, O_RDWR, 0);
if (fd < 0) {
@@ -257,7 +262,29 @@ int main(int argc, char **argv)
char buf[5000];
char * ptr;
- printf("[] initrd_helper v" VERSION "\n");
+ if (strstr(argv[0], "modprobe"))
+ exit(0);
+
+ if (mount("/proc", "/loopfs", "proc", 0, NULL))
+ printf("[] couldn't mount proc filesystem\n");
+ else {
+ int fd_cmdline = open("/loopfs/cmdline", O_RDONLY);
+ if (fd_cmdline > 0) {
+ i = read(fd_cmdline, buf, sizeof(buf));
+ if (i == -1)
+ warning("could not read cmdline");
+ else {
+ buf[i] = '\0';
+ if (strstr(buf, "quiet"))
+ quiet = 1;
+ }
+ close(fd_cmdline);
+ }
+ umount("/loopfs");
+ }
+
+ if (!quiet)
+ printf("[] initrd_helper v" VERSION "\n");
if ((fd_conf = open("/mkinitrd_helper.conf", O_RDONLY)) < 0)
fatal_error("could not open mkinitrd_helper config file");