pUPnGO - 6Mb ISO - Basic Building Block Puplet

A home for all kinds of Puppy related projects
Message
Author
goingnuts
Posts: 932
Joined: Sun 07 Dec 2008, 13:33
Contact:

#681 Post by goingnuts »

Uploaded below my present source of tinyXlib. From Changelog:
20120719: Changed ICElib to include transport to make ROX-Filer compile.
20120916: Added GetFPath.c to get Abiword 1.0.7 compile. Added X11/Xmu/Misc.h for XawM-1.5u.
20121002: Added ListExt.c and QuBest.c to X11 for xdpyinfo
20121011: Changed libXt source and include/X11/Intrinsic.h to test if Xaw can be compiled. Added GetDflt.c to tinyX11 and added -DXOS_USE_MTSAFE_PWDAPI to tinyXll make flags
Removed file Copying as well.
I have not tested the libXaw much but at least it compiled the attached xload - which is using approx 700k when running compared to the dynamic linked xload which uses approx 3400k...
Now we might have most of the tools to do a mcb of most of the X-utilities.

Anyone know where sources for absvolume has gone?
20130513: Removed attachment as forum does not support the size anymore
Last edited by goingnuts on Mon 13 May 2013, 17:42, edited 1 time in total.

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

#682 Post by technosaurus »

Small tip on the static builds, if you still use -ffunction-sections -fdata-sections when you build the objects (.o files), you can get a list of unused functions and data by doing the final link with -Wl,--gc-sections,--print-gc-sections (output to a file for later use). Then you can use that data to remove all of the useless functions and data from the .c/.h files. When you build shared libs, they will be _almost_ as small as a single static build (added space for position independent code and elf data).
This is essentially what libopt and the perl script in either uclibc or uclibc++ do (i don't recall which) except they use the symbol tables more directly using objdump or similar.
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:

#683 Post by goingnuts »

Static build of tightvncserver/viewer 1.3.10...replaced the perl vncserver-script with rarsa´s shell-version...

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

#684 Post by goingnuts »

Trying to implement some multiuser capabilities in pupngo...but run into a lot of things not working. Most things have been fixed but uncertain on some of the solutions so guidelines would be helpful:

* Many configuration scripts and wizards uses /tmp for temp-files and I have changed user/owner of /tmp to spot and given group r+w. That helps a lot but still no way for spot to overwrite files created by root. So should the wizards use the users home dir for temporary files or is there another/better way?

* The mount/umount command is for superuser only - any workaround for this to give a normal user those rights?

* Running udhcpc to configure the network has the same problem: Only root have the power to get an ip...any suggestions beside configure at boot-time?

I would like to prevent using sudo if possible...

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

#685 Post by technosaurus »

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:

#686 Post by goingnuts »

Thanks! And found a gtk1-source at amigos place :)
Guess the use of gksu or su should be coded in for every function where it is needed...(?).
Implemented the real su as BB-su had some limitations. Working on a solution for CLI only like the below modification in mount-script:

Code: Select all

if [ ! $(id -u) = 0 ]; then
  TARGET="${@}"
  su -c "mount-FULL -n ${TARGET}" root
else
  mount-FULL -n ${@}
fi
which works - and could be expanded to lookup a list of users where mount is enabled. Guess I have to adapt this to every other function that need roots privilege for making scripts working (mkdir in /mnt, umount etc...).

Update 20121210: Found that it is very difficult to get "su -c "some_command" running from scripts when in X. Replaced with sudo things are much easier...changed above snippet to:

Code: Select all

if [ ! $(id -u) = 0 ]; then
[ $(which sudo) ] && sudo mount-FULL -n ${@}
else
mount-FULL -n ${@}
fi
Update 20121213: sudo need /etc/sudoers configured. Found that one need to add "Defaults env_keep += "HOME"" to keep the HOME of spot when using sudo. This influence the icon_unmounted_func/icon_mounted_func which controls the ROX drive icon change when mount/umount are used. Strange thing is that the icon change when mounting/unmounting is very slow (slowest when umount) and icon change faster in .pup_event than on the desktop...

bark_bark_bark
Posts: 1885
Joined: Tue 05 Jun 2012, 12:17
Location: Wisconsin USA

#687 Post by bark_bark_bark »

