source: overlays/install-overlay/etc/SetupInstall.sh @ 1620346

9.1-release9.2-releasereleng/10.0releng/10.0.1releng/10.0.2releng/10.0.3releng/10.1releng/10.1.1releng/10.1.2
Last change on this file since 1620346 was 1620346, checked in by Kris Moore <kris@…>, 2 years ago

Initial import of PC-BSD /current/ SVN repo

  • Property mode set to 100755
File size: 2.2 KB
Line 
1#!/bin/sh
2
3
4# Setup the /memfs memory device
5echo "Mounting /memfs"
6
7# Do a check of available memory
8sysMem=`/sbin/sysctl hw.realmem | /bin/cut -d ' ' -f 2`
9minSize=`/bin/expr 500 \* 1024 \* 1024`
10if [ $sysMem -lt $minSize ] ; then
11  MDSIZE="2"
12  echo "Creating ${MDSIZE}MB ramdisk..."
13  /sbin/mdmfs -S -s ${MDSIZE}M -O space md2 /memfs
14
15  echo "Mounting /usr"
16  MDDEVICE="`/sbin/mdconfig -a -t vnode -o readonly -f /uzip/usr.uzip`.uzip"
17  /sbin/mount -r /dev/$MDDEVICE /usr
18
19else
20  # Copy uzip to memory which lets us run faster
21  MDSIZE="`/bin/du -m /uzip/usr.uzip | /bin/cut -f 1`"
22  MDSIZE="`/bin/expr ${MDSIZE} + 10`"
23  echo "Creating ${MDSIZE}MB ramdisk..."
24  /sbin/mdmfs -S -s ${MDSIZE}M -O space md2 /memfs
25
26  echo "Copying setup image into memory... Please Wait..."
27  /bin/cp /uzip/usr.uzip /memfs/
28
29  # Mount the  "usr" directory
30  echo "Mounting /usr"
31  MDDEVICE="`/sbin/mdconfig -a -t vnode -o readonly -f /memfs/usr.uzip`.uzip"
32  /sbin/mount -r /dev/$MDDEVICE /usr
33
34  # End of loading if we have > 512MB ram
35fi
36
37PATH="${PATH}:/usr/bin"
38export PATH
39
40# Load the extra klds we need
41/etc/rc.d/kld start
42
43# Check for optimus / video drivers
44/etc/pcbsd-video.sh
45
46# See if we have install / meta pkgs for the front-end to use
47if [ -e "/dist/no-meta-pkgs" ] ; then touch /tmp/no-meta-pkgs ; fi
48if [ -e "/dist/no-install-pkgs" ] ; then touch /tmp/no-install-pkgs ; fi
49if [ -e "/dist/no-fbsd-release" ] ; then touch /tmp/no-fbsd-release ; fi
50
51# Check if we have a pc-autoinstall.conf file
52if [ -e "/boot/pc-autoinstall.conf" ]
53then
54  # We have one, copy it over so that pc-sysinstall can parse it later during the bootup
55  cp /boot/pc-autoinstall.conf /tmp/pc-autoinstall.conf
56 
57  # Check if the config file is on disk as well
58  PCCFG=`grep "pc_config:" /tmp/pc-autoinstall.conf | grep -v "^#" | /bin/cut -d ':' -f 2 | tr -d ' '`
59
60  # Check that this isn't a http / ftp file we need to fetch later
61  echo "${PCCFG}" | grep -e "^http" -e "^ftp" > /dev/null 2>/dev/null
62  if [ "$?" != "0" ]
63  then
64    if [ -e "/${PCCFG}" ]
65    then
66      cp /${PCCFG} /tmp/pc-sysinstall.cfg
67    else
68      echo "ERROR: pc_config: ${PCCFG} isn't on the boot media! Automated install aborted!"
69      rm /tmp/pc-autoinstall.conf
70    fi
71  fi
72 
73fi
Note: See TracBrowser for help on using the repository browser.