pUPnGO - 6Mb ISO - Basic Building Block Puplet

A home for all kinds of Puppy related projects
Message
Author
User avatar
technosaurus
Posts: 4853
Joined: Mon 19 May 2008, 01:24
Location: Blue Springs, MO
Contact:

#141 Post by technosaurus »

Ad blocking gui for dialog or Xdialog-gtk1

Code: Select all

#!/bin/sh
[ -z $DISPLAY ] && DIALOG=dialog || DIALOG=Xdialog
[ ! -f /etc/hosts.usr ] && touch /etc/hosts && cp -f /etc/hosts /etc/hosts.usr #back up original
for x in `$DIALOG --stdout --checklist "Choose your ad blocking service(s)" 0 0 6 1 "mvps.org" off 2 "systcl.org" off 3 "technobeta.com" off 4 "yoyo.org" off 5 "turn off adblocking" ON 6 "manually edit" off |tr "/" " " |tr '\"' ' '`; do
   case $x in
   1)wget -c -4 -t 0 -O /tmp/adlist1 'http://www.mvps.org/winhelp2002/hosts.txt';;
   2)wget -c -4 -t 0 -O /tmp/adlist2 'http://sysctl.org/cameleon/hosts';;
   3)wget -c -4 -t 0 -O /tmp/adlist3 'http://www.technobeta.com/download/urlfilter.ini';;
   4)wget -c -4 -t 0 -O /tmp/adlist4 'http://pgl.yoyo.org/as/serverlist.php?hostformat=hosts&showintro=0&mimetype=plaintext';;
   5)ln -sf /etc/hosts.usr /etc/hosts && exit;;
   6)[ -z $DISPLAY ] && $DIALOG --editbox /etc/hosts 0 0 && exit || vi /etc/hosts && exit;;#dialog has no editbox so try vi which is cli and in busybox
   *)echo $x;;
   esac
