Puppy Linux Discussion Forum Forum Index Puppy Linux Discussion Forum
Puppy HOME page : puppylinux.com
"THE" alternative forum : puppylinux.info
 
 FAQFAQ   SearchSearch   MemberlistMemberlist   UsergroupsUsergroups   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

The time now is Sun 21 Sep 2014, 16:19
All times are UTC - 4
 Forum index » Advanced Topics » Cutting edge
New Remaster script Working!!
Moderators: Flash, Ian, JohnMurga
Post_new_topic   Reply_to_topic View_previous_topic :: View_next_topic
Page 1 of 2 Posts_count   Goto page: 1, 2 Next
Author Message
stemsee


Joined: 27 Jun 2013
Posts: 371
Location: London

PostPosted: Thu 21 Aug 2014, 04:47    Post_subject:  New Remaster script Working!!
Sub_title: sfsdirect - 3 minute remaster in ram!
 

SOLVED
I have arrived at a new remaster script which simply squashes the system running in ram with extra sfs and savefile included.
sfsdirect-remaster.gz
Description 
gz

 Download 
Filename  sfsdirect-remaster.gz 
Filesize  756 Bytes 
Downloaded  23 Time(s) 

Edited_times_total
Back to top
View user's profile Send_private_message MSNM 
mavrothal


Joined: 24 Aug 2009
Posts: 1621

PostPosted: Thu 21 Aug 2014, 05:17    Post_subject:  

/proc and /sys get 555 permissions *after* the kernel is done writing in them. 555 makes the dirs not writable hence the kernel panic (I think)
Change them to 755 and see if this solves it.

PS: you may also need the /run directory that depending on your booting process may cause panic as udev needs it to make devices.
BTW, how the directories on the remastered sfs compare to the original sfs?

_________________
Kids all over the world go around with an XO laptop. They deserve one puppy (or many) too Very Happy
Back to top
View user's profile Send_private_message 
stemsee


Joined: 27 Jun 2013
Posts: 371
Location: London

PostPosted: Thu 21 Aug 2014, 10:30    Post_subject:  

How do they compare? In terms of permissions? I started listing all permissions in running system to compare with remastered directory, but rightclick->properties-> shows a graphic status of permissions I do not know how they are translated numerically! Except by experimenting on a NewDir in Downloads, which I was doing until I got distracted somehow and stopped. Is there a table showing puppy dir permissions in number format?

Also I thought that /run was not a used dir in puppy linux! DebianDog yes, fatdog 700 has a symlink /run linked to /tmp . But i wont hurt to have it there!
Back to top
View user's profile Send_private_message MSNM 
saintless


Joined: 11 Jun 2011
Posts: 2456
Location: Bulgaria

PostPosted: Thu 21 Aug 2014, 10:56    Post_subject:  

stemsee wrote:
Is there a table showing puppy dir permissions in number format?

Try this one:
Code:
ls -l | awk '{k=0;for(i=0;i<=8;i++)k+=((substr($1,i+2,1)~/[rwx]/) \
             *2^(8-i));if(k)printf("%0o ",k);print}'

Or this:
Code:
stat -c '%a %n' /tmp /root

_________________
Farewell, Nooby, you will be missed...
Back to top
View user's profile Send_private_message MSNM 
mavrothal


Joined: 24 Aug 2009
Posts: 1621

PostPosted: Thu 21 Aug 2014, 11:02    Post_subject:  

There plenty of articles for linux permissions like this one or this one
Running
Code:
ls -l /initrd/pup_ro2

in a running puppy, will show the default directories and permissions in a puppy sfs.

_________________
Kids all over the world go around with an XO laptop. They deserve one puppy (or many) too Very Happy
Back to top
View user's profile Send_private_message 
stemsee


Joined: 27 Jun 2013
Posts: 371
Location: London

PostPosted: Thu 21 Aug 2014, 11:24    Post_subject:  

ok....thanks guys! Another lesson to learn and apply ...

Saintless's code lists with numerically represented permissions ie tmp=777 etc!

Perfect.
Back to top
View user's profile Send_private_message MSNM 
Flash
Official Dog Handler


