How to automate extracting Puppy wallpapers?

Using applications, configuring, problems
Post Reply
Message
Author
User avatar
ally
Posts: 1957
Joined: Sat 19 May 2012, 19:29
Location: lincoln, uk
Contact:

How to automate extracting Puppy wallpapers?

#1 Post by ally »

OK boys and girls

Had an idea to put puppy wallpapers up on archive.org for sharing and posterity

Trouble is I have over 2850 puppys and would rather not do it all manually if I can avoid it.....!

I'm sadly completely unable to code but wondered if the process could be automated to chug through my collection expand the iso, copy the wallpapers and place them in a folder consisting of the iso name

If anybody can help I'd be grateful

:)

User avatar
Semme
Posts: 8399
Joined: Sun 07 Aug 2011, 20:07
Location: World_Hub

#2 Post by Semme »

Although I think your post should outline your desires in greater detail.. PING >> :cool: SFR! Hang in there Ally..
>>> Living with the immediacy of death helps you sort out your priorities. It helps you live a life less trivial <<<

User avatar
ally
Posts: 1957
Joined: Sat 19 May 2012, 19:29
Location: lincoln, uk
Contact:

#3 Post by ally »

thanks semme

I have the puppy iso's (and img.xz) files on a 1Tb ext4 hdd

I would like to retrieve the wallpaper files from the iso's. I have done this manually by clicking the iso to expand the file system, finding the wallpaper locations and copy them, clicking the iso again to close it

so I can catalogue the files I would like to collected wallpaper images placed into a folder of the iso names (ie slacko-5.3.3)

then repeat for the rest of the iso's on the drive

:)

ebisu
Posts: 176
Joined: Wed 25 Sep 2013, 05:06

Re: archiving puppy wallpapers

#4 Post by ebisu »

ally wrote:Trouble is I have over 2850 puppys
:shock:

User avatar
ally
Posts: 1957
Joined: Sat 19 May 2012, 19:29
Location: lincoln, uk
Contact:

#5 Post by ally »

I know!!

There is some lovely artwork buried away in these. Will do it manually if I have to. It took over a year to upload the bulk of the puppy builds doing some every day

:)

User avatar
SFR
Posts: 1800
Joined: Wed 26 Oct 2011, 21:52

#6 Post by SFR »

This is only for ISO/SFS pair and won't work with img.xz or e.g. FatDog, which has .sfs inside of initrd.

Works simple - finds all the ISOs in defined path, mounts them one by one and extracts /usr/share/backgrounds/ dir from all found SFSes.

Code: Select all

#!/bin/sh

# Customize these variables:
OUTDIR="/root/Wallpapers_from_ISOs"
ISODIR="/path/to/your/ISO/collection"

# -----------------------------------------------------------------------------

ISOMNTPT="/tmp/iso_mntpt_${$}"
mkdir -p "$OUTDIR"
mkdir -p "$ISOMNTPT"

trap 'umount "$ISOMNTPT" 2>/dev/null; rmdir "$ISOMNTPT"' EXIT

# -----------------------------------------------------------------------------

find "$ISODIR" -type f -iname "*.iso" | while read -r ISO; do
  mount -o,ro "$ISO" "$ISOMNTPT"
  mkdir -p "$OUTDIR/$(basename "${ISO%.*}")"
  find "$ISOMNTPT" -type f -iname "*.sfs" | while read -r SFS; do
    unsquashfs -f -d "$OUTDIR/$(basename "${ISO%.*}")" "$SFS" "/usr/share/backgrounds"
  done
  umount "$ISOMNTPT"
done

# Uncomment this if you want to delete empty subdirectories in OUTDIR:
#find "$OUTDIR" -type d -empty -delete

exit
HTH
Greetings!
[color=red][size=75][O]bdurate [R]ules [D]estroy [E]nthusiastic [R]ebels => [C]reative [H]umans [A]lways [O]pen [S]ource[/size][/color]
[b][color=green]Omnia mea mecum porto.[/color][/b]

User avatar
ally
Posts: 1957
Joined: Sat 19 May 2012, 19:29
Location: lincoln, uk
Contact:

#7 Post by ally »

Sweet. Many thanks

Will report back soon

:)

User avatar
mavrothal
Posts: 3096
Joined: Mon 24 Aug 2009, 18:23

#8 Post by mavrothal »

