source: overlays/install-overlay/root/PCBSDStart.sh @ fe78043

9.2-releasereleng/10.0releng/10.0.1releng/10.0.2releng/10.0.3
Last change on this file since fe78043 was fe78043, checked in by Kris Moore <kris@…>, 13 months ago

Fix a small UI bug in the installer, and while here check for and enable
vboxguest services during the install if running in VirtualBox?

  • Property mode set to 100755
File size: 3.0 KB
Line 
1#!/bin/sh
2# Copyright 2007 PC-BSD Software
3# http://www.pcbsd.com
4# Author: Kris Moore
5###########################################################################
6MM_CHARSET="UTF-8" ; export MM_CHARSET
7LANG="en_US.UTF-8" ; export LANG
8LC_CTYPE="en_US.UTF-8" ; export LC_CTYPE     
9LC_COLLATE="POSIX" ; export LC_COLLATE
10
11# Make sure this is only executed on the first login, in order for other ctrl-fX screens to work
12if [ -f "/tmp/1stRun" ] 
13then
14  exit
15fi
16
17touch /tmp/1stRun
18
19# Make /var/tmp link
20mv /var/tmp /tmp/vartmp
21ln -s /tmp/vartmp /var/tmp
22
23# Check ZFS tmpdir
24if [ ! -d "/tmp/zfs" ] ; then
25  mkdir /tmp/zfs
26  if [ $? -ne 0 ] ; then
27     echo "Error creating /tmp/zfs, ZFS installs will not work!"
28     echo "Press ENTER to continue"
29     read tmp
30  fi
31fi
32
33# Check if we have FreeBSD dist files on this media
34if [ ! -d "/dist-fbsd" ] ; then
35   touch /tmp/no-fbsd-release
36fi
37
38# Enable the debug version of pc-sysinstall
39/root/debugpcsysinstall.sh
40
41# Check if we are running in a VM and enable guest services
42case "$(kenv smbios.system.product)" in
43VirtualBox) /usr/local/etc/rc.d/vboxguest onestart ;;
44VMware*) ;;
45  *) ;;
46esac
47
48# Set all NICS to DHCP
49NICS=`ifconfig -l`
50for i in $NICS
51do
52  ifconfig ${i} | grep -q "status: active"
53  if [ $? -eq 0 ] ; then
54    echo "Enabling networking on ${i}..."
55    echo "ifconfig_${i}_ipv6=\"inet6 accept_rtadv\"" >> /etc/rc.conf
56    echo "ifconfig_${i}=\"DHCP\"" >> /etc/rc.conf
57    (dhclient ${i} >/dev/null 2>/dev/null ) &
58  fi
59done
60
61# Check if we are booting in LIVE or INSTALL mode
62if [ -e "/usr/pcbsd-live" ]; then
63
64  # Check if we should be going to the console instead of X directly
65  /sbin/sysctl kern.module_path | /usr/bin/grep "CONSOLE" >/dev/null 2>/dev/null
66  FOUND="$?"
67  if [ "$FOUND" = "0" ]
68  then
69    /root/PCBSDtext.sh
70    shutdown -r now
71    exit
72  fi
73
74  # We are running LIVE mode, start that script now
75  sh /root/PCBSDStartLive.sh
76  exit 0
77fi
78
79# Source our functions
80. /root/functions.sh
81
82# Check if we have an auto-install directive
83if [ -e "/tmp/pc-autoinstall.conf" ]
84then
85  # Start the parser on this directive and begin the install
86  /usr/sbin/pc-sysinstall start-autoinstall /tmp/pc-autoinstall.conf
87fi
88
89# Run the intial sorting of directories
90mv /root/.fluxbox /memfs/
91ln -s /memfs/.fluxbox /root/.fluxbox
92
93# Create the .qt directory
94mkdir /tmp/.qt
95mkdir /tmp/xkb
96
97# Check if we should be going to the console instead of X directly
98/sbin/sysctl kern.module_path | /usr/bin/grep "CONSOLE" >/dev/null 2>/dev/null
99FOUND="$?"
100if [ "$FOUND" = "0" ]
101then
102  /root/PCBSDtext.sh
103  shutdown -r now
104  exit
105fi
106
107# Now run the X auto-detection
108detect_x
109
110# Now start xorg
111start_xorg
112
113# Check if we had a successful SysInstaller exit
114if [ -e "/root/.exitStatus" ] ; then
115  STATUS="`cat /root/.exitStatus`"
116  if [ "$STATUS" = "0" ] ; then
117    shutdown -r now
118  else
119    echo "Installation failed! Press any key to drop to shell or type 'reboot' to restart the system"
120    read tmp
121    if [ "$tmp" = "reboot" ] ; then
122      shutdown -r now
123    else
124      /bin/sh
125    fi
126  fi
127fi
Note: See TracBrowser for help on using the repository browser.