Porteus module activation status

For discussions about programming and projects not necessarily associated with Porteus.

Re: Porteus module activation status

Postby jssouza » 10 Oct 2016, 16:06

Hi Ed_P

Ed_P wrote:Do you have the 00* fix modules also?


No, I downloaded the iso directly from http://dl.porteus.org/x86_64/archive/Porteus-v3.0.1/. But I guess that should not matter since you also see the issue on Cinnamon 3.2rc5.

Could you show the output of this please: (Do not be booted through copy2ram)
Code: Select all
#! /bin/bash
PORTROOTDIR=`grep -A1 "Porteus data found in" /var/log/porteus-livedbg | tail -n1`
echo $PORTROOTDIR | egrep -q 'isoloop' && PORTROOTDIR="/mnt/live${PORTROOTDIR}"
echo "Porteus Root: $PORTROOTDIR"
echo "Base Modules:"
find "$PORTROOTDIR" -name "*.xzm" | sort


In one of your older posts you mentioned:
Ed_P wrote:Yes I am booting from an iso but the Boot device: path shown in cat /var/log/porteus-livedbg is misleading as are the paths it shows for the base modules, /mnt/isoloop/porteus/base/00*. The actual paths are /mnt/image/mnt/isoloop/.

This is strange, could you also let me know what does ls -l /mnt/image/mnt/isoloop/ say?
jssouza
Samurai
Samurai
 
Posts: 112
Joined: 09 Jul 2015, 15:17
Location: Liechtenstein
Distribution: Porteus x86 arm

Re: Porteus module activation status

Postby jssouza » 10 Oct 2016, 16:51

Hi brokenman,
brokenman wrote:If you are checking all conditions, don't forget the scenario where one boots via iso and uses copy2ram.

Thank you for your input. I have copy2ram condition now implemented. I also removed the xzm module name appearance in the directory paths for modules activated after bootup.

Code: Select all
#! /bin/bash

# Check if running as root
if [ "$UID" -ne 0 ]; then
  if [ "$DISPLAY" ]; then
    ktsuss $0
  else
    echo "Enter root password"
    su -c $0
  fi
  exit
fi

export MODULE_LOAD_DIR="/mnt/live/memory/images"
export TMPFILE="/tmp/${$}_port_modules"
export LOADEDENTRIES="grep -c gtk-yes $TMPFILE | tr -d '\n'"
export NUMENTRIES="wc -l $TMPFILE | cut -f 1 -d ' '"
export PORTROOTDIR=`grep -q copy2ram /proc/cmdline && echo "/mnt/live/memory/copy2ram" || grep -A1 "Porteus data found in" /var/log/porteus-livedbg | tail -n1`

trap sigint_handler INT
sigint_handler()
{
    rm -f "$TMPFILE"
}

# Functions modified from the linuxrc
function value() { egrep -o " $1=[^ ]+" /proc/cmdline | cut -d= -f2; }

function search()
{
 local FOUND=""
 for x in `ls /mnt | tac`; do
  if [ -e /mnt/$x/$1 -a $(grep -c "/mnt/$x/$1" /var/log/porteus-livedbg) -ne 0 ]; then
   FOUND="$x"
   break
  fi
 done
 echo $FOUND
}

export EXTRAMODS=`value extramod | sed 's/;/ /g'`

# Load modules activated after booting.
function load_remaining_modules
{
  local PORTMODULES="$(ls $MODULE_LOAD_DIR | sort)"
  for PORTMODULE in $PORTMODULES
  do
     local MODNAME="$(basename -a $PORTMODULE)"
     if ! grep -q "$MODNAME" "$TMPFILE"; then
       local MODDIR="$(losetup  -a | grep $MODNAME | cut -d \( -f2 | cut -d \) -f1)"
       MODDIR="$(dirname $MODDIR)"
      echo "gtk-yes|${MODNAME}|${MODDIR}" >> "$TMPFILE"
     fi
  done   
}

