install.sub - disklabel template modification

classic Classic list List threaded Threaded
3 messages Options
Reply | Threaded
Open this post in threaded view
|

install.sub - disklabel template modification

Jiri B.
Hi,

if somebody would put into install.conf following line:

  URL to autopartitioning template for disklabel = /disklabel.template

ftp would end in its prompt.

# ftp -Vo - /disklabel.template                                                                                                                  
ftp: /disklabel.template: no address associated with name
ftp>

I took current check for ramdisk local {install,upgrade}.conf

  649:    [[ -f $_rf ]] && _rf="file://$_rf"

and added it to disklabel_autolayout(), so installer would know
how to handle path to ramdisk's local disklabel template without file:// uri.

Jiri

---%>---
diff --git distrib/miniroot/install.sub distrib/miniroot/install.sub
index 740064a86a8..63ecf5cab14 100644
--- distrib/miniroot/install.sub
+++ distrib/miniroot/install.sub
@@ -414,6 +414,7 @@ disklabel_autolayout() {
                        err_exit "https not supported on this platform."
                fi
                echo "Fetching $resp"
+         [[ -f $resp ]] && resp="file://$resp"
                if unpriv ftp -Vo - "$resp" >$_dl && [[ -s $_dl ]]; then
                        disklabel -T $_dl -F $_f -w -A $_disk && return
                        err_exit "Autopartitioning failed."
---%<---

Reply | Threaded
Open this post in threaded view
|

Re: install.sub - disklabel template modification

Rivo Nurges-2
Hi!

"URL to autopartitioning template for disklabel =
file:///disklabel.auto" works fine.

Rivo

On Thu, 2018-08-30 at 13:27 +0000, Jiri B. wrote:

> Hi,
>
> if somebody would put into install.conf following line:
>
>   URL to autopartitioning template for disklabel =
> /disklabel.template
>
> ftp would end in its prompt.
>
> # ftp -Vo -
> /disklabel.template                                                  
>                                                                  
> ftp: /disklabel.template: no address associated with name
> ftp>
>
> I took current check for ramdisk local {install,upgrade}.conf
>
>   649:    [[ -f $_rf ]] && _rf="file://$_rf"
>
> and added it to disklabel_autolayout(), so installer would know
> how to handle path to ramdisk's local disklabel template without
> file:// uri.
>
> Jiri
>
> ---%>---
> diff --git distrib/miniroot/install.sub distrib/miniroot/install.sub
> index 740064a86a8..63ecf5cab14 100644
> --- distrib/miniroot/install.sub
> +++ distrib/miniroot/install.sub
> @@ -414,6 +414,7 @@ disklabel_autolayout() {
>                         err_exit "https not supported on this
> platform."
>                 fi
>                 echo "Fetching $resp"
> +         [[ -f $resp ]] && resp="file://$resp"
>                 if unpriv ftp -Vo - "$resp" >$_dl && [[ -s $_dl ]];
> then
>                         disklabel -T $_dl -F $_f -w -A $_disk &&
> return
>                         err_exit "Autopartitioning failed."
> ---%<---
>

Reply | Threaded
Open this post in threaded view
|

Re: install.sub - disklabel template modification

Alexander Hall
In reply to this post by Jiri B.


On August 30, 2018 3:27:07 PM GMT+02:00, "Jiri B." <[hidden email]> wrote:

>Hi,
>
>if somebody would put into install.conf following line:
>
>  URL to autopartitioning template for disklabel = /disklabel.template
>
>ftp would end in its prompt.
>
># ftp -Vo - /disklabel.template                                        
>                                                                      
>ftp: /disklabel.template: no address associated with name
>ftp>
>
>I took current check for ramdisk local {install,upgrade}.conf
>
>  649:    [[ -f $_rf ]] && _rf="file://$_rf"
>
>and added it to disklabel_autolayout(), so installer would know
>how to handle path to ramdisk's local disklabel template without
>file:// uri.

But it doesn't solve the problem. How about "/nonexistent_file"?

Will a simple </dev/null on the ftp command make it not hang?

'cause it does say URL, but indeed should not hang.

/Alexander

>
>Jiri
>
>---%>---
>diff --git distrib/miniroot/install.sub distrib/miniroot/install.sub
>index 740064a86a8..63ecf5cab14 100644
>--- distrib/miniroot/install.sub
>+++ distrib/miniroot/install.sub
>@@ -414,6 +414,7 @@ disklabel_autolayout() {
>                       err_exit "https not supported on this platform."
>                fi
>                echo "Fetching $resp"
>+         [[ -f $resp ]] && resp="file://$resp"
>               if unpriv ftp -Vo - "$resp" >$_dl && [[ -s $_dl ]]; then
>                        disklabel -T $_dl -F $_f -w -A $_disk && return
>                        err_exit "Autopartitioning failed."
>---%<---