236pages on
this wiki
Add New Page
Talk0 Share

An additional script for dual-boot systems Edit

If you're running coLinux on a dual-boot system, but still want to boot from the Linux partition occasionally, you need to manage your configuration somehow, since (especially if your networking is bridged) a lot of settings differ between coLinux-booting from it and directly-booting from it.

The idea is that you keep 2 versions of configuration files around, the ${conf_file}-colinux one (for coLinux) and ${conf_file}-non-colinux (your native Linux distribution). Before adding the script below, make a configuration specific copy of every configuration file.

If you use the naming conventions of the /etc/init.d/colinux script below, you do:

for conf_file in \
	"/etc/fstab" \
	"/etc/network/interfaces" \
	"/etc/X11/gdm/gdm.conf" \
	"/etc/hostname" \
	"/etc/mailname" \
	; do
	cp $conf_file $conf_file-colinux 
	cp $conf_file $conf_file-non-colinux


I find the following script useful (link to it from /etc/rcS.d/ , after the root fs becomes writable, but before the rest of the local filesystems are mounted, on my system I have linked it to /etc/rcS.d/

/etc/init.d/colinux Edit

# colinux       use either a set of [[coLinux]]-related configuration
#               files, or their direct-boot counterparts

if [[ $COLINUX ]]; then

for conf_file in \
	"/etc/fstab" \
	"/etc/network/interfaces" \
	"/etc/X11/gdm/gdm.conf" \
	"/etc/hostname" \
	"/etc/mailname" \
	; do
        # Instead of copying the file with:
        #    cp -f $conf_file-$SUFFIX $conf_file 
        # you can create a symbolic link.  This way, you will always edit the current
        # configuration file.
	ln -s -f $conf_file-$SUFFIX $conf_file 

# the COLINUX environment variable is not inherited much further
# than the init scripts, so if you want user processes to be able
# to tell whether we're in [[coLinux]] or stand-alone mode, you could
# do something like

# echo $COLINUX > /var/local/colinux

# or have the file's existence be the thing to check:

#if [[ $COLINUX ]]; then
#	touch /var/local/colinux
#	rm -f /var/local/colinux

: exit 0

Obviously, you're asking yourself who sets the COLINUX environment variable. Well, you do! in your coLinux configuration file, have a bootprompt line such as the following:

<bootparams>root=/dev/cobd0 COLINUX=1</bootparams>

(you may have other parameters, you just need to set the COLINUX value).

Now, as for the settings files themselves - these will differ based on exactly what you're configuring, as well as difference between distributions. The example above is for Debian. You can apply this to as many configuration files as you want to have system specific, to avoid gdm from starting I also have /etc/X11/default-display-manager system specific (where the non-colinux version file is empty).

See also Edit

Comments are welcome: or

MassTranslated on Sun Apr 23 17:36:03 UTC 2006

Ad blocker interference detected!

Wikia is a free-to-use site that makes money from advertising. We have a modified experience for viewers using ad blockers

Wikia is not accessible if you’ve made further modifications. Remove the custom ad blocker rule(s) and the page will load as expected.