Added mandriva quirks to ffinit.c

Signed-off-by: Claudio Matsuoka <cmatsuoka@gmail.com>
This commit is contained in:
Claudio Matsuoka committed 2008-01-02 14:10:45 -02:00
1 parent 59876f1e37
commit ee446d3138
1 file changed
+14 -5
+14 -5
View File
@@ -21,6 +21,13 @@
#include <linux/limits.h> #include <linux/limits.h>
#ifdef DIST_MDV
#define RANDOMSEED "/var/lib/random-seed"
#else
#define RANDOMSEED "/var/lib/urandom/random-seed"
#endif
/* From sysvinit */ /* From sysvinit */
/* Set a signal handler. */ /* Set a signal handler. */
#define SETSIG(sa, sig, fun, flags) \ #define SETSIG(sa, sig, fun, flags) \
@@ -157,7 +164,10 @@ int main()
system("/bin/run-parts --arg=-i /etc/resolvconf/update.d"); system("/bin/run-parts --arg=-i /etc/resolvconf/update.d");
chdir("/"); chdir("/");
#ifdef DIST_MDV
#else
touch("/etc/network/run/ifstate"); touch("/etc/network/run/ifstate");
#endif
if ((f = fopen("/etc/hostname", "r")) != NULL) { if ((f = fopen("/etc/hostname", "r")) != NULL) {
fgets(hline, 1023, f); fgets(hline, 1023, f);
@@ -175,13 +185,12 @@ int main()
* Set random seed * Set random seed
*/ */
/* Bug: the eeepc never sets its random seed from file */ /* Bug: the eeepc never sets its random seed from file */
system("/bin/cat /var/lib/urandom/random-seed >/dev/urandom " system("/bin/cat " RANDOMSEED " >/dev/urandom 2> /dev/null");
"> /dev/null 2>&1"); unlink(RANDOMSEED);
unlink("/var/lib/urandom/random-seed");
umask(077); umask(077);
system("/bin/dd if=/dev/urandom of=/var/lib/urandom/random-seed " system("/bin/dd if=/dev/urandom of=" RANDOMSEED "bs=4096 count=1 "
"bs=4096 count=1 >/dev/null 2>&1"); ">/dev/null 2>&1");
/* /*
* Misc setup * Misc setup