(OLD) (ARCHIVED) Puppy Linux Discussion Forum Forum Index (OLD) (ARCHIVED) Puppy Linux Discussion Forum
Puppy HOME page : puppylinux.com
"THE" alternative forum : puppylinux.info

This forum can also be accessed as http://oldforum.puppylinux.com
It is now read-only and serves only as archives.

Please register over the NEW forum
and continue your work there. Thank you.

 FAQFAQ   SearchSearch   MemberlistMemberlist   UsergroupsUsergroups    
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

The time now is Thu 24 Sep 2020, 02:02
All times are UTC - 4
 Forum index » Off-Topic Area » Programming
Proposed mods to puppies Remaster Script
This forum is locked: you cannot post, reply to, or edit topics.   This topic is locked: you cannot edit posts or make replies. View previous topic :: View next topic
Page 1 of 1 [1 Post]  
Author Message

Joined: 02 Sep 2014
Posts: 2626

PostPosted: Tue 06 Aug 2019, 11:53    Post subject:  Proposed mods to puppies Remaster Script
Subject description: for my woof-next fork

I know that a lot of work has been done on remastering scripts and various tools can be found in the following thread:


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):


   squash() {
      echo $0 $@
      rxvt -bg orange -fg black -title "$m_01" -geometry 80x6 -e mksquashfs $@ 2> /dev/null
    fk_squash() {
      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
       fk_squash $@    
       squash $@
     #source_dir=$1; shift
     #target_dir=$2; shift
      out=() #Currently not used
      declare -A exludes
     for arg in "$@";do
       if [[ "$arg" == -* ]]; then
         case "$arg" in
         option="$arg" ;;
         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
           cd $aDir
           cpio -pd "$target_dir"
     #done < <(ls -a -1)
     if [ "$mode" = dir ]; then
       fk_mksquashfs $@    
       mksquashfs $@

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.
Back to top
View user's profile Send private message Visit poster's website 
Display posts from previous:   Sort by:   
Page 1 of 1 [1 Post]  
This forum is locked: you cannot post, reply to, or edit topics.   This topic is locked: you cannot edit posts or make replies. View previous topic :: View next topic
 Forum index » Off-Topic Area » Programming
Jump to:  

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

Powered by phpBB © 2001, 2005 phpBB Group
[ Time: 0.9371s ][ Queries: 11 (0.8547s) ][ GZIP on ]