Changes between Initial Version and Version 1 of Ticket #14382, comment 5


Ignore:
Timestamp:
Nov 5, 2019, 8:27:40 AM (9 months ago)
Author:
ambroff

Legend:

Unmodified
Added
Removed
Modified
  • Ticket #14382, comment 5

    initial v1  
    11I started looking into this. I'm still learning how the package system works, but I think I see a few problems right off the bat.
    22
    3 Problem #1: The package daemon tries to load the activated-packages file from the incorrect location when initializing a new volume in [https://github.com/haiku/haiku/blob/f6f19105dccc07fcf567d1b6b243ffdb54eb2058/src/servers/package/Volume.cpp#L990 Volume::_InitLatestStateFromActivatedPackages()]. It tries to read /boot/system/packages/activated-packages instead of /boot/system/packages/administrative/activated-packages.
     3Problem 1: The package daemon tries to load the activated-packages file from the incorrect location when initializing a new volume in [https://github.com/haiku/haiku/blob/f6f19105dccc07fcf567d1b6b243ffdb54eb2058/src/servers/package/Volume.cpp#L990 Volume::_InitLatestStateFromActivatedPackages()]. It tries to read /boot/system/packages/activated-packages instead of /boot/system/packages/administrative/activated-packages.
    44
    55This should probably be something more like this (although I'm not totally sure I'm using the StorageKit API properly):
     
    2727
    2828
    29 Problem #2: Packages are marked as activated [https://github.com/haiku/haiku/blob/f6f19105dccc07fcf567d1b6b243ffdb54eb2058/src/servers/package/Volume.cpp#L975 if the activated-packages file is not found]. In the case of first boot after running the installer, there is no activated-packages file, so all packages are marked as activated even if the activation logic has not been performed.
     29Problem 2: Packages are marked as activated [https://github.com/haiku/haiku/blob/f6f19105dccc07fcf567d1b6b243ffdb54eb2058/src/servers/package/Volume.cpp#L975 if the activated-packages file is not found]. In the case of first boot after running the installer, there is no activated-packages file, so all packages are marked as activated even if the activation logic has not been performed.
    3030
    31 Problem #3: Nothing performs activation on boot. Even if activated-packages does exist, and a new package has been added to the packages dir to be activated at boot, the activation will not happen until the user [https://github.com/haiku/haiku/blob/f6f19105dccc07fcf567d1b6b243ffdb54eb2058/src/servers/package/CommitTransactionHandler.cpp#L614 initiates a new transaction], since that is the only place where activation logic is performed.
     31Problem 3: Nothing performs activation on boot. Even if activated-packages does exist, and a new package has been added to the packages dir to be activated at boot, the activation will not happen until the user [https://github.com/haiku/haiku/blob/f6f19105dccc07fcf567d1b6b243ffdb54eb2058/src/servers/package/CommitTransactionHandler.cpp#L614 initiates a new transaction], since that is the only place where activation logic is performed.
    3232
    3333The only place where activation will happen automatically is [https://github.com/haiku/haiku/blob/f6f19105dccc07fcf567d1b6b243ffdb54eb2058/src/servers/package/Root.cpp#L441 in response to a filesystem notification] that a package has been copied into the packages directory. Booting up after a fresh install and moving the openssh package out of /boot/system/packages and then moving it back at least gets it far enough to create users.