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

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

Патч: modutils-2.4.2-rh-prepost.patch


--- modutils-2.4.2/util/alias.h.prepost	Tue Mar  6 18:24:18 2001
+++ modutils-2.4.2/util/alias.h	Wed Mar  7 12:35:40 2001
@@ -227,6 +227,28 @@
 };
 
 /*
+ * This is the list of pre-defined "post-install"s,
+ * used to execute commands after loading modules.
+ * /etc/modules.conf can add entries but not remove them.
+ */
+char *post_install[] =
+{
+	"binfmt_misc /bin/mount -t binfmt_misc binfmt_misc /proc/sys/fs/binfmt_misc >/dev/null 2>&1 ||:",
+	NULL 
+};
+
+/*
+ * This is the list of pre-defined "pre-remove"s,
+ * used to execute commands before unloading modules.
+ * /etc/modules.conf can add entries but not remove them.
+ */
+char *pre_remove[] =
+{
+	"binfmt_misc /bin/umount /proc/sys/fs/binfmt_misc >/dev/null 2>&1 ||:",
+	NULL
+};
+
+/*
  * This is the list of pre-defined "prune"s,
  * used to exclude paths from scan of /lib/modules.
  * /etc/modules.conf can add entries but not remove them.
--- modutils-2.4.2/util/config.c.prepost	Thu Jan  4 20:45:19 2001
+++ modutils-2.4.2/util/config.c	Tue Mar  6 18:24:18 2001
@@ -691,6 +691,20 @@
 		 */
 		if (all && aliaslist[0])
 			n_aliases = build_list(aliaslist, &aliases, version, 0);
+		
+		/*
+		 * Build predef postinstalls
+		 */
+		if (all && post_install[0])
+			for (i=0 ; post_install[i] ; i++ )
+				decode_exec(xstrdup(post_install[i]), EXEC_POST_INSTALL);
+		
+		/*
+		 * Build predef preremoves
+		 */
+		if (all && pre_remove[0])
+			for (i=0 ; pre_remove[i] ; i++ )
+				decode_exec(xstrdup(pre_remove[i]), EXEC_PRE_REMOVE);
 
 		/* Order and priority is now: (MODPATH + modules.conf) || (predefs + modules.conf) */
 		if ((envpath = getenv("MODPATH")) != NULL && !safemode) {
 
design & coding: Vladimir Lettiev aka crux © 2004-2005