Page 7 of 8

Porteus-v4.0rc4 bug reports

Posted: 30 Mar 2018, 18:11
by roadie
jssouza wrote:
30 Mar 2018, 18:03
roadie wrote:
30 Mar 2018, 17:49
When the lid is closed, it goes to suspend but when reopened the machine reboots
Tried on an acer aspire one, lid closed and reopened, I get the lock screen prompt. Enter password and brings me back to desktop.
roadie wrote:
30 Mar 2018, 17:49
I get the Grub boot screen
Why grub? is this a customized mate?
roadie wrote:
30 Mar 2018, 17:49
Power Manager is set to suspend on lid closure.
Yes, Isnt this correct?

I have an Aspire One I can dig out and try on.

I do only frugal installs and use Grub to boot them.

Yes, Power Manager settings are correct, I mention Power Manager only so you know I checked it before posting.

Porteus-v4.0rc4 bug reports

Posted: 30 Mar 2018, 19:55
by roadie
jssouza wrote:
30 Mar 2018, 18:03
Why grub? is this a customized mate?


You may disregard, turns out it is customized to the extent of changing kernels to 4.15.2.....the stock kernel is working fine.

Porteus-v4.0rc4 bug reports

Posted: 31 Mar 2018, 11:51
by Blaze
roadie, do you use grub or grub2?
Please, look at this post grub2 menu entry (Пост Blaze #59969)

Porteus-v4.0rc4 bug reports

Posted: 31 Mar 2018, 15:41
by roadie
Blaze wrote:
31 Mar 2018, 11:51
roadie, do you use grub or grub2?
Please, look at this post grub2 menu entry (Пост Blaze #59969)
I've been using Grub 2 for the last 2-3 years, though I never use update-grub....things get messy with it. When the bootloader is working, I don't play with it, learned my lessons in that.

Porteus-v4.0rc4 bug reports

Posted: 02 Apr 2018, 06:22
by Rava
System: Porteus 4.0rc4 i586.

Could be that this issue is valid for rc5 as well, so far have not managed to update my currently only used i586 (32 bit only) machine to rc5.

Since the swap partition on my Samsung Q40 (i586 machine, sadly no x86-64 on that one) is too small, and I don't want to change the geometry of most of the partitions on an almost full internal 60 GB hard drive (also quite small, but it teaches restraint. xD), I just created an swap file on a Linux ext3 partition and added it at boot time by adding

Code: Select all

swapon -v /mnt/sda3/linuxswap
into /etc/rc.d/rc.local

But the priority of the two available swaps is not what I like:

Code: Select all

root@porteus:/# type sx
sx is a function
sx () 
{ 
    echo $(date +%d.%m.%Y\ %H:%M:%S) ____________________________________________________________;
    { 
        read firstLine;
        echo "$firstLine";
        while read f t s u p; do
            let "s2 = $s / 1024";
            let "u2 = $u / 1024";
            printf '%-40s%-16s%-8s%-8s%-8s\n' $f $t $s2 $u2 $p;
        done
    } < /proc/swaps
}
root@porteus:/mnt/live/memory/images# sx
02.04.2018 07:35:36 ____________________________________________________________
Filename				Type		Size	Used	Priority
/mnt/sda3/linuxswap                     file            2047    257     -2
/dev/sda2                               partition       949     0       -3
As you can see, I did not give any priority info when I swapon'ed /mnt/sda3/linuxswap. But the swap partition should, by default, have a higher priority than a swap file. Or not?
For some reason Porteus gave it an even lower priority.

Is that a bug? Or done by a reason I don't get?

To test this, I did a swapoff /mnt/sda3/linuxswap and lo and behold… Porteus changed the priority of the swap partition during the swapoff:

Code: Select all

root@porteus:/# sx
02.04.2018 07:36:02 ____________________________________________________________
Filename				Type		Size	Used	Priority
/mnt/sda3/linuxswap                     file            2047    33      -2      
/dev/sda2                               partition       949     41      -2      
and kept that priority after the swapoff:

Code: Select all

root@porteus:/# sx
02.04.2018 07:36:18 ____________________________________________________________
Filename				Type		Size	Used	Priority
/dev/sda2                               partition       949     52      -2      
Seems, at least for now the only fix there is is to give the /mnt/sda3/linuxswap a lower priority, e.g. like so:

Code: Select all

swapon -vp -10 /mnt/sda3/linuxswap
But… that failed, kind of.
While doing the manual swapon, swapon gave no error message, nothing telling me that something with the given priority of "-10" was off:

Code: Select all

root@porteus:/# swapon -vp -10 /mnt/sda3/linuxswap
swapon: /mnt/sda3/linuxswap: found signature [pagesize=4096, signature=swap]
swapon: /mnt/sda3/linuxswap: pagesize=4096, swapsize=2147483648, devsize=2147483648
swapon /mnt/sda3/linuxswap
root@porteus:/# sx
02.04.2018 07:38:19 ____________________________________________________________
Filename				Type		Size	Used	Priority
/mnt/sda3/linuxswap                     file            2047    0       -3      
/dev/sda2                               partition       949     73      -2      
As you can see… the swap partition kept its priority, and the swap file got a lower one. That`s how I want it, but without having to manually swapoff and swapon. But the swap partition got not assigned the priority I told swapon to give it.

Now I would have to reboot [*] seeing how the entry of

Code: Select all

swapon -vp -10 /mnt/sda3/linuxswap
in /etc/rc.d/rc.local would work out, if that would result in the swap file having a lower priority than the swap partition, or not. And also, if at that time, during working on rc.local, swapon / Porteus would assign the priority I told it to, or again chooses something else. Like with the manual swapon as described above.

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?

_________
[*] Prior rebooting I plan on being able to install rc5 on that machine… when the stuff I have to prepare today for Tuesday and Wednesday gives me the needed free time. Cannot say for now if that is so, or not.

Porteus-v4.0rc4 bug reports

Posted: 02 Apr 2018, 14:18
by Ed_P
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:

:)

Porteus-v4.0rc4 bug reports

Posted: 02 Apr 2018, 19:15
by alsass
Version: Porteus-XFCE-v4.0rc4-i586

recently I was in mainland China and wanted to install the vbox-guest-additions using "/opt/porteus-scripts/update-vbox".
But I got a message like: "It appears you have no internet connection!"
But my Internet connection was OK.

I narrowed the problem down to the (in)famous chinese "Great FireWall"!!!
It dropped silently some IP-traffic to US sites like "google.com".

I found that by inspecting the "update-vbox" script:
1. it phones home (to Porteus web site) to download a live script:
"http://dl.porteus.org/i586/testing/live ... -vbox-live"
2. "update-vbox-live" sources "/usr/lib/librokenman" which contains the function "has_internet".
3. "has_internet" finally calls "wget -q --spider --force-html --inet4-only http://www.google.com"
assuming that "google.com" must be answering, if not it guesses that there is probably "no Internet connection".

This raises some questions and suggestions:
a) why does the script "update-vbox" and the other "update-*" scripts phone home?
All the downloaded live scripts could be integrated in "/opt/porteus-scripts" in an XZM file into the ISO image, is not it?
b) In step "3." it is really not necessary any more to test for Internet availibility because step "1." already succeeded.
In fact if step "1." failed, there would be no step "3." at all, because the script would exit at step "1."
c) I saw that "has_internet" in "/usr/lib/librokenman" has many calling points, of course it is usefull and should be kept.
But I'd suggest to change it, so that it calls "wget http://dl.porteus.org", instead of "google.com" to check if Internet is up.
Or at least "apple.com" or "bing.com" or "microsoft.com" or "baidu.cn", if the porteus site does not fit your needs/requirements.

Please let me know if you would like me to do the changes myself and send them in as patches.
I'd be glad to help.

Thanks

Porteus-v4.0rc4 bug reports

Posted: 02 Apr 2018, 21:34
by Ed_P
alsass wrote:
02 Apr 2018, 19:15
This raises some questions and suggestions:
a) why does the script "update-vbox" and the other "update-*" scripts phone home?
So brokenman can maintain them on the server thus saving him time and load on the porteus.org servers.
But I'd suggest to change it, so that it calls "wget http://dl.porteus.org", instead of "google.com" to check if Internet is up.
It would put too much of a load on the porteus.org servers.
Or at least "apple.com" or "bing.com" or "microsoft.com" or "baidu.cn", if the porteus site does not fit your needs/requirements.
How are they better than google.com?

Porteus-v4.0rc4 bug reports

Posted: 02 Apr 2018, 22:14
by ncmprhnsbl
Ed_P wrote:
02 Apr 2018, 21:34
How are they better than google.com?
i guess they are not blocked by the (in)famous chinese "Great FireWall" (in mainland china)

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.