pkgman support
trungnt2910 opened this issue · comments
While filesystem and network emulation has been implemented in Hyclone, pkgman still requires some magic port to communicate with the kernel.
This magic port's specification is still unknown by Hyclone and undocumented by Haiku.
Currently package_daemon
requires specific details related to mounted volumes.
It would now be necessary to rewrite the whole way HyClone emulates the filesystem. The vchroot
mechanism that is currently living in haiku_loader
should be completely re-written in HyClone server instead.
It does not need to be something complicated like fs_shell
, probably just a function that translates paths (a more robust solution to the current vchroot
), and statbufs (necessary for us to establish full control over dev_t
, and probably uid_t
and gid_t
in the not so far future.
As of 9ab2cf6 the features mentioned above has been implemented.
package_daemon
is now stuck when trying to communicate with the packagefs
driver through a magic ioctl
:
if (ioctl(fd.Get(), PACKAGE_FS_OPERATION_GET_VOLUME_INFO, info,
bufferSize) != 0) {
ERROR("Volume::Init(): failed to get volume info: %s\n",
strerror(errno));
RETURN_ERROR(errno);
}
This is closely related to #2
As of 70e6ff8, pkgman search
can run without crashing either itself or package_daemon
. transfer_area
also works properly, as shown in the test below (taken from Haiku's test).
The error, No matching packages found.
, is probably due to HyClone not being configured with Haiku's default package sources.
Currently, pkgman
can resolve dependencies and install packages for us. However:
- All installations require a restart (of HyClone, not of the host). This is because some magic
ioctl
s used to activate and deactivate packages are not implemented in HyClone'spackagefs
driver yet. Sometimes downloads may be interrupted by a signal. HyClone uses a realtime signal to send "requests" toAfter some more research, thehaiku_loader
andmonika
from the server side. This signal has been registered withSA_RESTART
so it should not make syscalls likeread
andwrite
fail, but somehowpkgman
just gets interrupted. There should be some more investigation into this.EINTR
comes fromlibpackage
when receiving a HTTP 416 for trying to retrieve an invalid range and not because ofmonika
really getting interrupted.- [WSL1 only] WSL1 does not support extended file attributes, therefore lots of (non-fatal) errors will occur during installation as
pkgman
heavily depends on extended attributes in its operation.
With extended attributes implemented in 6f657e2 and the rest of the VFS subsystem polished, HyClone is now able to do a full-sync
:
All the problems mentioned in the above comment has been fixed.