Refining puppies remaster function

How to do things, solutions, recipes, tutorials
Post Reply
Message
Author
User avatar
RSH
Posts: 2397
Joined: Mon 05 Sep 2011, 14:21
Location: Germany

Refining puppies remaster function

#1 Post by RSH »

Hi.

User greengeek did ask if the LazY Puppy Remaster Suite would run in other puppies. Unfortunately it doesn't. So i have made a quick hack to make you able to refine your remaster script (remasterpup2 in /usr/sbin) to make a remaster without the need to mount a iso file or to have a cd in the cd drive.

It will make the remaster from the running system, though it needs all the files, from the iso inside the boot directory (not partition --> works also but needs directory if booting from a separate directory).

I have tested this successful in lucid 528-4 and slacko 5.3.

1. Install the attached .pet. This contains the needed files to be able to tell the remaster script from where to take the files ---> no matter if booted from /mnt/home or /mnt/sda1 or /mnt/sdd3/YourPuppy or what ever your puppy can boot. Link to the .pet is at the end of this post.

2 Open your remaster script and put the following code at the very beginning.

Code: Select all

# get LazY Puppy Bootdirectory
exec /usr/sbin/ceelab/tools/get_boot_dir
sleep .1
. /usr/sbin/ceelab/lp2_sys_data/LP2_BootDir
3. Search for some code like:

Code: Select all

#VIRTUALCD=$(mount -t iso9660|grep '^/dev/loop' | sed -e 's/on[ ].*+//' -e 's/[ ]type[ ]iso9660[ ].*$//')
#MSG="$m_14"
#choice_cdd
#
#CDPATTERN="/dev/$BURNERDRV "
#CDMNTPT="`mount | grep "$CDPATTERN" | tr -s " " | cut -f 3 -d " "`"
#if [ "$CDMNTPT" != "" ];then
#	if [ ! -f $CDMNTPT/initrd.gz ];then
#		# 091212 weird bug, no processes but when run this, x restarts...
#		xFUSER="`fuser -m /dev/$BURNERDRV 2>/dev/null`" #do this first, seems to fix it.
#		[ "$xFUSER" != "" ] && fuser -k -m /dev/$BURNERDRV
#		sync
#		umount /dev/$BURNERDRV 2> /dev/null
#		if [ $? -ne 0 ];then
#			Xdialog --wrap --center  --title "$m_02" --msgbox "$m_15" 0 0
#			go_exit
#		fi
#		CDMNTPT=""
#	fi
#fi
#
#if [ "$CDMNTPT" = "" ];then
#	eval m_16=\"$m_16\"
#	while [ 1 ];do
#		Xdialog --wrap --center  --title "$m_01" --msgbox "$m_16" 0 0
#		[ $? -eq 0  ] || go_exit	# 22jun09
#		# now mount it...
#		CDMNTPT="/mnt/$BURNERDRV"
#		mkdir -p /mnt/$BURNERDRV
#		mount -t iso9660 /dev/$BURNERDRV /mnt/$BURNERDRV
#		[ $? -eq 0 ] && break
#	done
#fi
and comment it out ---> already done in the above code

In LazY Puppy Remaster Skript it is at line 347 ---> in your script it's surely another line number :)

Search for some code like:

Code: Select all

for F in vmlinuz initrd.gz ${ZDRVSFS} grldr menu.lst '*.xpm' isolinux.bin isolinux.cfg '*.msg' '*.16' '*.HTM*' '*.ICO' '*.INF'
do
	cp $CDMNTPT/$F $WKGMNTPT/$rebuilddir/ 2> /dev/null
	sync
done
Change code:

Code: Select all

cp $CDMNTPT/$F $WKGMNTPT/$rebuilddir/ 2> /dev/null
to

Code: Select all

cp $LP2BDL/$F $WKGMNTPT/$rebuilddir/ 2> /dev/null
If you do mount the boot directory, then the whole iso will be rebuild. If the boot directory is not mounted, it ends with a message about no bootloader was found. Then you'll get only the new created YourPuppy.sfs file.

The above shown code might be different to the code inside your script. I have made lots of specific modifications - can not remember each detail. :lol:

Link to the needed .pet

I have attached the already refined remaster scripts taken from the lucid 528-4 and slacko 5.3 test remasters. These files are fake .gz files. Just rename to remasterpup2 (might be necessary to make executable after download).

Even though I've attached these files, i do recommend to do manually as described above.

