Woof at Github

A home for all kinds of Puppy related projects
Post Reply
Message
Author
User avatar
Karl Godt
Posts: 4199
Joined: Sun 20 Jun 2010, 13:52
Location: Kiel,Germany

#16 Post by Karl Godt »

Don't know what I am doing :

/root/KarlGodtWOOF.GIT/woof-CE/woof-code/rootfs-skeleton/etc/rc.d/rc.shutdown

Code: Select all

#130217 01micko: relocate umount of network shares.

PATH=/bin:/sbin:/usr/bin:/usr/sbin
#read PUPPYVERSION </etc/puppyversion

#110923
. /usr/bin/gettext.sh # enables use of eval_gettext (several named variables) and ngettext (plurals)
export TEXTDOMAIN=rc.shutdown
export OUTPUT_CHARSET=UTF-8

. /etc/rc.d/functions4puppy #v3.01
#variables created at bootup by init script in initrd...
. /etc/rc.d/PUPSTATE #v2.02
. /etc/DISTRO_SPECS #v412
ORIGPUPMODE=$PUPMODE #v2.22

if [ "$PUPMODE" =  5 ] ; then
clear
exec 1> /dev/null 2>&1
fi

which rfkill &>/dev/null && rfkill unblock all #110919 jemimah has this in fluppy. if don't do this, may be locked at next boot.

#w482 use xorriso if it is installed (see also functions4puppy)...
CDRECORD='cdrecord'
MKISOFS='mkisofs'
if [ "`which xorriso`" != "" ];then
 CDRECORD='xorrecord'
 MKISOFS='xorrisofs' #growisofs reads this variable.
fi
export CDRECORD MKISOFS

#echo "`eval_gettext \"\\\${DISTRO_NAME} is now shutting down...\"`" > /dev/console
#echo "${DISTRO_NAME} is now shutting down..." > /dev/console
pidof poweroff 2>/dev/null && {
echo "${DISTRO_NAME} ${DISTRO_VERSION} $(gettext 'is now shutting down...')" > /dev/console #120130
} || {
pidof reboot 2>/dev/null && {
echo "${DISTRO_NAME} ${DISTRO_VERSION} $(gettext 'is now rebooting...')" > /dev/console
} || {
#echo $(gettext "Executing /etc/rc.d/rc.shutdown...")
echo "Executing /etc/rc.d/rc.shutdown..."
}; }

#100315 improper shutdown check. see /etc/rc.d/rc.sysinit, /init in initramfs, and /sbin/init...
if [ -f /fsckme.flg ];then
 if [ -f /tmp/dmesg_e2fsck_warnings1 ];then #120717 rc.sysinit creates this file for full installation.
  if [ "`grep -G "(${PDEV1})" /tmp/dmesg_e2fsck_warnings1`" = "" ];then
   rm -f /fsckme.flg
  else
   echo -n 'MAXIMAL' >> /fsckme.flg #read by /sbin/initNEW
  fi
 else
  rm -f /fsckme.flg
 fi
fi
[ -f /initrd${PUP_HOME}/fsckme.flg ] && rm -f /initrd${PUP_HOME}/fsckme.flg

#puppy.sfs is in a subdirectory, default to saving in it...
PUPSFSFILE=`echo "$PUPSFS" | cut -f 3 -d ','`
PSUBDIR=`dirname "$PUPSFSFILE"`
[ "$PSUBDIR" = "/" ] && PSUBDIR=""
[ $PUPMODE -eq 5 -a "$DEV1FS" = "iso9660" ] && PSUBDIR="" #100920 booting off cd, always default have savefile at /.
[ $PUPMODE -eq 5 -a "$DEV1FS" = "udf" ] && PSUBDIR=""     #130128 ditto, for udf f.s.
[ "$DEV1FS" = "msdos" ] && DEV1FS="vfat" #110919

