This repository has been archived by the owner on Feb 4, 2019. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 6
/
Copy path2_install_ubuntu_maverick.sh
93 lines (76 loc) · 2.75 KB
/
2_install_ubuntu_maverick.sh
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
#!/bin/bash
#
# OpenVZ Template OS Creator
# http://github.com/RogerSik/OpenVZ-Template-Creator
#
cat << EOF > /etc/init/openvz.conf
# OpenVZ - Fix init sequence to have OpenVZ working with upstart
# by Stephane Graber [1] modified by bodhi.zazen [2] to work with Proxmox
# [1] https://bugs.launchpad.net/ubuntu/+source/mountall/+bug/436130/comments/34
# [2] http://blog.bodhizazen.net/linux/ubuntu-10-04-openvz-templates/
description "Fix OpenVZ"
start on startup
task
pre-start script
mount -t devpts devpts /dev/pts
mount -t tmpfs varrun /var/run
mount -t tmpfs varlock /var/lock
mkdir -p /var/run/network
if [ ! -e /etc/mtab ]; then
cat /proc/mounts > /etc/mtab
fi
touch /var/run/utmp
chmod 664 /var/run/utmp
chown root.utmp /var/run/utmp
if [ "$(find /etc/network/ -name upstart -type f)" ]; then
chmod -x /etc/network/*/upstart || true
fi
end script
script
start networking
initctl emit filesystem --no-wait
initctl emit local-filesystems --no-wait
initctl emit virtual-filesystems --no-wait
initctl emit net-device-up --no-wait
init 2
end script
EOF
cat << EOF > /etc/apt/sources.list
deb http://de.archive.ubuntu.com/ubuntu maverick main restricted universe multiverse
deb-src http://de.archive.ubuntu.com/ubuntu maverick main restricted universe multiverse
deb http://de.archive.ubuntu.com/ubuntu maverick-updates main restricted universe multiverse
deb-src http://de.archive.ubuntu.com/ubuntu maverick-updates main restricted universe multiverse
deb http://de.archive.ubuntu.com/ubuntu maverick-security main restricted universe multiverse
deb-src http://de.archive.ubuntu.com/ubuntu maverick-security main restricted universe multiverse
#deb http://de.archive.ubuntu.com/ubuntu maverick-backports main #restricted universe multiverse
#deb-src http://de.archive.ubuntu.com/ubuntu maverick-backports main #restricted universe multiverse
EOF
source ./5_distri_install_packages.sh
apt-get install gpgv --force-yes -y
apt-get update
apt-get dist-upgrade -y --force-yes
apt-get install $ubuntu_all -y --force-yes
apt-get clean
apt-get autoremove
# because another a upgrade would begins the booting problems again
aptitude hold mountall upstart
# modprobe fix
rm /sbin/modprobe
ln -s /bin/true /sbin/modprobe
# ssh fix
sed -i -e 's_oom never_#oom never_g' /etc/init/ssh.conf
# Removing of broken scripts
cd /etc/init/
rm -f cron console* control* hwclock* module* mount* network-interface* plymouth* procps* tty* udev* upstart*
# network
echo "hostname" > /etc/hostname
echo "127.0.0.1 localhost.localdomain localhost" > /etc/hosts
# the real password set OpenVZ!
passwd
clear
echo -e "\e[01;31m ######################### \033[0m"
echo "Don't forget to comment in"
echo "console output"
echo "env INIT_VERBOSE"
echo "in /etc/init/rc.conf"
echo -e "\e[01;31m ######################### \033[0m"