Create a module in two steps :
1. slackyd search packages and dependencies and stores it in the directory "/var/slackyd"
2. the script "mkmodule.sh" install packages in the temporary directory "tmp-dir" and
create a new module.
A. slackyd :
During the first use of slack you must update packages list and md5 hash list :
guest@porteus:~$ slackyd -u
You can then download the package you are interested :
guest@porteus:~$ slackyd -g package-name (ie: firefox-11, chrome, apache ...)
Before downloading a new package, remember to empty the last package (it's very important!):
guest@porteus:~$ slackyd -p
B. mkmodule.sh :
1. code: SELECT ALL
2. copy and paste under Kwrite.
3. save as "mkmodule.sh" for instance.
4. make script executable : chmod +x mkmodule.sh
5. run this script as root (su, password).
Become root.
guest@porteus:~$ su root
Password:
root@porteus:/home/guest#
The script expects parameter the name of the future module. (without extension),
as shown below :
root@porteus:/home/guest# ./mkmodule.sh apache (for instance)
If all goes well you should find the module enabled in the directory "porteus/modules" as "apache.xzm".
Unfortunately things do not happen the way we want, for example with "google-chrome".
The error messages below illustrates my point :
[4208:4208:846892184:FATAL:zygote_host_linux.cc(143)] The SUID sandbox helper binary was found,
but is not configured correctly. Rather than run without sandboxing I'm aborting now.
You need to make sure that /opt/google/chrome/chrome-sandbox is owned by root and has mode 4755.
Aborted
This is why I added an option to correct a package :
[1]Open a terminal as root to view or modify file(s) in directory "tmp-dir"
[2]Continue
[3]Quit
In the case of google-chrome we choose to open a terminal so as to correct access rights to files.
In the terminal window we enter the following command :
root@porteus:/home/guest# chmod 4755 tmp-dir/opt/google/chrome/chrome-sandbox
root@porteus:/home/guest# ls -l tmp-dir/opt/google/chrome/chrome-sandbox
root@porteus:/home/guest# exit
We then choose option 2 to continue and create the new module.
At the end of the script you are prompted to delete the directory "tmp-dir" and
to empty the folder "/var/slackyd".
remove directory vlc-dir created later ? [y/n] :
Answer no until you have not tested the new module.
If everything works fine you can then delete "tmp-dir" and empty "/var/slackyd".
root@porteus:/home/guest# rm -r tmp-dir
root@porteus:/home/guest# slackyd -p
If you have a problem to fix, you can restart the script "mkmodule.sh".
As the files were not deleted, you can correct a defect.
After that, you can recreate the module with option 1.
Temporary directory "tmp-dir" already exists:
[1]Skip directly to module creation
[2]Clear the directory and install new package
With option 2, you can empty the directory "tmp-dir". This means that you probably downloaded a new packages
and had forgotten to delete "tmp-dir" during a previous operation.
Before restarting the script, pay attention to the fact that you must first disable the module with "activate".
root@porteus:/home/guest# activate module-name.xzm
Then, you can delete the module:
root@porteus:/home/guest# rm /mnt/your-usb-key/porteus/modules/module-name.xzm
With a little help of "Dolphin" or "Konqueror" (super user mode) you can do everything at once.
"right click" -> activate and "shift-suppr" -> delete.
Enjoy!
Code: Select all
#!/bin/bash
#Install package and make module for porteus 1.1 (64 and 32 bit)
if [ ! $1 = "" ]; then
txz=`ls /var/slackyd/*.txz 2>/dev/null`
if [ ${#txz} != 0 ];then
if [ ! -d tmp-dir ];then
mkdir tmp-dir; yes="n"
else
echo
echo "Temporary directory \"tmp-dir\" already exists:"
echo
echo "[1]Skip directly to module creation"
echo "[2]Clear the directory and install new package"
while [ true ]; do
read -n 1 -s option
case "$option" in
"1") yes="y"; break;;
"2") rm -r tmp-dir/* 2>/dev/null; yes="n"; break;;
esac
done
#read -p 'tmp-dir already exists. Skip directly to module creation ? [y/n] : ' -n 1 -s yes
fi
if [ $yes = "n" ]; then
for toconv in $txz
do
echo $toconv
installpkg -root tmp-dir $toconv
if [ $? != 0 ]; then
echo "error installing package "$toconv; exit
fi
done
fi
echo "Installation of the package is complete:"
echo
echo "[1]Open a terminal as root to view or modify file(s) in directory \"tmp-dir\""
echo "[2]Continue"
echo "[3]Quit"
yes="n"
while [ true ];do
read -n 1 -s option
case "$option" in
"1") /usr/bin/ktsuss /tmp/.terminal ;;
"2") yes="y"; break;;
"3") exit;;
esac
done
#Make module vlc and activate it
dir2xzm tmp-dir ${1%*.xzm}.xzm
activate ${1%*.xzm}.xzm
#Remove temporary dir.
read -p 'remove directory vlc-dir created later ? [y/n] : ' -n 1 -s yes
echo
if [ $yes = "y" ]; then
rm -r tmp-dir
slackyd -p
fi
else echo "Directory /var/slackyd is empty"
fi
else echo "Précisez le nom du module"
fi