[elbe-devel] [PATCH] commands init: Ignore files for elbe-devel.tar.bz2

Torben Hohn torben.hohn at linutronix.de
Wed Jun 3 11:08:47 CEST 2020


On Wed, May 27, 2020 at 11:41:38AM -0400, Olivier Dion wrote:
> TLDR; Unnecessary files are copied into the initvm from the
> development directory.  This results in a kernel panic when installing
> a new initvm with '--devel'.
> 
> --
> 
> When creating a new initvm with the '--devel' flag, a compressed
> archive called 'elbe-devel.tar.bz2' is created from the development
> directory.  That archive is cpio into the initrd of the initvm
> installer and, at a late stage, is decompressed into the filesystem of
> the initvm.  Resulting in a exact copy of the development directory.
> 
> However, this caused me a headache yesterday when I was unable to
> generate a new initvm.
> 
> This is QEMU complaining about the initrd is taking all the RAM:
> ----------------------------------------------------------------------
> /usr/bin/qemu-system-x86_64
> qemu: initrd is too large, cannot support.(max: 1073577983, need 1081853998)
> ----------------------------------------------------------------------
> one way to overcome this is to double the default size, up to 2Gib.
> 
> However, even if that's the case, the kernel will panic after
> decompressing the initrd:
> ----------------------------------------------------------------------
> [    0.017764] Kernel panic - not syncing: initrd too large to handle, disabling initrd (1080776424 needed, 1073469440 available)
> ----------------------------------------------------------------------
> 
> The culprits are the .git directory if not 'git-gc' recently.  This and
> the elbe-build* that are blindly copied into the initvm.  Thus,
> exclusion rules were added to the archiving of the development
> directory.
> 
> Signed-off-by: Olivier Dion <dion at linutronix.de>

Oh well, a warning would have been sufficient, probably.

Reviewed-by: Torben Hohn <torben.hohn at linutronix.de>

> ---
>  elbepack/commands/init.py | 12 ++++++++----
>  1 file changed, 8 insertions(+), 4 deletions(-)
> 
> diff --git a/elbepack/commands/init.py b/elbepack/commands/init.py
> index a97d45df..e77688ce 100644
> --- a/elbepack/commands/init.py
> +++ b/elbepack/commands/init.py
> @@ -263,12 +263,16 @@ def run_command(argv):
>  
>          if opt.devel:
>              out_real = os.path.realpath(out_path)
> -            ignore = ''
> +            opts = []
>              if out_real.startswith(elbe_dir + os.sep):
> -                ignore = '--exclude "%s"' % os.path.relpath(out_path,
> -                                                            start=elbe_dir)
> +                opts.append('--exclude "%s"' %
> +                            os.path.relpath(out_path, start=elbe_dir))
>  
> +            opts.append("--exclude-vcs")
> +            opts.append("--exclude-vcs-ignores")
> +            opts.append("--exclude='elbe-build*'")
> +            opts.append("--exclude='docs/*'")
>              tar_fname = os.path.join(out_path, "elbe-devel.tar.bz2")
>              system('tar cfj "%s" %s -C "%s" .' % (tar_fname,
> -                                                  ignore,
> +                                                  " ".join(opts),
>                                                    elbe_dir))
> -- 
> 2.26.2
> 
> 
> _______________________________________________
> elbe-devel mailing list
> elbe-devel at linutronix.de
> https://lists.linutronix.de/mailman/listinfo/elbe-devel

-- 
Torben Hohn
Linutronix GmbH | Bahnhofstrasse 3 | D-88690 Uhldingen-Mühlhofen
Phone: +49 7556 25 999 18; Fax.: +49 7556 25 999 99

Hinweise zum Datenschutz finden Sie hier (Informations on data privacy 
can be found here): https://linutronix.de/kontakt/Datenschutz.php

Linutronix GmbH | Firmensitz (Registered Office): Uhldingen-Mühlhofen | 
Registergericht (Registration Court): Amtsgericht Freiburg i.Br., HRB700 
806 | Geschäftsführer (Managing Directors): Heinz Egger, Thomas Gleixner



More information about the elbe-devel mailing list