<div dir="ltr">It indeed worked as squashfs image. Thanks for that.<div><br></div><div>It is not working as a folder though (portablectl --runtime attach --extension=./stackupper ./base stackupper) This stuff should work on folders too right? Should I open a ticket? </div><div><br></div><div>Also, when it works, the upper stack shows as detached. Isn't that wrong too? Should I open a ticket?</div><div><br></div><div><font face="monospace" size="1">root@osboxes:/home/osboxes/Development# portablectl attach --runtime --extension $PWD/stackupper.raw $PWD/base.raw stackupper<br>(Matching unit files with prefixes 'stackupper'.)<br>Created directory /run/systemd/system.attached.<br>Created directory /run/systemd/system.attached/stackupper.service.d.<br>Written /run/systemd/system.attached/stackupper.service.d/20-portable.conf.<br>Created symlink /run/systemd/system.attached/stackupper.service.d/10-profile.conf → /usr/lib/systemd/portable/profile/default/service.conf.<br>Copied /run/systemd/system.attached/stackupper.service.<br>Created symlink /run/portables/stackupper.raw → /home/osboxes/Development/stackupper.raw.<br>Created symlink /run/portables/base.raw → /home/osboxes/Development/base.raw.<br>root@osboxes:/home/osboxes/Development# portablectl list<br>NAME       TYPE RO CRTIME                      MTIME                       USAGE  STATE           <br>base       raw  no Wed 2021-10-20 10:54:41 EDT Wed 2021-10-20 10:54:41 EDT 920.0K attached-runtime<br>stackupper raw  no Wed 2021-10-20 10:54:57 EDT Wed 2021-10-20 10:54:57 EDT 36.0K  <font color="#ff0000">detached</font></font><br><br><br></div><div>Thanks again</div><div>Umut</div></div><br><div class="gmail_quote"><div dir="ltr" class="gmail_attr">On Wed, Oct 20, 2021 at 12:01 AM Luca Boccassi <<a href="mailto:bluca@debian.org">bluca@debian.org</a>> wrote:<br></div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left-width:1px;border-left-style:solid;border-left-color:rgb(204,204,204);padding-left:1ex">On Tue, 2021-10-19 at 16:09 +0200, Umut Tezduyar Lindskog wrote:<br>
> Hi Luca, have you had time to help me out or do you think you could<br>
> help me<br>
> out? Thanks in advance.<br>
<br>
Works fine for me with systemd 249.5:<br>
<br>
$ tar xf ~/Downloads/portable.tar<br>
$ mksquashfs base/ base.raw<br>
Parallel mksquashfs: Using 4 processors<br>
Creating 4.0 filesystem on base.raw, block size 131072.<br>
[=======================================================================================================|] 23/23 100%<br>
<br>
Exportable Squashfs 4.0 filesystem, gzip compressed, data block size 131072<br>
        compressed data, compressed metadata, compressed fragments,<br>
        compressed xattrs, compressed ids<br>
        duplicates are removed<br>
Filesystem size 918.80 Kbytes (0.90 Mbytes)<br>
        39.83% of uncompressed filesystem size (2306.95 Kbytes)<br>
Inode table size 359 bytes (0.35 Kbytes)<br>
        35.69% of uncompressed inode table size (1006 bytes)<br>
Directory table size 319 bytes (0.31 Kbytes)<br>
        62.80% of uncompressed directory table size (508 bytes)<br>
Number of duplicate files found 3<br>
Number of inodes 29<br>
Number of files 9<br>
Number of fragments 2<br>
Number of symbolic links 0<br>
Number of device nodes 0<br>
Number of fifo nodes 0<br>
Number of socket nodes 0<br>
Number of directories 20<br>
Number of ids (unique uids + gids) 1<br>
Number of uids 1<br>
        luca (1000)<br>
Number of gids 1<br>
        luca (1000)<br>
$ mksquashfs stackupper/ stackupper.raw<br>
Parallel mksquashfs: Using 4 processors<br>
Creating 4.0 filesystem on stackupper.raw, block size 131072.<br>
[=========================================================================================================|] 3/3 100%<br>
<br>
Exportable Squashfs 4.0 filesystem, gzip compressed, data block size 131072<br>
        compressed data, compressed metadata, compressed fragments,<br>
        compressed xattrs, compressed ids<br>
        duplicates are removed<br>