# Loads modules from porteus base/modules/optional directories and extramod= directories
function load_modules
{
  local PORTMODULES="$(find $PORTROOTDIR -name "*.xzm" | sort)"
  for PORTMODULE in $PORTMODULES
  do
     local MODNAME="$(basename -a $PORTMODULE)"
     local MODDIR="$(dirname $PORTMODULE)"
     local OUT="${MODNAME}|${MODDIR}"
 
     if [ -e "${MODULE_LOAD_DIR}/${MODNAME}" ]; then
       echo "gtk-yes|${OUT}" >> "$TMPFILE"
     else
       echo "gtk-no|${OUT}" >> "$TMPFILE"
     fi
  done

  # Copy2Ram copies even the extramods to copy2ram directory. No need to check it again
  if [ "$EXTRAMODS" -a "$PORTROOTDIR" != "/mnt/live/memory/copy2ram" ]; then
   for EXTRAMOD in $EXTRAMODS; do
    echo $EXTRAMOD | egrep -q '^UUID|^LABEL' && EXTRAMOD="$(echo $EXTRAMOD | cut -d \/ -f2-)"
    echo $EXTRAMOD | egrep -q '^/mnt/' && EXTRAMOD="$(echo $EXTRAMOD | cut -d \/ -f4-)"
   RET=$(search $EXTRAMOD)
   if [ $RET ]; then
     PORTMODULES="$(find /mnt/${RET}/${EXTRAMOD} -name "*.xzm" | sort)"
    else
     PORTMODULES="$(find ${EXTRAMOD} -name "*.xzm" | sort)"
    fi     
   for PORTMODULE in $PORTMODULES
   do
     local MODNAME="$(basename -a $PORTMODULE)"
     local MODDIR="$(dirname $PORTMODULE)"
     local OUT="${MODNAME}|${MODDIR}"
       
     if [ -e "${MODULE_LOAD_DIR}/${MODNAME}" ]; then
      echo "gtk-yes|${OUT}" >> "$TMPFILE"
     else
      echo "gtk-no|${OUT}" >> "$TMPFILE"
     fi
   done
   done
  fi
  load_remaining_modules
}

# Activate or deactivate a modules
function activate_module
{
  if [ "$1" = "" ]; then return; fi

  local MODDIR="$(grep $1 $TMPFILE | cut -f 3 -d "|")"
  local MODULE="${MODDIR}/${1}"

  if [ -e "${MODULE_LOAD_DIR}/${1}" ]; then
   deactivate "$MODULE"
  else
   activate "$MODULE"
  fi

  rm -f "$TMPFILE"
  load_modules
}

export -f load_modules
export -f load_remaining_modules
export -f activate_module
export -f value
export -f search

echo $PORTROOTDIR | egrep -q 'isoloop' && PORTROOTDIR="/mnt/live${PORTROOTDIR}" #isoloop workaround, to be removed in 3.2 final
load_modules

export MODULES_MAIN='
<window window_position="1" title="Porteus Modules" default-height="550" default-width="500" icon-name="cdr" resizable="true" decorated="true">
<vbox>
 <hbox>
  <text>
   <label>"Modules Activated: "</label>
  </text>
  <text>
   <variable>ENTRIES</variable>
   <input>'$LOADEDENTRIES'</input>
  </text>
 </hbox>
 <tree homogeneous="true" selection-mode="1" file-monitor="true">
  <variable>ENTRY</variable>
  <label>"Module Name                        |Containing Directory               "</label>
  <input file icon_column="0">'$TMPFILE'</input>
  <action signal="row-activated">"activate_module $ENTRY"</action>
  <action signal="file-changed" type="refresh">ENTRY</action>
  <action signal="file-changed" type="refresh">ENTRIES</action>
 </tree>
 <hseparator default-width="300"></hseparator>
 <hbox>
  <button space-fill="true">
   <label>Exit</label>
   <action>exit:0</action>
  </button> 
 </hbox>
</vbox>
</window>


gtkdialog --program=MODULES_MAIN -c
rm -f $TMPFILE
jssouza
Samurai
Samurai
 
