trungnt2910 / hyclone

A runtime environment for Haiku applications.

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

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.

image

We've been able to run package_daemon, but pkgman is still returning an error.

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

image

package_daemon works!

However, running pkgman will immediately crash the package_daemon due to a missing transfer_area syscall.

image

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.

Dirty as it may seem, pkgman can now conduct package searches on Linux:

image
image

image

pkgman install still needs some more work.

image

pkgman install is actually fixing broken dependencies on HyClone! WOW!

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 ioctls used to activate and deactivate packages are not implemented in HyClone's packagefs driver yet.
  • Sometimes downloads may be interrupted by a signal. HyClone uses a realtime signal to send "requests" to haiku_loader and monika from the server side. This signal has been registered with SA_RESTART so it should not make syscalls like read and write fail, but somehow pkgman just gets interrupted. There should be some more investigation into this. After some more research, the EINTR comes from libpackage when receiving a HTTP 416 for trying to retrieve an invalid range and not because of monika 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:

image

All the problems mentioned in the above comment has been fixed.

image

pkgman is also able to do an uninstall. I think this is enough to close this issue for now.