hello. I think this is a great project and I am currently am using "pUPnGO_V216_060611.iso" through QEMU and so far it works great. I have had no problems with the GUI_V412.sfs either. pUPnGO is the best and I hope you can keep it alive. I will actually install it on a computer soon.
....

User avatar
BarryK
Puppy Master
Posts: 9392
Joined: Mon 09 May 2005, 09:23
Location: Perth, Western Australia
Contact:

#688 Post by BarryK »

goingnuts wrote:Thanks! And found a gtk1-source at amigos place :)
Guess the use of gksu or su should be coded in for every function where it is needed...(?).
Implemented the real su as BB-su had some limitations. Working on a solution for CLI only like the below modification in mount-script:

Code: Select all

if [ ! $(id -u) = 0 ]; then
  TARGET="${@}"
  su -c "mount-FULL -n ${TARGET}" root
else
  mount-FULL -n ${@}
fi
which works - and could be expanded to lookup a list of users where mount is enabled. Guess I have to adapt this to every other function that need roots privilege for making scripts working (mkdir in /mnt, umount etc...).

Update 20121210: Found that it is very difficult to get "su -c "some_command" running from scripts when in X. Replaced with sudo things are much easier...changed above snippet to:

Code: Select all

if [ ! $(id -u) = 0 ]; then
[ $(which sudo) ] && sudo mount-FULL -n ${@}
else
mount-FULL -n ${@}
fi
Update 20121213: sudo need /etc/sudoers configured. Found that one need to add "Defaults env_keep += "HOME"" to keep the HOME of spot when using sudo. This influence the icon_unmounted_func/icon_mounted_func which controls the ROX drive icon change when mount/umount are used. Strange thing is that the icon change when mounting/unmounting is very slow (slowest when umount) and icon change faster in .pup_event than on the desktop...
Woof-built pups have this in first line of many scripts, ex /usr/sbin/pmount:

Code: Select all

[ "`whoami`" != "root" ] && exec sudo -A ${0} ${@}
Woof-built pups have /etc/sudo.conf:

Code: Select all

# sudo 1.7.2 required askpass in /etc/sudoers, but 1.8.1p2 reports that as a syntax error
# and requires it in this file (see: http://www.gratisoft.us/sudo/man/1.8.0/sudo.man.html)
Path askpass /usr/sbin/askpass
So, the script gets re-executed at 'root' level.

Oh, /etc/sudoers:

Code: Select all

# sudoers file.
#
# This file MUST be edited with the 'visudo' command as root.
# Failure to use 'visudo' may result in syntax or file permission errors
# that prevent sudo from running.
#
# See the sudoers man page for the details on how to write a sudoers file.
#
# 120110 added /usr/sbin/delayedrun to SYSTEM category. also, see sudo line added to script.

# Host alias specification

# User alias specification

# Cmnd alias specification
Cmnd_Alias     SHUTDOWN = /sbin/poweroff, /sbin/reboot, /usr/sbin/snapmergepuppy
Cmnd_Alias     SYSTEM = /sbin/pup_event_frontend_d, /usr/sbin/delayedrun

# Defaults specification
Defaults	env_reset
Defaults	env_keep="HOME PATH DISPLAY HOSTNAME LANG"
Defaults	editor=/usr/bin/mp
# asks for root password (not user), only one attempt allowed...
Defaults:users	runaspw, passwd_tries=1

# sudo 1.7.2 needs this, for 1.8.1 it is specified in /etc/sudo.conf...
# Defaults:ALL	askpass=/usr/sbin/askpass

# Runas alias specification

# User privilege specification
root	ALL=(ALL) ALL

# Uncomment to allow people in group wheel to run all commands
# %wheel	ALL=(ALL) ALL

# Same thing without a password
# %wheel	ALL=(ALL) NOPASSWD: ALL

# Samples
# %users  ALL=/sbin/mount /cdrom,/sbin/umount /cdrom
# %users  localhost=/sbin/shutdown -h now

# fido belongs to users group...
# %users	ALL=(ALL) ALL

# want to run certain apps without asking for password...
# %users ALL=(SHUTDOWN) NOPASSWD: ALL
%users	ALL=(ALL) ALL, NOPASSWD: SHUTDOWN, SYSTEM
I don't know if any of the above is useful for you, just thought I would post it in case it, or part of it, is.
[url]https://bkhome.org/news/[/url]

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