Posts: 112
Joined: 09 Jul 2015, 15:17
Location: Liechtenstein
Distribution: Porteus x86 arm

Re: Porteus module activation status

Postby Ed_P » 10 Oct 2016, 22:14

jssouza wrote:Hi Ed_P

Ed_P wrote:Do you have the 00* fix modules also?


No, I downloaded the iso directly from http://dl.porteus.org/x86_64/archive/Porteus-v3.0.1/. But I guess that should not matter since you also see the issue on Cinnamon 3.2rc5.

Could you show the output of this please: (Do not be booted through copy2ram)
Code: Select all
#! /bin/bash
PORTROOTDIR=`grep -A1 "Porteus data found in" /var/log/porteus-livedbg | tail -n1`
echo $PORTROOTDIR | egrep -q 'isoloop' && PORTROOTDIR="/mnt/live${PORTROOTDIR}"
echo "Porteus Root: $PORTROOTDIR"
echo "Base Modules:"
find "$PORTROOTDIR" -name "*.xzm" | sort


In one of your older posts you mentioned:
Ed_P wrote:Yes I am booting from an iso but the Boot device: path shown in cat /var/log/porteus-livedbg is misleading as are the paths it shows for the base modules, /mnt/isoloop/porteus/base/00*. The actual paths are /mnt/image/mnt/isoloop/.

This is strange, could you also let me know what does ls -l /mnt/image/mnt/isoloop/ say?


Code: Select all
guest@porteus:~$ test.sh
Porteus Root: /mnt/live/mnt/isoloop/porteus
Base Modules:
guest@porteus:~$ ls -l /mnt/image/mnt/isoloop/
/bin/ls: cannot access /mnt/image/mnt/isoloop/: No such file or directory

:oops: I misspoke.

Code: Select all
guest@porteus:~$ ls -l /mnt/live/mnt/isoloop/
total 6
-rw-r--r-- 1 root root 1141 Jan 30  2015 USB_INSTALLATION.txt
drwxr-xr-x 2 root root 2048 Jan 30  2015 boot/
drwxr-xr-x 2 root root 2048 Jan 30  2015 porteus/
guest@porteus:~$ ls -l /mnt/live/mnt/isoloop/porteus/
total 10
drwxr-xr-x 2 root root 2048 Jan 30  2015 base/
-rwxr-xr-x 1 root root 1015 Jan 30  2015 make_iso.sh*
drwxr-xr-x 2 root root 2048 Jan 30  2015 modules/
drwxr-xr-x 2 root root 2048 Jan 30  2015 optional/
-rw-r--r-- 1 root root  437 Jan 30  2015 porteus-v3.0.1-x86_64.sgn
drwxr-xr-x 2 root root 2048 Jan 30  2015 rootcopy/
guest@porteus:~$ ls -l /mnt/live/mnt/isoloop/porteus/base
total 190120
-r--r--r-- 1 root root 16879616 Jan 30  2015 000-kernel.xzm
-r--r--r-- 1 root root 53059584 Jan 30  2015 001-core.xzm
-r--r--r-- 1 root root 48644096 Jan 30  2015 002-xorg.xzm
-r--r--r-- 1 root root 76099584 Jan 30  2015 003-razor.xzm
guest@porteus:~$


Code: Select all
guest@porteus:~$ ls -l  /mnt/live/memory/images
total 0
drwxr-xr-x  7 root root  95 Aug 28 19:02 000-kernel.xzm/
drwxrwxrwt 20 root root 281 Sep  3 01:59 001-core.xzm/
drwxr-xr-x 10 root root 143 Sep  3 02:18 002-xorg.xzm/
drwxr-xr-x 11 root root 141 Sep  3 03:10 003-cinnamon.xzm/
drwxr-xr-x  3 root root  26 Aug  5 13:23 009-caches.xzm/
drwxr-xr-x  9 root root 118 Feb  5  2014 07-printing.xzm/
drwxr-xr-x  9 root root  85 Oct 10 18:57 changes/
drwxr-xr-x  5 root root  49 Oct  7 19:21 firefox-50.0b5-x86_64-1.xzm/
drwxr-xr-x  4 root root  37 Sep 29 20:27 flashplayer-plugin-23.0.0.162-x86_64-1.xzm/
drwxr-xr-x  3 root root  26 Oct  9 16:14 multiload-ng-1.4.0-x86_64.xzm/
drwxr-xr-x  3 root root  26 Jul 15 23:06 nemo-actions-fix-by-blaze.xzm/
drwxr-xr-x  3 root root  26 Sep 24 22:56 pepperflash-23.0.0.162-x86_64-1.xzm/
drwxr-xr-x  3 root root  26 Sep 16 20:18 xf86-video-amdgpu-1.1.1-x86_64.xzm/
drwxr-xr-x  3 root root  26 Sep 16 20:21 xf86-video-ati-7.7.1-x86_64.xzm/
guest@porteus:~$


