I've got a virtual serial port package( wifi RS232 device ) I'm attempting to build on a Debian/Ubuntu system and the build script is a piece of crap. I'm 'fixing' the script for those who follow and was wondering how I could test the system for the Linux platform( Debian, Redhat, Suse, etc ) so I use the right init processing mechanisms?
They currently hard coded the build script for Redhat and I'm Debian/ Ubuntu. My hack as it stands is just to check for 'ubuntu' in /proc/version and I added the Ubuntu way of updating startup scripts. I probably should use upstart but for now and for a few more years this should work.( FYI, upstart is a new more fine grained startup system ). Here's a snippet of my added "if/then/else" control and the Debian test following with the stuff the vendor had for Redhat. # Copy sprd script to /etc/rc.d/init.d dir and create a link to it # in the rc0.d, rc3.d, rc4.d, rc5.d, rc6.d directories #djl grep -i ubuntu /proc/version if [ $? -eq 0 ]; then echo Debian based init processing cp sprd /etc/init.d update-rc.d sprd defaults 96 else echo Redhat or Suse based init processing cp sprd /etc/sprd/ cd /etc/rc.d/rc0.d ln -s /etc/sprd/sprd K96sprd cd /etc/rc.d/rc3.d ln -s ../etc/sprd/sprd S96sprd cd ../rc4.d ln -s /etc/sprd/sprd S96sprd cd ../rc5.d ln -s /etc/sprd/sprd S96sprd cd ../rc6.d ln -s /etc/sprd/sprd K96sprd fi Doug -- [email protected] http://www.kernel-panic.org/cgi-bin/mailman/listinfo/kplug-list
