What is the proper way to run something "on boot"?

Hello,

I’m still trying to come to grips with immutable OS concepts, so best to ask the community.

I have a relatively new laptop model: Yoga Pro 9i 16IMH9 (2024, Intel, Gen 9)

I am affected by this bug:
https://bugzilla.kernel.org/show_bug.cgi?id=217449

As a result, to work around this I need to run the script attached to that bug on every boot (basically the command 2pa-byps.sh 2 as root at startup).

What is the best way to achieve this in Bluefin?

I literally just found out how to switch between different base images here: My sylog is spammed by battery threshold failure messages (Yoga Pro 9i - 16IMH9) - SOLVED

  • Is this something you would define as specific to a base image? Is that even possible?
  • I suppose creating a /etc/systemd/system/myservice.service file and enabling it run on boot across all images?

I’m just wondering if populating /etc with “user stuff” defeats the purpose of using Bluefin? Is there a special location for “user customizations”?

This is the way

It does not defeat the purpose. The place to customize your system on the system-level is /etc. By the way: Every time you update to the next image, a snapshot of your current /etc is taken, so that when you roll back, your /etc also rolls back. And if you really screw up, then you can still restore the current “original” files from /usr/etc.

5 Likes

This is great. I think I will create a structure in /root/customization/... and simply link to it.

For example , this can be: /root/customization/etc/systemd/system/fix-yoga-speakers.service

Then I will symlink /etc/systemd/system/fix-yoga-speakers.service to point to that file. This way I can have all my stuff in the root user’s home, in one folder.

Man thanks. That’s very useful information. I’ve been paranoid taking manual snapshots of my /etc/ dir.