Skip to content
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

pkgman support #4

Closed
trungnt2910 opened this issue Oct 4, 2022 · 11 comments
Closed

pkgman support #4

trungnt2910 opened this issue Oct 4, 2022 · 11 comments
Assignees
Labels
enhancement New feature or request hacktoberfest help wanted Extra attention is needed

Comments

@trungnt2910
Copy link
Owner

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.

@trungnt2910 trungnt2910 added enhancement New feature or request help wanted Extra attention is needed hacktoberfest labels Oct 4, 2022
@trungnt2910
Copy link
Owner Author

image

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

@trungnt2910
Copy link
Owner Author

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.

@trungnt2910
Copy link
Owner Author

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

@trungnt2910 trungnt2910 self-assigned this Apr 6, 2023
@trungnt2910
Copy link
Owner Author

image

package_daemon works!

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

@trungnt2910
Copy link
Owner Author

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.

@trungnt2910
Copy link
Owner Author

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

image
image

@trungnt2910
Copy link
Owner Author

image

pkgman install still needs some more work.

@trungnt2910
Copy link
Owner Author

image

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

@trungnt2910
Copy link
Owner Author

trungnt2910 commented Apr 8, 2023

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.

@trungnt2910
Copy link
Owner Author

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.

@trungnt2910
Copy link
Owner Author

image

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request hacktoberfest help wanted Extra attention is needed
Projects
None yet
Development

No branches or pull requests

1 participant