[elbe-devel] [PATCH 2/3] commands init: Create initrd-tree

Olivier Dion dion at linutronix.de
Mon Jun 15 20:33:01 CEST 2020


On Mon, 15 Jun 2020, Torben Hohn <torben.hohn at linutronix.de> wrote:
>> +
>> +        if opt.devel:
>> +            to_cpy.append(("elbe-devel.tar.bz2", ""))
>> +
>> +        for src, dst in to_cpy:
>> +            src = os.path.join(out_path, src)
>> +            dst = os.path.join(out_path, "initrd-tree", dst)
>> +            print("Including %s in initrd at %s" % (src, dst))
>> +            try:
>> +                os.makedirs(dst)
>> +            except FileExistsError:
>> +                pass
>> +            shutil.copy(src, dst)
>
> I would prefer to have elbepack.filesystem.Filesystem
> used. it already defines mkdir_p() and glob()

This is rather difficult because rfs.glob return absolute paths (outside
the rfs) and rfs.mkdir_p work on relative (inside the rfs).

I could genere all absolute path and then used os.makedirs and shutil.copyfile.

>
>
>> -- 
>> 2.27.0
>> 
>> 
>> _______________________________________________
>> 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
-- 
Olivier Dion
Linutronix GmbH | Bahnhofstrasse 3 | D-88690 Uhldingen-Mühlhofen



More information about the elbe-devel mailing list