From 067ea25e278d221724425e492452d4341ab2e669 Mon Sep 17 00:00:00 2001 From: Guillaume Cottenceau Date: Thu, 17 May 2001 16:53:32 +0000 Subject: don't write nonsense code to separate frontend from stage1, but rather, try to do some clever things --- mdk-stage1/stage1.c | 40 +++++++++++++++++++++++++--------------- 1 file changed, 25 insertions(+), 15 deletions(-) (limited to 'mdk-stage1/stage1.c') diff --git a/mdk-stage1/stage1.c b/mdk-stage1/stage1.c index db9a4a15c..1f39489a1 100644 --- a/mdk-stage1/stage1.c +++ b/mdk-stage1/stage1.c @@ -22,19 +22,18 @@ * */ -#include +#include +#include #include #include #include -#include -#include -#include - -#include #include +#include +#include #include #include #include +#include #include "stage1.h" @@ -78,18 +77,29 @@ void fatal_error(char *msg) /************************************************************ - * backend functs - * the principle is to not pollute frontend code with stage1-specific stuff */ + * special frontend functs + * (the principle is to not pollute frontend code with stage1-specific stuff) */ -int error_message_backend(void) +void stg1_error_message(char *msg, ...) { + va_list args; + va_start(args, msg); + log_message("unsetting automatic"); unset_param(MODE_AUTOMATIC); - return 0; + verror_message(msg, args); + va_end(args); } -int info_message_backend(void) +void stg1_info_message(char *msg, ...) { - return IS_AUTOMATIC ? 1 : 0; + va_list args; + va_start(args, msg); + if (IS_AUTOMATIC) { + vlog_message(msg, args); + return; + } + vinfo_message(msg, args); + va_end(args); } @@ -215,14 +225,14 @@ static void expert_third_party_modules(void) my_insmod("floppy", ANY_DRIVER_TYPE, NULL); if (my_mount("/dev/fd0", floppy_mount_location, "ext2") == -1) { - error_message("I can't find a Linux ext2 floppy in first floppy drive."); + stg1_error_message("I can't find a Linux ext2 floppy in first floppy drive."); return expert_third_party_modules(); } modules = list_directory(floppy_mount_location); if (!modules || !*modules) { - error_message("No modules found on floppy disk."); + stg1_error_message("No modules found on floppy disk."); umount(floppy_mount_location); return expert_third_party_modules(); } @@ -246,7 +256,7 @@ static void expert_third_party_modules(void) if (rc) { log_message("\tfailed"); - error_message("Insmod failed."); + stg1_error_message("Insmod failed."); } return expert_third_party_modules(); -- cgit v1.2.1