#100920 reverse...
##100915 if booting from cd, .sfs's now optionally copied into a subdir, also want save-file in it...
## (warning: puppy.sfs on cd must be at /)
#if [ "$PSUBDIR" = "" ];then
# if [ "$DEV1FS" = "iso9660" ];then #test if booted off cd.
#   PSUBDIR="`echo -n "${DISTRO_IDSTRING}" | cut -c 1-8`" #limit dir name to 8 chars.
# fi
#fi

#for a full hd install, only setting PUPMODE (=2). no /initrd, no initrd.gz.

killzombies() {
And much more to figure out ..
«Give me GUI or Death» -- I give you [[Xx]term[inal]] [[Cc]on[s][ole]] .
Macpup user since 2010 on full installations.
People who want problems with Puppy boot frugal :P

User avatar
Karl Godt
Posts: 4199
Joined: Sun 20 Jun 2010, 13:52
Location: Kiel,Germany

#17 Post by Karl Godt »

Looks quite ok now with

/usr/git/bin/git commit -am "01 adjustments to rc.shutdown"

git push origin

https://github.com/KarlGodt/woof-CE/com ... e31aafff76

not finished, but am really happy !!
:D

User avatar
mavrothal
Posts: 3096
Joined: Mon 24 Aug 2009, 18:23

#18 Post by mavrothal »

Congratulations Karl! :D
You managed to find and solve all strange issues with git and made the first fork. 8)

Let me take this opportunity though to reiterate some things that I just mentioned at the bottom of the first post.

I'm sure many of us have seen BK's commits in his fossil repo, where many things are changing in one commit and some are not even mentioned in the commit message.
But this was perfectly OK because this was/is his own repo and a message was more of a landmark (besides most of his scripts have their "internal" versioning with comments on the top of the file).

This practice can not work in a collaborative project and may even generate some unnecessary friction if/when pull requests will be asked to be modified.
So with the best intentions, let me use your commit as an example of things that we should not be doing (that I learned the hard way :cry: ).

The commit message "01 adjustments to rc.shutdown" tells nothing about what was done and why.
In this case there is not even a second line to explain a bit more about it.
Any change in a file could go under "adjustments", "changes" or "fixes", but this is obvious since you change the file.
A more precise and verbal commit message makes it also easier to track it down from the git log. If for example you X is not turning off you can grep for shutdown and X and see if you can find a relevant commit

The second problem is the plural.
We should not do more than one kind of change in one commit.
If you change more things ie "Do not clear console during shutdown" and "bring calls to external variables relier" and "kill X only if it is running during shutdown" etc. you should make more commits.
This way if 1 out of the 5 things that are changed generates a problem will be easy to isolate and resolve.
It is not really the size of the commit but the functions that is affecting that define the number of commits needed.
One commit can change 200 lines and the other can be a single letter.
If you put them together makes it really hard to isolate issues related to the single letter change.
Git also has the "blame" option that shows which commit is the last one for each line of code.
If a problem in a line is identified and this belongs to a "multi purpose" commit makes it harder to determine what a consecutive change will affect.

Also a reasoning behind a change is always helpful.
For example you want to make shutdown more verbal so potential problems can be spotted and solved, which is fine, but what about making this thing optional, with a "debug" argument for example.
Puppy has a "quiet" boot why "verbal" shutdown?
Which brings us back to the "multi commit".
If it is broken down to the different things that is doing and there is an objection about the default verbal shutdown, the other commits could be pulled "as is" and the specific one be revised.
Actually the FOSS practice is, when a major change involves changing many things/functions to be presented as a series of patches instead a big one, ie "Allow alternative WM; remove rox hard codding", "Allow alternative WM; call WM from /etc/profile", "Allow alternative WM;..." etc so it is clear that are going together but is also easy to follow and improve as/if needed.

I'm really happy about your input and certainly this post is not intended as criticism of any kind.
I just felt that I should clarify few things so our life can be easier down the road and move more efficiently. :wink:
It may look like unnecessary "formalism" but when many people are involved in a project, is vital.

