Author |
Message |
ally

Joined: 19 May 2012 Posts: 1983 Location: lincoln, uk
|
Posted: Sat 07 Feb 2015, 23:21 Post subject:
How to automate extracting Puppy wallpapers? Subject description: Extract them from Puppy iso/sfs, then put them in archive.org |
|
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
|
Back to top
|
|
 |
Semme

Joined: 07 Aug 2011 Posts: 8427 Location: World_Hub
|
Posted: Sun 08 Feb 2015, 15:47 Post subject:
|
|
Although I think your post should outline your desires in greater detail.. PING >> 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 <<<
|
Back to top
|
|
 |
ally

Joined: 19 May 2012 Posts: 1983 Location: lincoln, uk
|
Posted: Sun 08 Feb 2015, 19:48 Post subject:
|
|
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
|
Back to top
|
|
 |
ebisu
Joined: 25 Sep 2013 Posts: 176
|
Posted: Mon 09 Feb 2015, 03:16 Post subject:
Re: archiving puppy wallpapers Subject description: help needed |
|
ally wrote: | Trouble is I have over 2850 puppys |
|
Back to top
|
|
 |
ally

Joined: 19 May 2012 Posts: 1983 Location: lincoln, uk
|
Posted: Mon 09 Feb 2015, 03:18 Post subject:
|
|
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
|
Back to top
|
|
 |
SFR

Joined: 26 Oct 2011 Posts: 1802
|
Posted: Mon 09 Feb 2015, 05:31 Post subject:
|
|
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: | #!/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!
_________________ [O]bdurate [R]ules [D]estroy [E]nthusiastic [R]ebels => [C]reative [H]umans [A]lways [O]pen [S]ource
Omnia mea mecum porto.
|
Back to top
|
|
 |
ally

Joined: 19 May 2012 Posts: 1983 Location: lincoln, uk
|
Posted: Mon 09 Feb 2015, 05:33 Post subject:
|
|
Sweet. Many thanks
Will report back soon
|
Back to top
|
|
 |
mavrothal

Joined: 24 Aug 2009 Posts: 3108
|
Posted: Mon 09 Feb 2015, 05:38 Post subject:
|
|
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: | #!/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
|
_________________ == Here is how to solve your Linux problems fast ==
|
Back to top
|
|
 |
MochiMoppel

Joined: 26 Jan 2011 Posts: 2084 Location: Japan
|
Posted: Mon 09 Feb 2015, 08:27 Post subject:
|
|
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 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.
Quote: | #!/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, 03:46; edited 1 time in total
|
Back to top
|
|
 |
dejan555

Joined: 30 Nov 2008 Posts: 2817 Location: Montenegro
|
Posted: Mon 09 Feb 2015, 08:42 Post subject:
|
|
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 HERE or HERE
|
Back to top
|
|
 |
ally

Joined: 19 May 2012 Posts: 1983 Location: lincoln, uk
|
Posted: Tue 10 Feb 2015, 06:34 Post subject:
|
|
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
|
Back to top
|
|
 |
ally

Joined: 19 May 2012 Posts: 1983 Location: lincoln, uk
|
Posted: Tue 10 Feb 2015, 06:58 Post subject:
|
|
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....)
|
Back to top
|
|
 |
ally

Joined: 19 May 2012 Posts: 1983 Location: lincoln, uk
|
Posted: Tue 10 Feb 2015, 07:01 Post subject:
|
|
@deejan
solved the wget using http://puppy.b0x.me/gallery/pictures
cheers
|
Back to top
|
|
 |
dejan555

Joined: 30 Nov 2008 Posts: 2817 Location: Montenegro
|
Posted: Tue 10 Feb 2015, 10:02 Post subject:
|
|
Be sure to include -A.png in wget too, there might be some gifs too...
_________________ puppy.b0x.me stuff mirrored HERE or HERE
|
Back to top
|
|
 |
ally

Joined: 19 May 2012 Posts: 1983 Location: lincoln, uk
|
Posted: Tue 10 Feb 2015, 10:06 Post subject:
|
|
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/2011/043/0/1/puppy_iphone_wallpaper_by_lostprophetslaw-d39ds9h.png
|
Back to top
|
|
 |
|