Re: [PATCH 6/7] Use the updated DriverDisc code in loader

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On 12/17/2009 10:47 AM, Martin Sivak wrote:
> - enable dlabel on RHEL by default
> - use glib's linked lists to traverse through available DDs
> ---
>  loader/loader.c |   37 +++++++++++++++++++++++++++++++++++++
>  loader/loader.h |    2 ++
>  2 files changed, 39 insertions(+), 0 deletions(-)
> 
> diff --git a/loader/loader.c b/loader/loader.c
> index cd3e178..6312781 100644
> --- a/loader/loader.c
> +++ b/loader/loader.c
> @@ -959,6 +959,10 @@ static void parseCmdLineFlags(struct loaderData_s * loaderData,
>          else if (!strcasecmp(argv[i], "dd") || 
>                   !strcasecmp(argv[i], "driverdisk"))
>              flags |= LOADER_FLAGS_MODDISK;
> +        else if (!strcasecmp(argv[i], "dlabel=on"))
> +            flags |= LOADER_FLAGS_AUTOMODDISK;
> +        else if (!strcasecmp(argv[i], "dlabel=off"))
> +            flags &= ~LOADER_FLAGS_AUTOMODDISK;
>          else if (!strcasecmp(argv[i], "rescue"))
>              flags |= LOADER_FLAGS_RESCUE;
>          else if (!strcasecmp(argv[i], "nopass"))
> @@ -1785,6 +1789,7 @@ int main(int argc, char ** argv) {
>      struct loaderData_s loaderData;
>  
>      char *path;
> +    GSList *dd, *dditer;
>  
>      gchar *cmdLine = NULL, *ksFile = NULL, *virtpcon = NULL;
>      gboolean testing = FALSE, mediacheck = FALSE;
> @@ -1882,6 +1887,12 @@ int main(int argc, char ** argv) {
>      flags |= LOADER_FLAGS_NOSHELL;
>  #endif
>  
> +    /* XXX if RHEL, enable the AUTODD feature by default,
> +     * but we should come with more general way how to control this */
> +    if (!strncmp(getProductName(), "Red Hat", 7)) {
> +        flags |= LOADER_FLAGS_AUTOMODDISK;
> +    }
> +
>      openLog(FL_TESTING(flags));
>      if (!FL_TESTING(flags))
>          openlog("loader", 0, LOG_LOCAL0);
> @@ -1946,6 +1957,26 @@ int main(int argc, char ** argv) {
>      /* FIXME: this is a bit of a hack */
>      loaderData.modInfo = modInfo;
>  
> +    /* Setup depmod & modprobe so we can load multiple DDs */
> +    modprobeDDmode();
> +
> +    if (FL_AUTOMODDISK(flags)) {
> +        /* Load all autodetected DDs */
> +        logMessage(INFO, "Trying to detect vendor driver discs");
> +        dd = findDriverDiskByLabel();
> +        dditer = dd;
> +        while(dditer) {
> +            if (loadDriverDiskFromPartition(&loaderData, (char*)(dditer->data))) {
> +                logMessage(ERROR, "Automatic driver disk loader failed for %s.", (char*)(dditer->data));
> +            }
> +            else {
> +                logMessage(INFO, "Automatic driver disk loader succeeded for %s.", (char*)(dditer->data));
> +            }

The formatting is bad here.

> +            dditer = g_slist_next(dditer);
> +        }
> +        g_slist_free(dd);
> +    }
> +
>      if (FL_MODDISK(flags)) {
>          startNewt();
>          loadDriverDisks(DEVICE_ANY, &loaderData);
> @@ -1955,6 +1986,9 @@ int main(int argc, char ** argv) {
>          logMessage(INFO, "found /dd.img, loading drivers");
>          getDDFromSource(&loaderData, "path:/dd.img");
>      }
> +    
> +    /* Reset depmod & modprobe to normal mode and get the rest of drivers*/
> +    modprobeNormalmode();
>  
>      /* this allows us to do an early load of modules specified on the
>       * command line to allow automating the load order of modules so that
> @@ -2139,6 +2173,9 @@ int main(int argc, char ** argv) {
>          tmparg++;
>      }
>  
> +    if (FL_AUTOMODDISK(flags))
> +        *argptr++ = "--dlabel";
> +
>      if (FL_NOIPV4(flags))
>          *argptr++ = "--noipv4";
>  
> diff --git a/loader/loader.h b/loader/loader.h
> index ebf3766..ca6404f 100644
> --- a/loader/loader.h
> +++ b/loader/loader.h
> @@ -70,6 +70,7 @@
>  #define LOADER_FLAGS_HAVE_CMSCONF       (((uint64_t) 1) << 37)
>  #define LOADER_FLAGS_NOKILL		(((uint64_t) 1) << 38)
>  #define LOADER_FLAGS_KICKSTART_SEND_SERIAL   (((uint64_t) 1) << 39)
> +#define LOADER_FLAGS_AUTOMODDISK        (((uint64_t) 1) << 40)
>  
>  #define FL_TESTING(a)            ((a) & LOADER_FLAGS_TESTING)
>  #define FL_TEXT(a)               ((a) & LOADER_FLAGS_TEXT)
> @@ -107,6 +108,7 @@
>  #define FL_HAVE_CMSCONF(a)       ((a) & LOADER_FLAGS_HAVE_CMSCONF)
>  #define FL_NOKILL(a)		 ((a) & LOADER_FLAGS_NOKILL)
>  #define FL_KICKSTART_SEND_SERIAL(a) ((a) & LOADER_FLAGS_KICKSTART_SEND_SERIAL)
> +#define FL_AUTOMODDISK(a)        ((a) & LOADER_FLAGS_AUTOMODDISK)
>  
>  void startNewt(void);
>  void stopNewt(void);

This all looks fine.

-- 
        Peter

I number the Linux folks among my personal heroes.
		-- Donald Knuth

_______________________________________________
Anaconda-devel-list mailing list
Anaconda-devel-list@xxxxxxxxxx
https://www.redhat.com/mailman/listinfo/anaconda-devel-list

[Index of Archives]     [Kickstart]     [Fedora Users]     [Fedora Legacy List]     [Fedora Maintainers]     [Fedora Desktop]     [Fedora SELinux]     [Big List of Linux Books]     [Yosemite News]     [Yosemite Photos]     [KDE Users]     [Fedora Tools]
  Powered by Linux