BTW The boot screen shows the Base modules as being loaded last.
Last edited by Ed_P on 11 Oct 2016, 00:09, edited 2 times in total.
Ed
User avatar
Ed_P
Contributor
Contributor
 
Posts: 2882
Joined: 06 Feb 2013, 23:12
Location: Western NY, USA
Distribution: Cinnamon 3.2.2 64-bit ISO

Re: Porteus module activation status

Postby ncmprhnsbl » 10 Oct 2016, 23:30

suggestion: refresh button
use case senario: if i activate a module from some random partition/folder (from a filemanager) in running system..
the only way at the moment to refresh the list is to restart the app..
Forum Rules : http://forum.porteus.org/viewtopic.php?f=35&t=44
User avatar
ncmprhnsbl
Full of knowledge
Full of knowledge
 
Posts: 701
Joined: 20 Mar 2012, 04:42
Location: australia
Distribution: 3.2.2-64bit xfce/openbox

Re: Porteus module activation status

Postby jssouza » 11 Oct 2016, 13:08

Ed_P wrote:BTW The boot screen shows the Base modules as being loaded last.

Even during boot! I thought the base modules should always be booted (activated) first, hence the 00x prefixing :%) Maybe you should try once in always fresh mode...

ncmprhnsbl wrote:suggestion: refresh button
use case senario: if i activate a module from some random partition/folder (from a filemanager) in running system..
the only way at the moment to refresh the list is to restart the app..

Hi ncmprhnsbl,

Thank you for your input. I added a refresh button to the script now.
Code: Select all
#! /bin/bash

# Check if we are root
if [ "$UID" -ne 0 ]; then
  if [ "$DISPLAY" ]; then
    ktsuss $0
  else
    echo "Enter root password"
    su -c $0
  fi
  exit
fi

export MODULE_LOAD_DIR="/mnt/live/memory/images"
export TMPFILE="/tmp/${$}_port_modules"
export LOADEDENTRIES="grep -c gtk-yes $TMPFILE | tr -d '\n'"
export NUMENTRIES="wc -l $TMPFILE | cut -f 1 -d ' '"
export PORTROOTDIR=`grep -q copy2ram /proc/cmdline && echo "/mnt/live/memory/copy2ram" || grep -A1 "Porteus data found in" /var/log/porteus-livedbg | tail -n1`

trap sigint_handler INT
sigint_handler()
{
    rm -f "$TMPFILE"
}

# Functions modified from the linuxrc
function value() { egrep -o " $1=[^ ]+" /proc/cmdline | cut -d= -f2; }

function search()
{
 local FOUND=""
 for x in `ls /mnt | tac`; do
  if [ -e /mnt/$x/$1 -a $(grep -c "/mnt/$x/$1" /var/log/porteus-livedbg) -ne 0 ]; then
   FOUND="$x"
   break
  fi
 done
 echo $FOUND
}

export EXTRAMODS=`value extramod | sed 's/;/ /g'`

