Haz lo que veas, pero creo que con modificar el script de activate es suficiente pues el resto lo llaman.
en su caso, el que habria que modificar es el deactivate, para que no queden menus invalidos.
No lo postee por que eso es meramente estético. pues si lo desactivas no vas a querer utilizarlo.
y al ser live... al reiniciar..
lo único que el código habria que ponerlo a la salida del script con exito. después de done.
#!/bin/bash
# Deactivate module from the root directory structure on the fly
# This may fail for many cases, most likely when your module is 'busy'
# - for example if you have files open from the module yet.
#
# Author: Tomas M. <http://www.linux-live.org>
if [ "$1" = "-k" ]; then
CALLED_BY_KDE_HELPER=1
shift
fi
if [ -e /usr/bin/kdeactivate -a "$DISPLAY" -a ! "$CALLED_BY_KDE_HELPER" ]; then
exec /usr/bin/kdeactivate "$@" 2>/dev/null
fi
PATH=.:$(dirname $0):/usr/lib:$PATH
. liblinuxlive || exit 5
allow_only_root
MODULE=$(basename "$1" .xzm).xzm
IMAGES=/mnt/live/memory/images
IPREV=empty
if [ "$MODULE" = "" -o ! -e "$IMAGES/$MODULE" ]; then
echo
echo "Deactivate module from the root filesystem while running Linux Live"
echo "Usage: $0 module.xzm"
exit 1
fi
# if the module contains /var/lock/deactivatelock, deny deactivation
if [ -e "$IMAGES/$MODULE/var/lock/deactivatelock" ]; then
echo "Can't deactivate the given module, I am sorry."
exit 2
fi
try_remount()
{
mount -t aufs -o remount,verbose,del:$IMAGES/$MODULE aufs / 2>/dev/null
}
# Try to simply remove the dir first. If succeeds, finish
rmdir "$IMAGES/$MODULE" 2>/dev/null && exit 0
# OK the previous trick didn't work. So we have a real module here.
# First, try to stop all daemons which may be started by this module
find_n_run_scripts $IMAGES/$MODULE stop deactivate
# detach it from aufs union. This may take a long time, remounting the
# root directory is an expensive operation.
try_remount
# if remount fails, try to free all inotify watchers and remount again
while [ $? -ne 0 -a "$IPREV" != "$INODE" ]; do
IPREV="$INODE"
INODE=$(dmesg | fgrep "test_inode_busy" | tail -n 1 | cut -d : -f 4 | cut -b 8-)
if [ "$INODE" != "" ]; then
find / -noleaf -xdev -inum "$INODE"
find / -noleaf -xdev -inum "$INODE" | xargs touch
try_remount
fi
done
###### salida con exito insertar code
if [ -x /usr/bin/update-desktop-database ]; then
/usr/bin/update-desktop-database -q /usr/share/applications >/dev/null 2>&1
fi
if [ -e usr/share/icons/hicolor/icon-theme.cache ]; then
if [ -x /usr/bin/gtk-update-icon-cache ]; then
/usr/bin/gtk-update-icon-cache /usr/share/icons/hicolor >/dev/null 2>&1
fi
fi
if [ $? -ne 0 ]; then
echo "The module can't be removed, because it's busy (used)." >&2
exit 3
fi
# if we are here, the module has been successfuly removed from aufs union
# so now we have to umount the xzm file and then free the loop device
LOOP=$(cat /proc/mounts | grep "$IMAGES/$MODULE " | cut -d " " -f 1)
umount -n "$IMAGES/$MODULE" 2>/dev/null
if [ $? -ne 0 ]; then
exit 4
fi
losetup -d "$LOOP" 2>/dev/null # sometimes it's freed by umount automatically
rmdir "$IMAGES/$MODULE" # if not empty or busy, a message will be shown
#!/bin/bash
# Activate a module, while running LiveCD.
# Include it into live directory structure on the fly
#
# Author: Tomas M. <http://www.linux-live.org>
if [ "$1" = "-k" ]; then
CALLED_BY_KDE_HELPER=1
shift
fi
if [ -e /usr/bin/kactivate -a "$DISPLAY" -a ! "$CALLED_BY_KDE_HELPER" ]; then
exec /usr/bin/kactivate "$@" 2>/dev/null
fi
MODULE=$(readlink -f "$1")
if [ "$MODULE" = "" -o ! -e "$MODULE" -o -d "$MODULE" ]; then
echo
echo "Activate a module on the fly while running Linux Live"
echo "Usage: $0 module.xzm"
exit 1
fi
if [ "$(echo $MODULE | fgrep -i .xzm)" = "" ]; then
echo
echo "$(basename $MODULE): Module must end with .xzm"
exit 2
fi
PATH=.:$(dirname $0):/usr/lib:$PATH
. liblinuxlive || exit 3
allow_only_root
IMAGES=/mnt/live/memory/images
MODULES=/mnt/live/memory/modules
# are we even using union?
if [ "$(grep '^aufs / ' /proc/mounts)" = "" ]; then
echo "not in the live mode, can't continue. Try xzm2dir $MODULE /"
exit 4
fi
mkdir -p "$MODULES"
# Test whether the module file is stored in union
# if yes, then we must move it somewhere else (to RAM) else it can't be added
if [ -e "/mnt/live/memory/changes/$(readlink -f "$MODULE")" ]; then
echo "module file is stored inside the union, moving to $MODULES first..."
TARGET="$MODULES/$(basename "$MODULE")"
mv "$MODULE" "$TARGET"
if [ $? -ne 0 ]; then
echo "error copying module to memory, not enough free RAM? try df" >&2
rm "$TARGET"
exit 6
fi
MODULE="$TARGET"
fi
MOD=$(union_insert_module / "$MODULE" $IMAGES)
if [ $? -ne 0 ]; then echo "error inserting module to live filesystem" >&2; exit 3; fi
# All executables (but symlinks) in /etc/rc.d/init.d/ from this module will be started
# with two arguments: "start" "activate".
# This is done only by the 'activate' script, not in the case when the module is loaded
# during OS startup (in that case, your distro is responsible for execution)
#
# For compatibility, /etc/init.d is also examined, but it's not recommended for you to put your startup scripts
# there in your module
MOD="$IMAGES/$(basename $MOD)"
find_n_run_scripts $MOD start activate
# update ld cache if new ld.so.conf/cache exists in the module
if [ -e "$MOD/etc/ld.so.conf" -o -e "$MOD/etc/ld.so.cache" ]; then
echo "Module contains ld.so.conf or ld.so.cache, updating lib#!/bin/bash
# Activate a module, while running LiveCD.
# Include it into live directory structure on the fly
#
# Author: Tomas M. <http://www.linux-live.org>
if [ "$1" = "-k" ]; then
CALLED_BY_KDE_HELPER=1
shift
fi
if [ -e /usr/bin/kactivate -a "$DISPLAY" -a ! "$CALLED_BY_KDE_HELPER" ]; then
exec /usr/bin/kactivate "$@" 2>/dev/null
fi
MODULE=$(readlink -f "$1")
if [ "$MODULE" = "" -o ! -e "$MODULE" -o -d "$MODULE" ]; then
echo
echo "Activate a module on the fly while running Linux Live"
echo "Usage: $0 module.xzm"
exit 1
fi
if [ "$(echo $MODULE | fgrep -i .xzm)" = "" ]; then
echo
echo "$(basename $MODULE): Module must end with .xzm"
exit 2
fi
PATH=.:$(dirname $0):/usr/lib:$PATH
. liblinuxlive || exit 3
allow_only_root
IMAGES=/mnt/live/memory/images
MODULES=/mnt/live/memory/modules
# are we even using union?
if [ "$(grep '^aufs / ' /proc/mounts)" = "" ]; then
echo "not in the live mode, can't continue. Try xzm2dir $MODULE /"
exit 4
fi
mkdir -p "$MODULES"
# Test whether the module file is stored in union
# if yes, then we must move it somewhere else (to RAM) else it can't be added
if [ -e "/mnt/live/memory/changes/$(readlink -f "$MODULE")" ]; then
echo "module file is stored inside the union, moving to $MODULES first..."
TARGET="$MODULES/$(basename "$MODULE")"
mv "$MODULE" "$TARGET"
if [ $? -ne 0 ]; then
echo "error copying module to memory, not enough free RAM? try df" >&2
rm "$TARGET"
exit 6
fi
MODULE="$TARGET"
fi
MOD=$(union_insert_module / "$MODULE" $IMAGES)
if [ $? -ne 0 ]; then echo "error inserting module to live filesystem" >&2; exit 3; fi
# All executables (but symlinks) in /etc/rc.d/init.d/ from this module will be started
# with two arguments: "start" "activate".
# This is done only by the 'activate' script, not in the case when the module is loaded
# during OS startup (in that case, your distro is responsible for execution)
#
# For compatibility, /etc/init.d is also examined, but it's not recommended for you to put your startup scripts
# there in your module
MOD="$IMAGES/$(basename $MOD)"
find_n_run_scripts $MOD start activate
# update ld cache if new ld.so.conf/cache exists in the module
if [ -e "$MOD/etc/ld.so.conf" -o -e "$MOD/etc/ld.so.cache" ]; then
echo "Module contains ld.so.conf or ld.so.cache, updating libs cache..."
/sbin/ldconfig
fi
if [ -x /usr/bin/update-desktop-database ]; then
/usr/bin/update-desktop-database -q /usr/share/applications >/dev/null 2>&1
fi
if [ -e usr/share/icons/hicolor/icon-theme.cache ]; then
if [ -x /usr/bin/gtk-update-icon-cache ]; then
/usr/bin/gtk-update-icon-cache /usr/share/icons/hicolor >/dev/null 2>&1
fi
fis cache..."
/sbin/ldconfig
fi
### insertar code
if [ -x /usr/bin/update-desktop-database ]; then
/usr/bin/update-desktop-database -q /usr/share/applications >/dev/null 2>&1
fi
if [ -e usr/share/icons/hicolor/icon-theme.cache ]; then
if [ -x /usr/bin/gtk-update-icon-cache ]; then
/usr/bin/gtk-update-icon-cache /usr/share/icons/hicolor >/dev/null 2>&1
fi
fi
Respecto a lo de xfce y kde ambos utilizan estos scrips que están en el modulo desktop.
psdata habria que poner al inicio de los script
#
# Author: Tomas M. <http://www.linux-live.org>
# mod by wifixlax