[Suggestion] Changes to activate/deactivate to allow spaces

New features which should be implemented in Porteus; suggestions are welcome. All questions or problems with testing releases (alpha, beta, or rc) should go in their relevant thread here, rather than the Bug Reports section.
Kriss
Samurai
Samurai
Posts: 135
Joined: 06 Jul 2011, 07:07
Location: Russia

[Suggestion] Changes to activate/deactivate to allow spaces

Post#1 by Kriss » 03 Apr 2014, 06:20

Hello!
I've noted a couple of times that it's not possible to activate modules if they have spaces in path.
After a bit of searching I've found the way to activate such modules.
I've changed in "/opt/porteus-scripts/xorg/aufs-insert":
Line 07 "BASE=`basename $1`" >>"BASE=$(echo $* | sed -re 's/^.+\///')"
Line 30 "if [ ! -f $1 ]; then" >> "if [ ! -f "$*" ]; then"

This way I've been able to activate single module and all modules inside the "/root/test dir"

Edit: forgot a symbol "^" in sed expression. Sorry... :oops:
Last edited by Kriss on 03 Apr 2014, 16:38, edited 2 times in total.
Suggestions/corrections/additions are always welcome.

User avatar
fanthom
Moderator Team
Moderator Team
Posts: 5666
Joined: 28 Dec 2010, 02:42
Distribution: Porteus Kiosk
Location: Poland
Contact:

Re: [Suggestion] Changes to activate/deactivate to allow spa

Post#2 by fanthom » 03 Apr 2014, 14:02

thanks Kriss,

will test and if ok then merge and push through porteus updates to all the people :)
Please add [Solved] to your thread title if the solution was found.

Kriss
Samurai
Samurai
Posts: 135
Joined: 06 Jul 2011, 07:07
Location: Russia

Re: [Suggestion] Changes to activate/deactivate to allow spa

Post#3 by Kriss » 03 Apr 2014, 16:41

You're welcome. Glad to be of any use. :)
Suggestions/corrections/additions are always welcome.

User avatar
fanthom
Moderator Team
Moderator Team
Posts: 5666
Joined: 28 Dec 2010, 02:42
Distribution: Porteus Kiosk
Location: Poland
Contact:

Re: [Suggestion] Changes to activate/deactivate to allow spa

Post#4 by fanthom » 03 Apr 2014, 17:11

doesn't work - i'm getting:

Code: Select all

root@porteus:~# activate /root/test\ me/test.xzm 
test: Module must end with .xzm
: Module must end with .xzm
afair there are modifications needed to /opt/porteus-scripts/activate (putting $1 between double quotes) which will break parallel activation.
please let me know if you find a workaround.
Please add [Solved] to your thread title if the solution was found.

Kriss
Samurai
Samurai
Posts: 135
Joined: 06 Jul 2011, 07:07
Location: Russia

Re: [Suggestion] Changes to activate/deactivate to allow spa

Post#5 by Kriss » 03 Apr 2014, 17:30

Oops... Sorry...
/opt/porteus-scripts/xorg/aufs-insert:
Line 57: mount -no loop,ro $1 $MOD 2>/dev/null >>>>>> mount -no loop,ro "$*" $MOD 2>/dev/null


/opt/porteus-scripts/xorg/xactivate:
Line 4: BASE (the same change as with aufs-insert)
Line 18: /opt/porteus-scripts/xorg/aufs-insert $1 >>>>>> /opt/porteus-scripts/xorg/aufs-insert $*


Changes are quite simple actually, changing $1 to $* and getting rid of `basename ...` because it doesn't like spaces.
I just forgetting some steps in the process.
It's also good idea to check other cases where $1 is used (I see it is being used in error messages, for example), while not critical, whis can be misleading.
Anyway modules are being "handled" one at a time as I understand...
"activate" shouldn't interfere with it, as I aunderstand, because it properly hands out `readline $filename` for every file, and that transforms to "/any path/to/a/file/file.xzm"
Suggestions/corrections/additions are always welcome.

User avatar
fanthom
Moderator Team
Moderator Team
Posts: 5666
Joined: 28 Dec 2010, 02:42
Distribution: Porteus Kiosk
Location: Poland
Contact:

Re: [Suggestion] Changes to activate/deactivate to allow spa

Post#6 by fanthom » 03 Apr 2014, 17:42

this one works fine with default scripts in 3.0 for parallel activation of multiple modules:

Code: Select all

activate /root/try_me/*
will your updated scripts handle this?

Code: Select all

activate /root/try\ me/*
i want complete solution so please test in runlevel 3 as well (not only GUI).
Please add [Solved] to your thread title if the solution was found.

Kriss
Samurai
Samurai
Posts: 135
Joined: 06 Jul 2011, 07:07
Location: Russia

Re: [Suggestion] Changes to activate/deactivate to allow spa

Post#7 by Kriss » 03 Apr 2014, 17:45

You're right. I'll check again. It works with "activate ./" inside such directories though...
Suggestions/corrections/additions are always welcome.

Post Reply