RSH
Attachments
remasterpup2-slacko53.gz
(33.54 KiB) Downloaded 776 times
remasterpup2-lucid5284.gz
(32.57 KiB) Downloaded 761 times
[b][url=http://lazy-puppy.weebly.com]LazY Puppy[/url][/b]
[b][url=http://rshs-dna.weebly.com]RSH's DNA[/url][/b]
[url=http://murga-linux.com/puppy/viewtopic.php?t=91422][b]SARA B.[/b][/url]

User avatar
RSH
Posts: 2397
Joined: Mon 05 Sep 2011, 14:21
Location: Germany

#2 Post by RSH »

Hi.

I have noticed the three downloads of the attached scripts at first post.

But you did not download the attached .pet (link at end of first post).

This is needed! Otherwise it will not work!

RSH
[b][url=http://lazy-puppy.weebly.com]LazY Puppy[/url][/b]
[b][url=http://rshs-dna.weebly.com]RSH's DNA[/url][/b]
[url=http://murga-linux.com/puppy/viewtopic.php?t=91422][b]SARA B.[/b][/url]

User avatar
cimarron
Posts: 292
Joined: Fri 31 May 2013, 01:57

#3 Post by cimarron »

Thanks RSH. I was having trouble getting the remasterpup2 script to work with a mounted iso file, and your refinement allowed me to bypass that problem. The one glitch I found (using Lupu 5.1) is that the lines you say to add at the beginning of the script caused it to just stop. But when I added an "&" after your exec line, it worked fine. Like this:

Code: Select all

# get LazY Puppy Bootdirectory
exec /usr/sbin/ceelab/tools/get_boot_dir &
sleep .1
. /usr/sbin/ceelab/lp2_sys_data/LP2_BootDir
It also seems that since you have that line running get_boot_dir at the beginning of the remaster script, there doesn't seem to be any need for running that at every startup. Your .pet puts a script in the Startup folder to run get_boot_dir at each startup. I took that out and your new remaster script still seems to work fine.

It might be worth providing the .pet in this thread (not just the other thread) to make it easier for people to get it.

User avatar
Ted Dog
Posts: 3965
Joined: Wed 14 Sep 2005, 02:35
Location: Heart of Texas

#4 Post by Ted Dog »

isolinux.bin copied from a iso image has already been modified by mkiso and will lead to problems booting the remaster. Get a fresh un-modified copy each time, do not reuse isolinux.bin - learn from my mistakes... :?

User avatar
cimarron
Posts: 292
Joined: Fri 31 May 2013, 01:57

#5 Post by cimarron »

I've found RSH's modified remaster script useful primarily to rebuild a new Puppy sfs file (without needing a CD) for frugal installs. This remastered sfs can then easily replace the Puppy sfs file on the hard drive or USB stick.

Or building a remastered sfs to install on a new USB stick. And Puppy can also be pretty easily installed in a USB stick without a CD (as long as you have an iso file or Puppy installed on a previous USB stick, to get the files, isolinux.bin not needed). For anyone interested in that, I found good instructions here. Thanks to seperohacker.

User avatar
greengeek
Posts: 5789
Joined: Tue 20 Jul 2010, 09:34
Location: Republic of Novo Zelande

#6 Post by greengeek »

Ted Dog wrote:isolinux.bin copied from a iso image has already been modified by mkiso and will lead to problems booting the remaster. Get a fresh un-modified copy each time, do not reuse isolinux.bin - learn from my mistakes... :?
Hi Ted - where would you recommend getting the fresh isolinux.bin from please? cheers.

User avatar
Ted Dog
Posts: 3965
Joined: Wed 14 Sep 2005, 02:35
Location: Heart of Texas

#7 Post by Ted Dog »

pfind for it its inside the syslinux folder where its located on your spin. or extlinux forgot which. I copied my version to where I have a built directory with a static image also have some small scripts to do a md5sum prior to burn do not know why puppylinux does not do so by default. Priceless to use with BluRay data backups of my harddrives (etc one is bootible ) and rolling indexed so I can find stuff saved. :wink:

User avatar
greengeek
Posts: 5789
Joined: Tue 20 Jul 2010, 09:34
Location: Republic of Novo Zelande

#8 Post by greengeek »

Thanks Ted - just to clarify - I think you are saying that some 'isolinux.bin' files are virgin but some other 'isolinux.bin' files are modified during the mkiso process. Do i understand you correctly?

And if that is the case - how will i tell which is a safely usable file? Are you saying that any isolinux.bin that is currently bound up inside an iso should not be reused elsewhere?
cheers

User avatar
Ted Dog
Posts: 3965
Joined: Wed 14 Sep 2005, 02:35
Location: Heart of Texas

#9 Post by Ted Dog »

correct it has a master boot record type of offset to actual bootcode it changes based on construction of ISO. The unmodified verson exists until iso made. The unchanged version is In package folder.

User avatar
cimarron
Posts: 292
Joined: Fri 31 May 2013, 01:57

#10 Post by cimarron »

Maybe it's worth experimenting for yourself, because I've simply copied isolinux.bin from a previous CD to make a remastered CD a number of times, and the new CD has always booted fine, on several different computers.

I've always used shinobar's dir2iso to make the iso. It seems to make it with this command:

Code: Select all

mkisofs -J -D -R $VOLI -o "$z.iso" -b isolinux.bin -c boot.cat -no-emul-boot -boot-load-size 4 -boot-info-table "$t"
And t=`echo "$ISOFILEDIR" | sed "s/\/$//"`

I don't know enough to tell if this addresses Ted Dog's concerns. But it seems to work.

User avatar
Ted Dog
Posts: 3965
Joined: Wed 14 Sep 2005, 02:35
Location: Heart of Texas

#11 Post by Ted Dog »

That makeiso line is very very outdated. Will not be able to save session with newer spins due to miss match. Yes copy a used isolinux.bin does work most of the time but only after a fallback since offset is not pointing to correct files by default. Adds time every boot to search for correct file via reading files names in the directory. If there is an error prior to finding correct file it will refuse to boot.
Or worst boot an old copy of file on a unerased area of a rewrite optical drive.

Post Reply