]> git.proxmox.com Git - pve-installer.git/blame - unconfigured.sh
bump version to 4.0-11, depend on squashfs-tools
[pve-installer.git] / unconfigured.sh
CommitLineData
89a12446
DM
1#!/bin/bash
2
3trap "err_reboot" ERR
4
5parse_cmdline() {
6 root=
7 proxdebug=0
8 for par in $(cat /proc/cmdline); do
9 case $par in
10 root=*)
11 root=${par#root=}
12 ;;
13 proxdebug)
14 proxdebug=1
15 ;;
16 esac
17 done;
18}
19
20debugsh() {
16ff00ec 21 /bin/bash
89a12446
DM
22}
23
24real_reboot() {
25
26 trap - ERR
27
28 /etc/init.d/networking stop
29
30 # stop udev (release file handles)
31 /etc/init.d/udev stop
32
33 echo -n "Deactivating swap..."
34 swap=$(grep /dev /proc/swaps);
35 if [ -n "$swap" ]; then
36 set $swap
37 swapoff $1
38 fi
39 echo "done."
40
89a12446
DM
41 umount -l -n /dev/.static/dev
42 umount -l -n /dev
43
44 umount -l -n /target >/dev/null 2>&1
45 umount -l -n /tmp
46 umount -l -n /var/tmp
47 umount -l -n /var/log
48 umount -l -n /var/run
49 umount -l -n /var/lib/xkb
50
89a12446 51 umount -l -n /sys
e89d1aef 52 umount -l -n /proc
89a12446
DM
53
54 exit 0
55}
56
57err_reboot() {
58
59 echo "\nInstallation aborted - unable to continue (type exit or CTRL-D to reboot)"
60 debugsh
61 real_reboot
62}
63
64echo "Starting Proxmox installation"
65
66PATH=/sbin:/bin:/usr/sbin:/usr/bin:/usr/X11R6/bin
67
68mount -n -t proc proc /proc
69mount -n -t tmpfs tmpfs /tmp
70mount -n -t tmpfs tmpfs /var/tmp
71mount -n -t tmpfs tmpfs /var/log
72mount -n -t tmpfs tmpfs /var/run
73mount -n -t tmpfs tmpfs /var/lib/xkb
74mount -n -t sysfs sysfs /sys
75
76parse_cmdline
77
78# always load most common input drivers
79modprobe -q psmouse || /bin/true
80modprobe -q sermouse || /bin/true
81modprobe -q usbhid || /bin/true
82
83# load device mapper - used by lilo
84modprobe -q dm_mod || /bin/true
85
86echo "Installing additional hardware drivers"
87export RUNLEVEL=S
88export PREVLEVEL=N
89/etc/init.d/udev start
90
89a12446
DM
91# set the hostname
92hostname proxmox
93
89a12446
DM
94# try to get ip config with dhcp
95echo -n "Detecting network settings... "
96/etc/init.d/networking start >/dev/tty2 2>&1
97echo "done"
98
99xinit -- -dpi 96 >/dev/tty2 2>&1
100
b0c4afcc
DM
101# just to be sure everything is on disk
102sync
103
89a12446
DM
104if [ $proxdebug -ne 0 ]; then
105 echo "Debugging mode (type exit or CTRL-D to reboot)"
106 debugsh
107fi
108
109echo "Installation done, rebooting... "
110#mdadm -S /dev/md0 >/dev/tty2 2>&1
111real_reboot
112
113# never reached
114exit 0