SFR beat me to it, but since i did it, here it is. I use filemnt to have some visuall info that things are going on as it may take some time for 3000 isos!
(BTW SFR's looks fine to me)

Code: Select all

#!/bin/sh

ISOFOLDER= # Type full path to where your ISOs are ie /mnt/home/Puppy_ISOs
ARTFOLDER= # Type full path to where you want the backgrounds saved

mkdir -p /tmp/ISO_SFS

for I in $(ls $ISOFOLDER/*.iso)
do 
	filemnt $I
	ISO=$(echo "$I"|rev| cut -f1 -d '/'| rev)
	IPATH=$(df | grep "$ISO"| awk '{print $6}')
	SFS=$(ls "$IPATH"/*puppy*.sfs) 
	# If the puppy SFS does not have 'puppy' in its name, the above will fail
	mount -o loop  "$SFS" /tmp/ISO_SFS
    cp -afR /tmp/ISO_SFS/usr/share/backgrounds $ARTFOLDER/"$ISO"_backgrounds 
    # Remove ' "$ISO"_ ' part in the line above if you want all backgrounds in the same folder. Same names will be overwriten 
    sync
    umount /tmp/ISO_SFS
	filemnt $I	
done
== [url=http://www.catb.org/esr/faqs/smart-questions.html]Here is how to solve your[/url] [url=https://www.chiark.greenend.org.uk/~sgtatham/bugs.html]Linux problems fast[/url] ==

User avatar
MochiMoppel
Posts: 2084
Joined: Wed 26 Jan 2011, 09:06
Location: Japan

#9 Post by MochiMoppel »

SFR wrote:This is only for ISO/SFS pair and won't work with img.xz or e.g. FatDog, which has .sfs inside of initrd.
But it works even with old Puppies, which would normally spoil my day with a "NOTICE: This is an older version 3.x squashfs file, not usable...bla...bla". I just extracted wallpapers from a Puppy 2.14 :lol: Works perfectly!

The only thing I would wish is to have all extracted images at the root of each individual output directory and not in individual /usr/share/backgrounds directories, so I amended the code slightly.
#!/bin/sh

# Customize these variables:
OUTDIR="/root/Wallpapers_from_ISOs"
ISODIR="/path/to/your/ISO/collection"

# -----------------------------------------------------------------------------

ISOMNTPT="/tmp/iso_mntpt_${$}"
mkdir -p "$OUTDIR"
mkdir -p "$ISOMNTPT"

trap 'umount "$ISOMNTPT" 2>/dev/null; rmdir "$ISOMNTPT"' EXIT

# -----------------------------------------------------------------------------

find "$ISODIR" -type f -iname "*.iso" | while read -r ISO; do
mount -o,ro "$ISO" "$ISOMNTPT"
OUTSUBDIR="$OUTDIR/$(basename "${ISO%.*}")"
mkdir -p "$OUTSUBDIR"
find "$ISOMNTPT" -type f -iname "*.sfs" | while read -r SFS; do
unsquashfs -f -d "$OUTSUBDIR" "$SFS" "/usr/share/backgrounds"
mv "$OUTSUBDIR"/usr/share/backgrounds/* "$OUTSUBDIR" 2>/dev/null
done
umount "$ISOMNTPT"
done
find "$OUTDIR" -type d -empty -delete
exit
.
Last edited by MochiMoppel on Tue 10 Feb 2015, 07:46, edited 1 time in total.

User avatar
dejan555
Posts: 2798
Joined: Sun 30 Nov 2008, 11:57
Location: Montenegro
Contact:

#10 Post by dejan555 »

I can zip all the wallpapers and artwork from my site and put them up somewhere as one archive if you want to, up to some point I was following the puppy wallpapers thread and some other artwork threads and made a gallery here

http://puppy.b0x.me/gallery/

EDIT: Or, wget them all from http://puppy.b0x.me/gallery/pictures/
puppy.b0x.me stuff mirrored [url=https://drive.google.com/open?id=0B_Mb589v0iCXNnhSZWRwd3R2UWs]HERE[/url] or [url=http://archive.org/details/Puppy_Linux_puppy.b0x.me_mirror]HERE[/url]

User avatar
ally
Posts: 1957
Joined: Sat 19 May 2012, 19:29
Location: lincoln, uk
Contact:

#11 Post by ally »

sorry for the delay, not well yesterday

currently running SFR's script (mavrothal, many ISOs just have pup_*** as sfs names)

it's been running about 5 mins and half way through - NICE!

deejan

I have been unable to wget your files (wget -nd -r --no-parent -A.jpg your url)?

thanks all

:)

User avatar
ally
Posts: 1957
Joined: Sat 19 May 2012, 19:29
Location: lincoln, uk
Contact:

#12 Post by ally »

sorry, me again.....

the script worked very well with 2238/2994 files opened, tbh I had forgotten I have some deltas in there for building ISOs where they have not been published yet, the early early puppy builds and the non-ISO pups so chuffed

I am considering one archive with all the images in ~3gig and also uploading to each of the puppy directories

however each puppy has a 'default' image so when copying in to one directory it's get lost as there is already a default in there so I have started manually copying the ISO name and adding it to the default name

ie ISO_default (4.3.2.V3_default.jpg)

it's script wanting time again please (sorry for the lack of skills again - it is a source of constant embarrassment....)

:)

User avatar
ally
Posts: 1957
Joined: Sat 19 May 2012, 19:29
Location: lincoln, uk
Contact:

#13 Post by ally »

@deejan

solved the wget using http://puppy.b0x.me/gallery/pictures

cheers

:)

User avatar
dejan555
Posts: 2798
Joined: Sun 30 Nov 2008, 11:57
Location: Montenegro
Contact:

#14 Post by dejan555 »

Be sure to include -A.png in wget too, there might be some gifs too...
puppy.b0x.me stuff mirrored [url=https://drive.google.com/open?id=0B_Mb589v0iCXNnhSZWRwd3R2UWs]HERE[/url] or [url=http://archive.org/details/Puppy_Linux_puppy.b0x.me_mirror]HERE[/url]

User avatar
ally
Posts: 1957
Joined: Sat 19 May 2012, 19:29
Location: lincoln, uk
Contact:

#15 Post by ally »

thanks deejan I did

this is fun, just found some on deviant art including puppy 4 cloud for phone wallpaper - feakin cool

http://th03.deviantart.net/fs70/200H/f/ ... 39ds9h.png

:)

User avatar
SFR
Posts: 1800
Joined: Wed 26 Oct 2011, 21:52

#16 Post by SFR »

ally wrote:ie ISO_default (4.3.2.V3_default.jpg)
Here's some code, but I'm not sure if this is exactly what you want...

Just define (WALLDIR=) where all previously extracted wallpapers are and (OUTDIR=) where all default.* ones should be copied.
For example: default.gif from 214X-top10 subdirectory will be copied to OUTDIR as 214X-top10_default.gif.

Code: Select all

#!/bin/sh

# Customize these:
WALLDIR="/root/Wallpapers_from_ISOs"
OUTDIR="/root/All_Default_Wallpapers"

# -----------------------------------------------------------------------------

cd "$WALLDIR" || return 1
mkdir -p "$OUTDIR" || return 1

for SUBDIR in *; do
  find "$SUBDIR" -type f -iname "default.*" | while read DEFAULT; do
    NAMEONLY="$(basename "$DEFAULT")"
    cp -v "${DEFAULT}" "${OUTDIR}/${SUBDIR}_${NAMEONLY}"
  done
done
Greetings!
[color=red][size=75][O]bdurate [R]ules [D]estroy [E]nthusiastic [R]ebels => [C]reative [H]umans [A]lways [O]pen [S]ource[/size][/color]
[b][color=green]Omnia mea mecum porto.[/color][/b]

User avatar
ally
Posts: 1957
Joined: Sat 19 May 2012, 19:29
Location: lincoln, uk
Contact:

#17 Post by ally »

SFS

sincerest thanks again, worked like a charm

will start uploading this evening

:)

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

#18 Post by greengeek »

ally wrote:There is some lovely artwork buried away in these. Will do it manually if I have to. It took over a year to upload the bulk of the puppy builds doing some every day
Thanks Ally, you dont get enough praise for the recovery/archiving work you do - it is greatly appreciated!

User avatar
ally
Posts: 1957
Joined: Sat 19 May 2012, 19:29
Location: lincoln, uk
Contact:

#19 Post by ally »

I still have the early 1 and 2 series and the non iso builds

thanks for the thanks

:)

Post Reply