# Load modules activated after booting.
function load_remaining_modules
{
  local PORTMODULES="$(ls $MODULE_LOAD_DIR | sort)"
  for PORTMODULE in $PORTMODULES
  do
     local MODNAME="$(basename -a $PORTMODULE)"
     if ! grep -q "$MODNAME" "$TMPFILE"; then
       local MODDIR="$(losetup  -a | grep $MODNAME | cut -d \( -f2 | cut -d \) -f1)"
       MODDIR="$(dirname $MODDIR)"
      echo "gtk-yes|${MODNAME}|${MODDIR}" >> "$TMPFILE"
     fi
  done   
}

# Loads modules from porteus base/modules/optional directories and extramod= directories
function load_modules
{
  local PORTMODULES="$(find $PORTROOTDIR -name "*.xzm" | sort)"
  for PORTMODULE in $PORTMODULES
  do
     local MODNAME="$(basename -a $PORTMODULE)"
     local MODDIR="$(dirname $PORTMODULE)"
     local OUT="${MODNAME}|${MODDIR}"
 
     if [ -e "${MODULE_LOAD_DIR}/${MODNAME}" ]; then
       echo "gtk-yes|${OUT}" >> "$TMPFILE"
     else
       echo "gtk-no|${OUT}" >> "$TMPFILE"
     fi
  done

  # Copy2Ram copies even the extramods to copy2ram directory. No need to check it again
  if [ "$EXTRAMODS" -a "$PORTROOTDIR" != "/mnt/live/memory/copy2ram" ]; then
   for EXTRAMOD in $EXTRAMODS; do
    echo $EXTRAMOD | egrep -q '^UUID|^LABEL' && EXTRAMOD="$(echo $EXTRAMOD | cut -d \/ -f2-)"
    echo $EXTRAMOD | egrep -q '^/mnt/' && EXTRAMOD="$(echo $EXTRAMOD | cut -d \/ -f4-)"
   RET=$(search $EXTRAMOD)
   if [ $RET ]; then
     PORTMODULES="$(find /mnt/${RET}/${EXTRAMOD} -name "*.xzm" | sort)"
    else
     PORTMODULES="$(find ${EXTRAMOD} -name "*.xzm" | sort)"
    fi     
   for PORTMODULE in $PORTMODULES
   do
     local MODNAME="$(basename -a $PORTMODULE)"
     local MODDIR="$(dirname $PORTMODULE)"
     local OUT="${MODNAME}|${MODDIR}"
       
     if [ -e "${MODULE_LOAD_DIR}/${MODNAME}" ]; then
      echo "gtk-yes|${OUT}" >> "$TMPFILE"
     else
      echo "gtk-no|${OUT}" >> "$TMPFILE"
     fi
   done
   done
  fi
  load_remaining_modules
}

# Activate or deactivate a modules
function activate_module
{
  if [ "$1" = "" ]; then return; fi

  local MODDIR="$(grep $1 $TMPFILE | cut -f 3 -d "|")"
  local MODULE="${MODDIR}/${1}"

  if [ -e "${MODULE_LOAD_DIR}/${1}" ]; then
   deactivate "$MODULE"
  else
   activate "$MODULE"
  fi
 refresh_modules
}

# Refresh module list
function refresh_modules
{
  rm -f "$TMPFILE"
  load_modules
}

export -f load_modules
export -f refresh_modules
export -f load_remaining_modules
export -f activate_module
export -f value
export -f search

echo $PORTROOTDIR | egrep -q 'isoloop' && PORTROOTDIR="/mnt/live${PORTROOTDIR}" #isoloop workaround, to be removed in 3.2 final
load_modules

export MODULES_MAIN='
<window window_position="1" title="Porteus Modules" default-height="550" default-width="500" icon-name="cdr" resizable="true" decorated="true">
<vbox>
 <hbox>
  <text>
   <label>"Modules Activated: "</label>
  </text>
  <text>
   <variable>ENTRIES</variable>
   <input>'$LOADEDENTRIES'</input>
  </text>
 </hbox>
 <tree homogeneous="true" selection-mode="1" file-monitor="true">
  <variable>ENTRY</variable>
  <label>"Module Name                        |Containing Directory               "</label>
  <input file icon_column="0">'$TMPFILE'</input>
  <action signal="row-activated">"activate_module $ENTRY"</action>
  <action signal="file-changed" type="refresh">ENTRY</action>
  <action signal="file-changed" type="refresh">ENTRIES</action>
 </tree>
 <hseparator default-width="300"></hseparator>
 <hbox>
  <button space-fill="true">
   <label>Refresh</label>
   <input file stock="gtk-refresh"></input>
   <action>refresh_modules</action>
  </button> 
  <button space-fill="true">
   <label>Quit</label>
   <input file stock="gtk-quit"></input>
   <action>exit:0</action>
  </button> 
 </hbox>
