Burgin wrote:I installed gentoo on a real partition the standard way (didn't use the gentoo images from the coLinux Wiki site) and I got it to boot under coLinux.
I would like to know the best way to manage parallel sets of certain configuration files (mainly fstab and the network settings) to make booting under Colinux and as Standalone seemless. This was touched upon in this earlier thread,
http://forums.gentoo.org/viewtopic.php? ... ht=colinux< but no detailed solution has yet been posted.
For those using their real Gentoo installation under coLinux and trying to manage 2 fstab files (ie. one for Gentoo and one for coLinux).
Probate was on the right track when he talked about editing /sbin/rc & having it copy in the correct fstab. This is what works for me:
Create two fstab files in /etc, one for Gentoo called fstab.default, the other for coLinux called fstab.colinux.
At boot, have /sbin/rc remount '/' (rw), check the running kernel & copy over /etc/fstab with the correct one, remount '/' (ro).
Edit /sbin/rc, scroll down to just below
Code: Select all
echo -e " Copyright 2001-2003 Gentoo Technologies, Inc.; Distributed under the GPL"
echo
Add in the following lines:
Code: Select all
echo -e "Detected running kernel version `uname -r`"
echo -e "Adjusting /etc/fstab accordingly..."
echo
mount -o rw,remount /
if [ -z `uname -r|grep "\-co-"` ];
then
cp /etc/fstab.default /etc/fstab
else
cp /etc/fstab.colinux /etc/fstab
fi
mount -o ro,remount /
It should now boot seamlessly whether using coLinux or Gentoo.
There were some postings by Debian users that they get coLinux to use their normal /etc/fstab by just disabling the boot-up filesystem check (fsck). I'm not sure this is really a good idea, especially if the system is not shutdown nicely.
Another alternative I saw was to create /dev/hd(x) aliases in the colinux.xml file, allowing the normal /etc/fstab to be used. I've not tried it, but this may be the better way to go.
If you're Gentoo install autoloads a lot of modules on boot, under coLinux most of these will fail for obvious reasons. CoLinux will still boot & work, but I wanted to have coLinux boot cleanly without wasting time on modprobing modules that would fail and to not show any failures.
To do this, create another modules profile file in /etc/modules.autoload.d/ called kernel-colinux.
Edit /etc/init.d/modules, scroll down to just below
Code: Select all
# New support for /etc/modules.autoload/kernel-$KV
if [ "$(get_KV)" -ge "$(KV_to_int '2.5.48')" ] && \
[ -f /etc/modules.autoload.d/kernel-"${KV_MAJOR}.${KV_MINOR}" ]
then
load_modules /etc/modules.autoload.d/kernel-"${KV_MAJOR}.${KV_MINOR}"
Add in the following lines:
Code: Select all
elif [ ! -z `uname -r|grep "\-co-"` ] ;
then
load_modules /etc/modules.autoload.d/kernel-colinux
I still get failures on coLinux attempting to start certain services. Note that things still work, just don't want the boot process wasting time & do not want to see the failures (as above).
Probate, I'd be most interested if you could post more details on how you created another services profile for coLinux.
Other stuff:
At the time of posting, the fltk console leaves a lot to be desired. For greater flexibility, use the nt-console.
This provides a full screen terminal (Alt+Enter), allows copy/paste to and from the terminal, different default fonts/window sizes can be used by clicking the top left corner and setting properties, and only opens one window when coLinux is started.
'colinux-daemon.exe -c default.colinux.xml -t nt' to have coLinux use it by default.