Filesystem size 33.94 Kbytes (0.03 Mbytes)<br>
        41.81% of uncompressed filesystem size (81.18 Kbytes)<br>
Inode table size 269 bytes (0.26 Kbytes)<br>
        34.98% of uncompressed inode table size (769 bytes)<br>
Directory table size 261 bytes (0.25 Kbytes)<br>
        58.78% of uncompressed directory table size (444 bytes)<br>
Number of duplicate files found 2<br>
Number of inodes 24<br>
Number of files 5<br>
Number of fragments 1<br>
Number of symbolic links 1<br>
Number of device nodes 0<br>
Number of fifo nodes 0<br>
Number of socket nodes 0<br>
Number of directories 18<br>
Number of ids (unique uids + gids) 1<br>
Number of uids 1<br>
        luca (1000)<br>
Number of gids 1<br>
        luca (1000)<br>
$ sudo portablectl attach --runtime --extension $PWD/stackupper.raw $PWD/base.raw stackupper<br>
(Matching unit files with prefixes 'stackupper'.)<br>
Created directory /run/systemd/system.attached.<br>
Created directory /run/systemd/system.attached/stackupper.service.d.<br>
Written /run/systemd/system.attached/stackupper.service.d/20-portable.conf.<br>
Created symlink /run/systemd/system.attached/stackupper.service.d/10-profile.conf → /usr/lib/systemd/portable/profile/default/service.conf.<br>
Copied /run/systemd/system.attached/stackupper.service.<br>
Created symlink /run/portables/stackupper.raw → /tmp/portable/stackupper.raw.<br>
Created symlink /run/portables/base.raw → /tmp/portable/base.raw.<br>
$ sudo systemctl start stackupper<br>
$ systemctl status stackupper<br>
○ stackupper.service<br>
     Loaded: loaded (/run/systemd/system.attached/stackupper.service; static)<br>
    Drop-In: /run/systemd/system.attached/stackupper.service.d<br>
             └─10-profile.conf, 20-portable.conf<br>
     Active: inactive (dead)<br>
