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

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

Add ability to boot into text-install mode, and add new dialog menu options
to walk through the install wizard / edit / install menus

  • Property mode set to 100755
File size: 2.8 KB
Line 
1#!/bin/sh
2# Copyright 2013 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
42/usr/local/etc/rc.d/vboxguest onestart
43
44# Set all NICS to DHCP
45NICS=`ifconfig -l`
46for i in $NICS
47do
48  ifconfig ${i} | grep -q "status: active"
49  if [ $? -eq 0 ] ; then
50    echo "Enabling networking on ${i}..."
51    echo "ifconfig_${i}_ipv6=\"inet6 accept_rtadv\"" >> /etc/rc.conf
52    echo "ifconfig_${i}=\"DHCP\"" >> /etc/rc.conf
53    (dhclient ${i} >/dev/null 2>/dev/null ) &
54  fi
55done
56
57# Check if we are booting in LIVE or INSTALL mode
58if [ -e "/usr/pcbsd-live" ]; then
59
60  # Check if we should be going to the console instead of X directly
61  /sbin/sysctl kern.module_path | /usr/bin/grep "CONSOLE" >/dev/null 2>/dev/null
62  FOUND="$?"
63  if [ "$FOUND" = "0" ]
64  then
65    /root/PCBSDtext.sh
66    shutdown -r now
67    exit
68  fi
69
70  # We are running LIVE mode, start that script now
71  sh /root/PCBSDStartLive.sh
72  exit 0
73fi
74
75# Source our functions
76. /root/functions.sh
77
78# Check if we have an auto-install directive
79if [ -e "/tmp/pc-autoinstall.conf" ]
80then
81  # Start the parser on this directive and begin the install
82  /usr/sbin/pc-sysinstall start-autoinstall /tmp/pc-autoinstall.conf
83fi
84
85# Run the intial sorting of directories
86mv /root/.fluxbox /memfs/
87ln -s /memfs/.fluxbox /root/.fluxbox
88
89# Create the .qt directory
90mkdir /tmp/.qt
91mkdir /tmp/xkb
92
93# Check if we should be going to the console instead of X directly
94kenv xconsole 2>/dev/null | grep -q "YES"
95if [ $? -eq 0 ]; then
96  /root/PCBSDtext.sh
97  shutdown -r now
98  exit
99fi
100
101# Now run the X auto-detection
102detect_x
103
104# Now start xorg
105start_xorg
106
107# Check if we had a successful SysInstaller exit
108if [ -e "/root/.exitStatus" ] ; then
109  STATUS="`cat /root/.exitStatus`"
110  if [ "$STATUS" = "0" ] ; then
111    shutdown -r now
112  else
113    echo "Installation failed! Press any key to drop to shell or type 'reboot' to restart the system"
114    read tmp
115    if [ "$tmp" = "reboot" ] ; then
116      shutdown -r now
117    else
118      /bin/sh
119    fi
120  fi
121fi
Note: See TracBrowser for help on using the repository browser.