Technical issues/questions of an intermediate or advanced nature.
-
Ed_P
- Contributor
- Posts: 8367
- Joined: 06 Feb 2013, 22:12
- Distribution: Cinnamon 5.01 ISO
- Location: Western NY, USA
Post#16
by Ed_P » 17 Dec 2022, 19:11
coa wrote: ↑17 Dec 2022, 18:38
is there a tuturial out there for making settings module?
It's not that hard to make a module. Just make a bash script, like below, make it executable, chmod +x, run it, copy the xzm file to your /modules folder.
Code: Select all
#!/bin/sh
if [ `whoami` != "root" ]; then
echo -e "Enter root's password\033[1;31m"
su -c "sh $0 $1"
exit
fi
echo -e "\033[0m"; echo -en "\033]0;Make a Mod\a"
#set -x;
if [ -d /tmp/mod/ ]; then
rm -rf /tmp/mod
fi
mkdir -p /tmp/mod
cp -a -p --parents /lib with your changes1/* /tmp/mod/
cp -a -p --parents /lib with your changes2/* /tmp/mod/
ls -R /tmp/mod/
echo "If Ok press Enter"
read
dir2xzm /tmp/mod/ /tmp/mychanges.xzm
rm -rf /tmp/mod/ && echo && ls -sh /tmp/*.xzm
read
The hard part is determining what the settings folders/files are.
Ed
Ed_P
-
Rava
- Contributor
- Posts: 5401
- Joined: 11 Jan 2011, 02:46
- Distribution: XFCE 5.01 x86_64 + 4.0 i586
- Location: Forests of Germany
Post#17
by Rava » 17 Dec 2022, 19:18
Ed_P wrote: ↑17 Dec 2022, 19:11
The hard part is determining what the settings folders/files are.
My approch with my script suite is to have fixed folders for both modules in which I copy the tested and working as planned files (e.g. a script) or settings files via
e.g. I want to copy these files
Code: Select all
/home/guest/.config/mimeapps.list
/home/guest/.bashrc
/home/guest/.config/l3afpad/l3afpadrc
/home/guest/.mtpaint
into the target folder for my 992-rootcopy module - let's say the base folder for that being
Code: Select all
/mnt/sda5/Porteus_modules/rootcopy+usr-local_bin/992-rootcopy_5.0/
then the cp command thus would be
Code: Select all
cp -av --parents /home/guest/.config/mimeapps.list /home/guest/.bashrc /home/guest/.config/l3afpad/l3afpadrc /home/guest/.mtpaint /mnt/sda5/Porteus_modules/rootcopy+usr-local_bin/992-rootcopy_5.0/
I made a
help.cp script to give
lazy me copy&paste hints for aiding me in this cp business.
Cheers!
Yours Rava
Rava
-
Ed_P
- Contributor
- Posts: 8367
- Joined: 06 Feb 2013, 22:12
- Distribution: Cinnamon 5.01 ISO
- Location: Western NY, USA
Post#18
by Ed_P » 17 Dec 2022, 19:30
Rava wrote: ↑17 Dec 2022, 19:18
Code: Select all
cp -av --parents /home/guest/.config/mimeapps.list /home/guest/.bashrc /home/guest/.config/l3afpad/l3afpadrc /home/guest/.mtpaint /mnt/sda5/Porteus_modules/rootcopy+usr-local_bin/992-rootcopy_5.0/
Too hard for a new user to maintain, or even comprehend.
This is easier to create, understand and maintain.
Code: Select all
cp -a -p --parents /home/guest/.config/mimeapps.list /tmp/mod/
cp -a -p --parents /home/guest/.bashrc /tmp/mod/
cp -a -p --parents /home/guest/.config/l3afpad/l3afpadrc /tmp/mod/
cp -a -p --parents /home/guest/.mtpaint /tmp/mod/
Ed
Ed_P
-
Rava
- Contributor
- Posts: 5401
- Joined: 11 Jan 2011, 02:46
- Distribution: XFCE 5.01 x86_64 + 4.0 i586
- Location: Forests of Germany
Post#19
by Rava » 17 Dec 2022, 19:43
I think we can offer both variants and the user can choose which one he prefers.
Also, in my book this
is more easy than this
and using this
gives the info what is done. A user can skip the -v (=verbose) part, but since when copying from the live system to the hard drive a file or files it is in my book a good idea to be a bit more on the secure side, since when you not use changes= the settings or files are all lost after a reboot.
Could be the user worked some time to tweak settings to his likings. Then in my book it is good to have more control over the copying it to the folder for creation of the module.
Better more info that is sometime not needed but that keeps you on the more secure side of things than losing work you put some time and effort into.
Also, I recommend using a folder on a harddisk ext[234] partition since then you will have all other older files and settings already there and you either replace a file by its newer version or you add files to the folder and file hierarchy.
Cheers!
Yours Rava
Rava
-
Ed_P
- Contributor
- Posts: 8367
- Joined: 06 Feb 2013, 22:12
- Distribution: Cinnamon 5.01 ISO
- Location: Western NY, USA
Post#20
by Ed_P » 17 Dec 2022, 23:28
Rava wrote: ↑17 Dec 2022, 19:43
I think we can offer both variants and the user can choose which one he prefers.
Agreed.
Rava wrote: ↑17 Dec 2022, 19:43
Also, in my book this
is more easy than this
Picky, picky, picky.
Rava wrote: ↑17 Dec 2022, 19:43
I recommend using a folder on a harddisk ext[234] partition since then you will have all other older files and settings already there and you either replace a file by its newer version or you add files to the folder and file hierarchy.
The same can be said for USB drives and FAT32, exFAT and NTFS drives.
Ed
Ed_P
-
Rava
- Contributor
- Posts: 5401
- Joined: 11 Jan 2011, 02:46
- Distribution: XFCE 5.01 x86_64 + 4.0 i586
- Location: Forests of Germany
Post#21
by Rava » 18 Dec 2022, 00:41
Ed_P wrote: ↑17 Dec 2022, 23:28
The same can be said for USB drives and FAT32, exFAT and NTFS drives.
No.
When you use VFAT or NTFS then the file permissions and executable bits will all be messed up.
Not recommended at all to use VFAT / FAT32 or NTFS as the partition base for creating a Porteus module. Not sure about exFAT, i hardly used it, but I presume it's the same permissions and executable issue.
Unless you create a ext2 Filesystem container on that, mount the container, copy stuff on the container and use the path to the mounted container as the path for creating the module.
But
that would be making it too complicated for most users in my book.
Ed_P wrote: ↑17 Dec 2022, 23:28
Picky, picky, picky.
Look who's talking!
Cheers!
Yours Rava
Rava
-
Ed_P
- Contributor
- Posts: 8367
- Joined: 06 Feb 2013, 22:12
- Distribution: Cinnamon 5.01 ISO
- Location: Western NY, USA
Post#22
by Ed_P » 18 Dec 2022, 03:04
I thought we were talking about where the .xzm module could be stored. The mod folder and all the files that go into it are on the /tmp folder.
Ed
Ed_P
-
Rava
- Contributor
- Posts: 5401
- Joined: 11 Jan 2011, 02:46
- Distribution: XFCE 5.01 x86_64 + 4.0 i586
- Location: Forests of Germany
Post#23
by Rava » 18 Dec 2022, 09:44
Ed_P wrote: ↑18 Dec 2022, 03:04
I thought we were talking about where the .xzm module could be stored.
I see. A module can be tored anywhere, just like you wrote.
The base folder for creating one though cannot. Or at least you should use an UNIX filesystem for that.
Cheers!
Yours Rava
Rava
-
Ed_P
- Contributor
- Posts: 8367
- Joined: 06 Feb 2013, 22:12
- Distribution: Cinnamon 5.01 ISO
- Location: Western NY, USA
Post#24
by Ed_P » 18 Dec 2022, 18:33
I agree, that's why I recommend and showed /tmp in my script.
Ed
Ed_P
-
Rava
- Contributor
- Posts: 5401
- Joined: 11 Jan 2011, 02:46
- Distribution: XFCE 5.01 x86_64 + 4.0 i586
- Location: Forests of Germany
Post#25
by Rava » 19 Dec 2022, 03:05
Ed_P wrote: ↑18 Dec 2022, 18:33
I agree, that's why I recommend and showed /tmp in my script.
And how does your script handle the old settings where the user already had a settings-module created for and only wants to add to that module?
Cheers!
Yours Rava
Rava
-
Ed_P
- Contributor
- Posts: 8367
- Joined: 06 Feb 2013, 22:12
- Distribution: Cinnamon 5.01 ISO
- Location: Western NY, USA
Post#26
by Ed_P » 19 Dec 2022, 06:27
Rava wrote: ↑19 Dec 2022, 03:05
how does your script handle the old settings where the user already had a settings-module created for and only wants to add to that module?
The user has the prior module activated and runs the script again with the new settings and files to create the updated module.
Ed
Ed_P
-
Rava
- Contributor
- Posts: 5401
- Joined: 11 Jan 2011, 02:46
- Distribution: XFCE 5.01 x86_64 + 4.0 i586
- Location: Forests of Germany
Post#27
by Rava » 19 Dec 2022, 23:17
Ed_P wrote: ↑19 Dec 2022, 06:27
The user has the prior module activated and runs the script again with the new settings and files to create the updated module.
You mean, each time do a
Code: Select all
xzm2dir $PORTDIR/base/999-rootcopy.xzm /tmp/999-rootcopy
first (when the settings module is called 999-rootcopy.xzm ), and then copy the new files into the /tmp/999-rootcopy hierarchy?
Cheers!
Yours Rava
Rava
-
Ed_P
- Contributor
- Posts: 8367
- Joined: 06 Feb 2013, 22:12
- Distribution: Cinnamon 5.01 ISO
- Location: Western NY, USA
Post#28
by Ed_P » 20 Dec 2022, 04:16
Rava wrote: ↑19 Dec 2022, 23:17
You mean, each time do a
Code: Select all
xzm2dir $PORTDIR/base/999-rootcopy.xzm /tmp/999-rootcopy
No. I mean you boot with, or activate, the current module, make setting changes, rerun the script to recreate an updated module.
Ed
Ed_P