2015-01-29 05:12:17 +01:00
|
|
|
#!/bin/bash
|
|
|
|
#
|
|
|
|
# This program is free software; you can redistribute it and/or modify
|
|
|
|
# it under the terms of the GNU General Public License as published by
|
|
|
|
# the Free Software Foundation; version 2 of the License.
|
|
|
|
#
|
|
|
|
# This program is distributed in the hope that it will be useful,
|
|
|
|
# but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
|
|
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
|
|
# GNU General Public License for more details.
|
|
|
|
|
|
|
|
write_calamares_machineid_conf(){
|
2015-01-29 07:24:30 +01:00
|
|
|
local conf="$1/etc/calamares/modules/machineid.conf"
|
|
|
|
|
|
|
|
echo "systemd: false" > $conf
|
|
|
|
echo "dbus: true" >> $conf
|
|
|
|
echo "symlink: false" >> $conf
|
2015-01-29 05:12:17 +01:00
|
|
|
}
|
|
|
|
|
2015-02-11 14:06:44 +01:00
|
|
|
write_calamares_finished_conf(){
|
|
|
|
local conf="$1/etc/calamares/modules/finished.conf"
|
|
|
|
|
|
|
|
echo '---' > "$conf"
|
|
|
|
echo 'restartNowEnabled: true' >> "$conf"
|
|
|
|
echo 'restartNowChecked: false' >> "$conf"
|
|
|
|
echo 'restartNowCommand: "shutdown -r now"' >> "$conf"
|
|
|
|
}
|
|
|
|
|
|
|
|
write_calamares_services_conf(){
|
|
|
|
local conf="$1/etc/calamares/modules/services.conf"
|
2015-02-12 20:43:53 +01:00
|
|
|
|
2015-02-12 19:19:22 +01:00
|
|
|
echo '---' > "$conf"
|
2015-02-12 20:43:53 +01:00
|
|
|
echo '' >> "$conf"
|
2015-02-11 19:33:51 +01:00
|
|
|
if [[ ${initsys} == 'openrc' ]];then
|
2015-02-12 19:19:22 +01:00
|
|
|
echo 'services:' >> "$conf"
|
2015-02-11 19:33:51 +01:00
|
|
|
for s in ${start_openrc[@]};do
|
2015-02-12 19:19:22 +01:00
|
|
|
echo ' - name: '"$s" >> "$conf"
|
2015-02-12 20:43:53 +01:00
|
|
|
echo ' mandatory: false' >> "$conf"
|
|
|
|
echo '' >> "$conf"
|
2015-02-11 19:33:51 +01:00
|
|
|
done
|
2015-02-12 19:19:22 +01:00
|
|
|
echo 'targets:' >> "$conf"
|
|
|
|
echo ' - name: "graphical"' >> "$conf"
|
2015-02-12 20:43:53 +01:00
|
|
|
echo ' mandatory: false' >> "$conf"
|
2015-02-11 19:33:51 +01:00
|
|
|
else
|
|
|
|
echo 'services:' > "$conf"
|
|
|
|
for s in ${start_systemd[@]};do
|
2015-02-12 19:19:22 +01:00
|
|
|
echo ' - name: '"$s" >> "$conf"
|
2015-02-12 20:43:53 +01:00
|
|
|
echo ' mandatory: false' >> "$conf"
|
|
|
|
echo '' >> "$conf"
|
2015-02-11 19:33:51 +01:00
|
|
|
done
|
2015-02-12 19:19:22 +01:00
|
|
|
echo 'targets:' >> "$conf"
|
|
|
|
echo ' - name: "graphical"' >> "$conf"
|
|
|
|
echo ' mandatory: true' >> "$conf"
|
2015-02-11 19:33:51 +01:00
|
|
|
fi
|
2015-02-11 14:06:44 +01:00
|
|
|
}
|
|
|
|
|
2015-01-29 05:12:17 +01:00
|
|
|
write_calamares_dm_conf(){
|
2015-01-29 07:24:30 +01:00
|
|
|
local conf="$1/etc/calamares/modules/displaymanager.conf"
|
|
|
|
|
|
|
|
echo "displaymanagers:" > "$conf"
|
|
|
|
echo " - ${displaymanager}" >> "$conf"
|
|
|
|
echo '' >> "$conf"
|
|
|
|
echo '#executable: "startkde"' >> "$conf"
|
|
|
|
echo '#desktopFile: "plasma"' >> "$conf"
|
|
|
|
echo '' >> "$conf"
|
|
|
|
echo "basicSetup: false" >> "$conf"
|
2015-01-29 05:12:17 +01:00
|
|
|
}
|
|
|
|
|
|
|
|
write_calamares_initcpio_conf(){
|
2015-02-12 19:19:22 +01:00
|
|
|
local conf="$1/etc/calamares/modules/initcpio.conf"
|
2015-02-12 20:43:53 +01:00
|
|
|
|
2015-02-12 19:19:22 +01:00
|
|
|
echo "---" > "$conf"
|
|
|
|
echo "kernel: ${manjaro_kernel}" >> "$conf"
|
2015-01-29 05:12:17 +01:00
|
|
|
}
|
|
|
|
|
2015-02-12 20:43:53 +01:00
|
|
|
write_calamares_unpack_conf(){
|
|
|
|
local conf="$1/etc/calamares/modules/unpackfs.conf"
|
|
|
|
|
|
|
|
echo "---" > "$conf"
|
|
|
|
echo "unpack:" >> "$conf"
|
|
|
|
echo " - source: \"/bootmnt/${install_dir}/${arch}/root-image.sqfs\"" >> "$conf"
|
|
|
|
echo " sourcefs: \"squashfs\"" >> "$conf"
|
|
|
|
echo " destination: \"\"" >> "$conf"
|
|
|
|
echo " - source: \"/bootmnt/${install_dir}/${arch}/${custom}-image.sqfs\"" >> "$conf"
|
|
|
|
echo " sourcefs: \"squashfs\"" >> "$conf"
|
|
|
|
echo " destination: \"\"" >> "$conf"
|
|
|
|
}
|
2015-01-29 05:12:17 +01:00
|
|
|
|
|
|
|
configure_calamares(){
|
|
|
|
if [[ -f $1/usr/bin/calamares ]];then
|
|
|
|
msg2 "Configuring Calamares ..."
|
2015-02-12 19:19:22 +01:00
|
|
|
|
2015-01-29 07:24:30 +01:00
|
|
|
mkdir -p $1/etc/calamares/modules
|
2015-02-12 19:19:22 +01:00
|
|
|
|
2015-02-12 20:43:53 +01:00
|
|
|
write_calamares_unpack_conf $1
|
2015-01-29 07:24:30 +01:00
|
|
|
|
2015-01-29 05:12:17 +01:00
|
|
|
write_calamares_dm_conf $1
|
|
|
|
write_calamares_initcpio_conf $1
|
2015-02-11 14:06:44 +01:00
|
|
|
|
|
|
|
if [[ ${initsys} == 'openrc' ]];then
|
|
|
|
write_calamares_machineid_conf $1
|
2015-02-12 20:43:53 +01:00
|
|
|
write_calamares_finished_conf $1
|
2015-02-11 14:06:44 +01:00
|
|
|
fi
|
2015-01-29 07:24:30 +01:00
|
|
|
|
2015-02-11 19:33:51 +01:00
|
|
|
write_calamares_services_conf $1
|
|
|
|
|
2015-01-29 05:12:17 +01:00
|
|
|
mkdir -p $1/home/${username}/Desktop
|
2015-02-12 19:19:22 +01:00
|
|
|
|
2015-01-29 05:12:17 +01:00
|
|
|
cp $1/usr/share/applications/calamares.desktop $1/home/${username}/Desktop/calamares.desktop
|
|
|
|
chmod a+x $1/home/${username}/Desktop/calamares.desktop
|
2015-02-12 20:43:53 +01:00
|
|
|
# chown ${username}:users $1/home/${username}/Desktop/calamares.desktop
|
2015-02-12 19:19:22 +01:00
|
|
|
echo "QT_STYLE_OVERRIDE=gtk" >> $1/etc/environment
|
2015-01-29 05:12:17 +01:00
|
|
|
fi
|
|
|
|
}
|
|
|
|
|
|
|
|
configure_thus(){
|
|
|
|
if [[ -f $1/usr/bin/thus ]];then
|
|
|
|
msg2 "Configuring Thus ..."
|
2015-01-29 07:24:30 +01:00
|
|
|
local conf="$1/etc/thus.conf"
|
2015-01-29 05:12:17 +01:00
|
|
|
local rel=$(cat $1/etc/lsb-release | grep DISTRIB_RELEASE | cut -d= -f2)
|
2015-01-29 07:24:30 +01:00
|
|
|
sed -i "s|_version_|$rel|g" $conf
|
|
|
|
sed -i "s|_kernel_|$manjaro_kernel|g" $conf
|
|
|
|
configure_installer "$conf"
|
2015-01-29 05:12:17 +01:00
|
|
|
mkdir -p $1/home/${username}/Desktop
|
2015-02-12 19:19:22 +01:00
|
|
|
|
2015-01-29 05:12:17 +01:00
|
|
|
cp $1/usr/share/applications/thus.desktop $1/home/${username}/Desktop/thus.desktop
|
|
|
|
chmod a+x $1/home/${username}/Desktop/thus.desktop
|
2015-02-12 20:43:53 +01:00
|
|
|
# chown ${username}:users $1/home/${username}/Desktop/thus.desktop
|
2015-01-29 05:12:17 +01:00
|
|
|
fi
|
|
|
|
}
|