</vbox>
</window>


gtkdialog --program=MODULES_MAIN -c
rm -f $TMPFILE
jssouza
Samurai
Samurai
 
Posts: 112
Joined: 09 Jul 2015, 15:17
Location: Liechtenstein
Distribution: Porteus x86 arm

Re: Porteus module activation status

Postby Ed_P » 19 Oct 2016, 18:22

FWIW

Cinnamon 3.2rc5 64-bit

Dbl clicked on the last module. Not sure where it came from since I had replaced it with a newer version. But the terminal errors seem out of place.

Image
Ed
User avatar
Ed_P
Contributor
Contributor
 
Posts: 2882
Joined: 06 Feb 2013, 23:12
Location: Western NY, USA
Distribution: Cinnamon 3.2.2 64-bit ISO

Re: Porteus module activation status

Postby jssouza » 19 Oct 2016, 18:33

Probably the printing module itself could not be deactivated because it is still being used. I have seen the same thing with the devel module. Once activated, it could not be deactivated.
Try to deactivate from the command prompt. You should see the exact same errors.
Code: Select all
deactivate /mnt/live/memory/images/07-printing-x86_64.xzm


From the screenshot I also see that the base modules are at the top! So that is solved eh?
jssouza
Samurai
Samurai
 
Posts: 112
Joined: 09 Jul 2015, 15:17
Location: Liechtenstein
Distribution: Porteus x86 arm

Re: Porteus module activation status

Postby Ed_P » 19 Oct 2016, 20:25

jssouza wrote:Probably the printing module itself could not be deactivated because it is still being used. I have seen the same thing with the devel module. Once activated, it could not be deactivated.
Try to deactivate from the command prompt. You should see the exact same errors.
Code: Select all
deactivate /mnt/live/memory/images/07-printing-x86_64.xzm

Actually I don't. No multiple iterations of "Removing 07-"... msgs.
Code: Select all
guest@porteus:~$ deactivate /mnt/live/memory/images/07-printing-x86_64.xzm
glibtop(c=2802): [DEBUG] open.c:53 glibtop_open_l(): SIZEOF: 40 - 65648 - 248 - 65624 - 224 - 65624
glibtop(c=2802): [DEBUG] open.c:163 glibtop_open_l(): Calling sysdeps open function.
glibtop(c=2802): [DEBUG] init.c:229 glibtop_init_s(): init_s with features=0x7ffffff and flags=0
Quiet mode: off
find: `/mnt/live/memory/images/07-printing-x86_64.xzm': No such file or directory
07-printing-x86_64.xzm: Module is not activated
guest@porteus:~$ deactivate /mnt/live/memory/images/07-printing-x86_64-18.10.2016.xzm
find: `/mnt/live/memory/images/07-printing-x86_64-18.10.2016.xzm/var/log/setup/tmp': Permission denied
glibtop(c=2852): [DEBUG] open.c:53 glibtop_open_l(): SIZEOF: 40 - 65648 - 248 - 65624 - 224 - 65624
glibtop(c=2852): [DEBUG] open.c:163 glibtop_open_l(): Calling sysdeps open function.
glibtop(c=2852): [DEBUG] init.c:229 glibtop_init_s(): init_s with features=0x7ffffff and flags=0
Quiet mode: off
grep: /var/log/packages/07-printing-x86_64-18.10.2016: No such file or directory
cups: stopped scheduler.
Shutting down snmpd: . DONE
07-printing-x86_64-18.10.2016.xzm: The module can't be removed, because it's busy (used).
guest@porteus:~$
guest@porteus:~$ ls /mnt/sda5/porteus3.2/Modules/
009-caches.xzm*                                      flashplayer-plugin-22.0.0.209-x86_64-1.xyzm*
07-printing-3.2.xyzm*                                flashplayer-plugin-23.0.0.162-x86_64-1.xzm*
07-printing-x86_64-18.10.2016.xzm*                   iwlwifi-7265-ucode-25.30.14.0/
07-printing-x86_64.xyzm*                             multiload-ng-1.4.0-x86_64.xzm*
07-printing.xyzm*                                    nemo-actions-fix-by-blaze.xzm*
firefox-47.0b9-x86_64-1.xyzm*                        pepperflash-23.0.0.162-x86_64-1.xzm*
firefox-48.0b6-x86_64-1.xyzm*                        wine-1.9.15-x86_64-bundle.xyzm*
firefox-49.0.1-x86_64-1.xyzm*                        xf86-video-amdgpu-1.1.1-x86_64.xzm*
firefox-50.0b5-x86_64-1.xzm*                         xf86-video-ati-7.7.1-x86_64.xzm*
flashplayer-plugin-11.2.202.635-x86_64-1alien.xyzm*
guest@porteus:~$
guest@porteus:~$

