[lxc-devel] [PATCH] plamo: Improve template

Stéphane Graber stgraber at ubuntu.com
Tue Jan 21 14:50:51 UTC 2014


On Tue, Jan 21, 2014 at 04:46:46PM +0900, KATOH Yasufumi wrote:
> Allow to specify additional packages
> 
> Signed-off-by: TAMUKI Shoichi <tamuki at linet.gr.jp>
> Signed-off-by: KATOH Yasufumi <karma at jazz.email.ne.jp>

Acked-by: Stéphane Graber <stgraber at ubuntu.com>

> ---
>  templates/lxc-plamo.in | 25 +++++++++++++++++++------
>  1 file changed, 19 insertions(+), 6 deletions(-)
> 
> diff --git a/templates/lxc-plamo.in b/templates/lxc-plamo.in
> index 354cad9..c5a02ee 100644
> --- a/templates/lxc-plamo.in
> +++ b/templates/lxc-plamo.in
> @@ -31,12 +31,13 @@
>  [ -r /etc/default/lxc ] && . /etc/default/lxc
>  
>  DLSCHEME=${DLSCHEME:-"http"}
> -MIRRORSRV=${MIRRORSRV:-"ftp.ring.gr.jp"}
> +MIRRORSRV=${MIRRORSRV:-"www.ring.gr.jp"}
>  MIRRORPATH=${MIRRORPATH:-"/pub/linux/Plamo"}
>  CATEGORIES=${CATEGORIES:-"00_base 01_minimum"}
> -EXTRACTGRS=${EXTRACTGRS:-"Hamradio"}
> +EXTRACTGRS=${EXTRACTGRS:-""}
>  IGNOREPKGS=${IGNOREPKGS:-"grub kernel lilo linux_firmware microcode_ctl
> -    cpufreqd cpufrequtils gpm cqrlog hamlib fldigi"}
> +    cpufreqd cpufrequtils gpm"}
> +ADDONPKGS=${ADDONPKGS:-"`echo contrib/Hamradio/{morse,qrq}`"}
>  
>  download_plamo() {
>    # check the mini plamo was not already downloaded
> @@ -49,9 +50,11 @@ download_plamo() {
>    cd $ptcache
>    case $DLSCHEME in http) depth=2 ;; ftp) depth=3 ;; esac
>    rej=${IGNOREPKGS%% *} ; [ -n "$rej" ] && rej="$rej-*"
> -  for p in ${IGNOREPKGS#* } ; do rej="$rej,$p-*" ; done
> +  if [ `echo $IGNOREPKGS | wc -w` -ne 1 ] ; then
> +    for p in ${IGNOREPKGS#* } ; do rej="$rej,$p-*" ; done
> +  fi
>    for i in $CATEGORIES ; do
> -    wget -nv -e robots=off -r -l $depth -nd -A .tgz,.txz -R $rej \
> +    wget -nv -e robots=off -r -l $depth -nd -A .tgz,.txz -R "$rej" \
>          -I $MIRRORPATH/Plamo-$release/$arch/plamo/$i \
>          -X $MIRRORPATH/Plamo-$release/$arch/plamo/$i/old \
>          $DLSCHEME://$MIRRORSRV$MIRRORPATH/Plamo-$release/$arch/plamo/$i
> @@ -61,7 +64,7 @@ download_plamo() {
>      fi
>    done
>    for i in $EXTRACTGRS ; do
> -    wget -nv -e robots=off -r -l $depth -nd -A .tgz,.txz -R $rej \
> +    wget -nv -e robots=off -r -l $depth -nd -A .tgz,.txz -R "$rej" \
>          -I $MIRRORPATH/Plamo-$release/$arch/contrib/$i \
>          -X $MIRRORPATH/Plamo-$release/$arch/contrib/$i/old \
>          $DLSCHEME://$MIRRORSRV$MIRRORPATH/Plamo-$release/$arch/contrib/$i
> @@ -70,6 +73,16 @@ download_plamo() {
>        return 1
>      fi
>    done
> +  for p in $ADDONPKGS ; do
> +    wget -nv -e robots=off -r -l $depth -nd -A "`basename $p`-*" \
> +        -I $MIRRORPATH/Plamo-$release/$arch/`dirname $p` \
> +        -X $MIRRORPATH/Plamo-$release/$arch/`dirname $p`/old \
> +        $DLSCHEME://$MIRRORSRV$MIRRORPATH/Plamo-$release/$arch/`dirname $p`
> +    if [ $? -ne 0 ] ; then
> +      echo "Failed to download the rootfs, aborting."
> +      return 1
> +    fi
> +  done
>    mv $ptcache $dlcache
>    echo "Download complete."
>    return 0
> -- 
> 1.8.4.4
> 
> _______________________________________________
> lxc-devel mailing list
> lxc-devel at lists.linuxcontainers.org
> http://lists.linuxcontainers.org/listinfo/lxc-devel

-- 
Stéphane Graber
Ubuntu developer
http://www.ubuntu.com
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 836 bytes
Desc: Digital signature
URL: <http://lists.linuxcontainers.org/pipermail/lxc-devel/attachments/20140121/29ca1f47/attachment.pgp>


More information about the lxc-devel mailing list