Properly setup BionicPup64 (or another puppy)

Booting, installing, newbie
Message
Author
User avatar
UncleScrooge
Posts: 104
Joined: Tue 07 Apr 2020, 06:07
Location: Norway

#81 Post by UncleScrooge »

one more:

I may want to do some cleanup and checks before the user shuts the system down.

Iread that in Ubuntu you can do that putting the script(s) in /etc/rc6.d

I notice that all the /etc/rcn.d directories are empty, even rc0.d (executables to run at startup)

User avatar
UncleScrooge
Posts: 104
Joined: Tue 07 Apr 2020, 06:07
Location: Norway

#82 Post by UncleScrooge »

vtpup wrote:Set a new UUID on the stick. Then you'd know what it was.

How about:

Code: Select all

acce55 decaf c0ffee ea7 57a1e fe1afe1
nice hint for a brand new UUID, cheers! :D

I can actually use the label as a direct reference for mount, the script needs to be completed with the creation of a symlink in the desktop:

Code: Select all

#!/bin/bash
function splashWarning() 
{
	# $1 = message to be displayed
	# $2 = timeout in seconds
	yaf-splash -bg grey -fg white -fontsize 14 -timeout "$2" -icon /usr/local/lib/X11/pixmaps/error.png -icon_width 80 -close never -text "$@"	
}
# ------------------------
function asynchMount()
{
	logFile="/root/.tmp/bootMount.log"
	tmpDir="/root/.tmp"
	[ ! -d "$tmpDir" ] && mkdir $tmpDir
	mount -L "$1" "$2"
	echo "$?" > "$logFile"
}
#---------------------------
function startUpWarning()
{
	yaf-splash -bg yellow -fg blue -fontsize 10 -timeout 0 -icon /usr/local/lib/X11/pixmaps/drive48.png -icon_width 50 -close never -text "Mounting Windows_share filesystem. Please wait..." -placement top	
	
}
#------------------------
wsLabel='"Windows_share"'
numOfLabels=$(blkid | grep -wc 'LABEL='$wsLabel)
[ "$numOfLabels" -ne 1 ] && {
	msg="None or more than one Windows_share device found! Cannot mount Windows_share. To access Windows shared filesystem please mount the appropriate device manually using <PMount mount/unmount drives> from the Filesystem menu"
	splashWarning "$msg" 10
	exit 1	# cannot choose filesystem
	}
