fixes and tweaks

This commit is contained in:
udeved 2015-01-29 07:24:30 +01:00
parent 0db6d71897
commit 553a92d601
3 changed files with 188 additions and 235 deletions

View file

@ -10,109 +10,65 @@
# GNU General Public License for more details. # GNU General Public License for more details.
write_calamares_machineid_conf(){ write_calamares_machineid_conf(){
local _conf="$1/etc/calamares/modules/machineid.conf" local conf="$1/etc/calamares/modules/machineid.conf"
echo "systemd: false" > $_conf echo "systemd: false" > $conf
echo "dbus: true" >> $_conf echo "dbus: true" >> $conf
echo "symlink: false" >> $_conf echo "symlink: false" >> $conf
} }
write_calamares_dm_conf(){ write_calamares_dm_conf(){
# write the conf to overlay-image/etc/calamares ? # write the conf to livecd-image/etc/calamares ?
local cdm="$1/etc/calamares/modules/displaymanager.conf" local conf="$1/etc/calamares/modules/displaymanager.conf"
echo "displaymanagers:" > "$cdm" echo "displaymanagers:" > "$conf"
echo " - ${displaymanager}" >> "$cdm" echo " - ${displaymanager}" >> "$conf"
echo '' >> "$cdm" echo '' >> "$conf"
echo '#executable: "startkde"' >> "$cdm" echo '#executable: "startkde"' >> "$conf"
echo '#desktopFile: "plasma"' >> "$cdm" echo '#desktopFile: "plasma"' >> "$conf"
echo '' >> "$cdm" echo '' >> "$conf"
echo "basicSetup: false" >> "$cdm" echo "basicSetup: false" >> "$conf"
} }
write_calamares_initcpio_conf(){ write_calamares_initcpio_conf(){
local INITCPIO="$1/usr/share/calamares/modules/initcpio.conf" local conf="$1/usr/share/calamares/modules/initcpio.conf"
if [ ! -e $INITCPIO ] ; then if [ ! -e $conf ] ; then
echo "---" > "$INITCPIO" echo "---" > "$conf"
echo "kernel: ${manjaro_kernel}" >> "$INITCPIO" echo "kernel: ${manjaro_kernel}" >> "$conf"
else
sed -e "s|_kernel_|$manjaro_kernel|g" -i "$conf"
fi fi
} }
configure_installer () { configure_installer () {
cmd=$(echo "QT_STYLE_OVERRIDE=gtk" >> /etc/environment) sed -i "s|_root-image_|/bootmnt/${install_dir}/${arch}/root-image.sqfs|g" $1
if [ -e "$1" ] ; then sed -i "s|_desktop-image_|/bootmnt/${install_dir}/${arch}/${custom}-image.sqfs|g" $1
sed -i "s|_root-image_|/bootmnt/${install_dir}/_ARCH_/root-image.sqfs|g" $1 echo "QT_STYLE_OVERRIDE=gtk" >> /etc/environment
if [ -e "/bootmnt/${install_dir}/${arch}/xfce-image.sqfs" ] ; then
sed -i "s|_desktop-image_|/bootmnt/${install_dir}/_ARCH_/xfce-image.sqfs|g" $1
$cmd
fi
if [ -e "/bootmnt/${install_dir}/${arch}/gnome-image.sqfs" ] ; then
sed -i "s|_desktop-image_|/bootmnt/${install_dir}/_ARCH_/gnome-image.sqfs|g" $1
$cmd
fi
if [ -e "/bootmnt/${install_dir}/${arch}/cinnamon-image.sqfs" ] ; then
sed -i "s|_desktop-image_|/bootmnt/${install_dir}/_ARCH_/cinnamon-image.sqfs|g" $1
$cmd
fi
if [ -e "/bootmnt/${install_dir}/${arch}/openbox-image.sqfs" ] ; then
sed -i "s|_desktop-image_|/bootmnt/${install_dir}/_ARCH_/openbox-image.sqfs|g" $1
$cmd
fi
if [ -e "/bootmnt/${install_dir}/${arch}/mate-image.sqfs" ] ; then
sed -i "s|_desktop-image_|/bootmnt/${install_dir}/_ARCH_/mate-image.sqfs|g" $1
$cmd
fi
if [ -e "/bootmnt/${install_dir}/${arch}/kde-image.sqfs" ] ; then
sed -i "s|_desktop-image_|/bootmnt/${install_dir}/_ARCH_/kde-image.sqfs|g" $1
fi
if [ -e "/bootmnt/${install_dir}/${arch}/lxde-image.sqfs" ] ; then
sed -i "s|_desktop-image_|/bootmnt/${install_dir}/_ARCH_/lxde-image.sqfs|g" $1
$cmd
fi
if [ -e "/bootmnt/${install_dir}/${arch}/lxqt-image.sqfs" ] ; then
sed -i "s|_desktop-image_|/bootmnt/${install_dir}/_ARCH_/lxqt-image.sqfs|g" $1
fi
if [ -e "/bootmnt/${install_dir}/${arch}/enlightenment-image.sqfs" ] ; then
sed -i "s|_desktop-image_|/bootmnt/${install_dir}/_ARCH_/enlightenment-image.sqfs|g" $1
$cmd
fi
if [ -e "/bootmnt/${install_dir}/${arch}/pekwm-image.sqfs" ] ; then
sed -i "s|_desktop-image_|/bootmnt/${install_dir}/_ARCH_/pekwm-image.sqfs|g" $1
$cmd
fi
if [ -e "/bootmnt/${install_dir}/${arch}/custom-image.sqfs" ] ; then
sed -i "s|_desktop-image_|/bootmnt/${install_dir}/_ARCH_/custom-image.sqfs|g" $1
fi
if [ "${arch}" == "i686" ] ; then
sed -i "s|_ARCH_|i686|g" $1
else
sed -i "s|_ARCH_|x86_64|g" $1
fi
fi
} }
configure_calamares(){ configure_calamares(){
if [[ -f $1/usr/bin/calamares ]];then if [[ -f $1/usr/bin/calamares ]];then
msg2 "Configuring Calamares ..." msg2 "Configuring Calamares ..."
mkdir -p $1/etc/calamares/modules mkdir -p $1/etc/calamares/modules
local UNPACKFS="$1/usr/share/calamares/modules/unpackfs.conf" local conf="$1/usr/share/calamares/modules/unpackfs.conf"
if [ ! -e $UNPACKFS ] ; then if [ ! -e $conf ] ; then
echo "---" > "$UNPACKFS" echo "---" > "$conf"
echo "unpack:" >> "$UNPACKFS" echo "unpack:" >> "$conf"
echo " - source: \"/bootmnt/${install_dir}/${arch}/root-image.sqfs\"" >> "$UNPACKFS" echo " - source: \"/bootmnt/${install_dir}/${arch}/root-image.sqfs\"" >> "$conf"
echo " sourcefs: \"squashfs\"" >> "$UNPACKFS" echo " sourcefs: \"squashfs\"" >> "$conf"
echo " destination: \"\"" >> "$UNPACKFS" echo " destination: \"\"" >> "$conf"
echo " - source: \"/bootmnt/${install_dir}/${arch}/${desktop}-image.sqfs\"" >> "$UNPACKFS" echo " - source: \"/bootmnt/${install_dir}/${arch}/${custom}-image.sqfs\"" >> "$conf"
echo " sourcefs: \"squashfs\"" >> "$UNPACKFS" echo " sourcefs: \"squashfs\"" >> "$conf"
echo " destination: \"\"" >> "$UNPACKFS" echo " destination: \"\"" >> "$conf"
else
configure_installer "$conf"
fi fi
write_calamares_dm_conf $1 write_calamares_dm_conf $1
write_calamares_initcpio_conf $1 write_calamares_initcpio_conf $1
[[ "${initsys}" == "openrc" ]] && write_calamares_machineid_conf $1 [[ "${initsys}" -eq "openrc" ]] && write_calamares_machineid_conf $1
configure_installer "$UNPACKFS"
mkdir -p $1/home/${username}/Desktop mkdir -p $1/home/${username}/Desktop
cp $1/usr/share/applications/calamares.desktop $1/home/${username}/Desktop/calamares.desktop cp $1/usr/share/applications/calamares.desktop $1/home/${username}/Desktop/calamares.desktop
chmod a+x $1/home/${username}/Desktop/calamares.desktop chmod a+x $1/home/${username}/Desktop/calamares.desktop
@ -122,11 +78,11 @@ configure_calamares(){
configure_thus(){ configure_thus(){
if [[ -f $1/usr/bin/thus ]];then if [[ -f $1/usr/bin/thus ]];then
msg2 "Configuring Thus ..." msg2 "Configuring Thus ..."
local conf_file="$1/etc/thus.conf" local conf="$1/etc/thus.conf"
local rel=$(cat $1/etc/lsb-release | grep DISTRIB_RELEASE | cut -d= -f2) local rel=$(cat $1/etc/lsb-release | grep DISTRIB_RELEASE | cut -d= -f2)
sed -i "s|_version_|$rel|g" $conf_file sed -i "s|_version_|$rel|g" $conf
sed -i "s|_kernel_|$manjaro_kernel|g" $conf_file sed -i "s|_kernel_|$manjaro_kernel|g" $conf
configure_installer "$conf_file" configure_installer "$conf"
mkdir -p $1/home/${username}/Desktop mkdir -p $1/home/${username}/Desktop
cp $1/usr/share/applications/thus.desktop $1/home/${username}/Desktop/thus.desktop cp $1/usr/share/applications/thus.desktop $1/home/${username}/Desktop/thus.desktop
chmod a+x $1/home/${username}/Desktop/thus.desktop chmod a+x $1/home/${username}/Desktop/thus.desktop

View file

@ -235,13 +235,13 @@ configure_displaymanager(){
;; ;;
esac esac
if [ ${initsys} == 'openrc' ];then if [[ ${initsys} -eq "openrc" ]];then
local _conf_xdm='DISPLAYMANAGER="'${displaymanager}'"' local conf='DISPLAYMANAGER="'${displaymanager}'"'
sed -i -e "s|^.*DISPLAYMANAGER=.*|${_conf_xdm}|" $1/etc/conf.d/xdm sed -i -e "s|^.*DISPLAYMANAGER=.*|${conf}|" $1/etc/conf.d/xdm
[[ ! -d $1/etc/runlevels/default ]] && mkdir -p $1/etc/runlevels/default [[ ! -d $1/etc/runlevels/default ]] && mkdir -p $1/etc/runlevels/default
chroot $1 rc-update add xdm default &> /dev/null chroot $1 rc-update add xdm default &> /dev/null
else else
if [ -e $1/etc/plymouth/plymouthd.conf ] ; then if [[ -f $1/etc/plymouth/plymouthd.conf ]] ; then
chroot $1 systemctl enable ${displaymanager}-plymouth &> /dev/null chroot $1 systemctl enable ${displaymanager}-plymouth &> /dev/null
else else
chroot $1 systemctl enable ${displaymanager} &> /dev/null chroot $1 systemctl enable ${displaymanager} &> /dev/null

View file

@ -74,11 +74,9 @@ copy_livecd_helpers(){
msg2 "Copying livecd helpers ..." msg2 "Copying livecd helpers ..."
[[ ! -d $1 ]] && mkdir -p $1 [[ ! -d $1 ]] && mkdir -p $1
cp ${LIBDIR}/util-livecd.sh $1 cp ${LIBDIR}/util-livecd.sh $1
cp ${LIBDIR}/util-livecd-calamares.sh $1
cp ${LIBDIR}/util-msg.sh $1 cp ${LIBDIR}/util-msg.sh $1
# cp ${LIBDIR}/util-mount.sh $1
cp ${LIBDIR}/util.sh $1 cp ${LIBDIR}/util.sh $1
# cp ${LIBDIR}/util-mount.sh $1
if [[ -f ${USER_CONFIG}/manjaro-tools.conf ]]; then if [[ -f ${USER_CONFIG}/manjaro-tools.conf ]]; then
msg2 "Copying ${USER_CONFIG}/manjaro-tools.conf ..." msg2 "Copying ${USER_CONFIG}/manjaro-tools.conf ..."
@ -587,7 +585,7 @@ make_isolinux() {
fi fi
} }
generate_isomounts(){ gen_isomounts(){
echo '# syntax: <img> <arch> <mount point> <type> <kernel argument>' > $1 echo '# syntax: <img> <arch> <mount point> <type> <kernel argument>' > $1
echo '# Sample kernel argument in syslinux: overlay=extra,extra2' >> $1 echo '# Sample kernel argument in syslinux: overlay=extra,extra2' >> $1
echo '' >> $1 echo '' >> $1
@ -614,12 +612,11 @@ generate_isomounts(){
echo "${arch}/root-image.sqfs ${arch} / squashfs" >> $1 echo "${arch}/root-image.sqfs ${arch} / squashfs" >> $1
} }
# Process isomounts
make_isomounts() { make_isomounts() {
if [[ ! -e ${work_dir}/build.${FUNCNAME} ]]; then if [[ ! -e ${work_dir}/build.${FUNCNAME} ]]; then
msg "Creating [isomounts]" msg "Creating [isomounts]"
generate_isomounts "${work_dir}/iso/${install_dir}/isomounts" gen_isomounts "${work_dir}/iso/${install_dir}/isomounts"
: > ${work_dir}/build.${FUNCNAME} : > ${work_dir}/build.${FUNCNAME}
@ -677,8 +674,8 @@ load_profile(){
custom=${packages_custom#*-} custom=${packages_custom#*-}
custom=${custom,,} custom=${custom,,}
displaymanager=$(cat displaymanager) displaymanager="$(cat displaymanager)"
initsys=$(cat initsys) initsys="$(cat initsys)"
iso_file="${img_name}-${custom}-${iso_version}-${arch}.iso" iso_file="${img_name}-${custom}-${iso_version}-${arch}.iso"
@ -694,7 +691,6 @@ load_profile(){
} }
compress_images(){ compress_images(){
make_isomounts
make_iso make_iso
make_checksum "${iso_file}" make_checksum "${iso_file}"
} }
@ -729,6 +725,7 @@ build_images(){
make_efiboot make_efiboot
fi fi
make_isolinux make_isolinux
make_isomounts
} }
build_profile(){ build_profile(){