Joined: 04 May 2005
Posts: 11069
Location: Arizona USA

PostPosted: Thu 21 Aug 2014, 16:24    Post_subject:  

Stemsee, is your problem solved? Does the remastered iso work now?
Back to top
View user's profile Send_private_message 
stemsee


Joined: 27 Jun 2013
Posts: 371
Location: London

PostPosted: Fri 22 Aug 2014, 03:28    Post_subject:  

@Flash

It didn't solve the issue! But i have to look at mksquashfs -e (exclude) option to make sure tmp mnt sys proc are excluded from the running system, and only those from /tmp/quaddirs/* are added to the sfs.

But try it ... maybe it will work on your distro!
Back to top
View user's profile Send_private_message MSNM 
stemsee


Joined: 27 Jun 2013
Posts: 371
Location: London

PostPosted: Fri 22 Aug 2014, 06:09    Post_subject:  

I have an idea what might be the error. Namely, when creating new mnt in /tmp/quaddirs/ must also create subdirs for mount points - sda1-8 sr0-3 home and ram1, just remastering now. Also experimenting with -read-queue and -write-queue to speed things up.
Back to top
View user's profile Send_private_message MSNM 
stemsee


Joined: 27 Jun 2013
Posts: 371
Location: London

PostPosted: Fri 22 Aug 2014, 13:20    Post_subject:  

Nah - that didn't make any difference either. I wonder if it has to do with uuid or guid?

So i was trying to void using an inermeiary directory that you copy into first but now I will use one in ram --- see if that works.
Back to top
View user's profile Send_private_message MSNM 
amigo

Joined: 02 Apr 2007
Posts: 2247

PostPosted: Fri 22 Aug 2014, 13:38    Post_subject:  

I think you need to investigate the 'standard' perms/ownerships used by other distros in order to get a clear idea of what is needed. And, the same to find out what should not be included in a clone of a system. There should be nothing copied from kernel-gernerated content, that is, /proc /sys and /run should never be copied over. And, /mnt should also not be copied if it contains non-system mounts.

Trying to clone a puppy system is quite difficult to figure out because best-practices are completely ignored or contravened.

Normally, you should be able to just cd into / and:
Code:
cp -a list-of-dirs destination

where list-of-dirs excludes the above mentioned dirs. This is the list I always use -I often clone a running system:
bin lib opt root var etc home sbin srv usr
These:
dev media mnt tmp boot proc run sys
should be handled with care. dev should only be copied if static device files are being used. boot is often mounted on another filesysetm so your clone may or may not need that content. mnt and media should be empty dirs or empty dir structures. proc sys tmp and run should be empty dirs on the cloned system

Normal best-practices usage of the filesystem hierarchy *would* make this possible also under puppy.

I have written two tools which convert perms from octal to human and human to octal which I can provide here if needed in the end. But, the problems booting are owning to improper perms and content, I'm afraid.
Back to top
View user's profile Send_private_message 
stemsee


Joined: 27 Jun 2013
Posts: 371
Location: London

PostPosted: Fri 22 Aug 2014, 14:07    Post_subject:  

Thanks amigo

That makes sense! I believe I have figured out the right way to do it! Avoiding the pitfalls you mention. As i am sure it is kernel-generated content. So I will use the mksquashfs command specifying several more folders for source, namely /initrd/pup_ro2 /initrd/pup_rw /initrd/pup_* (any mounted sfs greater than zero) It must work I think!! And no intermediary directory just more careful excludes
Back to top
View user's profile Send_private_message MSNM 
amigo

Joined: 02 Apr 2007
Posts: 2247

PostPosted: Sat 23 Aug 2014, 03:17    Post_subject:  

The contents of /initrd should also not be copied as they are setup during boot.
Back to top
View user's profile Send_private_message 
stemsee


Joined: 27 Jun 2013
Posts: 371
Location: London

PostPosted: Fri 19 Sep 2014, 17:54    Post_subject: sfs direct remaster in ram or on device.
Sub_title: the fastest possible remaster.
 

This script is now working as it should!

Code:
#!/bin/sh
#sfsdirect remastering suite by stemsee copyright Marcos Contant 2014

