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:

#406 Post by technosaurus »

No, init has similar code, but I made a small static version that doesn't need Xlib at all.(getenv DISPLAY instead)
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:

#407 Post by goingnuts »

Cool! Any chance to have it replace xinit? Taking args as xinit I mean? Then one could symlink waitfordisplay to xinit without changing any other code/scripts....
Edit: Might just use a script like below (not tested):

Code: Select all

#!/bin/ash
XINITRC="$1"
COMMAND="X $(echo $@ | cut -d " " -f3-)"
"$COMMAND" &
waitfordisplay
exec "$XINITRC"
replacing the xinit in command:
xinit /root/.xinitrc -- -screen ${VIDEOMODE} -shadow -mouse /dev/${MOUSEDEVICE},5

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

#408 Post by technosaurus »

I wrote a little C proggie to quick autostart X, but I set it to be able to change the window manager instead. If you fixed the wm to jwm, you could use the argv for the X server.
EGGSACK is the shell equivalent of command &
EGGSACKWAIT is similar to command && ...
SHIFT is similar to shift in shell, but requires an integer arg for # of shifts

Code: Select all

/* Notes
 * no need for getenv/setenv PATH because execvp will automatically try /bin:/usr/bin
 * this program will run Xvesa with jwm if no arguments are passed, but
 * it requires Xvesa, waitfordisplay and jwm to exist in /bin:/usr/bin
 * usage: quickX [wm <arg for display :0>]
 * Copyright 2011 Brad Conroy
 * License: GPL2
 */
#include <unistd.h>
#define EGGSACKWAIT(a) ({int s,p;if((p=fork())==0){execvp(a[0],a);}else{while(wait(&s)!= p);}})
#define SHIFT(i,a) ({ int j=0;while(a[j] != NULL){a[j]=a[j+i];j++;}})
#define EGGSACK(a)	({if((fork())==0) execvp(a[0],a);})
int main(int argc, char** argv) {

char* X[99];
X[0]="Xvesa";
X[1]="-screen";
X[2]="1024x768x24";
X[3]="-nolisten";
X[4]="tcp";
X[5]=NULL;
EGGSACK(X);

char* wd[99];
wd[0]="waitfordisplay";
wd[1]=NULL;
EGGSACKWAIT(wd);

char* wm[99];
wm[0]="jwm";
wm[1]="-display";
wm[2]=":0";
wm[3]=NULL;
if(argc>1){
	SHIFT(1,argv);
	EGGSACKWAIT(argv);
}else{
	EGGSACKWAIT(wm);
}

char* kX[99];
kX[0]="killall";
kX[1]="Xvesa";
kX[2]=NULL;
EGGSACKWAIT(kX);

}
Edit:
here is a minimal mimic of xinit ... also cleaned up some unnecessary variable declarations
just add another "EGGSACK" for any scripts you want to run _while_ X is starting after the X eggsack ... or after the waitfordisplay eggsack if the server needs to be running
if you need programs to run sequentially use EGGSACKWAIT

Code: Select all

#include <unistd.h>
//these could be functions but gcc complains less this way 
#define EGGSACKWAIT(a) ({int s,p;if((p=fork())==0){execvp(a[0],a);}else{while(wait(&s)!= p);}})
#define SHIFT(i,a) ({ int j=0;while(a[j] != NULL){a[j]=a[j+i];j++;}})
#define EGGSACK(a)	({if((fork())==0) execvp(a[0],a);})
int main(int argc, char** argv) {

char* X[99];
if (argc>1) {
	argv[0]="Xvesa"; //could be X if using a symlink ... compat w/ xvfb, xvesa...
	EGGSACK(argv);
}else{
	X[0]="X";
	X[1]=NULL;
	EGGSACK(X);
}
//script? [0]="/root/.xinitrc" ...really getenv("HOME") instead of root

//could add the waitfordisplay code directly but only uclibc is compliant
//so currently forcing it to be separate till I get rid of the GNUisance
//tinycore's waitforX works but makes a large static bin due to Xlibs
X[0]="waitfordisplay";
X[1]=NULL;
EGGSACKWAIT(X);

X[0]="jwm";
X[1]="-display";
X[2]=":0";
X[3]=NULL;
EGGSACKWAIT(X);

X[0]="killall";
if (argc>1) {
	X[1]="Xvesa";
}else{
	X[1]="X";
}
//may want to add any programs that hold on to X server here
X[2]=NULL;
EGGSACK(X);

}
Attachments
jwmfaststart.tar.gz
here is a tarball with waitfordisplay and x
just running x will run Xorg
x &lt;parameters&gt; will run Xvesa with those parameters
(3.66 KiB) Downloaded 275 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].

User avatar
01micko
Posts: 8741
Joined: Sat 11 Oct 2008, 13:39
Location: qld
Contact:

#409 Post by 01micko »

Hi goingnuts

I tried pUPnGO_V216_060611.iso on my old 486. It's an IBM 80486DX50 with 16M RAM, 80M swap. Previously it had 32M but some of it was dodgy and had to be removed. Installed on the HDD is big_bass fat-free_dillo-216 as a full install but that is failing to get to X, it used to when it had 32M RAM. It used to run quite successfully, on the net, playing mp3s, CDs, basic browsing with elinks.

Now what I want to do with it is just that, but I don't need X. I can do all the things I want in console. Running live would be a bonus.

I thought I'd try your pUPnGO_V216_060611 variant because it uses the same kernel with which I had success and has a very small footprint.

I booted with Pakt's wakepup-2 floppy and had no issue with initialising boot. However, once I got to the 'depmod' part the machine just hangs there, keyboard is still responsive so it hasn't crashed. I let it go 20 odd minutes, no response. I tried different log levels with no clues, sorry. The machine still successfully boots fat-free_dillo to RAM, no X (the HDD was thrashing like a frenzied shark when trying to start X, almost got there though).

Any ideas?

TIA

EDIT:
Thoughts that occurred to me
  • I don't recall that swap was being detected and loaded, at least up until the 'depmod' stage anyway, I'll poke around in init (fat-free did detect and load swap)
    The zdrv wasn't loading due to RAM constraint? Maybe I'll do an lsmod in fat-free and cut the zdrv
Puppy Linux Blog - contact me for access

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

#410 Post by goingnuts »

technosaurus: Thanks for the scripts - I will test them asap!
01micko: Thank you for testing! I have no 486 machine so I can only test in qemu. No problem booting with 20Mb ram there (usually 20Mb ram in qemu is reported as 16Mb inside the running OS...). Going down to 16Mb (should then equal 12Mb on real hardware) it seems to have the problem you describe - hanging at depmod for ages. The version you are testing have to create the driver files (modules.dep and friends) at first boot and it might be that 16Mb ram then is at a limit.
I did a test to see if a swap partition is picked up: It is - but after depmod.
Maybe try booting without zdrv included - create a save file + swap - and reboot with zdrv?
Or inject a modules.dep from 216 to the pup_216pupngo.sfs before booting?

PANZERKOPF
Posts: 282
Joined: Wed 16 Dec 2009, 21:38
Location: Earth

#411 Post by PANZERKOPF »

Yet another image viewer:
http://www.johnhawthorn.com/meh/
Did you know about it?
Supports jpeg,gif,png,bmp,netpbm.
Really fast and small (about 20Kb). Needs Xlibs only.
Disadvantages: Cannot rotate or flip image. Other well-known formats like tiff and xpm are unsupported.
SUUM CUIQUE.

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

#412 Post by goingnuts »

PANZERKOPF: No - I did not know - very nice finding! I have tried to contact developer and asked if xpm-support will be included in the future...
Thanks!:D

PANZERKOPF
Posts: 282
Joined: Wed 16 Dec 2009, 21:38
Location: Earth

#413 Post by PANZERKOPF »

Well, seems we have identical purposes. :)
pUPnGO has ndiswrapper (I mean parser, not a kernel module) which needs Perl.
I have found another ndiswrapper written in pure C so it doesn't need any external interpreter. Source is attached here.
Attachments
ndiswrapper.tar.gz
(15.94 KiB) Downloaded 271 times
SUUM CUIQUE.

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

#414 Post by technosaurus »

meh's memory usage is horrid, I thought the code looked too clean. It just needs to free the large intermediate image data... I started working on an xcb based viewer though it may be a while.

Edit:
Improving the jwm menu here:
http://murga-linux.com/puppy/viewtopic.php?t=70804
Submenu support, 15x speedup and shell-only (no dependencies)
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:

#415 Post by goingnuts »

PANZERKOPF: I have no chance to test the ndiswrapper - but remember I considered translation of a perl-script to bash...
I have attached a static build of your ndiswrapper - 26K - any chance you could test it?
technosaurus: I haven't had time to evaluate the meh memory usage...but your JWM-menu-thing looks very promising!

Been busy caught up in building features on top of slock Xscreenlocker, view here - having fun with C/X-coding....
Attachments
static_ndiswrapper.tar.gz
static ndiswrapper
(15.12 KiB) Downloaded 250 times

PANZERKOPF
Posts: 282
Joined: Wed 16 Dec 2009, 21:38
Location: Earth

#416 Post by PANZERKOPF »

goingnuts wrote:any chance you could test it?
Sorry, I was not correct. Seems that ndiswrapper is old and buggy (crashes with segfault).
I found latest code from GeexBox project (file is attached). Today I rmmod-ed native module of my wireless card and loaded ndiswrapper module. It works with files parsed by this tool. Now I write this text "through" ndiswrapper :)
One exception: It cannot parse unicoded inf files. We must convert unicoded inf file to
one-byte encoding.
Attachments
ndiswrapper.gz
(9.53 KiB) Downloaded 268 times
SUUM CUIQUE.

PANZERKOPF
Posts: 282
Joined: Wed 16 Dec 2009, 21:38
Location: Earth

#417 Post by PANZERKOPF »

Double post.
Deleted.
SUUM CUIQUE.

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

#418 Post by technosaurus »

goingnuts wrote:PANZERKOPF: I have no chance to test the ndiswrapper - but remember I considered translation of a perl-script to bash...
I have attached a static build of your ndiswrapper - 26K - any chance you could test it?
technosaurus: I haven't had time to evaluate the meh memory usage...but your JWM-menu-thing looks very promising!

Been busy caught up in building features on top of slock Xscreenlocker, view here - having fun with C/X-coding....
I added a new utility to the jwm menu tools that replaces the slow ppm package manager GUI ... it still uses petget and some of puppy's default icons, so it may need a couple of mods to work with pupngo.
BTW your slock mods look great.

Edit:
After doing the menu, package manager replacement and jwm notification/dialog apps, I decided to try and gather the jwm addon apps together in one package... like your drive tray & background setter. Where can I get your latest versions.
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:

#419 Post by goingnuts »

Where can I get your latest versions.
Attached the present state of various jwm-stuff I have. Did a test of your jwm-configurator in pupngo: Runs quick and nice although some setting must be adjusted. I do like to split .jwmrc in sections (command, desktop, styles,tray etc.) - for me it is simpler...
Also like to have predefined menus that the desktop-files need to comply with - think the user should be the one to control what categories he/she wants...
Also attached my rudimentary try to make a shell-replacement for the xdg-suite...
Edit: Adapted your script to pm_jwm_xdg.sh - reduced script time to 8% of my original script :D

Code: Select all

