Hi x2go folks,
I would like to suggest a solution to make x2gothinclientsystem less invasive.
Instead of mounting a ramdisk and removing/symlinking some files and directories (which might be a Debian packaging policy violation) it might be smarter to mount a read only root filesystem and transparently overlay it with a tempfs.
I can this be achieved?
a) Install aufs modules in the clients' chroot environment. Aufs modules are part of Squeeze's default kernel.
b) Add "aufs" to /etc/initramfs-tools/modules.
c) Set "BOOT=aufs" in /etc/initramfs-tools/initramfs.conf.
d) Add a "magic" script (see attachment) named "aufs" to /etc/initramfs-tools/scripts
e) Call update-initramfs -u inside the chroot.
The "aufs" script is based on Debian's /usr/share/initramfs-tools/scripts/nfs script.
The attached script provides a three layer file root filesystem.
ro nfsroot/master (generic thinclients' chroot) ro nfsroot/<ip-address> (individual thinclient's configuration overriding master) rw tempfs (simulates a fully rw root file system)
Pros:
Cons:
Any feedback is appreciated.
Michael
-- EDV-Serviceteam Annika & Michael Hierweck GbR Egerstraße 53, 44225 Dortmund (Germany) http://www.edv-serviceteam.net
# NFS filesystem mounting -*- shell-script -*-
# FIXME This needs error checking
retry_nr=0
# parse nfs bootargs and mount nfs do_nfsmount() {
configure_networking
# get nfs root from dhcp
if [ "x${NFSROOT}" = "xauto" ]; then
# check if server ip is part of dhcp root-path
if [ "${ROOTPATH#*:}" = "${ROOTPATH}" ]; then
NFSROOT=${ROOTSERVER}:${ROOTPATH}
else
NFSROOT=${ROOTPATH}
fi
# nfsroot=[<server-ip>:]<root-dir>[,<nfs-options>]
elif [ -n "${NFSROOT}" ]; then
# nfs options are an optional arg
if [ "${NFSROOT#*,}" != "${NFSROOT}" ]; then
NFSOPTS="-o ${NFSROOT#*,}"
fi
NFSROOT=${NFSROOT%%,*}
if [ "${NFSROOT#*:}" = "$NFSROOT" ]; then
NFSROOT=${ROOTSERVER}:${NFSROOT}
fi
fi
if [ -z "${NFSOPTS}" ]; then
NFSOPTS="-o retrans=10"
fi
[ "$quiet" != "y" ] && log_begin_msg "Running /scripts/nfs-premount"
run_scripts /scripts/nfs-premount
[ "$quiet" != "y" ] && log_end_msg
if [ ${readonly} = y ]; then
roflag="-o ro"
else
roflag="-o rw"
fi
mkdir -p /aufs-root
mkdir -p /aufs-conf
mkdir -p /aufs-temp
nfsmount -o nolock ${roflag} ${NFSOPTS} ${NFSROOT}/master /aufs-root
nfsmount -o nolock ${roflag} ${NFSOPTS} ${NFSROOT}/config/${IPV4ADDR} /aufs-conf
mount -t tmpfs tmpfs /aufs-temp
mount -t aufs -o dirs=/aufs-temp=rw:/aufs-conf=ro:/aufs-root=ro aufs ${rootmnt}
}
# NFS root mounting mountroot() { [ "$quiet" != "y" ] && log_begin_msg "Running /scripts/nfs-top" run_scripts /scripts/nfs-top [ "$quiet" != "y" ] && log_end_msg
modprobe nfs
# For DHCP
modprobe af_packet
wait_for_udev 10
# Default delay is around 180s
# FIXME: add usplash_write info
if [ -z "${ROOTDELAY}" ]; then
delay=180
else
delay=${ROOTDELAY}
fi
# loop until nfsmount succeds
while [ ${retry_nr} -lt ${delay} ] && [ ! -e ${rootmnt}${init} ]; do
[ ${retry_nr} -gt 0 ] && \
[ "$quiet" != "y" ] && log_begin_msg "Retrying nfs mount"
do_nfsmount
retry_nr=$(( ${retry_nr} + 1 ))
[ ! -e ${rootmnt}${init} ] && /bin/sleep 1
[ ${retry_nr} -gt 0 ] && [ "$quiet" != "y" ] && log_end_msg
done
[ "$quiet" != "y" ] && log_begin_msg "Running /scripts/nfs-bottom"
run_scripts /scripts/nfs-bottom
[ "$quiet" != "y" ] && log_end_msg
}
Hi.
We're working on it: http://i4git.informatik.uni-erlangen.de/x2gothinclientsystem.git/tree/b0260a...
At the moment I'm busy with more general x2go stuff. But help is welcome.
Cheers Morty
On 2011-03-25 11:15, Michael Hierweck wrote:
Hi x2go folks,
I would like to suggest a solution to make x2gothinclientsystem less invasive.
Instead of mounting a ramdisk and removing/symlinking some files and directories (which might be a Debian packaging policy violation) it might be smarter to mount a read only root filesystem and transparently overlay it with a tempfs.
I can this be achieved?
a) Install aufs modules in the clients' chroot environment. Aufs modules are part of Squeeze's default kernel.
b) Add "aufs" to /etc/initramfs-tools/modules.
c) Set "BOOT=aufs" in /etc/initramfs-tools/initramfs.conf.
d) Add a "magic" script (see attachment) named "aufs" to /etc/initramfs-tools/scripts
e) Call update-initramfs -u inside the chroot.
The "aufs" script is based on Debian's /usr/share/initramfs-tools/scripts/nfs script.
The attached script provides a three layer file root filesystem.
ro nfsroot/master (generic thinclients' chroot) ro nfsroot/<ip-address> (individual thinclient's configuration overriding master) rw tempfs (simulates a fully rw root file system)
Pros:
- simple (to my mind)
- flexible
- less "hacky" (less/no conflicts with other packages)
- therefore more Debian compliant (to my mind)
- x2go related stuff currently stored in /ramdisk can go into /var/lib/x2go...
Cons:
- any?
Any feedback is appreciated.
Michael
X2go-dev mailing list X2go-dev@lists.berlios.de https://lists.berlios.de/mailman/listinfo/x2go-dev
-- Dipl.-Ing. Moritz 'Morty' Struebe (Wissenschaftlicher Mitarbeiter) Lehrstuhl für Informatik 4 (Verteilte Systeme und Betriebssysteme) Friedrich-Alexander-Universität Erlangen-Nürnberg Martensstr. 1 91058 Erlangen
Tel : +49 9131 85-25419 Fax : +49 9131 85-28732 eMail : struebe@informatik.uni-erlangen.de WWW : http://www4.informatik.uni-erlangen.de/~morty
Hi Morty,
On Fr 25 Mär 2011 13:15:23 CET Moritz Struebe wrote:
Hi.
We're working on it: http://i4git.informatik.uni-erlangen.de/x2gothinclientsystem.git/tree/b0260a...
At the moment I'm busy with more general x2go stuff. But help is welcome.
Cheers Morty
Note that x2gothinclientsystem.git has been renamed on code.x2go.org
to x2gothinclient.git.
Might be good to have this in sync (it was your idea orginially in the
X2go wiki's roadmap...)?
Greets, Mike
--
DAS-NETZWERKTEAM mike gabriel, dorfstr. 27, 24245 barmissen fon: +49 (4302) 281418, fax: +49 (4302) 281419
GnuPG Key ID 0xB588399B mail: mike.gabriel@das-netzwerkteam.de, http://das-netzwerkteam.de
freeBusy: https://mail.das-netzwerkteam.de/freebusy/m.gabriel%40das-netzwerkteam.de.xf...
On 2011-03-25 13:35, Mike Gabriel wrote:
Might be good to have this in sync (it was your idea orginially in the X2go wiki's roadmap...)?
Greets, Mike
i4git needs a thorough cleanup anyway. At the moment I do see more important matters, though. :)
Cheers Morty
-- Dipl.-Ing. Moritz 'Morty' Struebe (Wissenschaftlicher Mitarbeiter) Lehrstuhl für Informatik 4 (Verteilte Systeme und Betriebssysteme) Friedrich-Alexander-Universität Erlangen-Nürnberg Martensstr. 1 91058 Erlangen
Tel : +49 9131 85-25419 Fax : +49 9131 85-28732 eMail : struebe@informatik.uni-erlangen.de WWW : http://www4.informatik.uni-erlangen.de/~morty