I’ve been expanding my user_commands.bash to do post-install things, and I’m hitting a curious road bump on one specific issue, and hoping another pair of eyes might help out in this.
That’s the script itself. The part that’s specifically giving me trouble is pre-setting up snapper. For whatever reason, the snapper config is never created, and I don’t see any reason why not? The snapper-support package is supposed to be creating the config, I’m manually attempting again, after the package install, and seeing no output… I’m not sure what’s the issue here. Or if I have to create a post-install script to run at first boot or something.
set BTRFS as default and only option result in this… filesystem option chooser is hidden only swap choice is there and it uses the set BTRFS scheme and indeed using BTRFS
I was looking at this after you mentioned it. and this seems to be the snapper create config during the installation process, not the one after the pacman execution to install snapper-support.
I’m going to put in some echo’s in the script, and see if I can capture that a bit better.
post_install() {
# Change grub snapshot submenu name
if [ -e /etc/lsb-release ]; then
echo "Using default grub snapshot submenu name"
else
sed -i /etc/default/grub-btrfs/config \
-e "s,.*GRUB_BTRFS_SUBMENUNAME=.*,GRUB_BTRFS_SUBMENUNAME=\"$(sed '/^NAME=/!d;s/NAME=//;s/"//gm' /etc/os-release) snapshots\","
echo "Generating grub snapshot submenu name from /etc/os-release values"
fi
if [[ $(/usr/bin/systemctl is-enabled grub-btrfs.path) == "enabled" ]]; then
/usr/bin/systemctl disable --now grub-btrfs.path;
fi
echo "Enabling automatic rebuild of grub-btrfs when snapshots are taken"
/usr/bin/systemctl daemon-reload
/usr/bin/systemctl enable --now grub-btrfs-snapper.path
/usr/bin/systemctl enable --now snapper-cleanup.timer
#/usr/bin/systemctl enable snapper-timeline.timer
echo "Creating snapper config for root"
/usr/bin/snapper create-config --template garuda /
if ! mkinitcpio_has_grub_btrfs_overlayfs_hook; then
sed -re 's/(^HOOKS=[\"|(][^")]+)/\1 grub-btrfs-overlayfs/gi' -i /etc/mkinitcpio.conf
fi
}
Here is the corresponding part of your journal:
[PYTHON JOB]: "installing snapper-support...\n"
[PYTHON JOB]: "Using default grub snapshot submenu name\n"
[PYTHON JOB]: "Enabling automatic rebuild of grub-btrfs when snapshots are taken\n"
[PYTHON JOB]: "Running in chroot, ignoring command 'daemon-reload'\n"
[PYTHON JOB]: "Created symlink /etc/systemd/system/multi-user.target.wants/grub-btrfs-snapper.path -> /usr/lib/systemd/system/grub-btrfs-snapper.path.\n"
[PYTHON JOB]: "System has not been booted with systemd as init system (PID 1). Can't operate.\n"
[PYTHON JOB]: "Failed to connect to bus: Host is down\n"
[PYTHON JOB]: "Created symlink /etc/systemd/system/timers.target.wants/snapper-cleanup.timer -> /usr/lib/systemd/system/snapper-cleanup.timer.\n"
[PYTHON JOB]: "System has not been booted with systemd as init system (PID 1). Can't operate.\n"
[PYTHON JOB]: "Failed to connect to bus: Host is down\n"
[PYTHON JOB]: "Creating snapper config for root\n"
[PYTHON JOB]: "Failure (org.freedesktop.DBus.Error.FileNotFound).\n"
[PYTHON JOB]: "grep: /etc/mkinitcpio.conf: No such file or directory\n"
[PYTHON JOB]: "sed: can't read /etc/mkinitcpio.conf: No such file or directory\n"
[PYTHON JOB]: "error: command failed to execute correctly\n"
The post install script already runs /usr/bin/snapper create-config --template garuda / and gets Failure (org.freedesktop.DBus.Error.FileNotFound).
The second time this command is run (from your script) there isn’t an echo like in the post-install script, but you can still spot it since it happens after that batch of package installations, but before the hypervisor bit:
[...]
[PYTHON JOB]: "(5/7) Updating the info directory file...\n"
[PYTHON JOB]: "(6/7) Updating the desktop file MIME type cache...\n"
[PYTHON JOB]: "(7/7) Performing snapper post snapshots for the following configurations...\n"
[PYTHON JOB]: "Failure (org.freedesktop.DBus.Error.FileNotFound).\n"
[PYTHON JOB]: "[ 0.000000] Hypervisor detected: KVM\n"
[PYTHON JOB]: "[ 0.000000] Hypervisor detected: KVM\n"
[...]
Like you mentioned, there is no echo on your script to call it out but it is the same error message and that’s the right place for it.
I still think you should try adding the --no-dbus option to your snapper create-config command.
Confirmed! It was, but it was where to use it. snapper --no-dbus create-config, not snapper create-config --no-dbus.
Course now I see snapshots after the fact. The eos_bootloader installation I see the pacman calls to install grub, eos-dracut, and os-prober. heh
Does EndeavourOS, or Arch in general, have a means to possibly handle putting this process in the first boot, and never run again, or delete itself, or would I basically need to create a rc.local type thing that runs at boot and disables and deletes itself?
If you are saying you would prefer the bootloader installation stuff be set up before the snapper stuff, one thing you could try would be adding the bootloader installation commands manually into your user_commands.bash script so it could be deployed in whatever part of the sequence you wish, and then switch your EOS installation to the “no bootloader” choice.
No you got the meaning perfectly. But, I changed things up a bit, created a simple 1strun.service, and 1strun.sh. and voila! Snapper instantiates during first boot is done, and the scripts are self-deleting, and clean.