However the prior situation was unique.

From the screenshot I also see that the base modules are at the top! So that is solved eh?

Yes.
Ed
User avatar
Ed_P
Contributor
Contributor
 
Posts: 2882
Joined: 06 Feb 2013, 23:12
Location: Western NY, USA
Distribution: Cinnamon 3.2.2 64-bit ISO

Re: Porteus module activation status

Postby jssouza » 19 Oct 2016, 21:25

Tried to deactivate 05-devel.xzm multiple times, but the
Code: Select all
Removing 05-devel.xzm desktop file ...

comes only once each time. As you mentioned, seems like a unique case, the printing module twice in the list (07-printing-x86_64-18.10.2016.xzm).

Thanks for the input. I will see if I can reproduce it.
jssouza
Samurai
Samurai
 
Posts: 112
Joined: 09 Jul 2015, 15:17
Location: Liechtenstein
Distribution: Porteus x86 arm

Re: Porteus module activation status

Postby Ed_P » 19 Oct 2016, 22:47

jssouza wrote:seems like a unique case, the printing module twice in the list (07-printing-x86_64-18.10.2016.xzm).

Thanks for the input. I will see if I can reproduce it.

Well, the 07-printing-x86_64-18.10.2016.xzm module is actually only there once. The other printing module was 07-printing-x86_64.xzm.

And what happened was:

1. I booted with the 07-printing-x86_64.xzm module. thus it was active.
2. I then downloaded the 07-printing-x86_64-18.10.2016.xzm module and put it in my Modules folder.
3. I then renamed the 07-printing-x86_64.xzm module in my Modules folder to be 07-printing-x86_64.xyzm so the next time I booted the
07-printing-x86_64-18.10.2016.xzm module would be active.
4. Sometime later I wanted to check what modules were loaded and used your app.
5. I noticed a red icon on the GUI before the 07-printing-x86_64-18.10.2016.xzm module and didn't know what it meant. So I double clicked on it and it eventually became green.
6. I then noticed the 07-printing-x86_64.xzm module at the bottom of the GUI.
7. I think I then dbl clicked on it.

As said, a unique situation. :oops:
Ed
User avatar
Ed_P
Contributor
Contributor
 
Posts: 2882
Joined: 06 Feb 2013, 23:12
Location: Western NY, USA
Distribution: Cinnamon 3.2.2 64-bit ISO

Re: Porteus module activation status

Postby Ed_P » 22 Oct 2016, 20:18

jssouza

FYI I've changed line 5 to be:
Code: Select all
  if [ ! "$DISPLAY" == ":0.0" ]; then

thus when I run modules.sh in terminal mode the prompt for root is in the terminal window.
Ed
User avatar
Ed_P
Contributor
Contributor
 
