From 2559f92a83d2a04000fb1a0d392c6e2597758b11 Mon Sep 17 00:00:00 2001 From: cinap_lenrek Date: Mon, 13 Jul 2015 06:28:46 +0200 Subject: [PATCH] inst: fix download task using ip/httpfile to mount a iso over http and prompt for installurl --- rc/bin/inst/download | 28 ++++++++++++---------------- rc/bin/inst/mountdist | 3 ++- 2 files changed, 14 insertions(+), 17 deletions(-) diff --git a/rc/bin/inst/download b/rc/bin/inst/download index 35f0462f7..6e4aaedb6 100755 --- a/rc/bin/inst/download +++ b/rc/bin/inst/download @@ -18,27 +18,23 @@ case checkready } case go - # BUG make restartable - echo 'Downloading distribution package...' - baropt='-w 145,129,445,168' - if(~ $textinst 1) - baropt=-t - mkdir -p /n/newfs/dist - if(! hget -vo /n/newfs/dist/_9front.iso.bz2 $installurl/9front.iso.bz2 |[2] aux/statusbar $baropt 'downloading '^9front.iso.bz2) - exit - mv /n/newfs/dist/_9front.iso.bz2 /n/newfs/dist/9front.iso.bz2 + default=() + if(~ $#installurl 1) + default=(-d $installurl) + prompt $default 'Installation url' + installurl=$rd - echo 'The distribution is downloaded.' + if(! test -e /mnt/web/ctl) + webfs - srvmedia=() - mountmedia=(mount /srv/cwfs /n/distmedia) - distmediadir=/dist - export distmediadir mountmedia distmedia + srvmedia=(ip/httpfile -s httpdist $installurl/9front.iso) + mountmedia=(mount /srv/httpdist /n/distmedia) + distmediadir=/ + export srvmedia mountmedia distmediadir case checkdone - if(! test -f /n/newfs/dist/9front.iso.bz2) { + if(! test -f /n/distmedia/9front.iso) { download=notdone export download } } - diff --git a/rc/bin/inst/mountdist b/rc/bin/inst/mountdist index b9e60a37e..f3fb5dde0 100755 --- a/rc/bin/inst/mountdist +++ b/rc/bin/inst/mountdist @@ -22,7 +22,7 @@ fn havedist { fn trycdimage{ if(test -f $1){ rm -f /srv/9660.dist - unmount /n/dist + unmount /n/dist >[2]/dev/null 9660srv 9660.dist >[2]/dev/null logprog mount /srv/9660.dist /n/dist $1 exitifdone @@ -34,6 +34,7 @@ fn trycdimage{ fn trycdimagebz2 { if(test -f $1){ + mkdir -p /n/newfs/dist echo -n 'bunzip2 < '^$1^' >/n/newfs/dist/9front.iso' bunzip2 < $1 >/n/newfs/dist/_9front.iso && mv /n/newfs/dist/_9front.iso /n/newfs/dist/9front.iso