-
Notifications
You must be signed in to change notification settings - Fork 211
/
Copy pathchroot_reconst.sh
166 lines (145 loc) · 5.05 KB
/
chroot_reconst.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
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
155
156
157
158
159
160
161
162
163
164
165
166
#!/bin/bash
# Minimimal chroot file for a reconstruction of meilix
# 14 Nov 18 v.0.1 first minimal try
# 15 Nov 18 v.0.2 let's exmperiment
# 17 Nov 18 v.0.3 We have a desktop
# 18 Nov 18 v.0.4 Let's try to change the default user
# 19 Nov 18 v.0.5 Fix Plymouth installation
sudo chroot chroot <<EOF
# Set up several useful shell variables
export CASPER_GENERATE_UUID=1
export HOME=/root
#export USERNAME=meilix
export TTY=unknown
export TERM=vt100
export DEBIAN_FRONTEND=noninteractive
export LANG=C
export LIVE_BOOT_SCRIPTS="casper lupin-casper"
# This solves the setting up of locale problem for chroot
sudo locale-gen en_US.UTF-8
# To allow a few apps using upstart to install correctly. JM 2011-02-21
dpkg-divert --local --rename --add /sbin/initctl
ln -s /bin/true /sbin/initctl
# Installing wget
apt-get -qq install wget apt-transport-https
# Add key for third party repo
apt-key update
apt-key adv --keyserver keyserver.ubuntu.com --recv-keys E1098513
apt-key adv --keyserver keyserver.ubuntu.com --recv-keys 1EBD81D9
apt-key adv --keyserver keyserver.ubuntu.com --recv-keys 91E7EE5E
# Update in-chroot package database
apt-get -qq update
apt-get -qq -y upgrade
# Install core packages
apt-get -qq -y --purge install ubuntu-standard casper lupin-casper \
laptop-detect os-prober linux-generic
# Install base packages
#apt-get -qq -y install xorg lightdm
apt-get -qq -y install xorg xinit sddm
# Install LXQT components
apt-get -qq -y install lxqt-core lxqt-qtplugin
apt-get -f -qq install
update-alternatives --install /usr/bin/x-session-manager x-session-manager /usr/bin/startlxqt 140
# ugly hack
sed -i 's\plasma.desktop\lxqt.desktop\g' /usr/share/initramfs-tools/scripts/casper-bottom/15autologin
#While this is necessary for the changes to take effect we don't have to do that here.
update-initramfs -c -k -v all
# cat /usr/share/xsessions/plasma.desktop
rm /usr/share/xsessions/plasma.desktop
# ugliest hack ever
cp /usr/share/xsessions/lxqt.desktop /usr/share/xsessions/plasma.desktop
# 3rd party software installation
if ["chromium" in "$INSTALL"]
then
apt-get install -y chromium-browser
fi
if ["firefox" in "$INSTALL"]
then
apt-get -qq -y install firefox
fi
if ["chrome" in "$INSTALL"]
then
if [[ $(arch) = "amd64" ]]
then
wget -q https://dl.google.com/linux/direct/google-chrome-stable_current_amd64.deb &&
dpkg -i google-chrome-stable_current_amd64.deb &&
rm -f google-chrome-stable_current_amd64.deb
else
wget -q https://dl.google.com/linux/direct/google-chrome-stable_current_i386.deb &&
dpkg -i google-chrome-stable_current_i386.deb &&
rm -f google-chrome-stable_current_i386.deb
fi
fi
if ["vlc" in "$INSTALL"]
then
apt-get -qq -y install vlc
fi
if ["git" in "$INSTALL"]
then
apt-get -qq -y install git
fi
if ["gimp" in "$INSTALL"]
then
apt-get -qq -y --purge install gimp
fi
if ["inkscape" in "$INSTALL"]
then
apt-get -qq -y --purge install inkscape
fi
if ["office" in "$INSTALL"]
then
apt-get -qq -y --purge install --no-install-recommends libreoffice-gtk libreoffice-gtk libreoffice-writer libreoffice-calc libreoffice-impress
fi
if ["dropbox" in "$INSTALL"]
then
apt-get -qq -y install nautilus-dropbox
nautilus --quit
fi
# removal of desktop files
rm /usr/share/applications/mpv.desktop
rm /usr/share/applications/smplayer.desktop
rm /usr/share/applications/smtube.desktop
rm /usr/share/applications/audacious.desktop
# Installing sublime text editor
wget -qO - https://download.sublimetext.com/sublimehq-pub.gpg | apt-key add -
echo "deb https://download.sublimetext.com/ apt/stable/" | tee /etc/apt/sources.list.d/sublime-text.list
apt-get -qq update
apt-get -qq -y install sublime-text
# after Xenial one could also use apt install ./package
dpkg -i plymouth-theme-meilix-text_1.0-2_all.deb; apt-get -qq -y -f install; dpkg -i plymouth-theme-meilix-text_1.0-2_all.deb
dpkg -i plymouth-theme-meilix-logo_1.0-2_all.deb
dpkg -i meilix-default-theme_1.0-2_all.deb
dpkg -i systemlock_0.1-1_all.deb
# Remove the "LXQT about" entry from the menu
# /usr/share/applications/lxqt-about.desktop
# or ~/.local/usr/share override (in skel!)
# set the option NoDisplay=true
sed -i '$ a NoDisplay=true' /usr/share/applications/lxqt-about.desktop
# Meilix default settings
dpkg -i --force-overwrite meilix-default-settings_1.0_all.deb
# Meilix Check Skript
# chmod +x meilix_check.sh
# ./meilix_check.sh
#applying wallpaper sent by meilix-generator
if [ "$wallpaper_url" != "" ]
then
wget -q $wallpaper_url -O "/usr/share/lxqt/themes/meilix/wallpaper.jpg"
fi
# Clean up the chroot before
perl -i -nle 'print unless /^Package: language-(pack|support)/ .. /^$/;' /var/lib/apt/extended_states
apt-get -qq clean
rm -rf /tmp/*
#rm /etc/resolv.conf
# Clean up local packages that are not needed anymore
rm -f meilix-default-settings_1.0_all.deb
rm -f meilix-metapackage_1.0-1_all.deb
rm -f systemlock_0.1-1_all.deb
rm -f plymouth-theme-meilix-logo_1.0-2_all.deb
rm -f plymouth-theme-meilix-text_1.0-2_all.deb
rm -f meilix-default-theme_1.0-2_all.deb
rm -f systemlock_0.1-1_all.deb
# Reverting earlier initctl override. JM 2012-0604
rm /sbin/initctl
dpkg-divert --rename --remove /sbin/initctl
exit
EOF