From 06e0bdfe68920691681c0db04f31dc1c90fdad98 Mon Sep 17 00:00:00 2001 From: Guillaume Cottenceau Date: Wed, 21 Nov 2001 14:43:32 +0000 Subject: migrate to pcmcia support from kernel, patching untouched imported sources from pcmcia-cs-3.1.29, to ease further updates of vendor code (start from a clean pcmcia_ subdir) --- mdk-stage1/stage1.c | 20 +++++++++++++++++--- 1 file changed, 17 insertions(+), 3 deletions(-) (limited to 'mdk-stage1/stage1.c') diff --git a/mdk-stage1/stage1.c b/mdk-stage1/stage1.c index de9bffd2f..0db624951 100644 --- a/mdk-stage1/stage1.c +++ b/mdk-stage1/stage1.c @@ -1,9 +1,9 @@ /* * Guillaume Cottenceau (gc@mandrakesoft.com) * - * Copyright 2000 MandrakeSoft + * Copyright 2000-2001 MandrakeSoft * - * View the homepage: http://us.mandrakesoft.com/~gc/html/stage1.html + * View the homepage: http://people.mandrakesoft.com/~gc/html/stage1.html * * * This software may be freely redistributed under the terms of the GNU @@ -48,7 +48,7 @@ #include "insmod.h" #ifdef ENABLE_PCMCIA -#include "pcmcia/pcmcia.h" +#include "pcmcia_/pcmcia.h" #endif #ifndef DISABLE_CDROM @@ -268,6 +268,20 @@ static void expert_third_party_modules(void) static void handle_pcmcia(char ** pcmcia_adapter) { #ifdef ENABLE_PCMCIA + char buf[50]; + int fd = open("/proc/version", O_RDONLY); + int size; + if (fd == -1) + fatal_error("could not open /proc/version"); + size = read(fd, buf, sizeof(buf)); + buf[size-1] = '\0'; // -1 to eat the \n + close(fd); + buf[17] = '\0'; // enough to extract `2.2' + if (ptr_begins_static_str(buf+14, "2.2")) { + stg1_error_message("We now use kernel pcmcia support and this won't work with a 2.2 kernel."); + return; + } + *pcmcia_adapter = pcmcia_probe(); if (!*pcmcia_adapter) { log_message("no pcmcia adapter found"); -- cgit v1.2.1