#689 Post by goingnuts »

bark_bark_bark: :D I have it running on two old Pentium laptops - they are constructed to be rolled over by a tank and will probably last for 15 years more :lol: Funnny thing is that the batteries still works - I have laptops with an age of less than 3 years where battery is totally exhausted and they need instant external power to boot.

BarryK: :D Thanks a lot! The

Code: Select all

[ "`whoami`" != "root" ] && exec sudo -A ${0} ${@}
is brilliant - so much easier than my above codings. Adapted some of your sudo configs as well - thanks.


Still have very slow change of icons on ROX-desktop (GTK1.2-version) after mount/umount when run as spot - haven't got closer to speed it up - strange...but might be a missing call to ROX to revise status of file.

All this multiuser is quite a pain to get right - but a lot of fun and visit of places in code one seldom pay attention 8)

Started to convert pmount to gtkdialog1 - realized that I need mut - and after finding the source and building of a static bin - almost done...

Probably old common knowledge but mut is actually a multicall binary giving us:
mut mutd mutdaemon mutforeground mutclient probepart probedisk probedisk2 probepci drivelist guess_fstype mounts mediaplug
in a 183K static bin. I haven't tested all for differences in output or speed but attached a package if anyone feels in testing mode...

The probedisk script gives:
real 0m0.203s
user 0m0.060s
sys 0m0.080s

The mut probedisk gives:
real 0m0.100s
user 0m0.000s
sys 0m0.000s

so might speed up things if its not too hard to implement.
Attachments
mut2-src-1.3.2.1238_static.tar.gz
(80.35 KiB) Downloaded 498 times

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

#690 Post by technosaurus »

goingnuts wrote:Still have very slow change of icons on ROX-desktop (GTK1.2-version) after mount/umount when run as spot - haven't got closer to speed it up - strange...but might be a missing call to ROX to revise status of file.
I don't know how far back it goes, but I know there was some kind of major rox fix to speed it up that involved creating a file/folder/variable
Started to convert pmount to gtkdialog1 - realized that I need mut - and after finding the source and building of a static bin - almost done...
I had written a similar program that used my xpm generating shell functions for the %used/free - let me know if I need to look for it.
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
greengeek
Posts: 5789
Joined: Tue 20 Jul 2010, 09:34
Location: Republic of Novo Zelande

#691 Post by greengeek »

technosaurus wrote:I don't know how far back it goes, but I know there was some kind of major rox fix to speed it up that involved creating a file/folder/variable.
I recall amigo made a comment about hostname in this topic about rox speed:
http://www.murga-linux.com/puppy/viewto ... 7&start=34
How does pUPnGO handle hostname? Could that be an issue?

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

#692 Post by goingnuts »

greengeek: Thanks for the pointer. Adapted the modified hostname handling but with no luck.

After some tracking of what is going on it seems that as spot I run into this message from ROX:
"Existing ROX-Filer process is not responding! Try with -n"
which is spawn in ROX source-file "remoce.c" (origin from function "remote_init" which does include some hostname lookup).
The call (as spot) for "SetIcon" (in functions4puppy4) seems to run ok (no errors reported) but icon does not change. If I follow the request for "SetIcon" with a request for update (rox -x ${HOME}/.pup_event/drive_${1}) - in the functions4puppy4 script - I get the above error...

If I ask for the update (as spot) from rxvt command line it happens instantly. If I refresh the file view in /home/spot/.pup_event-folder it change the icon in the folder but icon on desktop is first changed when I move my mouse over the icon.

I am sure there is a single sign or two in some files that just has to be changed - its just how to find it....

As root it is fast changing and no problems at all.

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

#693 Post by technosaurus »

goingnuts wrote:After some tracking of what is going on it seems that as spot I run into this message from ROX:
"Existing ROX-Filer process is not responding! Try with -n"
which is spawn in ROX source-file "remoce.c" (origin from function "remote_init" which does include some hostname lookup).
The call (as spot) for "SetIcon" (in functions4puppy4) seems to run ok (no errors reported) but icon does not change. If I follow the request for "SetIcon" with a request for update (rox -x ${HOME}/.pup_event/drive_${1}) - in the functions4puppy4 script - I get the above error...