PS: and after all the preaching (:P ), you may want to revert your commit and reimplemented in smaller and more concise chunks, so it can be easier to pull when/if you ask.
Last edited by mavrothal on Thu 14 Nov 2013, 08:44, edited 2 times in total.

User avatar
Deacon
Posts: 185
Joined: Tue 19 Mar 2013, 15:14
Location: USA

#19 Post by Deacon »

IT LIVES!

You're working on Woof, so Puppy LIVES!

I haven't the foggiest idea what you people are doing but there's a new Woof trunk to work with! I think that is what it's called! Hurrah!

wanderer
Posts: 1098
Joined: Sat 20 Oct 2007, 23:17

#20 Post by wanderer »

thanks mavrothal

this is the way to go

wanderer

User avatar
Karl Godt
Posts: 4199
Joined: Sun 20 Jun 2010, 13:52
Location: Kiel,Germany

#21 Post by Karl Godt »

mavrothal, you are absolutely right !

Me too was confused seeing that much red and green at once .

I have set geany as default editor and my geany is set to handle whitespace/tabs for example .
I think that it needs to start saving the file unedited in the editor , just to convert space and tab first and then commit that as info on formatting superfluous space and newlines .

The short info message was also because of being unsure , if the shell could handle multiple lines .

For now , I need to figure out , which parts of git on my systems need really fixes to work with github .
I have the installation similar on four partitions on the current machine .

Code: Select all

[user]
	name = Karl Godt
	email = karlgodt@excite.de
[credential]
	helper = cache --timeout=3600
[core]
	editor = /usr/bin/geany
[http]
	sslVerify = false
The above root/.gitconfig file of mine, created by the git global commandos, still irritates me about where to find the git ca cert file . Firefox I remember, occasionally offers to download some when visiting web pages .

And I am still confused about whether to have the need for a webbrowser github access is needed , or if git from commandline can handle everything , like creating forks .

I am happy, not to have brought the github server down with my commit - but stability is one of Linux/GNU strength , we all know .

User avatar
Karl Godt
Posts: 4199
Joined: Sun 20 Jun 2010, 13:52
Location: Kiel,Germany

#22 Post by Karl Godt »

I have now reverted the commit on my local repo that I copied from the partition 5 to partition 6 but it seems not to made it into my fork on the github server automatically :

Code: Select all

bash-3.00# git reset --hard HEAD^
HEAD is now at 96ee655 Update README
see here :http://stackoverflow.com/questions/9273 ... git-commit

Note : I use my "normal" git now without recompiling anything :

Code: Select all

bash-3.00# git --version
git version 1.6.4.1
It seems that sslVerify = false does the trick(s) ..

User avatar
Iguleder
Posts: 2026
Joined: Tue 11 Aug 2009, 09:36
Location: Israel, somewhere in the beautiful desert
Contact:

#23 Post by Iguleder »

Made my first contribution.