done
touch /tmp/adlist{1,2,3,4} #in case they weren't downloaded
cat /etc/hosts.usr /tmp/adlist{1,2,3,4} |sed 's/^[ \t]*//' |sed 's/\t/ /g' |sed 's/  / /g' |grep ^[1-9] |dos2unix -u |sort |uniq > /etc/hosts.adblock
ln -sf /etc/hosts.adblock /etc/hosts
rm -f /tmp/adlist{1,2,3,4} #need to remove or unwanted lists will be added
#todo add whitelist
Last edited by technosaurus on Wed 01 Sep 2010, 03:05, edited 1 time in total.
Check out my [url=https://github.com/technosaurus]github repositories[/url]. I may eventually get around to updating my [url=http://bashismal.blogspot.com]blogspot[/url].

User avatar
technosaurus
Posts: 4853
Joined: Mon 19 May 2008, 01:24
Location: Blue Springs, MO
Contact:

#142 Post by technosaurus »

I posted the minimp3 player in the programming thread, but this time I compiled it against dietlibc and it is even smaller (30kb uncompressed) and uses only about 1/4th the ram (~400kb vs ~1700kb) and almost no cpu
http://www.murga-linux.com/puppy/viewtopic.php?t=59417
Check out my [url=https://github.com/technosaurus]github repositories[/url]. I may eventually get around to updating my [url=http://bashismal.blogspot.com]blogspot[/url].

goingnuts
Posts: 932
Joined: Sun 07 Dec 2008, 13:33
Contact:

#143 Post by goingnuts »

The minimp3 runs fine in pupngo - the new minimp3-builds ver0.3..

Made me wonder if alsa is needed at all to get sound...Probably common knowledge but I did remove all alsa-stuff from pupngo-build and still got sound from minimp3 (and xmms if present). Saving around 1600-1800K installed...
Funny thing is that a music mp3-file I use as test file is around 7Mb - almost doubles iso-build size...
Now if we could have a small mixer as well...more wants more...
Added 030910: After removing alsa the only three programs using ncurses left is grub, dialog and setterm. As most wizards already can run without dialog I wipped that one out. After trying to compile grub without need for ncurses (and all my trials failed) I found a grub bin inside geexbox that did not need ncurses. Setterm is only used for marking the actual date using xcal so that can be excluded...
Included aumix mentioned below as audio-mixer.
Now iso build size is below the targeted 8Mb (7964K) without loosing functionality...
Last edited by goingnuts on Fri 03 Sep 2010, 05:59, edited 1 time in total.

User avatar
technosaurus
Posts: 4853
Joined: Mon 19 May 2008, 01:24
Location: Blue Springs, MO
Contact:

#144 Post by technosaurus »

/proc/asound/card0/oss_mixer
seems to have the data

maybe this Xdialog script could be adapted to work (gtk1 version)

Code: Select all

#!/bin/sh
VOLUME=`amixer get Master | grep 'Mono:' | cut -d '%' -f 1 | cut -d '[' -f 2`
VOLUME=`Xdialog --stdout --under-mouse --title "VolumeControl" --buttons-style text --icon /usr/share/mini-icons/audio-volume-high.png \
--ok-label Set --cancel-label Advanced --rangebox "Master Volume" 9 30 0 100 $VOLUME`
if [ $? -eq 1 ];then
rxvt +sb -geometry 90x20 -e alsamixer
else
amixer set Master $VOLUME"%"
fi
aplay /usr/share/audio/2barks.au &
instead of amixer etc... maybe use grep and sed on the file directly

p.s. uploaded a new version that will play a list of files
Check out my [url=https://github.com/technosaurus]github repositories[/url]. I may eventually get around to updating my [url=http://bashismal.blogspot.com]blogspot[/url].

goingnuts
Posts: 932
Joined: Sun 07 Dec 2008, 13:33
Contact:

#145 Post by goingnuts »

For simple mixer found aumix and compiled without almost everything (./configure --without-ncurses --without-sysmouse --without-gtk --without-gtk1 -disable-nls). 11K stripped only using libc.

For GUI - xmixer might be used - 47K using shared libs...
Attachments
xmixer2.2.tar.gz
xmixer2.2
(20.16 KiB) Downloaded 392 times
aumix-2.9.1-i486.pet
aumix-2.9.1-i486 CLI-audio-mixer
(10.01 KiB) Downloaded 385 times

goingnuts
Posts: 932
Joined: Sun 07 Dec 2008, 13:33
Contact:

pmconky

#146 Post by goingnuts »

pmconky (Poor-Mans conky): The "quest" to reduce size and increase/maintain functionality continues. :)
Conky was introduced in pUPnGO to replace xload (have you seen its list of deps?), blinky and freememaplet. conky uses libs already needed for other applications in pUPnGO but take up huge 200K - and only delivers info that various shell scripts can give as well. So I found a replacement: root-tail - 14K! Writes content of text files to desktop...Reduce ISO size by 84 K.
So attached script to mimic the content conky delivers and root-tail. Will not work out of the box if ROX is in control of the desktop (kill ROX-Filer before use). The script is a draft - might even calculate wrong - modify for your own needs.
Attachments
pmconky.tar.gz
pmconky draft script + root-tail
(7.02 KiB) Downloaded 421 times
pmconky.png
pmconcy running in pUPnGO...
(63.64 KiB) Downloaded 1418 times

User avatar
technosaurus
Posts: 4853
Joined: Mon 19 May 2008, 01:24
Location: Blue Springs, MO
Contact:

#147 Post by technosaurus »

I had looked into the same things regarding ncurses etc... was thinking that gtk1 would take roughly the same space as those and then use Xdialog. (You can make some nice wizards with it... even a text editor, calendar, file browser, tail-boxes, color selector...)
these addons would then be possible:
ROX-Filer(amigo patched)
dillo-0.8.6
seamonkey-gtk1
xmms
mplayer-gtk1
aumix-2.90... but your Xmixer does look a bit nicer
gPS (view and kill running processes)
gFtp (ftp client)
minimum profit (highlighting text editor)
mtpaint-gtk1
blinky-tray
... and many more
Check out my [url=https://github.com/technosaurus]github repositories[/url]. I may eventually get around to updating my [url=http://bashismal.blogspot.com]blogspot[/url].

goingnuts
Posts: 932
Joined: Sun 07 Dec 2008, 13:33
Contact:

#148 Post by goingnuts »

technosaurus: I know you are right about using gtk1 and all it opens for...

But I still think that reducing size first is more important...pUPnGO is now below 8Mb ISO - and have full driver set for qemu. There is web-browser, sound and mixer, image-viewer, grub-hd-install, wizards and text-editor. Without drivers he is close to 6MB and still running GUI...
Read this the other day - far above my level but still indicates that major reduction is possible. I can hunt smaller apps. that do the same or build in different ways - but I think the major step could be in the coding...
jwm is 130K - and think of all the different things it can do! The xmixer is 47K and just have to adjust some volume - there must be a difference in level of smart coding...
Consider this hexdump application 202 B :!: from the site linked above. Thats small!

User avatar
technosaurus
Posts: 4853
Joined: Mon 19 May 2008, 01:24
Location: Blue Springs, MO
Contact:

#149 Post by technosaurus »

There is asmutils and embutils that can replace some busybox functions, and some of the unneeded stuff removed from the .config and maybe shift the absolute necessary kernel modules to the init and lzma it instead of gzip.
Check out my [url=https://github.com/technosaurus]github repositories[/url]. I may eventually get around to updating my [url=http://bashismal.blogspot.com]blogspot[/url].

goingnuts
Posts: 932
Joined: Sun 07 Dec 2008, 13:33
Contact:

#150 Post by goingnuts »

technosaurus: Trying to follow your guidelines:
First test using lzma went ok: Reduced initrd from 1928K to 1686K (approx. 12%). So kernel from P412 works as well with lzma. ISO now 7630K
First test with asmutils did not go well: Could not compile all utils. Haven't been able to mount the a-linux.img floppy disk to look if the utils could be copied from there.
embutils compile ok but haven't tested yet...
Will also try to make a BB for initrd including only what is needed.
Thought that the absolute necessary kernel modules already was in initrd?
Thank you for all you suggestions!

User avatar
technosaurus
Posts: 4853
Joined: Mon 19 May 2008, 01:24
Location: Blue Springs, MO
Contact:

#151 Post by technosaurus »

I already have most of those but I am on my Droid. also you can upx the kernel
Edit
The busybox in init is minimal, but it should probably be available after the switch root for daemons. The shared libc version uses an extra 1mb for each daemon.
Check out my [url=https://github.com/technosaurus]github repositories[/url]. I may eventually get around to updating my [url=http://bashismal.blogspot.com]blogspot[/url].

User avatar
technosaurus
Posts: 4853
Joined: Mon 19 May 2008, 01:24
Location: Blue Springs, MO
Contact:

#152 Post by technosaurus »

I compiled debian's latest version of dash statically against dietlibc - only 73kb without being upx'd. It works great for basic scripts and uses a lot less ram. I also have a dietlibc binaries collection here:

http://code.google.com/p/diet-binaries/downloads/list

sleep is a major one to pull out of there so I will include it with the dietdash tarball ... there were some other files built with the dash compile that may be useful to others... mkinit mknodes mksignames and mksyntax --- not needed for pupngo images though.
Attachments
dashdiet.tar.gz
(58.98 KiB) Downloaded 317 times
Check out my [url=https://github.com/technosaurus]github repositories[/url]. I may eventually get around to updating my [url=http://bashismal.blogspot.com]blogspot[/url].

goingnuts
Posts: 932
Joined: Sun 07 Dec 2008, 13:33
Contact:

#153 Post by goingnuts »

Did a lot of testing trying to get initrd based on asm/emb/bb-utils. You might put a reasonable mix together but still miss some of the utils thats present in BB. Almost got below 7Mb ISO but in the end I think you loose more in applications than you win in reduced size. BB seems to be the best compromise between number of apps and size (and ease of build...). The use of some of the small utils to save mem works: Using sleep from asmutils reduces it from approx. 1700 to 88.
Have not been able to UPX kernel (tried p412 and p431 kernels).
Removed unused editors, mail and printing stuff from BB (reduced size with approx 40K) and now down at 7,6MB ISO so room for new/better applications made...

scsijon
Posts: 1596
Joined: Thu 24 May 2007, 03:59
Location: the australian mallee
Contact:

#154 Post by scsijon »

goingnuts,

do you have another site (other than mediafire) that I can download the "full" version from, that site is just giving me grief as it's continually timing out. I can't even get started.

I do like the idea though, it's like going back to a puppy basic system.

?I wonder if it really needs X to do a simple lamp server though, wouldn't it be better without?

regards and thanks
scsijon

goingnuts
Posts: 932
Joined: Sun 07 Dec 2008, 13:33
Contact:

#155 Post by goingnuts »

scsijon: I have put it at my server. Will remove it again as some search engines keeps pulling files every day...
You can do the LAMP without X-GUI - if it improves depends on how minimal your hardware is...
puppymartin already made a LAMP-version with pupngo

User avatar
technosaurus
Posts: 4853
Joined: Mon 19 May 2008, 01:24
Location: Blue Springs, MO
Contact:

#156 Post by technosaurus »

I also compiled inotifywait, inotifywatch, cupsd (no ssl), and a couple others against dietlibc and edited the bash bang headers (switched to dash) to cut the load of backgrounded processes by ~20Mb in a stock 4.31 puppy.

I did not get udevd, syslogd, klogd, or dhcpcd to compile cleanly yet, but if I can't I may try uclibc instead, since Rob Landley finally put out the 1.0 release of aboriginal (formerly firmware linux)

Note: Large scripts that simply run and exit are much faster with busybox ash. In general, only use dash for backgrounded processes that stay running.
Check out my [url=https://github.com/technosaurus]github repositories[/url]. I may eventually get around to updating my [url=http://bashismal.blogspot.com]blogspot[/url].

User avatar
harii4
Posts: 448
Joined: Fri 30 Jan 2009, 04:08
Location: La Porte City, IA , U.S.A.
Contact:

#157 Post by harii4 »

technosaurus,
rox-1.3.pet (runs great)
is there any way to remove ''running as user 'root' ''
right now using PULP but thinking switching to classic pup 2.14x

EDIT:
roxgtk1-2.2.pet has the ''running as user 'root' '' as well
the memory uses are real close to emelfm.
Last edited by harii4 on Fri 10 Sep 2010, 18:04, edited 1 time in total.

User avatar
technosaurus
Posts: 4853
Joined: Mon 19 May 2008, 01:24
Location: Blue Springs, MO
Contact:

#158 Post by technosaurus »

http://www.murga-linux.com/puppy/viewtopic.php?p=441060
this version has running as root removed and some backports by amigo (most of the package is images that could be replaced with symlinks to save size)

Edit: I also posted the 1.17.2 busybox with most recent patches and added minimp3 as a busybox applet
http://www.murga-linux.com/puppy/viewtopic.php?p=449281
...will try and get a static uclibc build of it soon.
Check out my [url=https://github.com/technosaurus]github repositories[/url]. I may eventually get around to updating my [url=http://bashismal.blogspot.com]blogspot[/url].

goingnuts
Posts: 932
Joined: Sun 07 Dec 2008, 13:33
Contact:

#159 Post by goingnuts »

I have been trying to move drivers from initrd.gz to kernel as there seems to be some potential in boot-time, total ISO-size and reduced complexity. The idea is to have modules either in kernel or in zdrv, having all code needed to boot pupngo in initrd and all the rest of the basic system in main-sfs. This might also ease kernel up/down-grade as only kernel and zdrv might need to be changed.
Moving all crypto things to kernel seems to work (update: heavy works but light do not...) - but how to deal with all the fs and usb-stuff? Does kernel auto load and configure usb and fs? Anyone tried this or know how to do it or why not to do so?
To sort of answer my own question: Its possible to build in all the drivers from initrd - and boot normal. Seems that aufs do not work and you should hard code LAYERFS=unionfs in top of init. Boot time seems faster - and final iso size is reduced - and kernel size increase approx. 1K.
An example (not really pupngo but from my xwoaf re-borne project), view under xwoaf - x windows on a floppy - stuff, step 3.
Last edited by goingnuts on Sat 25 Sep 2010, 15:27, edited 2 times in total.

User avatar
technosaurus
Posts: 4853
Joined: Mon 19 May 2008, 01:24
Location: Blue Springs, MO
Contact:

#160 Post by technosaurus »

earlier versions of tinycore used jwm
Check out my [url=https://github.com/technosaurus]github repositories[/url]. I may eventually get around to updating my [url=http://bashismal.blogspot.com]blogspot[/url].

Post Reply