#!/bin/sh # # mol This shell script takes care of patching the running kernel # for Mac on Linux. # # chkconfig: 5 60 20 # description: Mac on Linux allows you to run MacOS (or Linux) in a window. MOL_DISK=/var/mol/MacOS9 # Source function library. . /etc/rc.d/init.d/functions [ -x /sbin/losetup ] || exit 0 [ -x /usr/lib/mol/bin/molpatching ] || exit 0 [ -f /etc/molrc ] || exit 0 [ -f $MOL_DISK ] || exit 0 # See how we were called. case "$1" in start) action "Preparing the system for Mac on Linux: " /usr/sbin/patchmol echo echo -n "Configuring the virtual disk for MoL: " /sbin/losetup /dev/loop0 $MOL_DISK echo rm -f /var/lock/mol touch /var/lock/subsys/mol ;; stop) action "Unconfiguring the virtual disk for MoL: " /sbin/losetup -d /dev/loop0 echo rm -f /var/lock/mol rm -f /var/lock/subsys/mol ;; *) echo "Usage: nfs {start|stop}" exit 1 esac exit 0