summaryrefslogtreecommitdiffstats
path: root/mdk-stage1/init.c
diff options
context:
space:
mode:
authorGuillaume Cottenceau <gc@mandriva.com>2001-02-21 23:01:11 +0000
committerGuillaume Cottenceau <gc@mandriva.com>2001-02-21 23:01:11 +0000
commit841067b45e61bb8d5a1394d8bba25db1d2a23ea0 (patch)
tree76a8779a4825eef4fa8655ece532a1e34b601615 /mdk-stage1/init.c
parent4fc11a304d40052e9515f660e144d925eff8575c (diff)
downloaddrakx-backup-do-not-use-841067b45e61bb8d5a1394d8bba25db1d2a23ea0.tar
drakx-backup-do-not-use-841067b45e61bb8d5a1394d8bba25db1d2a23ea0.tar.gz
drakx-backup-do-not-use-841067b45e61bb8d5a1394d8bba25db1d2a23ea0.tar.bz2
drakx-backup-do-not-use-841067b45e61bb8d5a1394d8bba25db1d2a23ea0.tar.xz
drakx-backup-do-not-use-841067b45e61bb8d5a1394d8bba25db1d2a23ea0.zip
- fix "init" on ppc (do not use minilibc on non-i386 arch's)
- fix segfault of dietlibc-linked apps (broken va_stuff in dietlibc) - cleanup of "init"
Diffstat (limited to 'mdk-stage1/init.c')
-rw-r--r--mdk-stage1/init.c48
1 files changed, 36 insertions, 12 deletions
diff --git a/mdk-stage1/init.c b/mdk-stage1/init.c
index 502bb3b21..edcce8508 100644
--- a/mdk-stage1/init.c
+++ b/mdk-stage1/init.c
@@ -19,19 +19,14 @@
*
*/
-#include "minilibc.h"
-#include "config-stage1.h"
-
-#define KICK_FLOPPY 1
-#define KICK_BOOTP 2
+#ifndef INIT_HEADERS
+#include "init-libc-headers.h"
+#else
+#include INIT_HEADERS
+#endif
-#define MS_REMOUNT 32
+#include "config-stage1.h"
-#define ENV_PATH 0
-#define ENV_LD_LIBRARY_PATH 1
-#define ENV_HOME 2
-#define ENV_TERM 3
-#define ENV_DEBUG 4
char * env[] = {
"PATH=/usr/bin:/bin:/sbin:/usr/sbin:/mnt/sbin:/mnt/usr/sbin:/mnt/bin:/mnt/usr/bin",
@@ -73,6 +68,33 @@ void print_warning(char *msg)
printf("W: %s\n", msg);
}
+void print_int(int fd, int i)
+{
+ char buf[10];
+ char * chptr = buf + 9;
+ int j = 0;
+
+ if (i < 0)
+ {
+ write(1, "-", 1);
+ i = -1 * i;
+ }
+
+ while (i)
+ {
+ *chptr-- = '0' + (i % 10);
+ j++;
+ i = i / 10;
+ }
+
+ write(fd, chptr + 1, j);
+}
+
+void print_str(int fd, char * string)
+{
+ write(fd, string, strlen(string));
+}
+
/* fork to:
* (1) watch /proc/kmsg and copy the stuff to /dev/tty4
@@ -203,6 +225,8 @@ void doklog()
}
+#define LOOP_CLR_FD 0x4C01
+
void del_loop(char *device)
{
int fd;
@@ -426,7 +450,7 @@ int main(int argc, char **argv)
if (!abnormal_termination) {
printf("rebooting system\n");
sleep(2);
- reboot(0xfee1dead, 672274793, 0x1234567);
+ reboot(LINUX_REBOOT_CMD_RESTART);
} else {
printf("you may safely reboot your system\n");
while (1);