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-02-13 01:21:57 +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(){
|
2015-02-13 01:21:57 +01:00
|
|
|
local conf="$1/etc/calamares/modules/finished.conf"
|
|
|
|
echo '---' > "$conf"
|
|
|
|
echo 'restartNowEnabled: true' >> "$conf"
|
|
|
|
echo 'restartNowChecked: false' >> "$conf"
|
|
|
|
echo 'restartNowCommand: "shutdown -r now"' >> "$conf"
|
2015-02-11 14:06:44 +01:00
|
|
|
}
|
|
|
|
|
2015-02-19 21:52:12 +01:00
|
|
|
write_calamares_bootloader_conf(){
|
2015-03-05 10:54:09 +01:00
|
|
|
source "$1/etc/mkinitcpio.d/${kernel}.preset"
|
2015-02-19 21:52:12 +01:00
|
|
|
local conf="$1/etc/calamares/modules/bootloader.conf"
|
|
|
|
echo '---' > "$conf"
|
2015-02-20 17:36:24 +01:00
|
|
|
echo "efiBootLoader: \"${efi_boot_loader}\"" >> "$conf"
|
2015-02-19 23:30:32 +01:00
|
|
|
echo "kernel: \"$(echo ${ALL_kver} | sed s'|/boot||')\"" >> "$conf"
|
2015-02-19 23:24:11 +01:00
|
|
|
echo "img: \"$(echo ${default_image} | sed s'|/boot||')\"" >> "$conf"
|
|
|
|
echo "fallback: \"$(echo ${fallback_image} | sed s'|/boot||')\"" >> "$conf"
|
2015-03-05 10:54:09 +01:00
|
|
|
echo "kernelLine: \", with ${kernel}\"" >> "$conf"
|
|
|
|
echo "fallbackKernelLine: \", with ${kernel} (fallback initramfs)\"" >> "$conf"
|
2015-02-19 21:52:12 +01:00
|
|
|
echo 'timeout: "10"' >> "$conf"
|
|
|
|
echo 'grubInstall: "grub-install"' >> "$conf"
|
|
|
|
echo 'grubMkconfig: "grub-mkconfig"' >> "$conf"
|
|
|
|
echo 'grubCfg: "/boot/grub/grub.cfg"' >> "$conf"
|
|
|
|
}
|
|
|
|
|
2015-02-11 14:06:44 +01:00
|
|
|
write_calamares_services_conf(){
|
2015-02-13 01:21:57 +01:00
|
|
|
local conf="$1/etc/calamares/modules/services.conf"
|
|
|
|
echo '---' > "$conf"
|
|
|
|
echo '' >> "$conf"
|
|
|
|
if [[ ${initsys} == 'openrc' ]];then
|
|
|
|
echo 'services:' >> "$conf"
|
|
|
|
for s in ${start_openrc[@]};do
|
|
|
|
echo ' - name: '"$s" >> "$conf"
|
|
|
|
echo ' mandatory: false' >> "$conf"
|
|
|
|
echo '' >> "$conf"
|
|
|
|
done
|
|
|
|
echo 'targets:' >> "$conf"
|
|
|
|
echo ' - name: "graphical"' >> "$conf"
|
|
|
|
echo ' mandatory: false' >> "$conf"
|
|
|
|
else
|
|
|
|
echo 'services:' > "$conf"
|
|
|
|
for s in ${start_systemd[@]};do
|
|
|
|
echo ' - name: '"$s" >> "$conf"
|
|
|
|
echo ' mandatory: false' >> "$conf"
|
|
|
|
echo '' >> "$conf"
|
|
|
|
done
|
|
|
|
echo 'targets:' >> "$conf"
|
|
|
|
echo ' - name: "graphical"' >> "$conf"
|
|
|
|
echo ' mandatory: true' >> "$conf"
|
|
|
|
fi
|
2015-02-11 14:06:44 +01:00
|
|
|
}
|
|
|
|
|
2015-01-29 05:12:17 +01:00
|
|
|
write_calamares_dm_conf(){
|
2015-02-13 01:21:57 +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-13 01:21:57 +01:00
|
|
|
local conf="$1/etc/calamares/modules/initcpio.conf"
|
|
|
|
echo "---" > "$conf"
|
2015-03-05 10:54:09 +01:00
|
|
|
echo "kernel: ${kernel}" >> "$conf"
|
2015-01-29 05:12:17 +01:00
|
|
|
}
|
|
|
|
|
2015-02-12 20:43:53 +01:00
|
|
|
write_calamares_unpack_conf(){
|
2015-02-13 01:21:57 +01:00
|
|
|
local conf="$1/etc/calamares/modules/unpackfs.conf"
|
|
|
|
echo "---" > "$conf"
|
|
|
|
echo "unpack:" >> "$conf"
|
2015-03-05 10:54:09 +01:00
|
|
|
echo " - source: \"/bootmnt/${iso_name}/${arch}/root-image.sqfs\"" >> "$conf"
|
2015-02-13 01:21:57 +01:00
|
|
|
echo " sourcefs: \"squashfs\"" >> "$conf"
|
|
|
|
echo " destination: \"\"" >> "$conf"
|
2015-03-05 10:54:09 +01:00
|
|
|
echo " - source: \"/bootmnt/${iso_name}/${arch}/${custom}-image.sqfs\"" >> "$conf"
|
2015-02-13 01:21:57 +01:00
|
|
|
echo " sourcefs: \"squashfs\"" >> "$conf"
|
|
|
|
echo " destination: \"\"" >> "$conf"
|
2015-02-12 20:43:53 +01:00
|
|
|
}
|
2015-01-29 05:12:17 +01:00
|
|
|
|
2015-02-13 21:38:41 +01:00
|
|
|
write_calamares_users_conf(){
|
|
|
|
local conf="$1/etc/calamares/modules/users.conf"
|
|
|
|
echo "---" > "$conf"
|
|
|
|
echo "userGroup: users" >> "$conf"
|
|
|
|
echo "defaultGroups:" >> "$conf"
|
2015-02-13 22:07:41 +01:00
|
|
|
local IFS=','
|
2015-02-13 21:38:41 +01:00
|
|
|
for g in ${addgroups[@]};do
|
|
|
|
echo " - $g" >> "$conf"
|
|
|
|
done
|
2015-02-13 22:07:41 +01:00
|
|
|
unset IFS
|
2015-02-13 21:38:41 +01:00
|
|
|
echo "autologinGroup: autologin" >> "$conf"
|
|
|
|
echo "sudoersGroup: wheel" >> "$conf"
|
|
|
|
}
|
|
|
|
|
2015-03-28 06:54:13 +01:00
|
|
|
brand_calamares_settings_conf(){
|
|
|
|
local conf="$1/usr/share/calamares/settings.conf"
|
|
|
|
local branding="$1/usr/share/calamares/branding/manjaro-${custom}"
|
|
|
|
if [[ -d $branding ]];then
|
|
|
|
sed -i -e "s|branding: manjaro|branding: manjaro-${custom}|g" "$conf"
|
|
|
|
fi
|
|
|
|
}
|
|
|
|
|
2015-01-29 05:12:17 +01:00
|
|
|
configure_calamares(){
|
2015-02-13 01:21:57 +01:00
|
|
|
if [[ -f $1/usr/bin/calamares ]];then
|
|
|
|
msg2 "Configuring Calamares ..."
|
|
|
|
mkdir -p $1/etc/calamares/modules
|
2015-02-19 21:52:12 +01:00
|
|
|
write_calamares_bootloader_conf $1
|
2015-02-13 01:21:57 +01:00
|
|
|
write_calamares_unpack_conf $1
|
|
|
|
write_calamares_dm_conf $1
|
|
|
|
write_calamares_initcpio_conf $1
|
2015-03-28 06:54:13 +01:00
|
|
|
brand_calamares_settings_conf $1
|
2015-02-13 01:21:57 +01:00
|
|
|
if [[ ${initsys} == 'openrc' ]];then
|
|
|
|
write_calamares_machineid_conf $1
|
|
|
|
write_calamares_finished_conf $1
|
|
|
|
fi
|
|
|
|
write_calamares_services_conf $1
|
2015-02-13 21:38:41 +01:00
|
|
|
write_calamares_users_conf $1
|
|
|
|
|
2015-02-13 01:21:57 +01:00
|
|
|
mkdir -p $1/home/${username}/Desktop
|
2015-03-22 11:19:50 +01:00
|
|
|
if [[ -f $1/usr/bin/kdesu ]];then
|
|
|
|
sed -i -e 's|sudo|kdesu|g' $1/usr/share/applications/calamares.desktop
|
|
|
|
fi
|
2015-02-13 01:21:57 +01:00
|
|
|
cp $1/usr/share/applications/calamares.desktop $1/home/${username}/Desktop/calamares.desktop
|
|
|
|
chmod a+x $1/home/${username}/Desktop/calamares.desktop
|
|
|
|
fi
|
2015-01-29 05:12:17 +01:00
|
|
|
}
|
|
|
|
|
|
|
|
configure_thus(){
|
2015-02-13 01:21:57 +01:00
|
|
|
if [[ -f $1/usr/bin/thus ]];then
|
|
|
|
msg2 "Configuring Thus ..."
|
2015-04-20 22:16:56 +02:00
|
|
|
source "$1/etc/mkinitcpio.d/${kernel}.preset"
|
2015-02-13 01:21:57 +01:00
|
|
|
local conf="$1/etc/thus.conf"
|
2015-03-21 23:27:38 +01:00
|
|
|
echo "[distribution]" > "$conf"
|
|
|
|
echo "DISTRIBUTION_NAME = \"${dist_name} Linux\"" >> "$conf"
|
|
|
|
echo "DISTRIBUTION_VERSION = \"${dist_release}\"" >> "$conf"
|
|
|
|
echo "SHORT_NAME = \"${dist_name}\"" >> "$conf"
|
|
|
|
echo "[install]" >> "$conf"
|
|
|
|
echo "LIVE_MEDIA_SOURCE = \"/bootmnt/${iso_name}/${arch}/root-image.sqfs\"" >> "$conf"
|
|
|
|
echo "LIVE_MEDIA_DESKTOP = \"/bootmnt/${iso_name}/${arch}/${custom}-image.sqfs\"" >> "$conf"
|
|
|
|
echo "LIVE_MEDIA_TYPE = \"squashfs\"" >> "$conf"
|
|
|
|
echo "LIVE_USER_NAME = \"${username}\"" >> "$conf"
|
|
|
|
echo "KERNEL = \"${kernel}\"" >> "$conf"
|
2015-04-20 15:59:49 +02:00
|
|
|
echo "VMLINUZ = \"$(echo ${ALL_kver} | sed s'|/boot/||')\"" >> "$conf"
|
|
|
|
echo "INITRAMFS = \"$(echo ${default_image} | sed s'|/boot/||')\"" >> "$conf"
|
|
|
|
echo "FALLBACK = \"$(echo ${fallback_image} | sed s'|/boot/||')\"" >> "$conf"
|
2015-02-13 01:21:57 +01:00
|
|
|
mkdir -p $1/home/${username}/Desktop
|
2015-03-22 11:19:50 +01:00
|
|
|
if [[ -f $1/usr/bin/kdesu ]];then
|
|
|
|
sed -i -e 's|sudo|kdesu|g' $1/usr/share/applications/thus.desktop
|
|
|
|
fi
|
2015-02-13 01:21:57 +01:00
|
|
|
cp $1/usr/share/applications/thus.desktop $1/home/${username}/Desktop/thus.desktop
|
|
|
|
chmod a+x $1/home/${username}/Desktop/thus.desktop
|
|
|
|
fi
|
2015-01-29 05:12:17 +01:00
|
|
|
}
|
2015-03-01 17:24:27 +01:00
|
|
|
|
|
|
|
configure_cli(){
|
2015-03-01 21:54:36 +01:00
|
|
|
if [[ -f $1/usr/bin/setup ]]||[[ -L $1/usr/bin/setup ]];then
|
2015-03-01 17:24:27 +01:00
|
|
|
msg2 "Configuring cli-installer ..."
|
2015-03-01 22:08:47 +01:00
|
|
|
if [[ ! -f $1/home/${username}/Desktop/installer-launcher-cli.desktop ]];then
|
|
|
|
cp $1/etc/skel/Desktop/installer-launcher-cli.desktop \
|
|
|
|
$1/home/${username}/Desktop/installer-launcher-cli.desktop
|
|
|
|
fi
|
|
|
|
chmod a+x $1/home/${username}/Desktop/installer-launcher-cli.desktop
|
2015-03-01 17:24:27 +01:00
|
|
|
fi
|
|
|
|
}
|