summaryrefslogtreecommitdiff
path: root/config/chroot_local-includes/lib/live/config/9010-hotfixes
blob: aeca75bbb9342147a172d555e4facb3e118b622f (plain)
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
#!/bin/sh

Hotfixes ()
{
if [ -e /var/lib/live/config/hotfixes ]
then
	return
fi
echo -n " hotfixes"
Configure_hotfixes
}

Configure_hotfixes ()
{
# Reading kernel command line
for _PARAMETER in ${_CMDLINE} ${LIVE_CONFIG_CMDLINE}; do
 case "${_PARAMETER}" in
  live-config.timezone=*|timezone=*)
   LIVE_TIMEZONE="${_PARAMETER#*timezone=}"
   ;;
  live-config.username=*|username=*)
   LIVE_USERNAME="${_PARAMETER#*username=}"
   ;;
 esac
done

# fix timezone
if [ -n "${LIVE_TIMEZONE}" ]; then
	echo "${LIVE_TIMEZONE}" > /etc/timezone
fi

# dirty hack to prevent kdm's "abort active sessions" prompt on live system
sudo -u "${LIVE_USERNAME}" sh -c "mkdir -p /home/${LIVE_USERNAME}/.kde/shutdown; cat > /home/${LIVE_USERNAME}/.kde/shutdown/kdm-force-shutdown-hack" <<"EOF"
#!/bin/sh
# dirty hack to prevent kdm's "abort active sessions" prompt on live system

. /etc/default/distro
[ "$FLL_DISTRO_MODE" = "live" ] || exit # are we live?

# "destroy" utmp, so kdm won't recognize the running logins on the other TTYs
sudo perl -pi -e 's/tty/xty/g' /var/run/utmp

EOF
chmod +x /home/${LIVE_USERNAME}/.kde/shutdown/kdm-force-shutdown-hack

# hack to prevent plasma suspend (bookworm)
# this file should be removed by installer
if [ "$(cat /etc/debian_version)" \> "12" ]; then
sudo -u "${LIVE_USERNAME}" sh -c "mkdir -p /home/${LIVE_USERNAME}/.config; cat > /home/${LIVE_USERNAME}/.config/powermanagementprofilesrc" <<"EOF"
[AC]

[AC][DPMSControl]
idleTime=600
lockBeforeTurnOff=0

[AC][DimDisplay]
idleTime=300000


[Battery]

[Battery][DPMSControl]
idleTime=720
lockBeforeTurnOff=0

[Battery][DimDisplay]
idleTime=300000


[LowBattery]

[LowBattery][DPMSControl]
idleTime=120
lockBeforeTurnOff=0

[LowBattery][DimDisplay]
idleTime=60000
EOF
fi

# google chrome hack
if [ -x /var/lib/dpkg/info/google-chrome-stable.postinst ]; then
cat <<EOT >/etc/apt/sources.list.d/google-chrome.list
### THIS FILE IS AUTOMATICALLY CONFIGURED ###
# You may comment out this entry, but any other modifications may be lost.
deb [arch=amd64] http://dl.google.com/linux/chrome/deb/ stable main
EOT
fi

# google earth hack
if [ -x /var/lib/dpkg/info/google-earth-stable.postinst ]; then
cat <<EOT >/etc/apt/sources.list.d/google-earth.list
### THIS FILE IS AUTOMATICALLY CONFIGURED ###
# You may comment out this entry, but any other modifications may be lost.
deb http://dl.google.com/linux/earth/deb/ stable main
EOT
fi

# google talkplugin hack
if [ -x /var/lib/dpkg/info/google-talkplugin.postinst ]; then
cat <<EOT >/etc/apt/sources.list.d/google-talkplugin.list
### THIS FILE IS AUTOMATICALLY CONFIGURED ###
# You may comment out this entry, but any other modifications may be lost.
deb http://dl.google.com/linux/talkplugin/deb/ stable main
EOT
fi

# steam list hack
if [ -x /var/lib/dpkg/info/steam-launcher.postinst ]; then
cat <<EOT >/etc/apt/sources.list.d/steam.list
deb [arch=amd64,i386] http://repo.steampowered.com/steam/ precise steam
deb-src [arch=amd64,i386] http://repo.steampowered.com/steam/ precise steam
EOT
fi

# vivaldi hack
if [ -x /var/lib/dpkg/info/vivaldi.postinst ]; then
cat <<EOT >/etc/apt/sources.list.d/vivaldi.list
### THIS FILE IS AUTOMATICALLY CONFIGURED ###
# You may comment out this entry, but any other modifications may be lost.
deb http://repo.vivaldi.com/stable/deb/ stable main
EOT
fi

# skype hack
if [ -x /opt/skypeforlinux/skypeforlinux ]; then
cat <<EOT >/etc/apt/sources.list.d/skype-stable.list
deb [arch=amd64] https://repo.skype.com/deb stable main
EOT
fi

# reconfigure console-setup
rm -f /etc/default/console-setup
. /etc/default/locale
dpkg-reconfigure console-setup -fnoninteractive

# disable update-apt-xapian-index in live mode
if [ -x /usr/sbin/update-apt-xapian-index ]; then
    chmod -x /usr/sbin/update-apt-xapian-index
fi

# disable mandb in live mode
if [ -x /usr/bin/mandb ]; then
    #chmod -x /usr/bin/mandb
    rm -f /var/lib/man-db/auto-update
fi

touch /var/lib/live/config/hotfixes
}

Hotfixes