IMHO, the next logical step is to get rid of xorgwizard, that crappy udev replacement shell script, legacy code for ancient kernels (i.e everything below kernel 2.6.32.x) and all the Xorg 7.3 legacy stuff.
[url=http://dimakrasner.com/]My homepage[/url]
[url=https://github.com/dimkr]My GitHub profile[/url]

User avatar
zigbert
Posts: 6621
Joined: Wed 29 Mar 2006, 18:13
Location: Valåmoen, Norway
Contact:

#24 Post by zigbert »

mavrothal wrote:We should not do more than one kind of change in one commit.
I understand fully this, but it also makes it impossible to improve guis. - Like this Pmount variant. (It has been default in 2 Slacko releases, so should be well tested by now.)

Barry has never focused on the gui-side, and I could gently let my fingers swipe over some gui-code.

But if woof-CE is meant to be kept in the Barry-tradition, I will continue to focus on my own apps.


Sigmund

User avatar
Iguleder
Posts: 2026
Joined: Tue 11 Aug 2009, 09:36
Location: Israel, somewhere in the beautiful desert
Contact:

#25 Post by Iguleder »

I think applications like Pmusic should be merged into woof-CE's rootfs-skeleton. They're part of any Puppy, so we can only benefit from the unification of Puppy's code into a single repository.

Is there any reason not to do this? :)
[url=http://dimakrasner.com/]My homepage[/url]
[url=https://github.com/dimkr]My GitHub profile[/url]

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

#26 Post by 01micko »

Iguleder wrote:I think applications like Pmusic should be merged into woof-CE's rootfs-skeleton. They're part of any Puppy, so we can only benefit from the unification of Puppy's code into a single repository.

Is there any reason not to do this? :)
Heavy development of Pmusic I think. Ziggy is pretty active. Plus some like to woof with deadbeef, aqualung etc instead of Pmusic or even with out ffmpeg which is Pmusic's core..

EDIT: on the other side, ziggy might like it in the git repo and it could be made optional.
Puppy Linux Blog - contact me for access

User avatar
Iguleder
Posts: 2026
Joined: Tue 11 Aug 2009, 09:36
Location: Israel, somewhere in the beautiful desert
Contact:

#27 Post by Iguleder »

Got good ol' Xfbdev to work with today's GCC and x86_64. Porting such a big pile of ancient code to x86_64 wasn't easy at all :lol:

With JWM and a kernel, it's possible to assemble 50 MB Puppy (uncompressed!) without any applications, with all core X fonts in. Not bad at all! I'll try to build a static GTK1 and gtkdialog - maybe I can make woof-CE support such a minimalistic Puppy, so we can finally have an "official" truly modular Puppy, in the spirit of Tiny Core (a small bootable ISO with a graphical desktop and graphical package management).
[url=http://dimakrasner.com/]My homepage[/url]
[url=https://github.com/dimkr]My GitHub profile[/url]

musher0
Posts: 14629
Joined: Mon 05 Jan 2009, 00:54
Location: Gatineau (Qc), Canada

#28 Post by musher0 »

Hello, all.

This is an excellent initiative! It will certainly improve Puppy building
methodology, as mentioned by mavrothal in his founding post.

I wish a long and fruitful life to the Puppy git hub.

BFN.

musher0
musher0
~~~~~~~~~~
"You want it darker? We kill the flame." (L. Cohen)

User avatar
Karl Godt
Posts: 4199
Joined: Sun 20 Jun 2010, 13:52
Location: Kiel,Germany

#29 Post by Karl Godt »

No comments to the recent posts from my side.
Have now pushed a new commit about rc.shutdown , that only strips trailing spaces :
https://github.com/KarlGodt/woof-CE/com ... 172f03857f
My first commit is still there as "rc.shutdown-01goal" and will be removed , then when it is transferred into the rc.shutdown file piece by piece .

Was having problems with my older git when pushing ,
and searching the net did not reveal much except that older git were apparently having problems when pushing, so used my new git for that .
I needed to

Code: Select all

/usr/git/bin/git push --verbose --force origin
use the --force option though, and have no clue why simple push failed .

The shell was working well on multiple lines for the commit message .

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

woof-CE mailing list

#30 Post by 01micko »

Ha what a bout a good old fashioned mailing list :)

This will be a cool place for all those following woof development but not particularly interested in getting their hands dirty and it will be great for developer collaboration as well..

http://woof-ce.26403.n7.nabble.com/Welc ... t-td2.html
Puppy Linux Blog - contact me for access

User avatar
mavrothal
Posts: 3096
Joined: Mon 24 Aug 2009, 18:23

Re: woof-CE mailing list

#31 Post by mavrothal »

01micko wrote:Ha what a bout a good old fashioned mailing list :)

This will be a cool place for all those following woof development but not particularly interested in getting their hands dirty and it will be great for developer collaboration as well..

http://woof-ce.26403.n7.nabble.com/Welc ... t-td2.html
Nice!
Let's see if it works :wink:
== [url=http://www.catb.org/esr/faqs/smart-questions.html]Here is how to solve your[/url] [url=https://www.chiark.greenend.org.uk/~sgtatham/bugs.html]Linux problems fast[/url] ==

User avatar
Karl Godt
Posts: 4199
Joined: Sun 20 Jun 2010, 13:52
Location: Kiel,Germany

#32 Post by Karl Godt »

Of course !

Have finished 90% of my first rc.shutdown ideas , hope you are satisfied ..

For the idea to add some options , I have played with that long time ago.
Horrible because the many shutdown scripts need to pass them to rc.shutdown.

I feel like a cotton picker centuries ago . Will wash myself with shoe cream now ..

User avatar
SFR
Posts: 1800
Joined: Wed 26 Oct 2011, 21:52

#33 Post by SFR »

Hi guys

Speaking of rc.shutdown - what do you think about including there the "save-on-demand" dialog (PUPMODE=13) at last?
Despite the fact I'm a big fan of it personally, the issue pops up quite often, from what I've seen in Beginners/Users sections.
BTW, an opinion of a happy customer. :wink:
pchan @[url=http://www.murga-linux.com/puppy/viewtopic.php?p=737173#737173]X-Precise thread[/url] wrote:Thanks so much rg66 for x precise 2.2! Thanks especially for making it possible for users to choose whether to save or not save when shutting down. It is a very wise thing to do and it will help us non technical users to have more confident in using puppy linux. In the past, I have damaged my save files so many times because I downloaded and installed something not suitable and when it comes to shutdown time, I can't stop puppy from saving my mismanaged session.
But if this would be included, a couple of other things can not be forgotten:
1. Save interval ought to be set to 0 by default, of course.
2. Petget, in PUPMODES 3/7/13, saves files directly to pup_ro1.
If it would be left as it is, after installing a package and rebooting without saving a session, the package's files remain installed, but can't be found on the list, since contents of ~/.packages/... won't get saved as well.
___________

Second thing: I've unlocked (in initrd.gz/init) the possibility to fsck encrypted savefile, but:
init wrote:[ "$PFSCK" = "yes" ] && fsckme_func loop1 ext2 #100318 however, commented out as there was an old not that f.s. check on an encrypted pupsave is broken.
Does anyone recall/know what was the exact nature of the issue?
Almost 4 yrs have passed, maybe it no longer applies? If so, would be nice to have it re-enabled.
Anyway, I haven't noticed anything bad, since I unlocked it a few months ago.

Just a couple of suggestions. 8)

Keep up the good work &
Greetings!
[color=red][size=75][O]bdurate [R]ules [D]estroy [E]nthusiastic [R]ebels => [C]reative [H]umans [A]lways [O]pen [S]ource[/size][/color]
[b][color=green]Omnia mea mecum porto.[/color][/b]

User avatar
mavrothal
Posts: 3096
Joined: Mon 24 Aug 2009, 18:23

#34 Post by mavrothal »

SFR wrote: Just a couple of suggestions. 8)
Suggestions are ok but (tested) patches is what is needed :wink:
== [url=http://www.catb.org/esr/faqs/smart-questions.html]Here is how to solve your[/url] [url=https://www.chiark.greenend.org.uk/~sgtatham/bugs.html]Linux problems fast[/url] ==

User avatar
SFR
Posts: 1800
Joined: Wed 26 Oct 2011, 21:52

#35 Post by SFR »

Hey Mavrothal

Well, I just wanted to check first is there anyone out there who's willing to support those suggestions, besides I'm not really considering myself as a dev and have never used GIT, so...
Anyway, since you're saying it's needed - no problemo. :wink:
Here are the patches, however dunno if I've made them as they *should* be done (they're tested though and work ok with 'patch -p1 < filename'):
[btw, unfortunately I can't recall from where exactly I "borrowed" the code of a dialog window for rc.shutdown; I only added gettext from my side]

Code: Select all

--- ./woof-CE-master/woof-code/rootfs-skeleton/etc/rc.d/rc.shutdown	2013-11-12 22:24:11.000000000 +0100
+++ ./woof-CE-master/woof-code/rootfs-skeleton/etc/rc.d/rc.shutdown	2013-03-05 17:06:50.000000000 +0100
@@ -435,9 +435,13 @@
  13) #PDEV1 and PUPSFS and PUPSAVE
   #/initrd/pup_rw has tmpfs, pup_ro1 has ${DISTRO_FILE_PREFIX}save.2fs file (PUPSAVE), pup_ro2 has PUPSFS file.
   #the above are in unionfs at /.
-  echo "$(eval_gettext "Saving session to \${SAVEFILE} (\${SAVEPART})...")" >/dev/console
-  #echo "Saving session to $SAVEFILE (${SAVEPART})..." >/dev/console
-  /usr/sbin/snapmergepuppy /initrd/pup_ro1 /initrd/pup_rw
+      dialog --timeout 60 --yes-label "$(eval_gettext "SAVE")" --no-label "$(eval_gettext "NO SAVE")" --yesno "$(eval_gettext "Press ENTER key to save session...
+Or, press TAB then ENTER to not save session...
+Or, wait 60 seconds to shutdown without saving session...")" 0 0 >/dev/console
+  if [ $? -eq 0 ]; then 
+    echo "$(eval_gettext "Saving session to \${SAVEFILE} (\${SAVEPART})...")" >/dev/console
+    /usr/sbin/snapmergepuppy /initrd/pup_ro1 /initrd/pup_rw 
+  fi 
   ;;
  128) #1st shutdown, save to ${DISTRO_FILE_PREFIX}save.2fs.
   #partition already mounted on $SMNTPT.

Code: Select all

--- ./woof-CE-master/woof-code/rootfs-skeleton/etc/eventmanager	2013-11-12 22:24:11.000000000 +0100
+++ ./woof-CE-master/woof-code/rootfs-skeleton/etc/eventmanager	2013-11-15 15:54:29.776387917 +0100
@@ -3,7 +3,7 @@
 
 #this parameter is read by /sbin/pup_event_frontend_d...
 #For odd-numbered PUPMODE, periodic save in minutes. 0=no periodic save...
-RAMSAVEINTERVAL=30
+RAMSAVEINTERVAL=0
 
 #read by pup_event_frontend_d. major switch to kill pup_event_backend_d...
 BACKENDON="true"

Code: Select all

--- ./woof-CE-master/woof-code/rootfs-skeleton/usr/local/petget/installpkg.sh	2013-11-12 22:24:11.000000000 +0100
+++ ./woof-CE-master/woof-code/rootfs-skeleton/usr/local/petget/installpkg.sh	2013-11-15 16:14:51.359705265 +0100
@@ -122,7 +122,7 @@
 DIRECTSAVEPATH=""
 #111013 shinobar: this currently not working, bypass for now... 111013 revert...
 #if [ "ABC" = "DEF" ];then #111013
-if [ $PUPMODE -eq 3 -o $PUPMODE -eq 7 -o $PUPMODE -eq 13 ];then
+if [ $PUPMODE -eq 3 -o $PUPMODE -eq 7 ];then	# SFR: enable installing to TMPFS in PUPMODE=13
  FLAGNODIRECT=1
  [ "`lsmod | grep '^unionfs' `" != "" ] && FLAGNODIRECT=0
  #100426 aufs can now write direct to save layer...
Greetings!
[color=red][size=75][O]bdurate [R]ules [D]estroy [E]nthusiastic [R]ebels => [C]reative [H]umans [A]lways [O]pen [S]ource[/size][/color]
[b][color=green]Omnia mea mecum porto.[/color][/b]

Post Reply