[Frugalware-darcs] setup: hotplug: new plugin

VMiklos vmiklos at frugalware.org
Wed Mar 29 23:53:45 CEST 2006


[hotplug: new plugin
VMiklos <vmiklos at frugalware.org>**20051104203221] {
hunk ./src/plugins/Makefile 11
-PLUGINS=asklang dolangsh greet layout
+PLUGINS=asklang dolangsh greet layout hotplug
hunk ./src/plugins/Makefile 30
+
+hotplug: hotplug.o ../util.o
+	$(CC) $(CFLAGS) -shared -Wl,-soname,hotplug.so -o 20hotplug.so \
+		hotplug.o ../util.o $(LDFLAGS)
addfile ./src/plugins/hotplug.c
hunk ./src/plugins/hotplug.c 1
+#define _GNU_SOURCE
+#include <stdio.h>
+#include <dialog.h>
+
+#include <setup.h>
+#include <util.h>
+#include "common.h"
+
+plugin_t plugin =
+{
+	"hotplug",
+	run,
+	NULL // dlopen handle
+};
+
+plugin_t *info()
+{
+	return &plugin;
+}
+
+int run(GList **config)
+{
+	dialog_vars.backtitle=gen_backtitle(_("Detecting hardware"));
+	dlg_put_backtitle();
+	dlg_clear();
+	dialog_msgbox(_("Please wait"), _("Scanning for SCSI and PCI cards"),
+		0, 0, 0);
+	system(g_strdup_printf("%s >%s 2>%s", HOTPLUGSCRIPT,
+		LOGDEV, LOGDEV));
+
+	return(0);
+}
hunk ./src/setup.h 13
+#define HOTPLUGSCRIPT "/etc/rc.d/rc.hotplug"
hunk ./src/setup.h 16
+#define HOTPLUGSCRIPT "echo /etc/rc.d/rc.hotplug"
}


More information about the Frugalware-darcs mailing list