[elbe-devel] [PATCH 6/8] init: init-elbe.sh.mako: call 'elbe buildrepo' as last thing

Manuel Traut manut at linutronix.de
Fri Oct 19 15:50:46 CEST 2018


On Thu, Sep 27, 2018 at 12:34:19PM +0200, Torben Hohn wrote:
> elbe buildrepo is supposed to create package repositories which carry
> binaries and sources used in the initvm. cdrom generation will use these
> repos to a) speedup the build and b) allow for "offline" initvm.
> 
> call elbe buildrepo as the last step during initvm install in init-elbe.sh
> 
> cdrom has to be mounted, because its already unmounted, when init-elbe.sh
> is executed. "in-target" can not be used to mount the cdrom, because
> it cleans up mounts.
> 
> In case of a cdrom build specify "elbe buildrepo" options:
> "--cdrom-device /dev/sr0 --cdrom-mount-path /media/cdrom0"
> This triggers a cdrom build.
> 
> Signed-off-by: Torben Hohn <torben.hohn at linutronix.de>

Reviewed-by: Manuel Traut <manut at linutronix.de>


> ---
>  elbepack/init/init-elbe.sh.mako | 17 +++++++++++++++++
>  1 file changed, 17 insertions(+)
> 
> diff --git a/elbepack/init/init-elbe.sh.mako b/elbepack/init/init-elbe.sh.mako
> index b29480dc..70356cf7 100644
> --- a/elbepack/init/init-elbe.sh.mako
> +++ b/elbepack/init/init-elbe.sh.mako
> @@ -6,6 +6,12 @@
>  ## SPDX-License-Identifier: GPL-3.0-or-later
>  ##
>  #! /bin/sh
> +<%
> +elbe_exe = 'elbe'
> +
> +if opt.devel:
> +    elbe_exe = '/var/cache/elbe/devel/elbe'
> +%>
>  
>  # First unset the variables which are set by the debian-installer
>  unset DEBCONF_REDIR DEBCONF_OLD_FD_BASE MENU
> @@ -36,4 +42,15 @@ cp vmlinuz /buildenv/var/cache/elbe/installer
>     sed -i s%/usr/bin/elbe%/var/cache/elbe/devel/elbe% /buildenv/lib/systemd/system/elbe-daemon.service
>  % endif
>  
> +# since elbe buildrepo generates repo keys,
> +# we need entropy in the target
> +
> +in-target haveged
> +
> +% if prj.has("mirror/cdrom"):
> +  in-target ${elbe_exe} buildrepo --cdrom-device /dev/sr0 --cdrom-mount-path /media/cdrom0 /var/cache/elbe/source.xml
> +% else:
> +  in-target ${elbe_exe} buildrepo /var/cache/elbe/source.xml
> +% endif
> +
>  exit 0
> -- 
> 2.11.0
> 
> 
> _______________________________________________
> elbe-devel mailing list
> elbe-devel at linutronix.de
> https://lists.linutronix.de/mailman/listinfo/elbe-devel



More information about the elbe-devel mailing list