<br>
Oct 19 22:57:16 luca-desktop tree[100886]: |   |   |   |   |-- oom_score<br>
Oct 19 22:57:16 luca-desktop tree[100886]: |   |   |   |   |-- oom_score_adj<br>
Oct 19 22:57:16 luca-desktop tree[100886]: |   |   |   |   |-- pagemap<br>
Oct 19 22:57:16 luca-desktop tree[100886]: |   |   |   |   |-- patch_state<br>
Oct 19 22:57:16 luca-desktop tree[100886]: |   |   |   |   |-- personality<br>
Oct 19 22:57:16 luca-desktop tree[100886]: |   |   |   |   |-- projid_map<br>
Oct 19 22:57:16 luca-desktop tree[100886]: |   |   |   |   |-- root -> [Error\ reading\ symbolic\ link\ information]<br>
Oct 19 22:57:17 luca-desktop systemd[1]: stackupper.service: Deactivated successfully.<br>
Oct 19 22:57:17 luca-desktop systemd[1]: Finished stackupper.service.<br>
Oct 19 22:57:17 luca-desktop systemd[1]: stackupper.service: Consumed 1.022s CPU time.<br>
<br>
> On Mon, Oct 18, 2021 at 12:56 PM Umut Tezduyar Lindskog<br>
> <<a href="mailto:umut@tezduyar.com" target="_blank">umut@tezduyar.com</a>><br>
> wrote:<br>
> <br>
> > Hi again. I tried renaming (<br>
> > <a href="https://www.freedesktop.org/software/systemd/man/os-release.html" rel="noreferrer" target="_blank">https://www.freedesktop.org/software/systemd/man/os-release.html</a>) it<br>
> > but<br>
> > that didn't work. I am not getting any errors during the attachment<br>
> > phase<br>
> > so I am not sure if the failure is due to extension file in any way.<br>
> > <br>
> > A wish list is to be more verbose regarding what is going on during<br>
> > extension file check/comparison and during overlaying /usr and /opt.<br>
> > I<br>
> > think portablectl is quite verbose when it comes to preparing files,<br>
> > symb<br>
> > links and what I wish fits well.<br>
> > <br>
> > Could you please try it yourself? I put them in<br>
> > <a href="https://drive.google.com/file/d/1LoN_swR7jgvo5yxajWjYK5ck_e8kJs1W/view?usp=sharing" rel="noreferrer" target="_blank">https://drive.google.com/file/d/1LoN_swR7jgvo5yxajWjYK5ck_e8kJs1W/view?usp=sharing</a><br>
> > there should be a download button on the top right. Appreciate your<br>
> > help.<br>
> > <br>
> > Thanks,<br>
> > Umut<br>
> > <br>
> > <br>
> > On Fri, Oct 15, 2021 at 3:46 PM Luca Boccassi <<a href="mailto:bluca@debian.org" target="_blank">bluca@debian.org</a>><br>
> > wrote:<br>
> > <br>
> > > On Fri, 2021-10-15 at 14:59 +0200, Umut Tezduyar Lindskog wrote:<br>
> > > > Thanks and I would have never figured it out without your help.<br>
> > > > However, moving the binary to /opt didn't work either (I made<br>
> > > > sure<br>
> > > > there is empty /opt in the base too). Anything else I am missing?<br>
> > > > <br>
> > > > root@osboxes:/home/osboxes/Development# tree stackupper/<br>
> > > > stackupper/<br>
> > > > ├── bin<br>
> > > > │   └── umut<br>
> > > > ├── dev<br>
> > > > ├── etc<br>
> > > > │   ├── machine-id<br>
> > > > │   ├── resolv.conf<br>
> > > > │   └── runtime<br>
> > > > ├── lib -> usr/lib<br>
> > > > ├── opt<br>
> > > > │   └── tree<br>
> > > > ├── proc<br>
> > > > ├── root<br>
> > > > ├── run<br>
> > > > ├── sys<br>
> > > > ├── tmp<br>
> > > > ├── usr<br>
> > > > │   ├── bin<br>
> > > > │   └── lib<br>
> > > > │       ├── extension-release.d<br>
> > > > │       │   └── extension-release.base<br>
> > > > │       └── systemd<br>
> > > > │           └── system<br>
> > > > │               └── stackupper.service<br>
> > > > └── var<br>
> > > >     └── tmp<br>
> > > > <br>
> > > > 18 directories, 7 files<br>
> > > > root@osboxes:/home/osboxes/Development# cat<br>
> > > > stackupper/usr/lib/systemd/system/stackupper.service<br>
> > > > [Service]<br>
> > > > Type=oneshot<br>
> > > > ExecStart=/opt/tree /<br>
> > > <br>
> > > The extension-release file in the extension must be named exactly<br>
> > > after<br>
> > > the extension (eg: foo.raw must contain /usr/lib/extension-<br>
> > > release.d/extension-release.foo), but in your case it's called<br>
> > > ".base"<br>
> > > which doesn't seem right, so double check that. This too is<br>
> > > documented<br>
> > > in the man page.<br>
> > > <br>
> > > > On Fri, Oct 15, 2021 at 2:23 PM Luca Boccassi <<a href="mailto:bluca@debian.org" target="_blank">bluca@debian.org</a>><br>
> > > > wrote:<br>
> > > > > On Fri, 2021-10-15 at 12:18 +0000, Umut Tezduyar Lindskog<br>
> > > > > wrote:<br>
> > > > > > Hi, following works for us (for reference, configuration is<br>
> > > > > printed<br>
> > > > > > at the end)<br>
> > > > > > <br>
> > > > > > portablectl --now attach --extension=./stackupper ./base<br>
> > > > > stackupper<br>
> > > > > > <br>
> > > > > > However, if we move the cat from base/usr/bin/cat to<br>
> > > > > > stackupper/bin/cat it is not working. Seems like we cannot<br>
> > > > > include<br>
> > > > > > any library/executable in the extension.<br>
> > > > > > <br>
> > > > > > Are we missing something?<br>
> > > > > > <br>
> > > > > > <br>
> > > > > > root@osboxes:/home/osboxes/Development# tree base/<br>
> > > > > > base/<br>
> > > > > > ├──bin<br>
> > > > > > ├──dev<br>
> > > > > > ├──etc<br>
> > > > > > │   ├── machine-id<br>
> > > > > > │   ├── os-release<br>
> > > > > > │   └── resolv.conf<br>
> > > > > > ├──lib<br>
> > > > > > │   └── x86_64-linux-gnu<br>
> > > > > > │       └── libc.so.6<br>
> > > > > > ├──lib64<br>
> > > > > > │   ├──<a href="http://ld-2.32.so" rel="noreferrer" target="_blank">ld-2.32.so</a><br>
> > > > > > │   └── ld-linux-x86-64.so.2<br>
> > > > > > ├──proc<br>
> > > > > > ├──root<br>
> > > > > > ├──run<br>
> > > > > > ├──sys<br>
> > > > > > ├──tmp<br>
> > > > > > ├──usr<br>
> > > > > > │   ├──bin<br>
> > > > > > │   │   ├──cat<br>
> > > > > > │   │   ├──echo<br>
> > > > > > │   │   └── tree<br>
> > > > > > │   └── lib<br>
> > > > > > │       └── systemd<br>
> > > > > > │           └── system<br>
> > > > > > └── var<br>
> > > > > >     └── tmp<br>
> > > > > > <br>
> > > > > > 18 directories, 9 files<br>
> > > > > > <br>
> > > > > > root@osboxes:/home/osboxes/Development# tree stackupper/<br>
> > > > > > stackupper/<br>
> > > > > > ├──bin<br>
> > > > > > │   └── umut<br>
> > > > > > ├──dev<br>
> > > > > > ├──etc<br>
> > > > > > │   ├── machine-id<br>
> > > > > > │   ├── resolv.conf<br>
> > > > > > │   └── runtime<br>
> > > > > > ├──lib -> usr/lib<br>
> > > > > > ├──proc<br>
> > > > > > ├──root<br>
> > > > > > ├──run<br>
> > > > > > ├──sys<br>
> > > > > > ├──tmp<br>
> > > > > > ├──usr<br>
> > > > > > │   ├──bin<br>
> > > > > > │   └── lib<br>
> > > > > > │       ├──extension-release.d<br>
> > > > > > │       │   └── extension-release.base<br>
> > > > > > │       └── systemd<br>
> > > > > > │           └── system<br>
> > > > > > │               └── stackupper.service<br>
> > > > > > └── var<br>
> > > > > >     └── tmp<br>
> > > > > > <br>
> > > > > > 17 directories, 6 files<br>
> > > > > > <br>
> > > > > > root@osboxes:/home/osboxes/Development# cat<br>
> > > > > > stackupper/usr/lib/systemd/system/stackupper.service<br>
> > > > > > [Service]<br>
> > > > > > Type=oneshot<br>
> > > > > > ExecStart=/usr/bin/cat /etc/os-release<br>
> > > > > > root@osboxes:/home/osboxes/Development#systemctl --version<br>
> > > > > > systemd 249 (249.4-1)<br>
> > > > > > +PAM +AUDIT +SELINUX +APPARMOR +IMA +SMACK +SECCOMP +GCRYPT<br>
> > > > > +GNUTLS -<br>
> > > > > > OPENSSL +ACL +BLKID +CURL +ELFUTILS -FIDO2 +IDN2 -IDN +IPTC<br>
> > > > > > +KMOD<br>
> > > > > > +LIBCRYPTSETUP -LIBFDISK +PCRE2 -PWQUALITY -P11KIT -QRENCODE<br>
> > > > > +BZIP2<br>
> > > > > > +LZ4 +XZ +ZLIB +ZSTD -XKBCOMMON +UTMP +SYSVINIT default-<br>
> > > > > > hierarchy=unified<br>
> > > > > <br>
> > > > > Hi,<br>
> > > > > <br>
> > > > > You need to build your extension with the binaries under either<br>
> > > > > the<br>
> > > > > /usr or /opt hierarchies. Legacy locations like /bin and /lib<br>
> > > > > are<br>
> > > > > ignored. This is explained in the systemd-sysext.8 manpage.<br>
> > > > > <br>
> > > <br>
> > > <br>
<br>
-- <br>
Kind regards,<br>
Luca Boccassi<br>
</blockquote></div>