If I ask for the update (as spot) from rxvt command line it happens instantly. If I refresh the file view in /home/spot/.pup_event-folder it change the icon in the folder but icon on desktop is first changed when I move my mouse over the icon.

I am sure there is a single sign or two in some files that just has to be changed - its just how to find it....

As root it is fast changing and no problems at all.
I think rox uses sockets for its IPC and may have some assumptions as to not changing the user without restarting rox (for most distros this is true - spot is a hack in reverse polish notation)
that message sounds like one of the following IPC related issues:
incorrect permissions to access socket/pipe (file permission issue)
using the user name to find $HOME and expecting a file and/or directory structure to be there _and_ be the expected file/permissions/etc...
made up examples
/root/.rox-socket != /root/spot/.rox-socket
/root/spot/.config/... does not exist
looking for /tmp/rox478578-spot, but the actual is /tmp/rox478578-root
(It has been too long since I examined the IPC code, but that was the general idea)
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:

#694 Post by goingnuts »

technosaurus: Thanks - you are probably very right. I have tried to create spot as a real user with HOME in /home/spot where spot owns everything etc. I think I will let the ROX desktop-icon-change for spot rest for a while - might change other things that fix it :?

Just an other observation: When ROX is told to update the icon blinky is showing activity...

Ibidem
Posts: 549
Joined: Wed 26 May 2010, 03:31
Location: State of Jefferson

#695 Post by Ibidem »

