I decide to start a new thread for this specific how-to because it might distract from the discussion around the motivation of why one might want to do this. For a discussion of the motivation see:
"Updating Puppy 4, for learning and nostalgia"
It appears that for puppy 4, the list of files that make up the built-in packages aren't included...at least not to my knowledge. So for AttackPup, I created a list of files for the Built-In core/cli components:
cli_builtin_files-puppy4%28attackpup%29.tar.xz (also attached in an unfortunately a less compressed format)
I developed a list of core and CLI type file that either are typically built-into puppy but I also added a few files which aren't (e.g. strace and midnight commander) that I just wanted to make sure they were removed for good measure because I wanted to include these as part of a CLI based system. The list was originally developed by looking at /var/packages/DISTRO_PKGS_SPEC of upupGG+D groovy pup and so the list should be widly applicable if I say wanted to use it to isolate or remove a CLI from a newer puppy but then I looked to see what I missed when trying to use this to remove files from attack pup. The list is:
the package to be removed is on the left and on the right there is a comment (starting with a "#") that gives information about the DISTRO_PKGS_SPEC line I borrowed it from. Most of these comments will start with "#upupGG+D: " but there a few items that start with "#puppy4 that are specific to either puppy 4 or a derivative (e.g. attackpup).
Prior to removing these files I modify puppy4 to have the package infromation in the same place as newer versions of puppy. So /root/.packages is moved to /var/packages.
Code: Select all
if [ -d ./root/.packages ]; then
#mkdir -p ./var/packages
mv ./root/.packages ./var/packages
cd ./root
ln -s ../var/packages .packages
cd "$CWD"
fi
and then I patch in the missing list of files for each built-in package:
Code: Select all
[ ! -z "$BUILTIN_FILE_LIST_PATCH" ] && cp -arfv --remove-destination "${BUILTIN_FILE_LIST_PATCH}"/* "$TARGET"
Finally, I remove the list of built-in files:
Code: Select all
CHROOT_DIR="$TARGET" bash -x ./remove_builtin.sh --pkg-list uninstallsfs "$TARGET"
* -x option not necessary, last argument "$TARGET" isn't implemented yet so export CHROOT_DIR instead.
The function to remove the built-in files is here:
Once the desired built-in files are removed one might want to replace them with a different version (e.g. a newer version). To do this one could likely just copy over (or under) said files.
That said I created a more involved script that:
1. takes some care in both /etc and /root of which files to use
2. extracts both the replacement files and the puppy that is having certian built-ins packages removed
3. Sometimes (depending on the specified options) Modifies /etc/profile and /etc/ld.so.conf to use muti-arch subfolders.
4. Sometimes (depending on the specified options) moves files to the multi-arch folders.
5. Moves the ./packages folder to the new location, adds missing metadata for built-in files and calls the remove_builtin.sh function mentioned above.
Here is the complete script:
This last script "mv_extracted_stuff.sh" was first mentioned in the following post,
and was used to upgraded Puli/Xenial with files from "WDLGO_UbuntuFocal64.