Posts: 2882
Joined: 06 Feb 2013, 23:12
Location: Western NY, USA
Distribution: Cinnamon 3.2.2 64-bit ISO

Re: Porteus module activation status

Postby jssouza » 22 Oct 2016, 21:47

Sure, go ahead. Although, be aware that if you eventually decide to create a start menu shortcut or a desktop shortcut for the program, with this change it would not work.

If you always want the prompt for root in terminal then you need not check for $DISPLAY at all. It can be called directly as
Code: Select all
if [ "$UID" -ne 0 ]; then
  echo "Enter root password"
  su -c $0
  exit
fi
jssouza
Samurai
Samurai
 
Posts: 112
Joined: 09 Jul 2015, 15:17
Location: Liechtenstein
Distribution: Porteus x86 arm

Re: Porteus module activation status

Postby Ed_P » 22 Oct 2016, 23:48

Actually I don't always want the ktsuss window but whether I ran the script via a terminal command line or via the nemo option to run it it was always opening the ktsuss window. If a terminal window is open it just seemed logical to respond to the password via it rather than a separate window.
Ed
User avatar
Ed_P
Contributor
Contributor
 
Posts: 2882
Joined: 06 Feb 2013, 23:12
Location: Western NY, USA
Distribution: Cinnamon 3.2.2 64-bit ISO

Re: Porteus module activation status

Postby ncmprhnsbl » 23 Oct 2016, 01:15

heres a thing: when booting with noauto cheatcode(no internal drives are mounted at boot)
but the partition on usb that is booted from, is mounted in /mnt/live/mnt/
so only active modules are visible..
of course, mods activated by other means then become visible upon refreshing..
but then cannot be deactivated...tho this could be a general issue with the noauto cheat..

..and with copy2ram, a similar thing occurs, with active module path: /mnt/live/memory/copy2ram
only booted modules are visible..
and when a module from say /mnt/sdb1/porteus/optional(post boot activation) is deactivated, it is lost from view..
Forum Rules : http://forum.porteus.org/viewtopic.php?f=35&t=44
User avatar
ncmprhnsbl
Full of knowledge
Full of knowledge
 
Posts: 701
Joined: 20 Mar 2012, 04:42
Location: australia
Distribution: 3.2.2-64bit xfce/openbox

Re: Porteus module activation status

Postby jssouza » 24 Oct 2016, 09:25

Hi ncmprhnsbl,

Some interesting food for thought :) .

With the noauto cheatcode, the porteus-livedbg file does mention where the porteus data was found (Eg: /mnt/sdb1/porteus) , but of course the drive itself will not be available (since it has been unmounted). I guess it would be dangerous to assume if the drive is remounted, the drive letters would come back the same (sdb1 may change to sdc1). Maybe the safe option here is to check if the path actually exists and mention unavailability if not (or a drive change has taken place).

but then cannot be deactivated...tho this could be a general issue with the noauto cheat.

That's strange, I could deactivate them ok. Maybe the module was actually busy?

Copy2ram:
Now this is tricky :). Please correct me if I am wrong, if copy2ram was used, only the modules activated during boot would be copied to RAM right? The subsequent modules are activated without copying to RAM. Similarly, deactivating/reactivating a copied to RAM module would deactivate and reactivate it in RAM and not on the booted drive. I guess, then if copy2ram along with load= and noload= cheatcodes are used, it could be a mixture of modules from base/modules/optional in RAM, and any subsequent activation from these directories is not copied, hence there would be two source paths. Further, if a copied to ram module is deactivated and the same module is activated from its place in the drive, then the drive one gets activated (without copying to ram), while the deactivated same module still remains in ram, again two separate source paths.
Please let me know if my assumptions are right, and I will try to modify the script along these lines.

Thanks!
jssouza
Samurai
Samurai
 
Posts: 112
Joined: 09 Jul 2015, 15:17
Location: Liechtenstein
Distribution: Porteus x86 arm

PreviousNext

Return to Programming



Who is online

Users browsing this forum: No registered users and 1 guest