goingnuts wrote:Uploaded below my present source of tinyXlib. From Changelog:
20120719: Changed ICElib to include transport to make ROX-Filer compile.
20120916: Added GetFPath.c to get Abiword 1.0.7 compile. Added X11/Xmu/Misc.h for XawM-1.5u.
20121002: Added ListExt.c and QuBest.c to X11 for xdpyinfo
20121011: Changed libXt source and include/X11/Intrinsic.h to test if Xaw can be compiled. Added GetDflt.c to tinyX11 and added -DXOS_USE_MTSAFE_PWDAPI to tinyXll make flags
Removed file Copying as well.
I have not tested the libXaw much but at least it compiled the attached xload - which is using approx 700k when running compared to the dynamic linked xload which uses approx 3400k...
I managed to build this with musl, though it took a couple trivial changes:
1- The error messages were getting lost because it ignored failed compiles in subdirectories.
This can be fixed one of two ways:
remove the "; cd .." (safe because each line is in a subshell, so it doesn't change the directory where the next line is)
OR, change all of this to make <target> -C <dirname>
I used

Code: Select all

sed 's/cd \(.*\); \(make.*\);.*/\2 -C \1/g' -i Makefile
2- I deleted -I/usr/include (it can only work when you have a libc that's fully header-compatible with your primary one), which made this start to compile.

3- In libXaw/OS.c, I changed <asm/page.h> to <limits.h>, which defines PAGE_SIZE.

Also, it seems that libXdmcp.so is not being rm'd on make clean.
All told however, much easier to build than the old version with shell build scripts...

Is the tinyXserver-0.01 tarball source for the kdrive servers?

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

#696 Post by goingnuts »

Ibidem: Thanks for testing and reporting! I have adapted your changes although I do not understand your comment on removing "-I/usr/include": Is that the headerinstall from makefile in /include directory?

Seems that uclibc also build Xaw with the change to <limits.h>. libXaw has some "flaws" when used - mainly errors like:
Warning: locale not supported by Xlib, locale set to C
Warning: X locale modifiers not supported, using default
Warning: translation table syntax error: Unknown keysym name: Kanji
Warning: ... found while parsing '<Key>Kanji:reconnect-im()'
Warning: String to TranslationTable conversion encountered errors
Warning: Input Method Open Failed
Warning: Unable to load any usable fontset
and the resulting window misses text in buttons.

Further changes/additions has been made:
20121013: Changed all makefiles to create shared libs as well
20121024: Added OCWrap.c and SetLocale.c to get musl/gtk/debug going (?) not quite...
20121028: Added libXmuu to be able to compile xprop
20121118: Added libXfixes to be able to comple xrdp
20121123: Added ReconfWM.c to tinyX11 to be able to compile rdesktop 1.6.0
20121126: Added libXss...
20121201: Addec QuCurShp.c to libX11 to be able to compile tightvnc
20121203: Added libXcursor to be able to compile xsetroot...small patch to avoid animated cursor.
I have started to see if I could generate the pkgconfig Xxxx.pc files in /usr/lib/pkgconfig to ease some automatic builds but haven't finalized that.

Let me know if you would like a fresh copy.

The tinyXserver-0.01 is the source for Xfbdev & Xvesa. I also made some changes for that so again if you want the updated source I will post it.

Did you go further with a build of gtk-libs and applications based on the tinyXlibs?

Update 20121216: Revised the source of libXaw and now it seems to get things right - attached image of static xmessage running - but also xload works fine.
Attachments
snap0001.png
(11.06 KiB) Downloaded 1020 times

Ibidem
Posts: 549
Joined: Wed 26 May 2010, 03:31
Location: State of Jefferson

#697 Post by Ibidem »

goingnuts wrote:Ibidem: Thanks for testing and reporting! I have adapted your changes although I do not understand your comment on removing "-I/usr/include": Is that the headerinstall from makefile in /include directory?

Seems that uclibc also build Xaw with the change to <limits.h>. libXaw has some "flaws" when used - mainly errors like:
Warning: locale not supported by Xlib, locale set to C
Warning: X locale modifiers not supported, using default
Warning: translation table syntax error: Unknown keysym name: Kanji
Warning: ... found while parsing '<Key>Kanji:reconnect-im()'
Warning: String to TranslationTable conversion encountered errors
Warning: Input Method Open Failed
Warning: Unable to load any usable fontset
and the resulting window misses text in buttons.

Further changes/additions has been made:
20121013: Changed all makefiles to create shared libs as well
20121024: Added OCWrap.c and SetLocale.c to get musl/gtk/debug going (?) not quite...
20121028: Added libXmuu to be able to compile xprop
20121118: Added libXfixes to be able to comple xrdp
20121123: Added ReconfWM.c to tinyX11 to be able to compile rdesktop 1.6.0
20121126: Added libXss...
20121201: Addec QuCurShp.c to libX11 to be able to compile tightvnc
20121203: Added libXcursor to be able to compile xsetroot...small patch to avoid animated cursor.
I have started to see if I could generate the pkgconfig Xxxx.pc files in /usr/lib/pkgconfig to ease some automatic builds but haven't finalized that.

Let me know if you would like a fresh copy.

The tinyXserver-0.01 is the source for Xfbdev & Xvesa. I also made some changes for that so again if you want the updated source I will post it.

Did you go further with a build of gtk-libs and applications based on the tinyXlibs?
1. I'm referring to the -I/usr/include COMPFLAGS in standard_definitions.mk, which forces the use of the primary system headers (ie, glibc)
2. The LOCALE issue I don't know about, though I've seen it before in a minimal Xorg build...
3. I thought there was some sort of libXmuu symlinking in the old tinyXlib...
4. A newer version of both would be nice.
BTW, I'm thinking it would be nice to see about installing to an alternate prefix.

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

#698 Post by goingnuts »

Thanks for pointing at the /usr/include - I compile in a chroot-environment so I have no normal libs sneaking in. And yes - in earlier versions the Xmuu was included but I stripped it out as no one seems to need it (until xprop). Installing to an alternative location should already be possible by setting the LIBDIR but I have now included a PREDIR variable specific for that. Some pkgconfig files are now generated as well. I have tested build of various gtk1.2 applications as well as normal X-apps like xcalc, xeyes, xmessage, rdesktop and xwininfo. Everything seems to work (with uclibc).
Also tested the build with musl and it seems to go ok - but haven't made applications with it.
20130513: Removed attachment as forum does not support the size anymore
Last edited by goingnuts on Mon 13 May 2013, 17:40, edited 1 time in total.

bark_bark_bark
Posts: 1885
Joined: Tue 05 Jun 2012, 12:17
Location: Wisconsin USA

#699 Post by bark_bark_bark »

I created a .pet for pupngo which contains the GUI from Tinycore 4.7.1a. I would like to upload it soon, but I have not fully tested it yet.
....

bark_bark_bark
Posts: 1885
Joined: Tue 05 Jun 2012, 12:17
Location: Wisconsin USA

#700 Post by bark_bark_bark »

I fixed the Tinycore and converted it to sfs3 format for pupngo to use.
....

Post Reply