so if the work I'm going to describe has been done then this thread is primary as a learning exercise for me. Otherwise, it is the shortest path forward for me and possibly others.
Puppies remaster script basically turns your currently running puppy into an iso (or basesfs or adrv). Everything is copied except for select folders such as (home, root, etc, and var) In these select folders the info is copied from the base iso and selected mods are made (e.g. meta information about which packages are installed and possibly hardware customizations depending on the user selection).
My first issue is that the remaster script might miss a lot of changes in these select folders. I created scripts to try to address this (see post). Of course with these scripts there is a greater risk of copying private information. Consequently one has to take a closer look at their save file prior to remastering.
In these scripts, I copy directly from the save file. This means that I might copy some whiteout files. I need to give more thought on how to handle whiteout files.
Now since puppy treats each of these select folders separately one can't copy based on following symlinks. This might not be an issue if each select folder is dealt with properly. However, in my mod of this script I will first create all these select folders prior to merging any of them into the sfs. This way if needed we can at least follow symlinks from one of these folders to another.
Secondly, if someone has enough space then they might want to first copy everything to a temporary work space prior to creating the sfs file. This would for instance allow people to chroot into the temporary folder and make changes. To allow this my strategy is to create a wrapper function for mksquashfs. Depending on the settings one will either directly merge to the squashfile or instead copy the info to a temporary file.
Here is some draft code (not tested yet):
echo $0 $@
rxvt -bg orange -fg black -title "$m_01" -geometry 80x6 -e mksquashfs $@ 2> /dev/null
echo $0 $@
#s243a: use set -x to echo cpio commands in fk_mksquashfs and pass to rxvt
#rxvt -bg orange -fg black -title "$m_01" -geometry 80x6 -e mksquashfs $@ 2> /dev/null
fk_mksquashfs $@ #Short term hack
if [ "$mode" = dir ]; then
out=() #Currently not used
declare -A exludes
for arg in "$@";do
if [[ "$arg" == -* ]]; then
case "$arg" in
case option in
exludes+=( ["$arg"]=1 ) ;;
args+=( "$arg" ) ;;
out+=( "$arg" ) ;;
mkdir -p "$target_dir"
unset 'args[$n_args-1]' #https://stackoverflow.com/questions/8247433/remove-the-last-element-from-an-array
#while read aDir; do
if [ realpath "$target_dir" != "/" ]; then
for aDir in "$args[@]"; do
[ -z "$excluded" ] && excluded=0
if [ ! $excluded -eq 1 ]; then
cpio -pd "$target_dir"
#done < <(ls -a -1)
if [ "$mode" = dir ]; then
Now, I know that changes are being made to remasterpup2 on woof-CE but am working on a woof-next fork so I don't have to go in the same direction.
the fk_makesquashfs stands for "fake make squash file system". The functions prefixed with do are to select between the real and fake versions based on the settings within the script.
The complete preliminary/untested code can be found at: https://pastebin.com/y0cSmdGT. I will test later today and modify the content at this link.
P.S. I might give the option to clean up each select file as one goes but instead one can chose to wait until all select folders are created before merging the content into the sfs. _________________ Find me on minds and on pearltrees.
You cannot post new topics in this forum You cannot reply to topics in this forum You cannot edit your posts in this forum You cannot delete your posts in this forum You cannot vote in polls in this forum You cannot attach files in this forum You can download files in this forum