. /etc/DISTRO_SPECS
echo "SfS direct is a live remaster system which works in either ram or device.
Make sure that your system has enough ram or uses a swap for the remaster, or
specify path and drive. e.g. mnt sda2.

Do you want to work in ram? y or n"
read ram
case $ram in
    y) if [ -d /tmp/quaddirs ]; then
   rm -r /tmp/quaddirs
   rm /tmp/*.sfs
   mkdir -p /tmp/quaddirs/{mnt,tmp,sys,proc}
   else
   mkdir -p /tmp/quaddirs/{mnt,tmp,sys,proc}
   fi
   if [ -d /aufs ]; then
   ln -fnrsv /tmp/quaddirs/tmp /tmp/quaddirs/run
   fi
   mksquashfs /* /tmp/quaddirs/* /tmp/$DISTRO_NAME.sfs -e /run /proc /tmp /mnt /initrd /sys /aufs /archive /root/.cache /root/.Trash/* /root/Downloads/* /root/.history /root/.bash_history /root/.Skype /etc/resolv.conf /root/.XLOADED /etc/.XLOADED /lib/modules /lib/firmware -keep-as-directory -noappend
   echo "'$DISTRO_NAME.sfs has been created in /tmp. Where do you want to save it to?
   Enter the path e.g. /mnt/sda2/"
   read savepart
   mv -f /tmp/$DISTRO_NAME.sfs $savepart
   echo "All done!" && exit;;

   n)  if [ -d /tmp/quaddirs ]; then
   rm -r /tmp/quaddirs
   mkdir -p /tmp/quaddirs/{mnt,tmp,sys,proc}
   else
   mkdir -p /tmp/quaddirs/{mnt,tmp,sys,proc}
   fi
   if [ -d /aufs ]; then
   ln -fnrsv /tmp/quaddirs/tmp /tmp/quaddirs/run
   else
   echo "Input path and drive  e.g. mnt sda2"
   read path drive
   mount /dev/$drive /$path/$drive
   mksquashfs  /* /tmp/quaddirs/* /$path/$drive/$DISTRO_NAME.sfs -e /proc /tmp /mnt /initrd /proc /sys /aufs /archive /root/.cache /root/.Trash /root/Downloads/* /root/.history /root/.bash_history /root/.Skype /etc/resolv.conf /root/.XLOADED /etc/.XLOADED  /lib/modules /lib/firmware -keep-as-directory -noappend
   echo "All done!"
   fi && exit;;
   *) echo "You didn't enter anything relevant! Exiting script." && exit;;
esac
Back to top
View user's profile Send_private_message MSNM 
Jasper


Joined: 25 Apr 2010
Posts: 1124
Location: England

PostPosted: Fri 19 Sep 2014, 19:00    Post_subject:  

Hi stemsee,

Your code works perfectly for me (as does that of Ted Dog).

I can automatically remaster my main sfs in less than 5 minutes.

I can make an updated iso in about 1 second.

I can burn an updated DVD in less than 1 minute (or a CD in <200")

My regards

PS I don't see much sense in remastering a full installation so I presume your hitch related to a frugal installation.

PPS I'm finishing my weekly bottle of red wine (chiante - though more tired than plastered) and I cluelessly and carelessly read your "now" as "not", but I have left my comments in case they may be of some minor general interest.

_________________
Desktop (1998 with 2002 Motherboard replacement) @ 2.0 GHz with 640 MB (SDRAM).
Precise 5.6 with Multi-session-Live-CD/DVD + W98SE solely for rare printing needs.
Back to top
View user's profile Send_private_message 
Display_posts:   Sort by:   
Page 1 of 2 Posts_count   Goto page: 1, 2 Next
Post_new_topic   Reply_to_topic View_previous_topic :: View_next_topic
 Forum index » Advanced Topics » Cutting edge
Jump to:  

Rules_post_cannot
Rules_reply_cannot
Rules_edit_cannot
Rules_delete_cannot
Rules_vote_cannot
You cannot attach files in this forum
You can download files in this forum


Powered by phpBB © 2001, 2005 phpBB Group
[ Time: 0.0827s ][ Queries: 12 (0.0037s) ][ GZIP on ]