2

I am using a dual boot setup of Arch Linux and Ubuntu. GRUB is installed on the Ubuntu partition and this leads to unwanted changes to grub.cfg after installing updates from within Ubuntu (specifically loosing Intel microcode initrd specifications). Currently I fix this manually by editing the grub.cfg file now and then.

I want to automate this and therefore wrote a python script that reads in grub.cfg and edits the appropriate lines. This python script shall be executed from within a shell script after each boot of Arch. For this I wrote the shell script and made it executable. I am now wondering what would be the best way to start this script automatically. For example are there any pros and cons between cron or systemd services? To edit the grub.cfg file I need to mount and umount the Ubuntu root partition where the file exists.

1
  • I am not sure how another custom entry would change the way the other entries are recreated after installing updates. For example initrd /boot/intel-ucode.img /boot/initramfs-linux.img will be changed to initrd /boot/initramfs-linux.img. – conste Jan 12 '19 at 16:31
1

/etc/rc.local is the normal place to run things after bootup.

Make sure it's executable, that it begins with #!/bin/sh (or #!/usr/bin/env python if you prefer that), and that systemd's rc-local service is enabled (systemctl status rc-local).

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.