-
Notifications
You must be signed in to change notification settings - Fork 15
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
PostInstall is broken in GoboLinux 017 #67
Comments
The different UnionFS implementations have always been challenging: at times, some of them would not work on the Live environment, whereas some others would show runtime bugs on the installed system. IIRC we even had different versions of Could you try to change this line: and move |
TL;DR:Changing Mount executes:
but the actual command (if mount -v -t overlay overlay -o lowerdir=/usr,upperdir=/.union_rw.tmp.MZF64mfUQ6x/usr,workdir=/.union_rw.tmp.5hs4MXnYVfG/usr /.union_mp.tmp.HDMuYbmyjtO/usr But fixing the mount command does not fix the PostInstall in the end. Which is why I suspect that PostInstall is supposed to run standalone outside of UnionSandbox. Before (or if :p) you read any further excuse me for the wall of text. Thanks for your input, that is actually the first thing I've tried. But the only thing it cosmetically changes is the error message:
The logical conclusion would be to understand why the mount command fails. But that is the wrong rabbit hole to get into 🥲 I am still gonna try to explain. The reason the mount command actually fails is, because it is being passed the wrong arguments:
That is completely unreadable because the same command is getting passed thrice (to upper, lower and workdir):
Actually it is supposed to be split like this: mount -v -t overlay overlay -o \
lowerdir=/.union_rw.tmp.GejezIVMqrK/Programs, \
upperdir=/Programs, \
workdir=/.union_rw.tmp.WcOeZ8ZUJJU/Programs \
/.union_mp.tmp.9irjB1HRaH7/Programs The reason that Lines 24 to 39 in c251900
The sed s in lines 30, 31, 32 are supposed to strip /.union_rw.tmp.GejezIVMqrK/Programs=rw:/Programs=rw:/.union_rw.tmp.WcOeZ8ZUJJU/Programs=tmp into essentially upper=/.union_rw.tmp.GejezIVMqrK/Programs
lower= /Programs
work= /.union_rw.tmp.WcOeZ8ZUJJU/Programs But that does not happen, because the At first I "fixed" the Lines 137 to 145 in c251900
In line 142 the variable $uniondirs is assigned. $uniondirs is being sed ed with | sed "s,$unionfsPackageDir=ro,$unionfsPackageDir=rw,g" , but as mentioned in my first post $unionfsPackageDir is an empty variable during the PostInstall execution! (but is correctly assigned during install step)
So So what happens is: echo "/.union_rw.tmp.GejezIVMqrK/Programs=rw:/Programs=ro:/.union_rw.tmp.WcOeZ8ZUJJU/Programs=tmp" | sed "s,=ro,rw,g" This basically replaces Because as mentioned before in Lines 24 to 39 in c251900
the three sed s in lines 30, 31, 32 (correctly) expect a rw..ro..tmp pattern. Therefore sed doesn't do anything here.
So mount -v -t overlay overlay -o lowerdir=/.union_rw.tmp.GejezIVMqrK/Programs=rw:/Programs=rw:/.union_rw.tmp.WcOeZ8ZUJJU/Programs=tmp,upperdir=/.union_rw.tmp.GejezIVMqrK/Programs=rw:/Programs=rw:/.union_rw.tmp.WcOeZ8ZUJJU/Programs=tmp,workdir=/.union_rw.tmp.GejezIVMqrK/Programs=rw:/Programs=rw:/.union_rw.tmp.WcOeZ8ZUJJU/Programs=tmp /.union_mp.tmp.9irjB1HRaH7/Programs which results in:
The only reason that
After that it simply proceeds. I have then 'fixed' all of this by removing the offending So basically I have managed to "fix":
as well as
But that will still result in a failed PostInstall:
??? That is why I suspect that PostInstall is not actually supposed to run in the unionSandbox. |
The last error you see is actually just stating that some files (var/mount) were modified when the UnionSandbox didn't expect them to be. There's an allow-list in its implementation that must account for changes to the mount table. Try changing the following line in
That should fix this particular problem. |
Thanks for making me aware of this! Sadly it didn't help.. Just to be sure I have changed it to Here's the output with some debug info: SandboxInstall: overlayfs is available. Using UnionSandbox.
SandboxInstall: Installing Tree...
mount: overlay mounted on /.union_mp.tmp.aszJurlF3c6/Programs.
mount: overlay mounted on /.union_mp.tmp.aszJurlF3c6/System.
mount: overlay mounted on /.union_mp.tmp.aszJurlF3c6/Data.
mount: overlay mounted on /.union_mp.tmp.aszJurlF3c6/Users.
mount: overlay mounted on /.union_mp.tmp.aszJurlF3c6/usr.
install -d /usr/local/bin
install -d /usr/local/man/man1
install tree /usr/local/bin/tree; \
install -m 644 doc/tree.1 /usr/local/man/man1/tree.1
UnionSandbox: Cleaning up.
UnionSandbox: Moving entries to: /Programs/Tree/6.6.6/.SandboxInstall_Root
sandbox_mp: /.union_mp.tmp.aszJurlF3c6
# ls -l $sandbox_mp
total 0
SandboxInstall: Postprocessing Sandbox
goboVariable /Data/Variable
removed directory './/Data/Variable/run/mount'
removed directory './/Data/Variable/run'
removed directory './/Data/Variable/tmp'
Compile: Stripping executables...
Compile: Running PostInstall for Tree
mount: overlay mounted on /.union_mp.tmp.FWu4Lkqq6sZ/Programs.
mount: overlay mounted on /.union_mp.tmp.FWu4Lkqq6sZ/System.
mount: overlay mounted on /.union_mp.tmp.FWu4Lkqq6sZ/Data.
mount: overlay mounted on /.union_mp.tmp.FWu4Lkqq6sZ/Users.
mount: overlay mounted on /.union_mp.tmp.FWu4Lkqq6sZ/usr.
Hello World!
UnionSandbox: Cleaning up.
UnionSandbox: Moving entries to: /Programs/Tree/6.6.6/.PostInstall_Root
sandbox_mp: /.union_mp.tmp.FWu4Lkqq6sZ
# ls -l $sandbox_mp
total 0
rmdir: failed to remove './run': No such file or directory
Compile: Postprocessing PostInstall changes.
Compile: PostInstall tried to change:
Data
Data/Variable
Data/Variable/run
Data/Variable/run/mount
Compile: Restoring safe copy *
Compile: Tree 6.6.6 - Failure in post-install operation. The cleanup seems to run for the first sandbox: removed directory './/Data/Variable/run/mount'
removed directory './/Data/Variable/run'
removed directory './/Data/Variable/tmp' But there is apparently no cleanup happening for the PostInstall sandbox (I have verified this by placing an echo log between the rm commands) 🤔 However frankly upon checking But Compile still classifies it as a failure in the end. |
@lucasvr Are you sure This is what the documentation states:
https://wiki.gobolinux.org/Recipes/Recipe-Format-Specification/index.html#postinstall |
I have noticed that
PostInstall
is completely broken on GoboLinux 017.Not sure why it has not yet been discovered. I have tried on a vanilla GoboLinux 017 installation as well as on my updated system and could reproduce on both. So this is a major issue.
I went down quite a rabbit hole.
The issue is as follows:
Assume we take a simple Program like
Tree
and add aPostInstall
script to/Data/Compile/Recipes/Tree/2.1.3/Resources/PostInstall
:make it executable:
chmod +x /Data/Compile/Recipes/Tree/2.1.3/Resources/PostInstall
.Upon trying to Compile the recipe, it fails with:
However I have "seemingly" discovered a workaround:
In
/System/Settings/Scripts/Directories.conf
we have to moveoverlayfs
to the bottom:Now the installation seems to succeed:
We see "Hello World!" being printed here and the installation does not register as fail.
However we also see some weird messages:
And actually that happens, because in:
Compile/bin/UnionSandbox
Lines 137 to 145 in c251900
in line 142
| sed "s,$unionfsPackageDir=ro,$unionfsPackageDir=rw,g"
does not correctly execute, because during PostInstall the variable$unionfsPackageDir
is empty (while it is correctly set during the normal install operation)! So the sed command is actually executed as| sed "s,=ro,=rw,g"
. This is definitely not intended.Therefore the value of
$uniondirs
is wrong at this point.The
overlayfs
implementation fails for that reason. But forunionfs-fuse
the operation is slightly different, as seen in lines 35-37:Compile/Functions/UnionFS
Lines 24 to 39 in c251900
Note that
$2
in this code is the wrongly assiged$uniondirs
from before.And for that reason, when using
unionfs-fuse
the output shows:(Note that the correct behaviour would be to assign
rw
.)When using
overlayfs
instead, it will completely fail with (above mentioned):So in my opinion the
unionfs-fuse
operation is just as flawed as withoverlayfs
. It seems to "work" for a simpleecho "Hello World"
but I doubt it would be able to actually manipulate the file system (as a proper PostInstall operation would).So at this point I am wondering:
Should the
PostInstall
operation even be run inside the UnionSandbox??If I understand correctly, it should just directly execute on the actual file system. Also the fact that the variable
$unionfsPackageDir
is empty during PostInstall indicates, that PostInstall was never intended to run in the UnionSandbox. I could be wrong.@lucasvr You seem to have written the code for this. Could you provide any input?
I do not know what the proper way to fix this would be at this point. It took me quite a lot of debugging to get to this point.
Thanks in advance! :)
The text was updated successfully, but these errors were encountered: