Butterknife moding

I almost always start with butterknife, but today I wanted to do some self-education on snapper instead of timeshift. The only thing I really need to do that on Debian is create an additional subvolume for sddm for the /var/lib/sddm directory. And of course I don’t need timeshift for this test. I can go back to the method that Drew did a while back on one of his most watched videos. But…

Is there a way to easily clone and mod butterknife so I could add subvolumes and add/remove packages?

Yeah, it’s not that challenging and appreciate you framing it as ā€œselfā€ education. Butterknife is plain Python, so you can mod it right from the live ISO without rebuilding anything. Boot it, drop to shell, and edit /opt/butterknife/lib/installer.py: add your subvolume to the BTRFS_SUBVOLS list near the top, swap packages in the apt list around line 265, and comment out the _configure_btrfs_snapshots(config) call to skip the timeshift setup. Then run /opt/butterknife/butterknife and install with network up (package changes only apply to the debootstrap path), and set up snapper yourself after first boot.

Heads up: butterknife wipes the whole disk, so use a VM or spare drive. Custom mods aren’t something I support, but the code’s all there.

Thanks, this is great help. I’ll get working on it today. I need something to do before happy hour. :grinning_face:

Thanks this was easy, I guess I can start happy hour early.

For those playing along at home, the experiment was making a modification that would allow for using butterknife to install a trxie Plasma system with btrfs but with snapper installed of timeshift. Not sure why, just wanted to try it.

So as Drew said, boot butterknife ISO then drop into shell. I added a subvol for sddm, which is part of what you need to boot read-only snapshots. Then I changed out some packages. Lastly, I commented out the ā€œ_configure_btrfs_snapshots(config)ā€.

Save everything and run /opt/butterknife/butterknife to start the install at the networking setup.

I probably missing a few minor things because to get snapper working with grub-btrfsd I had to remove the override.conf (timeshift version) and install grub-btrfs from the git repo so I could include a kernel parameter about the overlayfs.

So remarkable easy, thanks Drew for such a well thought out and organized set of scripts

1 Like

Hi there!

I’m currently looking to reinstall a few units with Debian btrfs and automatic snapshots. Spirallinux is nice, but there does not seem to be plans for a Trixie version. One thing that’s nice with spirallinux is its design to make itself redundant after installation so that you’re not dependant on the developer to keep supporting the distro, it’s basically just a custom installer for Debian.

From what I understand the automatic snapshots of butterbian is dependent on the continued support of the service that creates snapshots after apt?

Debian’s Snapper package already includes an APT hook. Once a working Snapper configuration named root exists, subsequent APT package operations automatically generate apt-labelled pre/post snapshots around APT’s dpkg invocations.

Forgive my ignorance, but what is the reason for the complicated workaround with timeshift? Wouldn’t snapper be an easier route, that would also create a wider audience for this distro?

Here’s my two cents. Snapper on Debian does tag each APT pre/post snapshot with just the word APT. So I created the same mod discussed here for 80snapper file in /etc/apt/apt.conf.d/ along with a similar script called snapper-apt-hook. I can post that if anyone cares.

But snapper creates read-only snapshots, so you need the tricks to include an overlayfs when you boot the snapshot. Can get complicated, but doable.

In my experience rollback with snapper is a risky undertaking that is different on different distros. Btrfs-assistant is a new app that makes it easier and safer. I also use btrfs-assistant to do the original creation of the config files for home and root. That makes sure the snapper subvol and matching directory get in the right place and manages the nesting subvols. Timeshift avoids all that by keeping the snapshots as a top Level 5.

Plus if your grub gets blown up, getting back to a working system is harder on snapper than Timeshift. With timeshift you can boot a Debian Live ISO and then install timeshift and run it. Choose btrfs and it will find your snapshots. You restore it and reboot.

So for me I like timeshift best for all the reasons I’ve mentioned and the one missing piece was a better description in the comments field. That’s what is coming soon and what I showed works today.

See this post for more on the apt hook:

timeshift hook

1 Like

New iso today.