Opened 23 months ago

Last modified 19 months ago

#18186 new enhancement

manual retrigger of post-install scripts

Reported by: kallisti5 Owned by: nobody
Priority: normal Milestone: Unscheduled
Component: Kits/Package Kit Version: R1/beta4
Keywords: Cc:
Blocked By: Blocking:
Platform: All

Description (last modified by kallisti5)

There doesn't appear to be a way to "manually reset" post-install scripts. While I can "touch ~/config/settings/first_login" to re-run the first_login scripts, there is no clear way to reset and re-run post-install scripts at boot (like sshd generating host keys). These are done via the package kit.

The usecase is sysprepping haiku installs (aka, we want the system to regenerate host keys on first boot... so the ssh host keys are manually erased before shutting down the host and making an image of it.

There should be a way to "manually re-trigger all post-install scripts on boot", much like the existence of "first_login in ~/config/settings/first_login

Change History (8)

comment:1 by kallisti5, 23 months ago

Description: modified (diff)

comment:2 by kallisti5, 23 months ago

There's some context for this here: https://cgit.haiku-os.org/haiku/commit/?id=3376ed1a72dc862faea22f98e4610bcf83760749

Essentially, sshd used to be the older first_login based script, however it was merged back into the more correct package kit post-install.

Looking at the commit above, it looks like a "manual re-run post-install scripts" touch file is needed as an override. (~/config/settings/redo_post_install or something?)

comment:3 by pulkomandy, 23 months ago

I'm not sure re-running all post install script is the right solution to this. It would work for ssh, but we have no idea what it would do for other packages.

I'm also not sure post-install is the right place to do this, either. Maybe we should do it when the service starts and the keys don't exist?

comment:4 by kallisti5, 23 months ago

Yeah, i thought about just checking for keys and re-generating them if missing.

We could technically turn the post-install script to a launchd service? Or maybe we need a /boot/system/boot/each_boot directory which just has everything in it executed on every boot? (that feels a bit less ideal though)

comment:5 by kallisti5, 23 months ago

I found a workaround... just don't boot from the disk. I can do the prep from the installation media, and manually copy over the needed hpkg's to the target new disk.

comment:6 by kallisti5, 23 months ago

... ack. That doesn't work. I need to upgrade the OS to get this fix: https://cgit.haiku-os.org/haiku/commit/?h=r1beta4&id=16abf336741cae0cc1e759152c15903aac8f2288

Last edited 23 months ago by kallisti5 (previous) (diff)

comment:7 by kallisti5, 23 months ago

hm. just saw packages/administrative/FirstBootProcessingNeeded on a freshly installed disk

comment:8 by pulkomandy, 19 months ago

Type: bugenhancement
Note: See TracTickets for help on using tickets.