[PC-BSD Commits] r16441 - pcbsd/current/overlays/mfsroot-overlay/etc

svn at pcbsd.org svn at pcbsd.org
Tue Apr 17 08:27:24 PDT 2012


Author: kris
Date: 2012-04-17 15:27:24 +0000 (Tue, 17 Apr 2012)
New Revision: 16441

Modified:
   pcbsd/current/overlays/mfsroot-overlay/etc/SetupInstall.sh
   pcbsd/current/overlays/mfsroot-overlay/etc/pcbsd-rc.sh
Log:

Change our loading a bit so we can install on systems with less than 512MB
of RAM. Need to experiment a bit to find the bottom floor, but for now warn
when using system with less than 256MB. 

When using < 512MB, the CD will stay mounted, and cannot be ejected until
reboot. 



Modified: pcbsd/current/overlays/mfsroot-overlay/etc/SetupInstall.sh
===================================================================
--- pcbsd/current/overlays/mfsroot-overlay/etc/SetupInstall.sh	2012-04-17 15:18:40 UTC (rev 16440)
+++ pcbsd/current/overlays/mfsroot-overlay/etc/SetupInstall.sh	2012-04-17 15:27:24 UTC (rev 16441)
@@ -3,24 +3,54 @@
 
 # Setup the /uzip memory device
 echo "Mounting /uzip"
-MDSIZE="`/bin/du -m /cdmnt/uzip/usr.uzip | /bin/cut -f 1`"
-MDSIZE="`/bin/expr ${MDSIZE} + 110`"
-echo "Creating ${MDSIZE}MB ramdisk..."
-/sbin/mdmfs -S -s ${MDSIZE}M -O space md2 /uzip
 
-echo "Copying setup image into memory... Please Wait..."
-/bin/cp /cdmnt/uzip/usr.uzip /uzip/
+# Do a check of available memory 
+sysMem=`/sbin/sysctl hw.realmem | /bin/cut -d ' ' -f 2`
+minSize=`/bin/expr 500 \* 1024 \* 1024`
+if [ $sysMem -lt $minSize ] ; then
+  NOUMOUNT="YES"
 
-# Mount the  "usr" directory
-echo "Mounting /usr"
-MDDEVICE="`/sbin/mdconfig -a -t vnode -o readonly -f /uzip/usr.uzip`.uzip"
-/sbin/mount -r /dev/$MDDEVICE /usr
+  MDSIZE="10"
+  echo "Creating ${MDSIZE}MB ramdisk..."
+  /sbin/mdmfs -S -s ${MDSIZE}M -O space md2 /uzip
 
-echo "Copying kernel into memory... Please Wait..."
-/bin/cp -R /cdmnt/boot/kernel /uzip/
-/bin/cp -R /cdmnt/boot/modules /uzip/
-/bin/cp /cdmnt/boot/device.hints /boot/device.hints
+  echo "Mounting /usr"
+  MDDEVICE="`/sbin/mdconfig -a -t vnode -o readonly -f /cdmnt/usr.uzip`.uzip"
+  /sbin/mount -r /dev/$MDDEVICE /usr
 
+  echo "Setting up kernel space... Please Wait..."
+  rm -rf /boot/kernel >/dev/null 2>/dev/null
+  rm -rf /boot/modules >/dev/null 2>/dev/null
+  rm -rf /boot/device.hints >/dev/null 2>/dev/null
+  ln -s /cdmnt/boot/kernel /boot/kernel
+  ln -s /cdmnt/boot/modules /boot/modules
+  ln -s /cdmnt/boot/device.hints /boot/device.hints
+
+  # End of loading if less than < 512 MB of ram
+else
+
+  # Copy uzip to memory which lets us boot faster and eject media
+  MDSIZE="`/bin/du -m /cdmnt/uzip/usr.uzip | /bin/cut -f 1`"
+  MDSIZE="`/bin/expr ${MDSIZE} + 110`"
+  echo "Creating ${MDSIZE}MB ramdisk..."
+  /sbin/mdmfs -S -s ${MDSIZE}M -O space md2 /uzip
+
+  echo "Copying setup image into memory... Please Wait..."
+  /bin/cp /cdmnt/uzip/usr.uzip /uzip/
+
+  # Mount the  "usr" directory
+  echo "Mounting /usr"
+  MDDEVICE="`/sbin/mdconfig -a -t vnode -o readonly -f /uzip/usr.uzip`.uzip"
+  /sbin/mount -r /dev/$MDDEVICE /usr
+
+  echo "Copying kernel into memory... Please Wait..."
+  /bin/cp -R /cdmnt/boot/kernel /uzip/
+  /bin/cp -R /cdmnt/boot/modules /uzip/
+  /bin/cp /cdmnt/boot/device.hints /boot/device.hints
+  # End of loading if we have > 512MB ram
+fi
+
+
 # Load the extra klds we need
 /etc/rc.d/kld start
 
@@ -62,4 +92,6 @@
   
 fi
 
-/sbin/umount /cdmnt
+if [ "$NOUMOUNT" != "YES" ] ; then
+  /sbin/umount /cdmnt
+fi

Modified: pcbsd/current/overlays/mfsroot-overlay/etc/pcbsd-rc.sh
===================================================================
--- pcbsd/current/overlays/mfsroot-overlay/etc/pcbsd-rc.sh	2012-04-17 15:18:40 UTC (rev 16440)
+++ pcbsd/current/overlays/mfsroot-overlay/etc/pcbsd-rc.sh	2012-04-17 15:27:24 UTC (rev 16441)
@@ -137,9 +137,9 @@
 
 # Do a check of available memory  
 sysMem=`/sbin/sysctl hw.realmem | /bin/cut -d ' ' -f 2`
-minSize=`/bin/expr 500 \* 1024 \* 1024`
+minSize=`/bin/expr 250 \* 1024 \* 1024`
 if [ $sysMem -lt $minSize ] ; then
-        echo "Warning: PC-BSD requires a minimum of 512MB of RAM for optimal performance."
+        echo "Warning: PC-BSD requires a minimum of 256MB of RAM for optimal performance."
         echo "You may experience problems with less than this ammount."
         echo ""
         echo "Press ENTER to continue"



More information about the Commits mailing list