Page 8 of 8

Porteus-v4.0rc4 bug reports

Posted: 03 Apr 2018, 00:39
by Ed_P
:oops: You read better than I do ncmprhnsbl. :sorry:

Porteus-v4.0rc4 bug reports

Posted: 03 Apr 2018, 15:20
by Rava
Ed_P wrote:
02 Apr 2018, 14:18
Rava wrote:
02 Apr 2018, 06:22
Why won't swapon (or Porteus?) assign the priority as I told it to? Why has the newly added swapfile priority of -3 instead of -10?
And what difference does it make? :%) What runs faster that way? And how much faster? :crazy:
On slow machines, and it is a slow one, you try to get everything as high-performance as you manage.

By default, a swap partition, especially one that sits at the very beginning of a harddisk, always will be quicker than some file that sits at the very end of the hard disk.

But you also could donate a 64 bit compatible laptop or notebook to me, then I won't have such issues with older hardware anymore. I am pulling your leg with the last sentence; I hope you get the joke... :D :crazy: :Yahoo!:

Porteus-v4.0rc4 bug reports

Posted: 03 Apr 2018, 15:56
by alsass
sorry for my bad english. Probably my previous message was not clear.

in
I related 3 points:
1) When being in China, the chinese national firewall blocks lots of US Internet sites like google or facebook.
This is why I suggested using something else than "google.com" for checking Internet availibility.
2) The dl.porteus.org site is connected first (before google.com).
I don't think that the server load would be much higher if it was used as sparing partner in function "has_internet"
3) No need to contact it twice (first dowload, then check for Internet connection), if the dowload of the update-live script succeeds, the Internet connection is definitively OK.

Hope that clarifies my observations and suggestions.
Would you be interested in patches to remedy that (very special) problem?

Thanks

Porteus-v4.0rc4 bug reports

Posted: 07 Apr 2018, 00:38
by brokenman
Thanks alsass,

The patches would be appreciated.

Porteus-v4.0rc4 bug reports

Posted: 08 Apr 2018, 10:06
by alsass
here are my patches (two for now):

1) librokenman.patch for file /usr/lib/librokenman

Code: Select all

--- librokenman.orig	2017-03-05 21:11:00.000000000 +0100
+++ librokenman	2018-04-08 11:05:34.956451679 +0200
@@ -262,17 +262,22 @@
 	else
     answ=1
   fi
+  export HAS_NO_INTERNET=$answ
 fi
 }
 
 # Check if a website is online and working (silently)
 # Returns url=0 if it is avaiable
 has_internet(){
-if (wget -q --spider --force-html --inet4-only http://www.google.com >/dev/null 2>&1); then
+answ=$HAS_NO_INTERNET
+if [ "$HAS_NO_INTERNET" != "0" ]; then
+  if (wget -q --spider --force-html --inet4-only http://dl.porteus.org >/dev/null 2>&1); then
     answ=0
-	else
+	   else
     answ=1
+   fi
 fi
+export HAS_NO_INTERNET=$answ
 }
 
 # Check that writable flag is set
2) update-vbox.patch for file /opt/porteus-scripts/update-vbox

Code: Select all

--- update-vbox.orig	2016-05-29 01:46:47.000000000 +0200
+++ update-vbox	2018-04-08 11:25:25.004451537 +0200
@@ -10,7 +10,7 @@
 PIXMAPS=/usr/share/pixmaps/porteus
 SERVER=`awk -F= '/SERVER=/{print$NF}' /etc/porteus.conf`
 link=$SERVER/i586/testing/live/update-vbox-live
-trap cleanup SIGHUP SIGINT SIGTERM
+trap cleanup 0
 
 cleanup(){
 rm /tmp/.vbox-live 2>/dev/null
@@ -64,18 +64,21 @@
 </window>
 '
 gtkdialog -p MAIN_DIALOG > /tmp/.vbox-live
+. /tmp/.vbox-live
 
-[ `egrep "Cancel|abort" /tmp/.vbox-live` ] && { cleanup; exit; }
-[[ `grep vbox-live /tmp/.vbox-live 2>/dev/null|cut -d'"' -f2` == "" ]] &&  { cleanup; exit; }
+if [ "$EXIT" = "abort" -o "$EXIT" = "Cancel" -o "$vbox-live" = "" ]; then
+   exit
+fi
 
-answer=`awk -F'"' '/vbox-live/{print$2}' /tmp/.vbox-live`
+answer=$vbox-live
 ## Internet check
 if [ ! -e /tmp/update-vbox-live ]; then
 if wget --spider -v "$link"; then
+        export HAS_NO_INTERNET=0
 	wget $link -P /tmp
 		else
+        export HAS_NO_INTERNET=1
 	gtk_message "An internet connection was not found or the porteus server was not reachable. Exiting now." 450 gtk-dialog-warning
-	cleanup
 fi
 fi
 
@@ -85,12 +88,8 @@
 case $answer in
 VirtualBox )
 /usr/local/bin/update-vbox-live vbox
-cleanup
 ;;
 "VirtualBox Guest additions" )
 /usr/local/bin/update-vbox-live vboxguest
-cleanup
 ;;
 esac
