# Submitted by wiigelec 10 Jan, 2024 16:51 # |
---|
I'm in the process of testing several SMGL upgrade strategies. I'll outline the general strategies below, and provide updates as results come in. Please feel free to add to the discussion! Basically, there are four update strategies I'm testing: 1) Single-command upgrade Running 2) Targeted upgrade In this strategy, each component is upgraded individually or in groups in a more targeted manner. 3) Package style upgrade In this strategy, spells are cast in a "DESTDIR" style using INSTALL_ROOT and STATE_ROOT. The spell is built but not installed to the target system. Later the spell can be installed using resurrect and the cache file created during the cast. The benefit of this approach is the package contents can be inspected before being installed on the system which could reduce the chances of borking the system with a full cast on a bad spell. Also, groups of packages that may create dependency or linking issues can be pre-built together and then later resurrected in a way that sidesteps those issues. One drawback is, if a spell that is to be cast depends on another spell that is to be cast, the cast will fail because the dependency spell will not have been installed on the target system. 4) Chroot upgrade This strategy is similar to package style upgrade except the spells are cast in a chroot environment. This strategy could be particularly useful in a system that is several versions behind in updating and certain intermediate steps are required in a sorcery -s or targeted upgrade, such as an intermediary version of gcc needs to be installed to build the current grimoire version. Chroot upgrade works by installing the current chroot image and casting spells in the chroot using INSTALL_ROOT and STATE_ROOT. The caches can then be resurrected to the target system. An entire system should be able to be upgraded using this strategy without the need for any extra code in the grimoire to accommodate certain intermediary version requirements, dependency or linking issues. One caveat to this upgrade strategy is the resurrect may not work with the target system online. It may be necessary to boot into a live iso, mount the target system and resurrect the spells to the mounted system. In this case certain processing may be required on the cached packages, namely setting the correct values for INSTALL_ROOT and STATE_ROOT in the tablet roots files embedded in the cache file. This requires extracting each cache, running a sed command to set the correct INSTALL_ROOT and STATE_ROOT values, then recompressing the cache. Final (for now) thought on upgrades: One thing IMO that SMGL does backwards during upgrades is dispelling the old spell before installing the new spell. I believe a better approach is to install the new version of the spell over the top of the old spell then remove any unused files from the previous version. This same sentiment seems to be reflected by sobukus during the discussion of this bug report: https://bugs.sourcemage.org/show_bug.cgi?id=16100 This could be fairly easily implemented at the grimoire level, either a custom grimoire or for testing purposes, by bypassing the default_pre_install (remove from PRE_INSTALL file using |
# Submitted by wiigelec 10 Jan, 2024 19:14 # |
---|
lol well I already messed up as it's sorcery -s not sorcery -c |
# Submitted by wiigelec 11 Jan, 2024 14:14 # |
---|
Upgrade Test Setup Here is the setup I'm using for testing the upgrade strategies: Hardware is a Dell E6510 I got off ebay for <$100. The 500GB hard drive is partitioned into 6 75G partitions so I can install up to six separate OSs. In this case sda5 has slackware for installing the chroots, sda6 has chroot .62 (SMGL stable) and sda7 has chroot .63 (SMGL test). To set up SMGL stable and test, I extract the appropriate chroot tarball to the appropriate partition, mount the kernel file systems and chroot in. First thing we need is a kernel, so ...and I forgot to set a root password so back to slackware, chroot to sda6 and run Ok now we're in. Setup wifi with Once the networking is setup we'll backup the system. Reboot to slackware, mount sda6 and |
# Submitted by wiigelec 11 Jan, 2024 14:42 # |
---|
Single-pass Upgrade Test So the first test to run against SMGL stable is the single pass upgrade Except what happens isn't very magical. The first pass cast a few spells, failed a few more and dropped the majority. Since the system didn't seem broken I went ahead and ran One solution I can see for this is to bypass the dispel so that so.3 does not get removed. Then the dependent spells cast before gmp upgrade will still be linked to so.3 while spells cast after gmp upgrade will (should) be linked to so.10 and in the meantime binaries that need it will still have so.3 to link to. Another pass ( And keep in mind, gmp breaking the system here was only a matter of timing. There are many many other library upgrades that will cause the same--or worse--issues. Fixing gmp will be like cutting the head off hydra; another one will grow in to take its place. Even if every library breakage were able to be accounted for, the system would likely need to be sorcery -r over and over again to straighten out the mountain of dependent dynamic linkages. Additionally, there is no guarantee that any given binary will actually link to the newer version of a library if both new and old libraries are present. To me it seems like a losing battle trying to fix this in the grimoire. It appears Gentoo uses a preserve-libs strategy to account for this, so maybe something like this could be implemented: https://wiki.gentoo.org/wiki/Preserve-libs However, in my mind, the best way given the current code base and dev time-to-contribute to really solve this issue is via a well documented chroot upgrade strategy. |
# Submitted by wiigelec 31 Jan, 2024 14:50 # |
---|
Create Packages Creating packages is easy: What "packages" do we need to create in order to upgrade our system? Well in a perfect world, we would run To get a list of currently installed spells run Once the gaze_installed file is satisfactory, go ahead and enter the .63 chroot and run I just want to note at this point that, in my always humble opinion, this whole process of trying to upgrade a many year old stable system is both trying and tedious. In my mind it should not be accommodated for in the grimoire, nor supported by the Sourcemage dev team. Sure it's fun and challenging to try and get this to work, but in my mind it ends up creating a big mess in the grimoire, like having multiple versioned spells of gnupg and gcc to make it work, rather than a single gnupg or gcc spell that gets version updates. The best path forward in my opinion at this point is to rebuild and clone your system using the new .63 "test". The way I do this is I always create at least 2 root partitions. Current stable would be running in root1 and then I would clone a .63 system in root2. This allows me to get the root2 system up to snuff while still having the root1 system available if I need it. I can also use one or the other for a chroot host in case something breaks. Of course the back and forth booting from root1 to root2 would not be acceptable on a production system, but if you're running a production system with software as out-of-date as SMGL stable-especially one connected to the internet, well I don't know what to tell you there. |