Re: [PATCH rhel6-branch] (take II) Set repository in kickstart harddrive command (#592239)

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

 



> diff --git a/loader/hdinstall.c b/loader/hdinstall.c
> index 54a5fd9..154d5bc 100644
> --- a/loader/hdinstall.c
> +++ b/loader/hdinstall.c
> @@ -339,6 +339,8 @@ char * mountHardDrive(struct installMethod * method,
>  void setKickstartHD(struct loaderData_s * loaderData, int argc,
>                       char ** argv) {
>      char *p;
> +    char *url = NULL;
> +    char *substr = NULL;
>      gchar *biospart = NULL, *partition = NULL, *dir = NULL;
>      GOptionContext *optCon = g_option_context_new(NULL);
>      GError *optErr = NULL;
> @@ -391,6 +393,15 @@ void setKickstartHD(struct loaderData_s * loaderData, int argc,
>      if (dir)
>          ((struct hdInstallData *)loaderData->stage2Data)->directory = dir;
>  
> +    if (partition && dir) {
> +        /* set repo only if location of stage 2 is not specified explicitly in --dir */
> +        substr = strstr(dir, ".img");
> +        if (!substr || (substr && *(substr+4) != '\0')) {
> +            checked_asprintf(&url, "hd:%s:%s", partition, dir)
> +            loaderData->instRepo = url;
> +        }
> +    }
> +
>      logMessage(INFO, "results of hd ks, partition is %s, dir is %s", partition,
>                 dir);
>  }

You can skip the middle man and asprintf right into loaderData->instRepo,
like what setKickstartNfs does:

        checked_asprintf(&(loaderData->instRepo), "nfs:%s:%s", host, dir);

But that's just me being picky.  ACK otherwise.

- Chris

_______________________________________________
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