[haiku-bugs] Re: [Haiku] #14382: Package kit boot activation doesn't create users
- From: "Haiku" <trac@xxxxxxxxxxxx>
- To: undisclosed-recipients: ;
- Date: Fri, 24 Apr 2020 00:35:08 -0000
#14382: Package kit boot activation doesn't create users
-------------------------------+----------------------------
Reporter: kallisti5 | Owner: agmsmith
Type: bug | Status: assigned
Priority: high | Milestone: R1/beta2
Component: Kits/Package Kit | Version: R1/Development
Resolution: | Keywords:
Blocked By: | Blocking:
Platform: All |
-------------------------------+----------------------------
Comment (by AGMS):
Problem 1: Incorrect location of activated-packages file.
It somehow finds the file and uses it. The confusion may be about the
error message which is about where it finds the packges, not the control
file. No changes needed for this one.
Problem 2: Packages are marked as activated if the activated-packages
file is not found.
Actually makes sense. Otherwise the only packages available while booting
up are the ones which loaded the kernel (SCSI driver and file system).
Which is why it would crash later on in launch_daemon if you had an empty
activated-packages file. Presumably a sensible set of files was put there
during the install and we don't need to worry about dependencies; just
activate them all. Need this behaviour.
The other trouble is that sometimes the activated-packages file is deleted
by the user as a way to save space, so we can't detect which packages need
to do their post install actions. Again activating all of them and not
doing installation activities makes sense.
Problem 3: Nothing performs activation on boot.
That is the real problem, for first boot. Can't do it too early,
otherwise the OS won't be fully running. So it can't be in the second
stage boot loader or the kernel initial package activation.
Change
https://review.haiku-os.org/c/haiku/+/2342 does find files in the
packages directory not known to be activated (you have to have enough
files in the initial activation list to be able to boot, then it works),
and activates them, adding them to the control file and mounting their
package file. But it doesn't run the install stuff.
The current hack is for launch_daemon to detect first boot and run all the
scripts in the boot/post-install directory. A better hack would be to do
the full set of package install operations for all packages, which
includes creating users and running the install scripts more properly (the
ones specified in .PackageInfo, not just all ones in the directory).
We could fake it by uninstalling everything and reinstalling. But besides
being dicy for running programs, it may need network access.
So, I'm thinking of adding a package kit function to do the post install
stuff, without the actual install - creating users and running scripts and
that config file creation action and so on for all packages. Should it
also do a consistency check? Though that would require network access,
which we don't have. Perhaps expose the function as "pkgman firstboot"
and have the launch_daemon call that when it detects first boot. Unless I
hear otherwise, I'll start working on that.
--
Ticket URL: <
https://dev.haiku-os.org/ticket/14382#comment:16>
Haiku <
https://dev.haiku-os.org>
The Haiku operating system.
Other related posts: