pUPnGO - 6Mb ISO - Basic Building Block Puplet

A home for all kinds of Puppy related projects
Message
Author
User avatar
Keef
Posts: 987
Joined: Thu 20 Dec 2007, 22:12
Location: Staffordshire

ndiswrapper

#401 Post by Keef »

I've looked a bit more closely at how I get wifi and ndiswrapper running under PupNgo (probably applies to other older pre- network-wizard puplets).
This is on the 216 version.
The best bit is that Perl and the ndiswrapper script are not needed.
I just make a directory in etc/ called 'ndiswrapper'
Copy the folder containing the windoze drivers - in my case 'netwg11t', into 'ndiswrapper'
I copy over an exisiting 'wpa_supplicant.conf' to etc/ but this could be edited manually of course.
Create another directory in etc/ called 'dhcpc'
dhcpcd was needed - copied it from the full 412, and it requires librt.so.1
loadndiswrapper is needed - the static one you made did not work for me so used a 'normal' one that is only 15k anyway.

Run this script:

Code: Select all

#!/bin/sh
## modify this script to include your wifi interface name (instead of "ath0")
## and wifi driver type (instead of "madwifi").
# Orginal script was provided by Tempestuous and modified by JustGreg for
# his network use.  Modified 12 May 2008 for testing of Dingo kernel 2.6.25

modprobe ndiswrapper
echo " Loading ndiswrapper module"

echo "Configuring Wireless LAN with wpa_supplicant"
## bring up the wireless interface, unconfigured
echo
echo "Starting up wlan0"
ifconfig wlan0 up
echo " "
echo "Now starting wpa_supplicant"
## first remove stale wpa_supplicant file if it exists
 if [ -e /var/run/wpa_supplicant/* ]; then rm /var/run/wpa_supplicant/*; fi
 wpa_supplicant -i wlan0 -D wext -c /etc/wpa_supplicant.conf -B
# sleep 60 used for testing.  For normal use, sleep 60 can be reduced
sleep 15
echo " "
# wp_cli is for testing.  However, it does show that wpa connect for 
#normal use.  
wpa_cli status
echo " "
echo "Running dhcpcd address service"
## for automatic IP
## first remove stale existings dhcpcd files if exists
# for puppy 2.17 use if [ -e /var/run/*.pid ]; then rm /var/run/*.pid; fi
# for puppy 3.00. Kill any active dhcpcd processes
dhcpcd -k wlan0
if [ -e /var/run/*.pid ]; then rm /var/run/*.pid; fi
rm /var/run/dhcpcd-*.*
dhcpcd -t 30 -h puppypc -d wlan0
sleep 5
## or for static IP
## modify /etc/resolv.conf to include your nameservers
#ifconfig ath0 192.168.0.xx broadcast 192.168.0.255 netmask 255.255.255.0
#route add default gw 192.168.0.1 ath0   # or whatever your router's IP is
Dug this out from the forum and adjusted to suit. I was having trouble previously (on the 412 version) until I discovered it was the 'sleep' after wpa_supplicant that was too short.

This script is to shut it down and tidy up:

Code: Select all

#!/bin/sh
#Just Greg script to terminate wifi processes 12 May 2008
# change wlan0 to your network interface name
dhcpcd -k wlan0
wpa_cli terminate
ifconfig wlan0 down
Still no joy with the '016' version, by the way...

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

#402 Post by goingnuts »

Keef: Excellent! Thanks for sharing your findings! I don't know why static loadndiswrapper did not work though...but seems that the other components do (wpa_supplicant, iwconfig and friends). My own wireless.sh script is only working every second time or so and I only can test it with WPA2. Would be cool to have a descent cli-based network-wizard...

Sorry you have no joy with the '016' version - my best guess is that one might have to modify the udev-rules - I took the main part of them from Lupo525 and they seems to work in P412 and P216 as well. I cant reproduce your error but I had to delete the drm/drm_kms_helper.ko to avoid black screen after boot (NVIDIA-cards - small report included in /etc/pupngo_udev_readme).

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

#403 Post by goingnuts »

I have been working on further modifying desklaunch. Now have the 3 mouse buttons defined in desklaunchrc, auto update image if icon change (works for symlinks too - useful for drive icons), user setting of font, fontcolour, colour of tooltip background (including transparent), removed Numlock bug, optimized main loop for lower cpu-usage, built in default image if image not found, removed the need for group settings in jwm and auto-adjust icon position depending on screen resolution . All in 15K.
But I have not been able to prevent jwm from showing all the icon windows in pager.
If anyone have a hint to solve this please give it away.
Update 280611: haven't solved it - seems that jwm only respect
"attr.override_redirect = 1" but that puts icons on top of all. He should respect "WMHints initial_state = 3 (IconicState)" but I haven't been able to tell him to...
The attached patch to jwm solves the problem by not adding sticky windows to pager - really cant see why they should be there in the first place.
Update 300611: For updates on this subject view
http://www.goingnuts.dk/programs.asp#NDL
Attachments
patch.tar.gz
patch to jwm that remove sticky windows from pager
used source jwm-2.0.1-pe-beta-1
(377 Bytes) Downloaded 352 times

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

#404 Post by technosaurus »

I take it the nolist group tag wouldnt fix it either then?

also while I am here, it looks like quite a few people are interested in gtk1 so I will post the "hidden" link to the old gtk1 standalone flash player (gflashplayer) which uses less than 9mb of RAM (depending on the size of the swf)

get gflashplayer

it needs a symlink for:
/usr/lib/libstdc++-libc6.2-2.so.3
to your existing libstdc++

One can theoretically play flash games on systems with <32mb of ram (surprisingly most swf games that I tried did work ... better to use other programs for flv anyways)

Edit:
using the Xvesa/jwm command to start X can sometimes fail because jwm tries to start before the X server is established.
This is easily fixed with sleep but to get the sleep value large enough for older PCs, it causes undue delay for others.
I recalled a program in tinycore that was called waitforx, but couldn't find any source code and wasn't 100% sure what it did, so I just wrote my own that just keeps trying to connect to a display and returns as soon as it does (so that a wm wont fail to open a display and quit)

Code: Select all

#include <X11/X.h>
int main(int argc, char *argv) {
int i=0;
for (i; i < 4095; i++) {
	if (XOpenDisplay(0)) return(1);}
return(0);
}
This works with either Xvesa or other Xservers (Xfbdev, Xorg...)

Ex.

Code: Select all

X & waitforx && jwm -display :0; killall X
where the initial "X" could be:
Xvesa -br -kb -nozap -screen 640x480x16 -shadow -mouse /dev/mouse -nolisten tcp -tst -I
or simply
Xorg
The && after waitforx prevents the wm from trying to start if the Xserver fails, while the killall X keeps the Xserver from staying open if the wm quits (this part could be modified if you wish to change window managers on the fly)
Attachments
waitforx.gz
compiled in wary, you will need to make it executable and put in /usr/bin to use it
(1.31 KiB) Downloaded 352 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:

#405 Post by goingnuts »

technosaurus wrote:I take it the nolist group tag wouldnt fix it either then?
I use jwm-2.0.1-pe-beta-1 with patches - and the nolist seems only to effect the task-list and not the pager. Couldn't find any flags to prevent jwm to show sticky windows in pager(s)...
technosaurus wrote: using the Xvesa/jwm command to start X can sometimes fail because jwm tries to start before the X server is established.
Can it also fail if you use xinit to launch jwm via .xinitrc (ex: xinit /root/.xinitrc -- -screen 800x600x256)? Just curious...

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].

Post Reply