forked from asb/spindle
-
Notifications
You must be signed in to change notification settings - Fork 0
/
wheezy-stage4-lxde
executable file
·122 lines (107 loc) · 3.62 KB
/
wheezy-stage4-lxde
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
#!/bin/sh
# Part of spindle http://asbradbury.org/projects/spindle
#
# See LICENSE file for copyright and license details
set -ex
CURIMG=stage4-lxde.qed
. ./common
install_packages() {
# we may want to break out DEBIAN_FRONTEND=noninteractive
ssh_in_to_qemu chroot /mnt sh -l -ex - <<EOF
apt-get update
apt-get install --no-install-recommends -y xserver-xorg-video-fbdev
apt-get install --no-install-recommends -y xserver-xorg xinit
apt-get install --no-install-recommends -y midori
apt-get install --no-install-recommends -y lxde lxtask menu-xdg gksu
apt-get install -y mupdf gtk2-engines alsa-utils
apt-get install -y --no-install-recommends netsurf-gtk zenity lxmusic xdg-utils
apt-get install -y desktop-base lxpolkit
EOF
}
# make gksu default to sudo mode
configure_gksu() {
onvm_chroot sh -l -e - <<\EOF
update-alternatives --set libgksu-gconf-defaults /usr/share/libgksu/debian/gconf-defaults.libgksu-sudo
update-gconf-defaults
EOF
}
install_wayland() {
onvm_chroot sh -l -e - <<\EOF
apt-get update
apt-get install -y libwayland0 libwayland-dev
EOF
}
install_omxplayer() {
onvm_chroot sh -l -e - <<\EOF
apt-get update
apt-get install -y omxplayer
EOF
}
configure_lxde() {
onvm_chroot sh -l -e <<EOF &&
mkdir -p /opt/rpi_artwork
EOF
scp_in_to_qemu ../misc/Raspberry_Pi_Logo.png /mnt/opt/rpi_artwork &&
onvm_chroot sh -l -e <<\EOF
# first change theme to mist (seems to render noticably faster)
sed /etc/xdg/lxsession/LXDE/desktop.conf -i -e "s|sNet/ThemeName.*|sNet/ThemeName=Mist|"
# configure openbox so it doesn't ask apps to redraw while resizing
sed /etc/xdg/openbox/LXDE/rc.xml -i -e \
"s|<drawContents>yes</drawContents>|<drawContents>no</drawContents>|"
# change background
update-alternatives --install /usr/share/images/desktop-base/desktop-background \
desktop-background /opt/rpi_artwork/Raspberry_Pi_Logo.png 65
PCMANFMCFG=/etc/xdg/pcmanfm/LXDE/pcmanfm.conf
sed "$PCMANFMCFG" -i -e 's/^wallpaper_mode.*/wallpaper_mode=3/'
sed "$PCMANFMCFG" -i -e 's/^desktop_bg.*/desktop_bg=#ffffff/'
# while we're at it, let's not use xdg-su which Debian doesn't even provide
sed "$PCMANFMCFG" -i -e 's/^su_cmd.*/su_cmd=gksu %s/'
EOF
}
setup_automounting() {
onvm_chroot sh -l -e <<\EOF1
apt-get install -y udisks
cat <<EOF2 > /etc/polkit-1/localauthority/50-local.d/55-storage.pkla
[Storage Permissions]
Identity=unix-group:plugdev
Action=org.freedesktop.udisks.filesystem-mount;org.freedesktop.udisks.drive-eject;org.freedesktop.udisks.drive-detach;org.freedesktop.udisks.luks-unlock;org.freedesktop.udisks.inhibit-polling;org.freedesktop.udisks.drive-set-spindown
ResultAny=yes
ResultActive=yes
ResultInactive=no
EOF2
EOF1
}
install_and_configure_lightdm() {
onvm_chroot sh -l -e <<\EOF
apt-get install -y lightdm gnome-themes-standard gnome-icon-theme
update-rc.d lightdm disable 2
sed -i /etc/lightdm/lightdm-gtk-greeter.conf -e "s/^background.*/background=#ffffff/"
# TODO: maybe change the computer icon to the Raspberry Pi logo? See
# https://wiki.archlinux.org/index.php/LightDM#Changing_the_Icon
EOF
}
install_qt5() {
onvm_chroot sh -l -e <<\EOF
apt-get update
apt-get install --allow-unauthenticated -y qt50-snapshot qt50-quick-particle-examples
EOF
}
cd $WORKDIR
dotask branch_image ../$OUTDIR/stage3.qed $CURIMG
dotask run_qemu $CURIMG
dotask mount_apt_cache
dotask disable_starting_services
dotask install_wayland
dotask install_packages
dotask configure_gksu
dotask install_omxplayer
dotask configure_lxde
dotask setup_automounting
dotask install_and_configure_lightdm
dotask install_qt5
dotask save_space_using_hardlink
dotask allow_starting_services
dotask update_issue
dotask fingerprint_debian
dotask shutdown_qemu
dotask finish_image