#!/bin/ash
#overall categories
MAINCATEGORIES="AudioVideo
Development
Education
Game
Graphics
Help
Network
Office
Settings
System
Utility"
#dummy category="Other"
for X in /usr/share/applications/*.desktop; do
  ICON="" CATEGORY="" NAME="" COMMAND=""
  while read LINE ; do
    case $LINE in
      Name=*) NAME="${LINE#*=}"'' ;;
      Icon=*) ICON="${LINE#*=}"''  ;;
      Categories=*) CATEGORY="${LINE#*=}"'' ;;
      Exec=*) COMMAND="${LINE#*=}"'' ;;
    esac
  done < $X
  [ "${ICON}" = "" ] && ICON="Default.png"
  #check to which category it belongs
  if [ ! "${CATEGORY}" = "" ]; then
    if [ ! "$(echo $MAINCATEGORIES | grep $CATEGORY)" = "" ]; then
      for Y in ${MAINCATEGORIES}; do
        if [ "${Y}" = "${CATEGORY}" ]; then
          echo "<Program label=\"$NAME\" icon=\"$ICON\">$COMMAND</Program>" >> /tmp/"${CATEGORY}"
        fi
      done
    else
       echo "<Program label=\"$NAME\" icon=\"$ICON\">$COMMAND</Program>" >> /tmp/Other
    fi
  fi
done
# construct the final menu
echo -n "" > /tmp/menu
# handle the Other category
if [ -f /tmp/Other ]; then
  echo "<Menu label=\"Other\" icon=\"Other.png\">" >> /tmp/menu
  cat /tmp/Other >> /tmp/menu
  echo "</Menu>" >> /tmp/menu
  rm -f /tmp/Other # clean up
fi
for Y in ${MAINCATEGORIES}; do
  if [ -f /tmp/$Y ]; then
    echo "<Menu label=\"$Y\" icon=\"$Y.png\">" >> /tmp/menu
    cat /tmp/$Y >> /tmp/menu
    echo "</Menu>" >> /tmp/menu
    rm -f /tmp/$Y # clean up
  fi
done
# publish the menu
echo "<JWM>" > /root/.jwmrc-installed
cat /tmp/menu >> /root/.jwmrc-installed
echo "</JWM>" >> /root/.jwmrc-installed
rm -f /tmp/menu # clean up
exit
Attachments
pupngo_jwm_stuff190811.tar.gz
(5.64 KiB) Downloaded 304 times

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

#420 Post by technosaurus »

I think I have come up with a way to let users (or pupleteers) choose and support everywhere from a single jwmrc to a separate include for every parameter. Almost too simple, so I am sure it will need tweak.... a separate config file with

Var1=
Var2=
...

Easily sourced by...?
. $HOME/.JWMRC
A program could choose to use only 1 or all vars to gen 1 or many xml files

And it would be fast and easy to mod with the while read line case format

Thoughts?
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:

jwm-2.0.1 static build compiled with uclibc and X11tiny

#421 Post by goingnuts »

configured with: --disable-confirm --disable-png --disable-jpeg --disable-xft --disable-fribidi --disable-xinerama --disable-xrender

with the "patch to jwm that remove sticky windows from pager" from here

Shipped as 125k upxed bin. Unpacked 266K - running using only 580K.
Same configuration but with dynamic linking is 124K and use 2636K.
Only bug so far is the time - showing time 2 hours behind - I have no clue to fix that other than setting system time 2 hours in the future :shock: Setting timezone to GMT0 also works.

Update 160911: Attached static build of rxvt-2.6.4 169K unpacked - shipped as 85K upxed bin. If ps tells the truth normal rxvt uses 2640K and this static build uses 368K running.

Update 190911: Finally got png to work so ship a build with everything but xft and fribidi enabled (confirm icons png shape xinerama xpm xrender). Unpacked size 413K shipped as upxed bin 204K.
Attachments
rxvt-2.6.4_static.tar.gz
rxvt-2.6.4 static build compiled with uclibc and X11tiny.
(83.5 KiB) Downloaded 267 times
jwm-2.0.1_static.tar.gz
jwm-2.0.1 static build compiled with uclibc and X11tiny.
(123.35 KiB) Downloaded 316 times

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

#422 Post by technosaurus »

I made a partially-static compile of dillo3 here:
http://murga-linux.com/puppy/viewtopic. ... 263#564263
(no libstdc++ or fltk-1.3 dependency, just X11, Xft and image libs)
... also I posted my uclibc++ and fltk configs a few posts later
anyhow, it ended up being smaller than the shared libstdc++ build, so it may be useful for using c++ apps (and pretty easy, no extra toolchain required, since it includes a wrapper ... which I was also able to modify to keep out unwanted optimizations flags like -O3 etc...)

btw what version of tinyx11 are you using? amigo's? any patches?
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:

#423 Post by goingnuts »

Tested you minimal dillo in P412 - was missing libjpeg.so.7 - but symlink to libjpeg.so.62.0.0 made him start. Looked nice - but crashed trying to go to 'http://goingnuts.dk/linux.asp' with a Segmentation fault :?:
Anyway - would it be possible to do full static build using tinyX11?

I am using amigos tinyX11 - but have added Xt, Xmu, SM, ICE and Xinerama (and added a couple of missing functions to tinyX11) to do this jwm. Attached build of Patriots JWM 2.0.1 with Enhancements and Fixes + the "no-sticky-in-pager-patch", 419K unpacked - shipped as 207K upxed bin. Only excluded fribidi and xft. I think this version of jwm is even better than the official 500...
Update 210911: Found a missing xfunction in the first attached bin that made a defect upper right corner of client windows - sorry. I have uploaded a new build with this fixed.
Last edited by goingnuts on Wed 21 Sep 2011, 17:56, edited 2 times in total.

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

#424 Post by technosaurus »

Re:dillo, If it wouldn't be too much trouble to package up your toolchain (any format will do), I can build a compatible minimal uclibc++ toolchain (or 2 or 3 ... sometimes minimal is too minimal ... for example, exceptions and rtti add a lot of bloat, but some programs use exceptions extensively --- geany required a lot of commenting out to get it to build) I posted my .config and other config options in the dillo thread a couple of posts later using
http://git.uclibc.org/uClibc++/snapshot ... er.tar.bz2
http://www.fltk.org/software.php?VERSIO ... 38.tar.bz2

EDIT btw the uclibc++ wrapper is a great template for eliminating the unwanted CFLAGS that upstream imposes on all builds (-O3 can be set to -Os, -finline* can be removed or replaced with -finline-small-functions etc...)

I do a lot of compiling and get a little annoyed with the stream of output clobbering my commands (I know they are still in history but I like to be able to scroll through them still) I also like sometimes having a history file that is not limited to a certain number of lines, so I can check for errors or special -D* defines or CFLAGS passed during compilation. I _had_ been using an Xdialog tailbox but have switched to rxvt + dialog for portability in my pupngo base systems with only X

Code: Select all

#!/bin/sh
touch /tmp/cmdhist
rxvt -e dialog --tailbox /tmp/cmdhist 0 0 &
while read CMDS; do
	echo " # ${CMDS}" >>/tmp/cmdhist
	eval ${CMDS} 2>>/tmp/cmdhist >>/tmp/cmdhist
done
there is much room for improvement like:
using tee to redirect to file while keeping stderr (if you just remove 2>>/tmp/cmdhist it will stay local but not be logged)
option to not show the output at all or only certain parts etc...
The basic idea here is how terminal emulators work, but missing stdin
(I got the idea while trying to learn to port a terminal to xcb)
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:

#425 Post by goingnuts »

I will try to make a package containing the uclibc used + my present tinyX11 source. It might take a day or two though.
Succeeded today to build links-2.3pre1 static - at the moment without ssl - but ended up in a 2400k bin (removed every language but english). Using 3800K running. Always liked links-2.3pre1 as it provides images, partly support javascript and build with ssl gives access to Gmail and other internet based services...

Post Reply