-
-rm /tmp/.vbox-live 2>/dev/null
you may apply them with these commands

Code: Select all

  # cd /usr/lib && patch < librokenman.patch
  # cd /opt/porteus-scripts && patch < update-vbox.patch
Short explanation of the patches:
I created an environment variable "HAS_NO_INTERNET". When it is set to "0" we know we have a valid Internet connection. No further tests will be done to check for that process (and children).
I also changed "google.com" to "dl.porteus.org" (within function "has_internet"), since that is the real destination for all update-* scripts.
And finally I rewrote some parts of update-vbox, to streamline it a bit.

If these patches are welcome, I plan to send you some more patches for the rest of the update-* scripts.
Just please give me a short message, if that is OK for you.
But then it then it would probably better to create a new threat, to not pollute this on...

Thanks

Porteus-v4.0rc4 bug reports

Posted: 08 Apr 2018, 13:29
by brokenman
Thanks. I'll apply these patches. Further patches are welcome.

Porteus-v4.0rc4 bug reports

Posted: 08 Apr 2018, 15:47
by alsass
Thanks brokenman. I'll do my best to submit the other patches soon.

Unfortunately I discovered a glitch with one of my patches.
The sourcing of "/tmp/.vbox-live" does not work as intended. My apologies.
Here is a corrected version of the patch:

update-vbox.patch for file /opt/porteus-scripts/update-vbox

Code: Select all

--- update-vbox.orig	2016-05-29 01:46:47.000000000 +0200
+++ update-vbox	2018-04-08 17:31:11.852397783 +0200
@@ -10,7 +10,7 @@
 PIXMAPS=/usr/share/pixmaps/porteus
 SERVER=`awk -F= '/SERVER=/{print$NF}' /etc/porteus.conf`
 link=$SERVER/i586/testing/live/update-vbox-live
-trap cleanup SIGHUP SIGINT SIGTERM
+trap cleanup 0
 
 cleanup(){
 rm /tmp/.vbox-live 2>/dev/null
@@ -49,7 +49,7 @@
 	<hbox>
 		'`txtmarkup 220 "Choose an option: "`'
 		<comboboxtext active="6" focus-on-click="false" button-sensitivity="1">
-			<variable>vbox-live</variable>
+			<variable>vbox_live</variable>
 			<item>VirtualBox</item>
 			<item>VirtualBox Guest additions</item>
 		</comboboxtext>
@@ -64,18 +64,21 @@
 </window>
 '
 gtkdialog -p MAIN_DIALOG > /tmp/.vbox-live
+. /tmp/.vbox-live
 
-[ `egrep "Cancel|abort" /tmp/.vbox-live` ] && { cleanup; exit; }
-[[ `grep vbox-live /tmp/.vbox-live 2>/dev/null|cut -d'"' -f2` == "" ]] &&  { cleanup; exit; }
+if [ "$EXIT" = "abort" -o "$EXIT" = "Cancel" -o "$vbox_live" = "" ]; then
+   exit
+fi
 
-answer=`awk -F'"' '/vbox-live/{print$2}' /tmp/.vbox-live`
+answer=$vbox_live
 ## Internet check
 if [ ! -e /tmp/update-vbox-live ]; then
 if wget --spider -v "$link"; then
+        export HAS_NO_INTERNET=0
 	wget $link -P /tmp
 		else
+        export HAS_NO_INTERNET=1
 	gtk_message "An internet connection was not found or the porteus server was not reachable. Exiting now." 450 gtk-dialog-warning
-	cleanup
 fi
 fi
 
@@ -85,12 +88,8 @@
 case $answer in
 VirtualBox )
 /usr/local/bin/update-vbox-live vbox
-cleanup
 ;;
 "VirtualBox Guest additions" )
 /usr/local/bin/update-vbox-live vboxguest
-cleanup
 ;;
 esac
-
-rm /tmp/.vbox-live 2>/dev/null
This patch should be applied to the original version of the file.
Sorry for the trouble.

Thanks

Porteus-v4.0rc4 bug reports

Posted: 09 Apr 2018, 15:30
by alsass
please find the next and last patch below:

this one is for file : /opt/porteus-scripts/xpns-tool

Code: Select all

--- xpns-tool.orig	2012-06-21 22:51:59.000000000 +0000
+++ xpns-tool	2018-04-09 15:18:56.821933178 +0000
@@ -520,7 +520,7 @@
 
 ## Check for good connection
 if [ "$METHOD" == "wifi" -o "$METHOD" == "wired" ]; then 
-  if (wget -q --spider --force-html --inet4-only http://www.google.com >/dev/null 2>&1); then
+  if (wget -q --spider --force-html --inet4-only http://dl.porteus.org >/dev/null 2>&1); then
     connected=1
 	else
     unset connected
The other update-* scripts are already in good shape (for the 40rcX series).

Thanks.

Porteus-v4.0rc4 bug reports

Posted: 20 Jul 2018, 20:19
by Rava
alsass wrote:
09 Apr 2018, 15:30
please find the next and last patch below:

this one is for file : /opt/porteus-scripts/xpns-tool
Could that even solve my online issue? I think not, it might only apply to update scripts, right, not to the whole system…