From: - K. <k0...@ho...> - 2004-04-02 18:23:31
|
Dear all. Sorry, I got to ask again. I put the detection in the beginning of rc.S (First initialisation). Both methods do not work since /proc does not exist. --------------- echoc "==> rc.S Setting up the base system configuration....." blue #sleep 2 # Checking the System echoc "Detecting environment ..." red CPU_MODEL=`cat /proc/cpuinfo | grep "model name" | cut -f2 -d : | cut -b 2-` echo "Model : $CPU_MODEL" # Failed because /proc does not exist ...... # Should be used here, but not working # Check the root filesystem: if [ ! $READWRITE = yes ]; then ## skip fsck if UML if [ ! "$CPU_MODEL" = "UML" ]; then echo "Checking filesystem for previous failures..." /sbin/fsck -A -C -a # If there was a failure, drop into single-user mode. if [ $? -gt 1 ] ; then ...... ---------- Thanks in advance for any help. >From: "- Kocil" <k0...@ho...> >To: use...@li... >Subject: Re: [uml-user] Detecting UML within UML >Date: Fri, 02 Apr 2004 09:43:26 +0800 > >>I would think `cat /proc/cpuinfo` would be acceptable. >>This assumes you haven't followed the directions to 'lie' about proc in >>a uml. >> >>-Dan Vande More > >Yes. That is the best way I think. >Thank you very much. > >Also thanks for Andreas. >It works too, though not as versatile as the above method. >> >>I usually pass the kernel command-line option "uml" when starting it up. >>You can pass all sorts of useful information on the kernel command-line: >> linux ... hostname=uml1 ... >>Then, within my init scripts I do: >> eval `cat /proc/cmdline` > > >>On Thu, 2004-04-01 at 14:58, - Kocil wrote: >> > Dear all. >> > >> > I want to make init scrip (rc.S in slackware) that automatically adjust >> > itself when running under UML. >> > What is the best way to detect that system is running under UML ? >> > >> > Currently I detect it by looking that the root system is ubd0. >> > But I'm sure this is not the best way. >> > >> > Thanks. > >_________________________________________________________________ >SEEK: Now with over 50,000 dream jobs! Click here: >http://ninemsn.seek.com.au?hotmail > > > >------------------------------------------------------- >This SF.Net email is sponsored by: IBM Linux Tutorials >Free Linux tutorial presented by Daniel Robbins, President and CEO of >GenToo technologies. Learn everything from fundamentals to system >administration.http://ads.osdn.com/?ad_id=1470&alloc_id=3638&op=click >_______________________________________________ >User-mode-linux-user mailing list >Use...@li... >https://lists.sourceforge.net/lists/listinfo/user-mode-linux-user _________________________________________________________________ What's your house worth? Click here to find out: http://www.ninemsn.realestate.com.au |