Репозиторий ALT Linux backports/2.4
Последнее обновление: 9 июля 2008 | Пакетов: 497 | Посещений: 1574621
 поиск   регистрация   авторизация 
 
Группа :: Система/Ядро и оборудование
Пакет: mkinitrd-busybox

 Главная   Изменения   Спек   Патчи   Загрузить   Bugs and FR 

Патч: busybox-1.00.pre8-alt-insmod-force_load.patch


--- busybox/modutils/insmod.c.orig	2003-10-17 20:31:20 +0400
+++ busybox/modutils/insmod.c	2003-10-17 20:34:34 +0400
@@ -709,6 +709,7 @@
 static int flag_verbose = 0;
 static int flag_quiet = 0;
 static int flag_export = 1;
+static int taint_forced_module = 0;
 
 
 /*======================================================================*/
@@ -3786,7 +3787,7 @@
 			break;
 	}
 
-	if (flag_force_load)
+	if (taint_forced_module)
 		set_tainted(f, fd, m_name, 1, TAINT_FORCED_MODULE, "forced load", "");
 
 	if (fd >= 0)
@@ -4240,6 +4241,7 @@
 						"\t%s was compiled for kernel version %s\n"
 						"\twhile this kernel is version %s",
 						m_filename, m_strversion, uts_info.release);
+				++taint_forced_module;
 			} else {
 				bb_error_msg("kernel-module version mismatch\n"
 						"\t%s was compiled for kernel version %s\n"
@@ -4427,7 +4430,36 @@
 	void *map;
 	char *filename, *options = bb_xstrdup("");
 
+#if !defined(CONFIG_FEATURE_2_4_MODULES) && !defined(CONFIG_FEATURE_2_2_MODULES)
+	int opt;
+
+	while ((opt = getopt(argc, argv, "fkqsvxLo:")) > 0) 
+		{
+			switch (opt) {
+				case 'f':			/* force loading */
+				case 'k':			/* module loaded by kerneld, auto-cleanable */
+				case 's':			/* log to syslog */
+				case 'v':			/* verbose output */
+				case 'q':			/* silent */
+				case 'x':			/* do not export externs */
+				case 'o':			/* name the output module */
+				case 'L':			/* Stub warning */
+#ifdef CONFIG_FEATURE_INSMOD_LOAD_MAP
+				case 'm':			/* print module load map */
+#endif
+					break;
+				default:
+					bb_show_usage();
+			}
+		}
+
+	if (argv[optind] == NULL) {
+		bb_show_usage();
+	}
+	filename = argv[optind];
+#else
 	filename = argv[1];
+#endif
 	if (!filename) {
 		bb_show_usage();
 		return -1;
 
design & coding: Vladimir Lettiev aka crux © 2004-2005