isMounted=$(df | grep -c ${wsLabel//"})	
[ "$isMounted" -ne 0 ] && exit 2 # filesystem is already mounted, exit with code 2
# check mounting point
wsDir="/mnt/Windows_share"
[ -d "$wsDir" ] && rm -r $wsDir	# remove the mounting point if already exists
mkdir $wsDir		# create the mounting point
startUpWarning &       # warn the user, it could take long
asynchMount ${wsLabel//"} $wsDir &	# mount the bloody thing asynchronously
counter=0
timeout=300
exitOnTimeout=0
# wait for mount to finish or exit on timeout
while [ "$isMounted" -eq 0 ]
	do
		sleep 1
		((counter+=1))
		[ "$counter" -eq "$timeout" ] && {
			exitOnTimeout=1
			break
			}
		isMounted=$(df | grep -c ${wsLabel//"})
	done
if [ "$exitOnTimeout" -eq 1 ]; then
	msg="The mounting process of the Windows_share folder is taking an unusual long time to complete. Please check if you can access /mnt/Windows_share directory and its files. Yuo can check the exit code of the process in /root/.tmp/bootMount.log"
	splashWarning "$msg" 15
	killall yaf-splash
	exit 3	# code 3: timeout mounting
fi
#define the symbolic link
wsSymLink="/root/Windows_share"
[ -L "$wsSymLink" ] && rm -r $wsSymLink #remove it if exists
# create the symlink to winshare mountpoint
ln -s $wsDir $wsSymLink
killall yaf-splash  # clear the splash warning
is there a way to also create a link in the desktop from the script? is the actual desktop mounted somewhere?

User avatar
vtpup
Posts: 1420
Joined: Thu 16 Oct 2008, 01:42
Location: Republic of Vermont
Contact:

#83 Post by vtpup »

Just drag the script onto the desktop.

Under the hood, the JWM/Rox desktop launchers are always maintained as simple links in a single xml file, they are not new copies of the linked object maintained in a "desktop" directory, unlike Windows etc. Technically that file of links (and the desktop itself) is called a "pinboard" in rox. You can't really drag a file's contents into the pinboard, you are dragging only a link there.

After creating a desktop launcher, you may want to give your launcher a nicer icon:

Right click on your 'fooscript' launcher > file 'fooscript' > set icon
then drag an icon image into the space indicated.

Lots of icon images in /usr/share/icons or do a pfind for a specific application's icons.

If your launcher ever gets deleted accidentally from the desktop, you'll have to do the same icon association thing again.

One trick to keep the icon image always associated with your script is to set the icon for the script itself (rather than the desktop launcher) Then when you drag the script to the desktop to create a new launcher, the icon image sticks with it.

FYI the screen positions and link pointers of all current launchers on the desktop are kept in the xml pinboard file:

/root/Choices/ROX-Filer/PuppyPin

You can manipulate them there if you want, too. If you copy that PuppyPin onto any new installation, all the launchers will be there on the new installation's desktop just as you set them up.

I guess to finally answer your question -- yes you can use your script to set a link to itself in PuppyPin. Or you can just copy PuppyPin with the link in it in the re-master.
[color=darkblue]Acer Aspire 5349-2635 laptop Tahrpup.[/color]
[color=blue]Acer R11 and C720 Chromebks Bionicpup64[/color]
[color=olive]Acer Iconia A1-830 tablet no pup[/color]
[color=orange]www.sredmond.com[/color]

User avatar
mikeslr
Posts: 3890
Joined: Mon 16 Jun 2008, 21:20
Location: 500 seconds from Sol

Cloning with Changed Password

#84 Post by mikeslr »

proebler's reply today to pertracus' inquiry, http://www.murga-linux.com/puppy/viewto ... 84#1059384 lead to a specific jafadmin application, http://murga-linux.com/puppy/viewtopic. ... 65#1046265 for this condition "Wanna quickly change BionicPup LUKS savefile password? Without creating a new savefile? Yeah, I figured you did."

User avatar
UncleScrooge
Posts: 104
Joined: Tue 07 Apr 2020, 06:07
Location: Norway

#85 Post by UncleScrooge »

vtpup wrote: ...
I guess to finally answer your question -- yes you can use your script to set a link to itself in PuppyPin. Or you can just copy PuppyPin with the link in it in the re-master.
I might have been ... obscure.. :D
what I want is to create a symlink on the desktop to the "Windows_share" filesystem/partition actually, not the script itself.
and I wnat to do it at every boot up, cuz if for some reason the Windows_share NTFS can't get mounted I don't want the link there,since th euser could be misled

User avatar
vtpup
Posts: 1420
Joined: Thu 16 Oct 2008, 01:42
Location: Republic of Vermont
Contact:

#86 Post by vtpup »

If the launcher is in the PuppyPin it will be on the desktop.

Clicking on the windows share partition icon on the desktop mounts it, whether it was mounted beforehand or not, and opens the windows share directory in rox filer.

Which is presumably what they would expect it to do by clicking on it?
[color=darkblue]Acer Aspire 5349-2635 laptop Tahrpup.[/color]
[color=blue]Acer R11 and C720 Chromebks Bionicpup64[/color]
[color=olive]Acer Iconia A1-830 tablet no pup[/color]
[color=orange]www.sredmond.com[/color]

User avatar
UncleScrooge
Posts: 104
Joined: Tue 07 Apr 2020, 06:07
Location: Norway

#87 Post by UncleScrooge »

@ vtpup

gotcha... and done.
My sin wasn't being "obscure", but "thick as a brick" (aging is a bitch...)

How about running scripts at shutdown? shall I just place them in etc/rc6.d?

User avatar
vtpup
Posts: 1420
Joined: Thu 16 Oct 2008, 01:42
Location: Republic of Vermont
Contact:

#88 Post by vtpup »

Nope, you're just possibly used to how some other Linuxes work.

I had a recent experience with GalliumOS where the drive (partition) icons could be made to appear on the desktop, but clicking on them put up an error message ("No such drive"). Same thing happened when plugging in a USB drive. A drive launcher would appear that didn't work.

After the icon appeared, a user was supposed to navigate to /media and a few subdirectories, as I remember it, to mount some odd drive designation for the desktop launcher to work -- for that drive and for that session only.

It's all Barry Kauler's fault that Puppy doesn't fit in.

btw, you'll notice a little flag of some sort (shape depends on the icon set chosen) on a desktop drive launcher icon after it is mounted. That flag means, well, it's mounted.

If you click on that little flag again, it unmounts that drive. That's the desktop GUI method.

You can also right click on the drive icon and select "unmount sd-foo" for the more old fashioned method.

Also, re. /etc/rc6.d, dunno. Test it.
[color=darkblue]Acer Aspire 5349-2635 laptop Tahrpup.[/color]
[color=blue]Acer R11 and C720 Chromebks Bionicpup64[/color]
[color=olive]Acer Iconia A1-830 tablet no pup[/color]
[color=orange]www.sredmond.com[/color]

User avatar
vtpup
Posts: 1420
Joined: Thu 16 Oct 2008, 01:42
Location: Republic of Vermont
Contact:

#89 Post by vtpup »

BTW, if you're using wine, the wine "C:" directory is actually /root/.wine.

Note that the above is a dotted directory (hidden).

I actually move .wine to /mnt/home/ myself, and link it back to /root/ which takes the C: directory out of the pupsave file. But in your case since you favor a giant encrypted pupsave file, that wouldn't make sense.

However, in case you find yourself running Puppy on a non-work computer, for, let's say, all home use -- as I and my family have for the last dozen years, that's a help in keeping a pupsave file trim in size.

Oh also, since I often reference Wine's C: dirve, I put a link to .wine up on my desktop, and call it "drive_c"
[color=darkblue]Acer Aspire 5349-2635 laptop Tahrpup.[/color]
[color=blue]Acer R11 and C720 Chromebks Bionicpup64[/color]
[color=olive]Acer Iconia A1-830 tablet no pup[/color]
[color=orange]www.sredmond.com[/color]

User avatar
UncleScrooge
Posts: 104
Joined: Tue 07 Apr 2020, 06:07
Location: Norway

#90 Post by UncleScrooge »

@ vtpup

got all of that.

but...

remember: copies of the the thumbrive will end up in the hands of both maniacs self-assuming geeks (windows world mainly) and quasi computer illiterate (barely managed to get their way through using windows, a word processor, a spreadsheet and that's it).
Our services engineers teams host the whole spectrum with a lot of nuances in between. We all have different backgrounds: from electric (me for instance) to mechanic, and all in between.

My intention is to make it sure the system starts setting up a GUI (the desktop) suited to all of them (the geeks will definately mess it up at some point... I did... :roll: , the less computer skilled colleagues may find it too hard to use it if it doesn't stay and show in a reasonably windows lookalike way)

That's why I'd like to have some form of control of the start-up and shutdown processes, to, so to speak, "tend" and "prepare" the dining table (startup), and clean up when we are done (shutdown). I could actually do both at start up tough: cleaning first and setting up afterward, but that's really an expedient which could lead into chaos in the long run, better to keep the two things separated, in my opinion, and occurring at the right time.

Although, if the guy hits the power off button out of impatience...

PS: I am not trying to belittle or denigrate my less computer skilled colleagues, they are mainly old guys close to retirement (I myself am 7 years from it), with a HUGE knowledge and skill of the nitty gritty at the mechanical side of our equipment/products, to them the laptop is mainly a typemachine and a library to consult documentation and specs (mechanical specs), they are wizards when it comes to torque set wrenches and spanners, filers, fillers, calipers, backlashes, plays and tolerances, adjusting and balancing hydraulic circuits, etc. but get easily scared or tired off in front of a keyboard, a screen and a mouse.
The "young" mechanics though... jeez... a nightmare, they are very good in their own field and since they grew up in the "computer" era, assume to know everything, since they are virtual cyborgs with their smartphone and laptop from primary school...

User avatar
bigpup
Posts: 13886
Joined: Sun 11 Oct 2009, 18:15
Location: S.C. USA

#91 Post by bigpup »

You may want to look at what can be controlled with the menu->System->Boot Manager
The things they do not tell you, are usually the clue to solving the problem.
When I was a kid I wanted to be older.... This is not what I expected :shock:
YaPI(any iso installer)

User avatar
vtpup
Posts: 1420
Joined: Thu 16 Oct 2008, 01:42
Location: Republic of Vermont
Contact:

#92 Post by vtpup »

@US, I was just providing some personal tips, and the wine drive location. Not how to make things user-proof. Up to you on that.

BTW it won't take only an impatient individual to shut down improperly. Somebody's laptop battery will run out while on standby, or someone else will get a browser/cursor lockup (thanks the the wide world of javascript) or download a Windows app/Wine combo that goes off to nana-land, and will then hold down the power button to reset.

That kind of thing is going to happen, sooner or later, not just might happen. So that probably should be part of your robustness plan.

In fact, you might want to shut down improperly as a test, yourself, on a sandbox stick install, after you get things the way you want them.

For me, in my experience of bail-out resets, the main problem after the auto fsck kicks in and checks for any disk problems is loss of the PuppyPin file, leaving my desktop a mess or with little on it. (I'm a desktop icon cluterrer, I admit it).

A backup of the PuppyPin would go a long way to restoring life as it was after an inadvertent shutdown.
[color=darkblue]Acer Aspire 5349-2635 laptop Tahrpup.[/color]
[color=blue]Acer R11 and C720 Chromebks Bionicpup64[/color]
[color=olive]Acer Iconia A1-830 tablet no pup[/color]
[color=orange]www.sredmond.com[/color]

User avatar
UncleScrooge
Posts: 104
Joined: Tue 07 Apr 2020, 06:07
Location: Norway

#93 Post by UncleScrooge »

@ vtpup

hard tests are part of the game.
we are going for hard shut down of the machine in different conditions, including a bunch our tools (wine or linux native) running at the same time and see what happen.
What's the recovery time in that event, etc.

We are also thinking if we have to provide some kind of daemon that logs events continuously (and cleans up during a regular shutdown, that's another reason why I'd like to run scripts at shutdown).

for what the backup of the desktop is concerned, that's one of our script running at boot up (the part i posted earlier is now enhanced with the backup of the puppypin and update of the stale icons).
Last edited by UncleScrooge on Tue 02 Jun 2020, 15:22, edited 2 times in total.

User avatar
UncleScrooge
Posts: 104
Joined: Tue 07 Apr 2020, 06:07
Location: Norway

#94 Post by UncleScrooge »

bigpup wrote:You may want to look at what can be controlled with the menu->System->Boot Manager
sure thing.
Already using it

User avatar
UncleScrooge
Posts: 104
Joined: Tue 07 Apr 2020, 06:07
Location: Norway

#95 Post by UncleScrooge »

One of the today's test was to try to boot the stick from different machines.

we had two problems with:

Macbook PRO 2012

A) Built in keyboard turns uresponsive during login
  1. at power up the machine sees the UEFI bootable drive.
  2. when the EFI menu pops up, we are able to scroll through the choices with the arrows (built in keyboard responds regularly)
  3. then the login/passphrase screen loads and... the built in keyboard becomes totally unresponsive: not possible to enter the passphrase or to move the option from <OK>. so we are stuck.
  4. Now: starting with a USB keyboard plugged in, instead, that never gets unresponsive: we are able to enter the passphrase and start the system.
    Once BionicPup is started, then the built in keyboard comes back to life again.
B) the touchpad does not work
I wasn't present during this test. It was reported to me. I argued that perhaps this was due to the Macbook pro touchpad functionality. I disabled all the tap-to-click options in the configuration of the master, one can click only with the buttons, but the MacPro does not have buttons.
Disabling the tap-to-click is a safety feature we must have, since we had an accident in the past where the wrong thing was inadvertendly dragged into the "wrong" box (drag and drop by tapping, unwanted: the user did not intend to tap-to-click, he just hit the touchpad a tad too hard...), and we blew up three cylinders of a 4000 KW engine.

or do you have a better explanation? Unfortunately the macbook won't be available again until next monday.

Dell, HP and ASUS tests went ok.

User avatar
UncleScrooge
Posts: 104
Joined: Tue 07 Apr 2020, 06:07
Location: Norway

#96 Post by UncleScrooge »

I found a way to have stuff done at shutdown.
at the end of usr/bin/logout_gui:

Code: Select all

....
case $EXIT in
  logout) 	cleanup_and_Backup
		exec wmexit 
		;;
  reboot)	cleanup_and_Backup
		exec wmreboot 
		;;
  poweroff) cleanup_and_Backup
		 exec wmpoweroff 
		;;
  restartx)restartwm ;;
  restartjwm)jwm -restart ;;
  refreshjwm)fixmenus; jwm -reload ;;
  *)exit ;;
esac
where part of cleanup_and_Backup for instance is:

Code: Select all

	maxBaks=9	#max number of backups before rotating back to 0
	countBakFile="/root/Choices/ROX-Filer/.bakcount"
	[ ! -e "$countBakFile" ] && {		# if the counter doesn't exist create it and seti it to 0'
			touch "$countBakFile"
			echo $maxBaks > "$countBakFile"
	}
	countBak=$(cat '/root/Choices/ROX-Filer/.bakcount')
	if [ $countBak -eq $maxBaks ]; then	#save up to maxBaks copies of the desktop
		countBak=0
	else
		((countBak+=1))
	fi
	echo $countBak > "$countBakFile"
	puppyPinFile="/root/Choices/ROX-Filer/PuppyPin"
	puppyPinFileBak="/root/Choices/ROX-Filer/PuppyPin.bak".$countBak
	cp -f "$puppyPinFile" "$puppyPinFileBak"

Post Reply