-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathinstall_mini_desktop
More file actions
executable file
·155 lines (127 loc) · 5.34 KB
/
Copy pathinstall_mini_desktop
File metadata and controls
executable file
·155 lines (127 loc) · 5.34 KB
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
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
#!/bin/bash
# ******************************
# Install minimal lxde desktop *
# ******************************
if [ "$(id -u)" != "0" ]; then
echo "Script must be run as root !"
exit 0
fi
# Check if we have enough disk space.
S=`df / | tail -n 1 | awk '{printf $4}' | sed s/[G,M,K]//g`
if [ "$S" -le "500000" ]; then
echo "We need at least 500MB free to perform minimal desktop instalation"
echo "Have you resized your partition (fs_resize)?"
exit 0
fi
# SET USER NAME !!
_user="odroid"
logfile="mdinstall.log"
#logfile=/dev/stdout
#_auto=""
_auto="-y -q"
_DST=`lsb_release -si`
_REL=`lsb_release -sc`
echo "$_DST - $_REL, Installing DESKTOP..."
echo "$_DST - $_REL, Installing DESKTOP..." > $logfile
echo " installing base packages, please wait..."
if [ "${_REL}" = "wheezy" ] ; then
apt-get $_auto install pulseaudio pulseaudio-module-x11 pulseaudio-utils alsa-base alsa-oss alsa-utils alsa-tools libasound2 aml-libs --no-install-recommends >> $logfile
else
apt-get $_auto install pulseaudio pulseaudio-module-x11 pulseaudio-utils alsa-base alsa-oss alsa-utils alsa-tools libasound2-data aml-libs --no-install-recommends >> $logfile
fi
apt-get clean
echo " installing lxde desktop, please wait..."
apt-get $_auto install xinit xserver-xorg lxde lightdm lightdm-gtk-greeter policykit-1 --no-install-recommends >> $logfile
apt-get clean
if [ "${_DST}" = "Ubuntu" ] ; then
apt-get $_auto install humanity-icon-theme --no-install-recommends >> $logfile
fi
echo " installing more packages, please wait..."
apt-get $_auto install synaptic pavucontrol software-properties-gtk lxtask galculator policykit-1-gnome gksu --no-install-recommends >> $logfile
apt-get clean
# you don't have to install internet browser, you can save ~100MB
echo " installing network packages, please wait..."
if [ "${_DST}" = "Ubuntu" ] ; then
apt-get $_auto install firefox gvfs-fuse gvfs-backends --no-install-recommends >> $logfile
else
apt-get $_auto install iceweasel gvfs-fuse gvfs-backends --no-install-recommends >> $logfile
fi
apt-get clean
echo ""
echo "Configuring desktop..."
rm /wallpaper.* > /dev/null 2>&1
echo "Creating \"xorg.conf\""
cat > /etc/X11/xorg.conf << _EOF_
# X.Org X server configuration file for xfree86-video-mali
Section "Screen"
Identifier "Default Screen"
Monitor "Configured Monitor"
Device "Configured Video Device"
DefaultDepth 16
EndSection
_EOF_
if [ -f /etc/X11/Xwrapper.config ]; then
cat /etc/X11/Xwrapper.config | sed s/"allowed_users=console"/"allowed_users=anybody"/g > /tmp/_xwrap
mv /tmp/_xwrap /etc/X11/Xwrapper.config
fi
if [ -f /etc/lightdm/lightdm-gtk-greeter.conf ]; then
cat /etc/lightdm/lightdm-gtk-greeter.conf | sed "/background=\/usr/d" > /tmp/_greet
mv /tmp/_greet /etc/lightdm/lightdm-gtk-greeter.conf
cat /etc/lightdm/lightdm-gtk-greeter.conf | sed '/\[greeter\]/abackground=\/usr\/share\/lxde\/wallpapers\/lxde_blue.jpg' > /tmp/_greet
mv /tmp/_greet /etc/lightdm/lightdm-gtk-greeter.conf
fi
# Adjust boot.ini
if [ -f /boot/boot.ini ]; then
cat /boot/boot.ini | sed s/"setenv m_bpp \"32\""/"#setenv m_bpp \"32\""/g > /tmp/_bootini
mv /tmp/_bootini /boot/boot.ini
cat /boot/boot.ini | sed s/"#setenv m_bpp \"16\""/"setenv m_bpp \"16\""/g > /tmp/_bootini
mv /tmp/_bootini /boot/boot.ini
cat /boot/boot.ini | sed s/"# setenv m_bpp \"16\""/"setenv m_bpp \"16\""/g > /tmp/_bootini
mv /tmp/_bootini /boot/boot.ini
cat /boot/boot.ini | sed s/"setenv vpu \"0\""/"setenv vpu \"1\""/g > /tmp/_bootini
mv /tmp/_bootini /boot/boot.ini
cat /boot/boot.ini | sed s/"setenv hdmioutput \"0\""/"setenv hdmioutput \"1\""/g > /tmp/_bootini
mv /tmp/_bootini /boot/boot.ini
fi
if [ -f /media/boot/boot.ini ]; then
cat /media/boot/boot.ini | sed s/"setenv m_bpp \"32\""/"#setenv m_bpp \"32\""/g > /tmp/_bootini
mv /tmp/_bootini /media/boot/boot.ini
cat /media/boot/boot.ini | sed s/"#setenv m_bpp \"16\""/"setenv m_bpp \"16\""/g > /tmp/_bootini
mv /tmp/_bootini /media/boot/boot.ini
cat /media/boot/boot.ini | sed s/"# setenv m_bpp \"16\""/"setenv m_bpp \"16\""/g > /tmp/_bootini
mv /tmp/_bootini /media/boot/boot.ini
cat /media/boot/boot.ini | sed s/"setenv vpu \"0\""/"setenv vpu \"1\""/g > /tmp/_bootini
mv /tmp/_bootini /media/boot/boot.ini
cat /media/boot/boot.ini | sed s/"setenv hdmioutput \"0\""/"setenv hdmioutput \"1\""/g > /tmp/_bootini
mv /tmp/_bootini /media/boot/boot.ini
fi
echo " configuring sound"
#*********************
# ** CONFIGURE SOUND
#*********************
cat > /etc/asound.conf << _EOF_
pcm.!default {
type plug
slave {
pcm "hw:0,1"
}
}
ctl.!default {
type hw
card 0
}
_EOF_
if [ -f /etc/pulse/default.pa ]; then
cat /etc/pulse/default.pa | sed s/"#load-module module-alsa-sink"/"load-module module-alsa-sink"/g > /tmp/default.pa
mv /tmp/default.pa /etc/pulse/default.pa
cat /etc/pulse/default.pa | sed s/"#load-module module-alsa-source device=hw:1,0"/"load-module module-alsa-source device=hw:0,1"/g > /tmp/default.pa
mv /tmp/default.pa /etc/pulse/default.pa
fi
usermod -a -G adm,dialout,cdrom,audio,dip,video,plugdev,netdev,fuse $_user
chown -R $_user:$_user /home/$_user
echo ""
echo "*******************************************"
echo "* DESKTOP INSTALLED, please REBOOT now! *"
echo "* AFTER LOGIN RUN startx TO START DESKTOP *"
echo "*******************************************"
echo ""