]>
Commit | Line | Data |
---|---|---|
89a12446 DM |
1 | #!/bin/bash |
2 | ||
3 | trap "err_reboot" ERR | |
4 | ||
5 | parse_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 | ||
20 | debugsh() { | |
16ff00ec | 21 | /bin/bash |
89a12446 DM |
22 | } |
23 | ||
24 | real_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 | ||
57 | err_reboot() { | |
58 | ||
59 | echo "\nInstallation aborted - unable to continue (type exit or CTRL-D to reboot)" | |
60 | debugsh | |
61 | real_reboot | |
62 | } | |
63 | ||
64 | echo "Starting Proxmox installation" | |
65 | ||
66 | PATH=/sbin:/bin:/usr/sbin:/usr/bin:/usr/X11R6/bin | |
67 | ||
68 | mount -n -t proc proc /proc | |
69 | mount -n -t tmpfs tmpfs /tmp | |
70 | mount -n -t tmpfs tmpfs /var/tmp | |
71 | mount -n -t tmpfs tmpfs /var/log | |
72 | mount -n -t tmpfs tmpfs /var/run | |
73 | mount -n -t tmpfs tmpfs /var/lib/xkb | |
74 | mount -n -t sysfs sysfs /sys | |
75 | ||
76 | parse_cmdline | |
77 | ||
78 | # always load most common input drivers | |
79 | modprobe -q psmouse || /bin/true | |
80 | modprobe -q sermouse || /bin/true | |
81 | modprobe -q usbhid || /bin/true | |
82 | ||
83 | # load device mapper - used by lilo | |
84 | modprobe -q dm_mod || /bin/true | |
85 | ||
86 | echo "Installing additional hardware drivers" | |
87 | export RUNLEVEL=S | |
88 | export PREVLEVEL=N | |
89 | /etc/init.d/udev start | |
90 | ||
89a12446 DM |
91 | # set the hostname |
92 | hostname proxmox | |
93 | ||
89a12446 DM |
94 | # try to get ip config with dhcp |
95 | echo -n "Detecting network settings... " | |
96 | /etc/init.d/networking start >/dev/tty2 2>&1 | |
97 | echo "done" | |
98 | ||
99 | xinit -- -dpi 96 >/dev/tty2 2>&1 | |
100 | ||
101 | if [ $proxdebug -ne 0 ]; then | |
102 | echo "Debugging mode (type exit or CTRL-D to reboot)" | |
103 | debugsh | |
104 | fi | |
105 | ||
106 | echo "Installation done, rebooting... " | |
107 | #mdadm -S /dev/md0 >/dev/tty2 2>&1 | |
108 | real_reboot | |
109 | ||
110 | # never reached | |
111 | exit 0 |