From 89613eafa680ca4624f3e404f27bd330dec66fb9 Mon Sep 17 00:00:00 2001 From: udeved Date: Wed, 3 Aug 2016 22:15:16 +0200 Subject: [PATCH 01/17] util-iso-cal: add support for openrc netinstall --- data/profile.conf.example | 2 +- lib/util-iso-calamares.sh | 20 ++++++++++++-------- lib/util.sh | 2 +- 3 files changed, 14 insertions(+), 10 deletions(-) diff --git a/data/profile.conf.example b/data/profile.conf.example index d6066cc..9d0f8f7 100644 --- a/data/profile.conf.example +++ b/data/profile.conf.example @@ -41,7 +41,7 @@ # cal_netinstall="false" # the default url for the netinstall.yaml -# cal_netgroups="https://raw.githubusercontent.com/calamares/calamares-manjaro/master/netinstall.yaml" +# cal_netgroups="https://raw.githubusercontent.com/calamares/calamares-manjaro/master" # configure calamares to use chrootcfg instead of unpackfs # cal_unpackfs="true" diff --git a/lib/util-iso-calamares.sh b/lib/util-iso-calamares.sh index cf8346c..363bed6 100644 --- a/lib/util-iso-calamares.sh +++ b/lib/util-iso-calamares.sh @@ -195,8 +195,6 @@ write_settings_conf(){ echo " - networkcfg" >> "$conf" echo " - packages" >> "$conf" else - # take out networkcfg once a new PR has been merged - echo " - networkcfg" >> "$conf" echo " - chrootcfg" >> "$conf" fi else @@ -233,21 +231,25 @@ write_settings_conf(){ } write_chrootcfg_conf(){ - local conf="$1/etc/calamares/modules/chrootcfg.conf" + local conf="$1/etc/calamares/modules/chrootcfg.conf" mode='"0o755"' echo "---" > "$conf" echo "directories:" >> "$conf" echo " - name: /etc" >> "$conf" - echo " mode: 755" >> "$conf" + echo " mode: ${mode}" >> "$conf" echo " - name: /var/log" >> "$conf" - echo " mode: 755" >> "$conf" + echo " mode: ${mode}" >> "$conf" echo " - name: /var/cache/pacman/pkg" >> "$conf" - echo " mode: 755" >> "$conf" + echo " mode: ${mode}" >> "$conf" echo " - name: /var/lib/pacman" >> "$conf" - echo " mode: 755" >> "$conf" + echo " mode: ${mode}" >> "$conf" echo '' >> "$conf" echo "requirements:" >> "$conf" echo " - pacman" >> "$conf" echo " - ${kernel}" >> "$conf" + if [[ ${initsys} == 'openrc' ]]; then + echo " - eudev-systemdcompat" >> "$conf" + echo " - udev-openrc" >> "$conf" + fi echo '' >> "$conf" echo "keyrings:" >> "$conf" echo " - archlinux" >> "$conf" @@ -258,8 +260,10 @@ write_chrootcfg_conf(){ write_netinstall_conf(){ local conf="$1/etc/calamares/modules/netinstall.conf" + local yaml="netinstall.yaml" + [[ ${initsys} == 'openrc' ]] && yaml="netinstall-${initsys}.yaml" echo "---" > "$conf" - echo "groupsUrl: ${cal_netgroups}" >> "$conf" + echo "groupsUrl: ${cal_netgroups}/${yaml}" >> "$conf" } configure_calamares(){ diff --git a/lib/util.sh b/lib/util.sh index bc33a80..738adaf 100644 --- a/lib/util.sh +++ b/lib/util.sh @@ -441,7 +441,7 @@ load_profile_config(){ [[ -z ${cal_unpackfs} ]] && cal_unpackfs='true' - [[ -z ${cal_netgroups} ]] && cal_netgroups="https://raw.githubusercontent.com/calamares/calamares-manjaro/master/netinstall.yaml" + [[ -z ${cal_netgroups} ]] && cal_netgroups="https://raw.githubusercontent.com/calamares/calamares-manjaro/master" check_profile_vars From 660d27b92d99ee75e341b2a5d3e79caf843ff56b Mon Sep 17 00:00:00 2001 From: udeved Date: Thu, 4 Aug 2016 09:59:47 +0200 Subject: [PATCH 02/17] buildiso: rename services vars to make it consistent --- bin/buildiso.in | 8 ++++---- data/profile.conf.example | 14 ++++++++------ docbook/manjaro-tools.conf.xml | 4 ++-- docbook/profile.conf.xml | 8 ++++---- lib/util-iso-calamares.sh | 20 ++++++++------------ lib/util-iso-image.sh | 8 ++++---- lib/util-iso.sh | 8 ++++---- lib/util.sh | 16 ++++++++-------- 8 files changed, 42 insertions(+), 44 deletions(-) diff --git a/bin/buildiso.in b/bin/buildiso.in index 79719d2..1c1cd21 100755 --- a/bin/buildiso.in +++ b/bin/buildiso.in @@ -48,12 +48,12 @@ show_profile(){ msg2 "addgroups: %s" "${addgroups}" if [[ ${initsys} == 'systemd' ]];then - msg2 "start_systemd: %s" "${start_systemd[*]}" - msg2 "start_systemd_live: %s" "${start_systemd_live[*]}" + msg2 "enable_systemd: %s" "${enable_systemd[*]}" + msg2 "enable_systemd_live: %s" "${enable_systemd_live[*]}" msg2 "disable_systemd: %s" "${disable_systemd[*]}" else - msg2 "start_openrc: %s" "${start_openrc[*]}" - msg2 "start_openrc_live: %s" "${start_openrc_live[*]}" + msg2 "enable_openrc: %s" "${enable_openrc[*]}" + msg2 "enable_openrc_live: %s" "${enable_openrc_live[*]}" msg2 "disable_openrc: %s" "${disable_openrc[*]}" fi if ${torrent};then diff --git a/data/profile.conf.example b/data/profile.conf.example index 9d0f8f7..8a1ec58 100644 --- a/data/profile.conf.example +++ b/data/profile.conf.example @@ -51,11 +51,13 @@ # unset defaults to given values # names must match systemd service names -# start_systemd=('bluetooth' 'cronie' 'ModemManager' 'NetworkManager' 'org.cups.cupsd' 'tlp' 'tlp-sleep') +# enable_systemd=('bluetooth' 'cronie' 'ModemManager' 'NetworkManager' 'org.cups.cupsd' 'tlp' 'tlp-sleep') +# disable_systemd=() # unset defaults to given values, # names must match openrc service names -# start_openrc=('acpid' 'bluetooth' 'consolekit' 'cronie' 'cupsd' 'dbus' 'syslog-ng' 'NetworkManager') +# enable_openrc=('acpid' 'bluetooth' 'consolekit' 'cronie' 'cupsd' 'dbus' 'syslog-ng' 'NetworkManager') +# disable_openrc=() ################# live-session ################# @@ -76,10 +78,10 @@ # unset defaults to given values # names must match systemd service names -# services in start_systemd array don't need to be listed here -# start_systemd_live=('manjaro-live' 'mhwd-live' 'pacman-init') +# services in enable_systemd array don't need to be listed here +# enable_systemd_live=('manjaro-live' 'mhwd-live' 'pacman-init' 'mirrors-live') # unset defaults to given values, # names must match openrc service names -# services in start_openrc array don't need to be listed here -# start_openrc_live=('manjaro-live' 'mhwd-live' 'pacman-init') +# services in enable_openrc array don't need to be listed here +# enable_openrc_live=('manjaro-live' 'mhwd-live' 'pacman-init' 'mirrors-live') diff --git a/docbook/manjaro-tools.conf.xml b/docbook/manjaro-tools.conf.xml index 0d70fe0..dc2a9be 100644 --- a/docbook/manjaro-tools.conf.xml +++ b/docbook/manjaro-tools.conf.xml @@ -266,8 +266,8 @@ Takes (the default) or . Selecting and option will change how the hostname, the displaymanager and services will be configured. - For services also controls if buildiso will use start_systemd and - start_systemd_live or start_openrc and start_openrc_live to determine + For services also controls if buildiso will use enable_systemd and + enable_systemd_live or enable_openrc and enable_openrc_live to determine the default services that will be enabled automatically. diff --git a/docbook/profile.conf.xml b/docbook/profile.conf.xml index cb143dd..f2d43b6 100644 --- a/docbook/profile.conf.xml +++ b/docbook/profile.conf.xml @@ -184,7 +184,7 @@ - start_systemd= + enable_systemd= Array of services that will be enabled in systemd systems. It has to match @@ -193,7 +193,7 @@ - start_openrc= + enable_openrc= Array of services that will be enabled in openrc systems. @@ -241,7 +241,7 @@ - start_systemd_live= + enable_systemd_live= Array of services that will be enabled in the systemd live-cd. It has to match @@ -250,7 +250,7 @@ - start_openrc_live= + enable_openrc_live= Array of services that will be enabled in the openrc live-cd. diff --git a/lib/util-iso-calamares.sh b/lib/util-iso-calamares.sh index 363bed6..3871d66 100644 --- a/lib/util-iso-calamares.sh +++ b/lib/util-iso-calamares.sh @@ -57,24 +57,20 @@ write_services_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" + for s in ${enable_openrc[@]};do + echo ' enabled:' >> "$conf" + echo ' - name: '"$s" >> "$conf" + echo ' runlevel: default' >> "$conf" done - echo 'targets:' >> "$conf" - echo ' - name: "graphical"' >> "$conf" - echo ' mandatory: false' >> "$conf" - echo '' >> "$conf" - echo 'disable:' >> "$conf" for s in ${disable_openrc[@]};do - echo ' - name: '"$s" >> "$conf" - echo ' mandatory: false' >> "$conf" + echo ' disabled:' >> "$conf" + echo ' - name: '"$s" >> "$conf" + echo ' runlevel: boot' >> "$conf" echo '' >> "$conf" done else echo 'services:' > "$conf" - for s in ${start_systemd[@]};do + for s in ${enable_systemd[@]};do echo ' - name: '"$s" >> "$conf" echo ' mandatory: false' >> "$conf" echo '' >> "$conf" diff --git a/lib/util-iso-image.sh b/lib/util-iso-image.sh index 63a3547..0dd878d 100644 --- a/lib/util-iso-image.sh +++ b/lib/util-iso-image.sh @@ -323,7 +323,7 @@ configure_services(){ info "Configuring [%s]" "${initsys}" case ${initsys} in 'openrc') - for svc in ${start_openrc[@]}; do + for svc in ${enable_openrc[@]}; do add_svc_rc "$1" "$svc" done if [[ ${displaymanager} != "none" ]];then @@ -332,7 +332,7 @@ configure_services(){ fi ;; 'systemd') - for svc in ${start_systemd[@]}; do + for svc in ${enable_systemd[@]}; do add_svc_sd "$1" "$svc" done if [[ ${displaymanager} != "none" ]];then @@ -347,12 +347,12 @@ configure_services_live(){ info "Configuring [%s]" "${initsys}" case ${initsys} in 'openrc') - for svc in ${start_openrc_live[@]}; do + for svc in ${enable_openrc_live[@]}; do add_svc_rc "$1" "$svc" done ;; 'systemd') - for svc in ${start_systemd_live[@]}; do + for svc in ${enable_systemd_live[@]}; do add_svc_sd "$1" "$svc" done ;; diff --git a/lib/util-iso.sh b/lib/util-iso.sh index 310378f..3530124 100644 --- a/lib/util-iso.sh +++ b/lib/util-iso.sh @@ -664,12 +664,12 @@ reset_profile(){ unset plymouth_theme unset password unset addgroups - unset start_systemd + unset enable_systemd unset disable_systemd - unset start_openrc + unset enable_openrc unset disable_openrc - unset start_systemd_live - unset start_openrc_live + unset enable_systemd_live + unset enable_openrc_live unset packages_custom unset packages_mhwd unset login_shell diff --git a/lib/util.sh b/lib/util.sh index 738adaf..fb0732b 100644 --- a/lib/util.sh +++ b/lib/util.sh @@ -413,24 +413,24 @@ load_profile_config(){ addgroups="video,power,disk,storage,optical,network,lp,scanner,wheel" fi - if [[ -z ${start_systemd[@]} ]];then - start_systemd=('bluetooth' 'cronie' 'ModemManager' 'NetworkManager' 'org.cups.cupsd' 'tlp' 'tlp-sleep') + if [[ -z ${enable_systemd[@]} ]];then + enable_systemd=('bluetooth' 'cronie' 'ModemManager' 'NetworkManager' 'org.cups.cupsd' 'tlp' 'tlp-sleep') fi [[ -z ${disable_systemd[@]} ]] && disable_systemd=('pacman-init') - if [[ -z ${start_openrc[@]} ]];then - start_openrc=('acpid' 'bluetooth' 'cgmanager' 'consolekit' 'cronie' 'cupsd' 'dbus' 'syslog-ng' 'NetworkManager') + if [[ -z ${enable_openrc[@]} ]];then + enable_openrc=('acpid' 'bluetooth' 'cgmanager' 'consolekit' 'cronie' 'cupsd' 'dbus' 'syslog-ng' 'NetworkManager') fi [[ -z ${disable_openrc[@]} ]] && disable_openrc=('pacman-init') - if [[ -z ${start_systemd_live[@]} ]];then - start_systemd_live=('manjaro-live' 'mhwd-live' 'pacman-init') + if [[ -z ${enable_systemd_live[@]} ]];then + enable_systemd_live=('manjaro-live' 'mhwd-live' 'pacman-init') fi - if [[ -z ${start_openrc_live[@]} ]];then - start_openrc_live=('manjaro-live' 'mhwd-live' 'pacman-init') + if [[ -z ${enable_openrc_live[@]} ]];then + enable_openrc_live=('manjaro-live' 'mhwd-live' 'pacman-init') fi [[ -z ${tracker_url} ]] && tracker_url='udp://mirror.strits.dk:6969' From e890543166b18d7d4caa99e91772555104cec823 Mon Sep 17 00:00:00 2001 From: udeved Date: Thu, 4 Aug 2016 15:45:08 +0200 Subject: [PATCH 03/17] buildiso: confiure only live-image, the target install will be configured by CAL --- lib/util-iso-image.sh | 108 ++++++++++++++++-------------------------- lib/util-iso.sh | 2 - 2 files changed, 40 insertions(+), 70 deletions(-) diff --git a/lib/util-iso-image.sh b/lib/util-iso-image.sh index 0dd878d..3905f56 100644 --- a/lib/util-iso-image.sh +++ b/lib/util-iso-image.sh @@ -147,7 +147,8 @@ set_sddm_ck(){ name=${g##*/} name=${name%%.*} case ${name} in - 'lightdm-deepin-greeter'|'lightdm-kde-greeter') + lightdm-gtk-greeter) break ;; + lightdm-*-greeter) sed -i -e "s/^.*greeter-session=.*/greeter-session=${name}/" $1/etc/lightdm/lightdm.conf ;; esac @@ -280,11 +281,6 @@ configure_logind(){ local conf=$1/etc/systemd/logind.conf sed -i 's/#\(HandleSuspendKey=\)suspend/\1ignore/' "$conf" sed -i 's/#\(HandleLidSwitch=\)suspend/\1ignore/' "$conf" -} - -configure_logind_live(){ - msg2 "Configuring logind ..." - local conf=$1/etc/systemd/logind.conf sed -i 's/#\(HandleHibernateKey=\)hibernate/\1ignore/' "$conf" } @@ -330,6 +326,9 @@ configure_services(){ set_xdm "$1" add_svc_rc "$1" "xdm" fi + for svc in ${enable_openrc_live[@]}; do + add_svc_rc "$1" "$svc" + done ;; 'systemd') for svc in ${enable_systemd[@]}; do @@ -338,20 +337,6 @@ configure_services(){ if [[ ${displaymanager} != "none" ]];then add_svc_sd "$1" "$(get_svc_dm $1)" fi - ;; - esac - info "Done configuring [%s]" "${initsys}" -} - -configure_services_live(){ - info "Configuring [%s]" "${initsys}" - case ${initsys} in - 'openrc') - for svc in ${enable_openrc_live[@]}; do - add_svc_rc "$1" "$svc" - done - ;; - 'systemd') for svc in ${enable_systemd_live[@]}; do add_svc_sd "$1" "$svc" done @@ -360,32 +345,6 @@ configure_services_live(){ info "Done configuring [%s]" "${initsys}" } -configure_root_image(){ - msg "Configuring [root-image]" - configure_lsb "$1" - configure_mhwd "$1" - - case ${initsys} in - 'systemd') - configure_logind "$1" - ;; - 'openrc') - configure_sysctl "$1" - rm $1/etc/runlevels/boot/hwclock - ;; - esac - msg "Done configuring [root-image]" -} - -configure_custom_image(){ - msg "Configuring [%s-image]" "${profile}" - configure_plymouth "$1" - [[ ${displaymanager} != 'none' ]] && configure_displaymanager "$1" - configure_services "$1" - configure_environment "$1" - msg "Done configuring [%s-image]" "${profile}" -} - write_live_session_conf(){ msg2 "Configuring live session ..." local path=$1${DATADIR} @@ -403,34 +362,47 @@ write_live_session_conf(){ echo "password=${password}" >> ${conf} } +configure_hostname(){ + msg2 "Configuring hostname ..." + case ${initsys} in + 'systemd') echo ${hostname} > $1/etc/hostname ;; + 'openrc') local hn='hostname="'${hostname}'"'; sed -i -e "s|^.*hostname=.*|${hn}|" $1/etc/conf.d/hostname ;; + esac +} + +configure_system(){ + case ${initsys} in + 'systemd') + configure_journald "$1" + configure_logind "$1" + + # Prevent some services to be started in the livecd + echo 'File created by manjaro-tools. See systemd-update-done.service(8).' \ + | tee "${path}/etc/.updated" >"${path}/var/.updated" + + msg2 "Disable systemd-gpt-auto-generator" + ln -sf /dev/null "${path}/usr/lib/systemd/system-generators/systemd-gpt-auto-generator" + ;; + 'openrc') + configure_sysctl "$1" + ;; + esac +} + configure_live_image(){ msg "Configuring [live-image]" configure_hosts "$1" configure_user "$1" configure_accountsservice "$1" "${username}" configure_pamac_live "$1" - case ${initsys} in - 'systemd') - configure_logind_live "$1" - configure_journald "$1" - - # Prevent some services to be started in the livecd - echo 'File created by manjaro-tools. See systemd-update-done.service(8).' \ - | tee "${path}/etc/.updated" >"${path}/var/.updated" - - msg2 "Configuring hostname ..." - echo ${hostname} > $1/etc/hostname - - msg2 "Disable systemd-gpt-auto-generator" - ln -sf /dev/null "${path}/usr/lib/systemd/system-generators/systemd-gpt-auto-generator" - ;; - 'openrc') - msg2 "Configuring hostname ..." - local _hostname='hostname="'${hostname}'"' - sed -i -e "s|^.*hostname=.*|${_hostname}|" $1/etc/conf.d/hostname - ;; - esac - configure_services_live "$1" + configure_environment "$1" + configure_plymouth "$1" + configure_lsb "$1" + configure_mhwd "$1" + [[ ${displaymanager} != 'none' ]] && configure_displaymanager "$1" + configure_hostname "$1" + configure_system "$1" + configure_services "$1" configure_calamares "$1" write_live_session_conf "$1" msg "Done configuring [live-image]" diff --git a/lib/util-iso.sh b/lib/util-iso.sh index 3530124..dfabcd2 100644 --- a/lib/util-iso.sh +++ b/lib/util-iso.sh @@ -212,7 +212,6 @@ make_image_root() { pacman -Qr "${path}" > "${path}/root-image-pkgs.txt" copy_overlay "${profile_dir}/root-overlay" "${path}" - configure_root_image "${path}" reset_pac_conf "${path}" @@ -235,7 +234,6 @@ make_image_custom() { pacman -Qr "${path}" > "${path}/${profile}-image-pkgs.txt" cp "${path}/${profile}-image-pkgs.txt" ${iso_dir}/$(gen_iso_fn)-pkgs.txt [[ -e ${profile_dir}/${profile}-overlay ]] && copy_overlay "${profile_dir}/${profile}-overlay" "${path}" - configure_custom_image "${path}" reset_pac_conf "${path}" From 274c4f1707dda2c4a4498336a4adb5478f033ef7 Mon Sep 17 00:00:00 2001 From: udeved Date: Thu, 4 Aug 2016 17:20:23 +0200 Subject: [PATCH 04/17] buildiso: move live config stuff to livecd repo --- Makefile | 1 - bin/buildiso.in | 1 - data/desktop.map | 17 ---- data/profile.conf.example | 19 ++-- docbook/profile.conf.xml | 10 --- lib/util-iso-calamares.sh | 6 +- lib/util-iso-image.sh | 182 ++++---------------------------------- lib/util-iso.sh | 5 +- lib/util.sh | 2 - 9 files changed, 30 insertions(+), 213 deletions(-) delete mode 100644 data/desktop.map diff --git a/Makefile b/Makefile index 28c2ec5..39dadce 100644 --- a/Makefile +++ b/Makefile @@ -77,7 +77,6 @@ LIBS_ISO = \ SHARED_ISO = \ data/pacman-gfx.conf \ - data/desktop.map \ data/profile.conf.example CPIOHOOKS = \ diff --git a/bin/buildiso.in b/bin/buildiso.in index 1c1cd21..98b51e7 100755 --- a/bin/buildiso.in +++ b/bin/buildiso.in @@ -39,7 +39,6 @@ show_profile(){ msg2 "cal_unpackfs: %s" "${cal_unpackfs}" msg2 "efi_boot_loader: %s" "${efi_boot_loader}" - msg2 "efi_part_size: %s" "${efi_part_size}" msg2 "hostname: %s" "${hostname}" msg2 "username: %s" "${username}" diff --git a/data/desktop.map b/data/desktop.map deleted file mode 100644 index 16620d2..0000000 --- a/data/desktop.map +++ /dev/null @@ -1,17 +0,0 @@ -openbox:openbox-session -bspwm:bspwm-session -jwm:jwm -i3:i3 -fluxbox:startfluxbox -pekwm:pekwm -plasma:startkde -gnome:gnome-session -xfce:startxfce4 -cinnamon:cinnamon-session-cinnamon -mate:mate-session -enlightenment:enlightenment_start -LXDE:lxsession -lxqt:lxqt-session -pantheon:pantheon-session -budgie-desktop:budgie-desktop -deepin:startdde diff --git a/data/profile.conf.example b/data/profile.conf.example index 8a1ec58..862c24a 100644 --- a/data/profile.conf.example +++ b/data/profile.conf.example @@ -34,9 +34,6 @@ # possible values: grub;systemd-boot # efi_boot_loader="grub" -# set uefi partition size -# efi_part_size=31M - # configure calamares for netinstall # cal_netinstall="false" @@ -59,23 +56,23 @@ # enable_openrc=('acpid' 'bluetooth' 'consolekit' 'cronie' 'cupsd' 'dbus' 'syslog-ng' 'NetworkManager') # disable_openrc=() -################# live-session ################# - # unset defaults to given value # hostname="manjaro" -# unset defaults to given value -# username="manjaro" - -# unset defaults to given value -# password="manjaro" - # the login shell # login_shell=/bin/bash # unset defaults to given values # addgroups="video,power,disk,storage,optical,network,lp,scanner,wheel" +################# live-session ################# + +# unset defaults to given value +# username="manjaro" + +# unset defaults to given value +# password="manjaro" + # unset defaults to given values # names must match systemd service names # services in enable_systemd array don't need to be listed here diff --git a/docbook/profile.conf.xml b/docbook/profile.conf.xml index f2d43b6..6e03a18 100644 --- a/docbook/profile.conf.xml +++ b/docbook/profile.conf.xml @@ -164,16 +164,6 @@ - - efi_part_size= - - Size in MiB of the fat partition where - the kernel is. This is useful if you add extra hooks - in the mkinitcpio.conf and it's to big to fit in the - partition. The default is "32M". - - - plymouth_theme= diff --git a/lib/util-iso-calamares.sh b/lib/util-iso-calamares.sh index 3871d66..c78cadd 100644 --- a/lib/util-iso-calamares.sh +++ b/lib/util-iso-calamares.sh @@ -211,7 +211,11 @@ write_settings_conf(){ echo " - hardwarecfg" >> "$conf" echo " - networkcfg" >> "$conf" echo " - hwclock" >> "$conf" - echo " - services" >> "$conf" + if [[ ${initsys} == 'systemd' ]];then + echo " - services" >> "$conf" + else + echo " - servicescfg" >> "$conf" + fi echo " - grubcfg" >> "$conf" echo " - bootloader" >> "$conf" echo " - postcfg" >> "$conf" diff --git a/lib/util-iso-image.sh b/lib/util-iso-image.sh index 3905f56..c0c5baa 100644 --- a/lib/util-iso-image.sh +++ b/lib/util-iso-image.sh @@ -18,26 +18,6 @@ copy_overlay(){ fi } -gen_pw(){ - echo $(perl -e 'print crypt($ARGV[0], "password")' ${password}) -} - -# $1: chroot -configure_user(){ - # set up user and password - msg2 "Creating user ..." - if [[ -n ${password} ]];then - chroot $1 useradd -m -G ${addgroups} -p $(gen_pw) -s ${login_shell} ${username} - else - chroot $1 useradd -m -G ${addgroups} -s ${login_shell} ${username} - fi -} - -# $1: chroot -configure_hosts(){ - sed -e "s|localhost.localdomain|localhost.localdomain ${hostname}|" -i $1/etc/hosts -} - configure_plymouth(){ if ${plymouth_boot};then msg2 "Configuring plymouth: %s" "${plymouth_theme}" @@ -60,60 +40,6 @@ add_svc_sd(){ chroot $1 systemctl enable $2 &>/dev/null fi } -# $1: chroot -configure_environment(){ - case ${profile} in - cinnamon*|deepin*|gnome|i3|lxde|mate|netbook|openbox|pantheon|xfce*) - echo "QT_STYLE_OVERRIDE=gtk" >> $1/etc/environment - if [[ -f "$1/usr/lib/qt/plugins/platformthemes/libqt5ct.so" ]];then - sed -i '/QT_STYLE_OVERRIDE=gtk/d' $1/etc/environment - echo "QT_QPA_PLATFORMTHEME=qt5ct" >> $1/etc/environment - fi - if [[ -f "$1/usr/lib/qt/plugins/styles/libqgtk2style.so" ]];then - sed -i '/QT_STYLE_OVERRIDE=gtk/d' $1/etc/environment - echo "QT_STYLE_OVERRIDE=gtk2" >> $1/etc/environment - fi - ;; - esac -} - -# $1: chroot -# $2: user -configure_accountsservice(){ - msg2 "Configuring accountsservice ..." - local path=$1/var/lib/AccountsService/users - if [ -d "${path}" ] ; then - echo "[User]" > ${path}/$2 - echo "XSession=${default_desktop_file}" >> ${path}/$2 - if [[ -f "/var/lib/AccountsService/icons/$2.png" ]];then - echo "Icon=/var/lib/AccountsService/icons/$2.png" >> ${path}/$2 - fi - fi -} - -load_desktop_map(){ - local _space="s| ||g" _clean=':a;N;$!ba;s/\n/ /g' _com_rm="s|#.*||g" \ - file=${DATADIR}/desktop.map - local desktop_map=$(sed "$_com_rm" "$file" \ - | sed "$_space" \ - | sed "$_clean") - echo ${desktop_map} -} - -detect_desktop_env(){ - local xs=$1/usr/share/xsessions ex=$1/usr/bin key val map=( $(load_desktop_map) ) - default_desktop_file="none" - default_desktop_executable="none" - for item in "${map[@]}";do - key=${item%:*} - val=${item#*:} - if [[ -f $xs/$key.desktop ]] && [[ -f $ex/$val ]];then - default_desktop_file="$key" - default_desktop_executable="$val" - fi - done - msg2 "Detected desktop environment: %s" "${default_desktop_file}" -} set_xdm(){ if [[ -f $1/etc/conf.d/xdm ]];then @@ -122,80 +48,6 @@ set_xdm(){ fi } -is_valid_de(){ - if [[ ${default_desktop_executable} != "none" ]] && \ - [[ ${default_desktop_file} != "none" ]]; then - return 0 - else - return 1 - fi -} - -set_sddm_ck(){ - local halt='/usr/bin/shutdown -h -P now' \ - reboot='/usr/bin/shutdown -r now' - sed -e "s|^.*HaltCommand=.*|HaltCommand=${halt}|" \ - -e "s|^.*RebootCommand=.*|RebootCommand=${reboot}|" \ - -e "s|^.*MinimumVT=.*|MinimumVT=7|" \ - -i "$1/etc/sddm.conf" - chroot $1 gpasswd -a sddm video &> /dev/null -} - - set_lightdm_greeter(){ - local greeters=$(ls $1/usr/share/xgreeters/*greeter.desktop) name - for g in ${greeters[@]};do - name=${g##*/} - name=${name%%.*} - case ${name} in - lightdm-gtk-greeter) break ;; - lightdm-*-greeter) - sed -i -e "s/^.*greeter-session=.*/greeter-session=${name}/" $1/etc/lightdm/lightdm.conf - ;; - esac - done - } - - set_lightdm_ck(){ - sed -i -e 's/^.*minimum-vt=.*/minimum-vt=7/' $1/etc/lightdm/lightdm.conf - sed -i -e 's/pam_systemd.so/pam_ck_connector.so nox11/' $1/etc/pam.d/lightdm-greeter - } - -# $1: chroot -configure_displaymanager(){ - msg2 "Configuring Displaymanager ..." - # Try to detect desktop environment - detect_desktop_env "$1" - # Configure display manager - case ${displaymanager} in - 'lightdm') - chroot $1 groupadd -r autologin - [[ ${initsys} == 'openrc' ]] && set_lightdm_ck "$1" - set_lightdm_greeter "$1" - if $(is_valid_de); then - sed -i -e "s/^.*user-session=.*/user-session=$default_desktop_file/" $1/etc/lightdm/lightdm.conf - fi - ;; - 'gdm') configure_accountsservice "$1" "gdm" ;; - 'mdm') - if $(is_valid_de); then - sed -i "s|default.desktop|$default_desktop_file.desktop|g" $1/etc/mdm/custom.conf - fi - ;; - 'sddm') - [[ ${initsys} == 'openrc' ]] && set_sddm_ck "$1" - if $(is_valid_de); then - sed -i -e "s|^Session=.*|Session=$default_desktop_file.desktop|" $1/etc/sddm.conf - fi - ;; - 'lxdm') - if $(is_valid_de); then - sed -i -e "s|^.*session=.*|session=/usr/bin/$default_desktop_executable|" $1/etc/lxdm/lxdm.conf - fi - ;; - esac - msg2 "Configured: ${displaymanager}" -} - # $1: chroot configure_mhwd_drivers(){ local path=$1/opt/live/pkgs/ \ @@ -249,13 +101,6 @@ chroot_clean(){ rm -rf --one-file-system "$1" } -# Remove pamac auto-update when the network is up, it locks de pacman db when booting in the livecd -# $1: chroot -configure_pamac_live() { - if [[ -f $1/etc/NetworkManager/dispatcher.d/99_update_pamac_tray ]];then - rm -f $1/etc/NetworkManager/dispatcher.d/99_update_pamac_tray - fi -} # $1: chroot configure_lsb(){ @@ -355,19 +200,24 @@ write_live_session_conf(){ echo '# autologin' >> ${conf} echo "autologin=${autologin}" >> ${conf} echo '' >> ${conf} + echo '# login shell' >> ${conf} + echo "login_shell=${login_shell}" >> ${conf} + echo '' >> ${conf} echo '# live username' >> ${conf} echo "username=${username}" >> ${conf} echo '' >> ${conf} echo '# live password' >> ${conf} echo "password=${password}" >> ${conf} + echo '' >> ${conf} + echo '# live group membership' >> ${conf} + echo "addgroups=${addgroups}" >> ${conf} + echo '' >> ${conf} + echo '# iso name' >> ${conf} + echo "iso_name=${iso_name}" >> ${conf} } -configure_hostname(){ - msg2 "Configuring hostname ..." - case ${initsys} in - 'systemd') echo ${hostname} > $1/etc/hostname ;; - 'openrc') local hn='hostname="'${hostname}'"'; sed -i -e "s|^.*hostname=.*|${hn}|" $1/etc/conf.d/hostname ;; - esac +configure_hosts(){ + sed -e "s|localhost.localdomain|localhost.localdomain ${hostname}|" -i $1/etc/hosts } configure_system(){ @@ -382,9 +232,13 @@ configure_system(){ msg2 "Disable systemd-gpt-auto-generator" ln -sf /dev/null "${path}/usr/lib/systemd/system-generators/systemd-gpt-auto-generator" + + echo ${hostname} > $1/etc/hostname ;; 'openrc') configure_sysctl "$1" + local hn='hostname="'${hostname}'"' + sed -i -e "s|^.*hostname=.*|${hn}|" $1/etc/conf.d/hostname ;; esac } @@ -392,15 +246,9 @@ configure_system(){ configure_live_image(){ msg "Configuring [live-image]" configure_hosts "$1" - configure_user "$1" - configure_accountsservice "$1" "${username}" - configure_pamac_live "$1" - configure_environment "$1" configure_plymouth "$1" configure_lsb "$1" configure_mhwd "$1" - [[ ${displaymanager} != 'none' ]] && configure_displaymanager "$1" - configure_hostname "$1" configure_system "$1" configure_services "$1" configure_calamares "$1" diff --git a/lib/util-iso.sh b/lib/util-iso.sh index dfabcd2..0c932bf 100644 --- a/lib/util-iso.sh +++ b/lib/util-iso.sh @@ -357,9 +357,9 @@ make_efi() { make_efiboot() { if [[ ! -e ${work_dir}/build.${FUNCNAME} ]]; then msg "Prepare [%s/iso/EFI]" "${iso_name}" - local path_iso="${work_dir}/iso" + local path_iso="${work_dir}/iso" size="31M" mkdir -p ${path_iso}/EFI/miso - truncate -s ${efi_part_size} ${path_iso}/EFI/miso/${iso_name}.img + truncate -s ${size} ${path_iso}/EFI/miso/${iso_name}.img mkfs.fat -n MISO_EFI ${path_iso}/EFI/miso/${iso_name}.img mkdir -p ${work_dir}/efiboot mount ${path_iso}/EFI/miso/${iso_name}.img ${work_dir}/efiboot @@ -656,7 +656,6 @@ reset_profile(){ unset plymouth_boot unset nonfree_xorg unset efi_boot_loader - unset efi_part_size unset hostname unset username unset plymouth_theme diff --git a/lib/util.sh b/lib/util.sh index fb0732b..b51976a 100644 --- a/lib/util.sh +++ b/lib/util.sh @@ -397,8 +397,6 @@ load_profile_config(){ [[ -z ${efi_boot_loader} ]] && efi_boot_loader="grub" - [[ -z ${efi_part_size} ]] && efi_part_size="31M" - [[ -z ${hostname} ]] && hostname="manjaro" [[ -z ${username} ]] && username="manjaro" From c86feb1368d5937626ad2ac54cf6aabe14317eb0 Mon Sep 17 00:00:00 2001 From: udeved Date: Thu, 4 Aug 2016 17:59:25 +0200 Subject: [PATCH 05/17] buildiso: readd DE detection and write vars to live.conf --- Makefile | 1 + data/desktop.map | 17 +++++++++++++++++ lib/util-iso-image.sh | 40 ++++++++++++++++++++++++++++++++++++++++ 3 files changed, 58 insertions(+) create mode 100644 data/desktop.map diff --git a/Makefile b/Makefile index 39dadce..28c2ec5 100644 --- a/Makefile +++ b/Makefile @@ -77,6 +77,7 @@ LIBS_ISO = \ SHARED_ISO = \ data/pacman-gfx.conf \ + data/desktop.map \ data/profile.conf.example CPIOHOOKS = \ diff --git a/data/desktop.map b/data/desktop.map new file mode 100644 index 0000000..16620d2 --- /dev/null +++ b/data/desktop.map @@ -0,0 +1,17 @@ +openbox:openbox-session +bspwm:bspwm-session +jwm:jwm +i3:i3 +fluxbox:startfluxbox +pekwm:pekwm +plasma:startkde +gnome:gnome-session +xfce:startxfce4 +cinnamon:cinnamon-session-cinnamon +mate:mate-session +enlightenment:enlightenment_start +LXDE:lxsession +lxqt:lxqt-session +pantheon:pantheon-session +budgie-desktop:budgie-desktop +deepin:startdde diff --git a/lib/util-iso-image.sh b/lib/util-iso-image.sh index c0c5baa..dd0e82f 100644 --- a/lib/util-iso-image.sh +++ b/lib/util-iso-image.sh @@ -190,6 +190,38 @@ configure_services(){ info "Done configuring [%s]" "${initsys}" } +is_valid_de(){ + if [[ ${default_desktop_executable} != "none" ]] && \ + [[ ${default_desktop_file} != "none" ]]; then + return 0 + else + return 1 + fi +} + +load_desktop_map(){ + local _space="s| ||g" _clean=':a;N;$!ba;s/\n/ /g' _com_rm="s|#.*||g" \ + file=${DATADIR}/desktop.map + local desktop_map=$(sed "$_com_rm" "$file" \ + | sed "$_space" \ + | sed "$_clean") + echo ${desktop_map} +} + +detect_desktop_env(){ + local xs=$1/usr/share/xsessions ex=$1/usr/bin key val map=( $(load_desktop_map) ) + default_desktop_file="none" + default_desktop_executable="none" + for item in "${map[@]}";do + key=${item%:*} + val=${item#*:} + if [[ -f $xs/$key.desktop ]] && [[ -f $ex/$val ]];then + default_desktop_file="$key" + default_desktop_executable="$val" + fi + done +} + write_live_session_conf(){ msg2 "Configuring live session ..." local path=$1${DATADIR} @@ -214,6 +246,13 @@ write_live_session_conf(){ echo '' >> ${conf} echo '# iso name' >> ${conf} echo "iso_name=${iso_name}" >> ${conf} + + echo '' >> ${conf} + echo '# default_desktop_file' >> ${conf} + echo "default_desktop_file=${default_desktop_file}" >> ${conf} + echo '' >> ${conf} + echo '# default_desktop_executable' >> ${conf} + echo "default_desktop_executable=${default_desktop_executable}" >> ${conf} } configure_hosts(){ @@ -245,6 +284,7 @@ configure_system(){ configure_live_image(){ msg "Configuring [live-image]" + detect_desktop_env "$1" configure_hosts "$1" configure_plymouth "$1" configure_lsb "$1" From 2e1125badf8e2e7724af4eef839b24b6bf555b43 Mon Sep 17 00:00:00 2001 From: udeved Date: Thu, 4 Aug 2016 18:22:04 +0200 Subject: [PATCH 06/17] util-iso-image: quote addgroups when writing to live.conf --- lib/util-iso-image.sh | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/lib/util-iso-image.sh b/lib/util-iso-image.sh index dd0e82f..b58f663 100644 --- a/lib/util-iso-image.sh +++ b/lib/util-iso-image.sh @@ -242,11 +242,10 @@ write_live_session_conf(){ echo "password=${password}" >> ${conf} echo '' >> ${conf} echo '# live group membership' >> ${conf} - echo "addgroups=${addgroups}" >> ${conf} + echo "addgroups='${addgroups}'" >> ${conf} echo '' >> ${conf} echo '# iso name' >> ${conf} echo "iso_name=${iso_name}" >> ${conf} - echo '' >> ${conf} echo '# default_desktop_file' >> ${conf} echo "default_desktop_file=${default_desktop_file}" >> ${conf} From 934e264c020c8a86ba747eabf6f0bea84994c8b7 Mon Sep 17 00:00:00 2001 From: udeved Date: Thu, 4 Aug 2016 19:50:32 +0200 Subject: [PATCH 07/17] util-iso-cal: fix disabled openrc services; write them only if defined --- lib/util-iso-calamares.sh | 16 +++++++++------- lib/util.sh | 2 +- 2 files changed, 10 insertions(+), 8 deletions(-) diff --git a/lib/util-iso-calamares.sh b/lib/util-iso-calamares.sh index c78cadd..41c78a6 100644 --- a/lib/util-iso-calamares.sh +++ b/lib/util-iso-calamares.sh @@ -57,17 +57,19 @@ write_services_conf(){ echo '' >> "$conf" if [[ ${initsys} == 'openrc' ]];then echo 'services:' >> "$conf" + echo ' enabled:' >> "$conf" for s in ${enable_openrc[@]};do - echo ' enabled:' >> "$conf" - echo ' - name: '"$s" >> "$conf" + echo " - name: $s" >> "$conf" echo ' runlevel: default' >> "$conf" done - for s in ${disable_openrc[@]};do + if [[ -n ${disable_openrc[@]} ]];then echo ' disabled:' >> "$conf" - echo ' - name: '"$s" >> "$conf" - echo ' runlevel: boot' >> "$conf" - echo '' >> "$conf" - done + for s in ${disable_openrc[@]};do + echo " - name: $s" >> "$conf" + echo ' runlevel: default' >> "$conf" + echo '' >> "$conf" + done + fi else echo 'services:' > "$conf" for s in ${enable_systemd[@]};do diff --git a/lib/util.sh b/lib/util.sh index b51976a..43454e0 100644 --- a/lib/util.sh +++ b/lib/util.sh @@ -421,7 +421,7 @@ load_profile_config(){ enable_openrc=('acpid' 'bluetooth' 'cgmanager' 'consolekit' 'cronie' 'cupsd' 'dbus' 'syslog-ng' 'NetworkManager') fi - [[ -z ${disable_openrc[@]} ]] && disable_openrc=('pacman-init') + [[ -z ${disable_openrc[@]} ]] && disable_openrc=() if [[ -z ${enable_systemd_live[@]} ]];then enable_systemd_live=('manjaro-live' 'mhwd-live' 'pacman-init') From 58dbef0a2d4fe89c44a8f264431bc012ed159697 Mon Sep 17 00:00:00 2001 From: udeved Date: Thu, 4 Aug 2016 19:50:32 +0200 Subject: [PATCH 08/17] util-iso-cal: fix disabled openrc services; write them only if defined --- lib/util-iso-calamares.sh | 16 +++++++++------- lib/util-iso-image.sh | 14 +++++++++----- lib/util.sh | 2 +- 3 files changed, 19 insertions(+), 13 deletions(-) diff --git a/lib/util-iso-calamares.sh b/lib/util-iso-calamares.sh index c78cadd..41c78a6 100644 --- a/lib/util-iso-calamares.sh +++ b/lib/util-iso-calamares.sh @@ -57,17 +57,19 @@ write_services_conf(){ echo '' >> "$conf" if [[ ${initsys} == 'openrc' ]];then echo 'services:' >> "$conf" + echo ' enabled:' >> "$conf" for s in ${enable_openrc[@]};do - echo ' enabled:' >> "$conf" - echo ' - name: '"$s" >> "$conf" + echo " - name: $s" >> "$conf" echo ' runlevel: default' >> "$conf" done - for s in ${disable_openrc[@]};do + if [[ -n ${disable_openrc[@]} ]];then echo ' disabled:' >> "$conf" - echo ' - name: '"$s" >> "$conf" - echo ' runlevel: boot' >> "$conf" - echo '' >> "$conf" - done + for s in ${disable_openrc[@]};do + echo " - name: $s" >> "$conf" + echo ' runlevel: default' >> "$conf" + echo '' >> "$conf" + done + fi else echo 'services:' > "$conf" for s in ${enable_systemd[@]};do diff --git a/lib/util-iso-image.sh b/lib/util-iso-image.sh index b58f663..d575309 100644 --- a/lib/util-iso-image.sh +++ b/lib/util-iso-image.sh @@ -165,12 +165,16 @@ configure_services(){ case ${initsys} in 'openrc') for svc in ${enable_openrc[@]}; do - add_svc_rc "$1" "$svc" + + if [[ $svc == "xdm" ]];then + if [[ ${displaymanager} != "none" ]];then + set_xdm "$1" + add_svc_rc "$1" "xdm" + fi + else + add_svc_rc "$1" "$svc" + fi done - if [[ ${displaymanager} != "none" ]];then - set_xdm "$1" - add_svc_rc "$1" "xdm" - fi for svc in ${enable_openrc_live[@]}; do add_svc_rc "$1" "$svc" done diff --git a/lib/util.sh b/lib/util.sh index b51976a..43454e0 100644 --- a/lib/util.sh +++ b/lib/util.sh @@ -421,7 +421,7 @@ load_profile_config(){ enable_openrc=('acpid' 'bluetooth' 'cgmanager' 'consolekit' 'cronie' 'cupsd' 'dbus' 'syslog-ng' 'NetworkManager') fi - [[ -z ${disable_openrc[@]} ]] && disable_openrc=('pacman-init') + [[ -z ${disable_openrc[@]} ]] && disable_openrc=() if [[ -z ${enable_systemd_live[@]} ]];then enable_systemd_live=('manjaro-live' 'mhwd-live' 'pacman-init') From 27f051d60a1efeb706e0c6771885999e5f74446e Mon Sep 17 00:00:00 2001 From: udeved Date: Thu, 4 Aug 2016 20:16:14 +0200 Subject: [PATCH 09/17] util-iso: tweak iso filename to reflect netinstall iso tweak checksum func --- lib/util-iso.sh | 21 ++++++++++++--------- 1 file changed, 12 insertions(+), 9 deletions(-) diff --git a/lib/util-iso.sh b/lib/util-iso.sh index 0c932bf..e0604ad 100644 --- a/lib/util-iso.sh +++ b/lib/util-iso.sh @@ -170,20 +170,23 @@ make_iso() { # $1: file make_checksum(){ - cd ${iso_dir} - msg "Creating [%s] sum ..." "${iso_checksum}" - local cs=$(${iso_checksum}sum $1) - msg2 "%s sum: %s" "${iso_checksum}" "${cs}" - echo "${cs}" > $1.${iso_checksum} - msg "Done [%s] sum" "${iso_checksum}" - cd .. + msg "Creating [%s] sum ..." "${iso_checksum}" + local cs=$(${iso_checksum}sum ${iso_dir}/$1) + msg2 "%s sum: %s" "${iso_checksum}" "${cs}" + echo "${cs}" > ${iso_dir}/$1.${iso_checksum} + msg "Done [%s] sum" "${iso_checksum}" } gen_iso_fn(){ local vars=() name vars+=("${iso_name}") - [[ -n ${profile} ]] && vars+=("${profile}") -# [[ ${edition} == 'community' ]] && vars+=("${edition}") + If ! ${cal_netinstall};then + [[ -n ${profile} ]] && vars+=("${profile}") + else + if ${cal_unpackfs};then + [[ -n ${profile} ]] && vars+=("${profile}") + fi + fi [[ ${initsys} == 'openrc' ]] && vars+=("${initsys}") vars+=("${dist_release}") vars+=("${target_branch}") From 97efcb4a67ea31759c01ff14530e870a9819dfc0 Mon Sep 17 00:00:00 2001 From: udeved Date: Thu, 4 Aug 2016 20:20:26 +0200 Subject: [PATCH 10/17] util-iso: fix typo --- lib/util-iso.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/util-iso.sh b/lib/util-iso.sh index e0604ad..7828392 100644 --- a/lib/util-iso.sh +++ b/lib/util-iso.sh @@ -180,7 +180,7 @@ make_checksum(){ gen_iso_fn(){ local vars=() name vars+=("${iso_name}") - If ! ${cal_netinstall};then + if ! ${cal_netinstall};then [[ -n ${profile} ]] && vars+=("${profile}") else if ${cal_unpackfs};then From 78ef8b8dd68df79b5daaaaf86085a8c85154f022 Mon Sep 17 00:00:00 2001 From: udeved Date: Thu, 4 Aug 2016 21:03:06 +0200 Subject: [PATCH 11/17] buildiso: rework DM service logic clean up --- lib/util-iso-image.sh | 40 ++-------------------------------------- lib/util.sh | 14 ++++++++++++++ 2 files changed, 16 insertions(+), 38 deletions(-) diff --git a/lib/util-iso-image.sh b/lib/util-iso-image.sh index d575309..e6c6451 100644 --- a/lib/util-iso-image.sh +++ b/lib/util-iso-image.sh @@ -135,45 +135,13 @@ configure_journald(){ sed -i 's/#\(Storage=\)auto/\1volatile/' "$conf" } -configure_sysctl(){ - msg2 "Configuring sysctl ..." - touch $1/etc/sysctl.conf - local conf=$1/etc/sysctl.d/100-manjaro.conf -# echo '# Virtual memory setting (swap file or partition)' > ${conf} -# echo 'vm.swappiness = 30' >> ${conf} - echo '# Enable the SysRq key' >> ${conf} - echo 'kernel.sysrq = 1' >> ${conf} -} - -get_svc_dm(){ - local service=${displaymanager} - if [[ $service != "sddm" ]] || \ - [[ $service != "lxdm" ]];then - if ${plymouth_boot}; then - local svc="systemd/system/$service-plymouth.service" - if [[ -f $1/etc/$svc ]] || \ - [[ -f $1/usr/lib/$svc ]];then - service="$service-plymouth" - fi - fi - fi - echo $service -} - configure_services(){ info "Configuring [%s]" "${initsys}" case ${initsys} in 'openrc') for svc in ${enable_openrc[@]}; do - - if [[ $svc == "xdm" ]];then - if [[ ${displaymanager} != "none" ]];then - set_xdm "$1" - add_svc_rc "$1" "xdm" - fi - else - add_svc_rc "$1" "$svc" - fi + [[ $svc == "xdm" ]] && set_xdm "$1" + add_svc_rc "$1" "$svc" done for svc in ${enable_openrc_live[@]}; do add_svc_rc "$1" "$svc" @@ -183,9 +151,6 @@ configure_services(){ for svc in ${enable_systemd[@]}; do add_svc_sd "$1" "$svc" done - if [[ ${displaymanager} != "none" ]];then - add_svc_sd "$1" "$(get_svc_dm $1)" - fi for svc in ${enable_systemd_live[@]}; do add_svc_sd "$1" "$svc" done @@ -278,7 +243,6 @@ configure_system(){ echo ${hostname} > $1/etc/hostname ;; 'openrc') - configure_sysctl "$1" local hn='hostname="'${hostname}'"' sed -i -e "s|^.*hostname=.*|${hn}|" $1/etc/conf.d/hostname ;; diff --git a/lib/util.sh b/lib/util.sh index 43454e0..803085b 100644 --- a/lib/util.sh +++ b/lib/util.sh @@ -373,6 +373,15 @@ check_profile_vars(){ fi } +get_svc(){ + local service=${displaymanager} + if [[ $service != "sddm" ]] || \ + [[ $service != "lxdm" ]];then + ${plymouth_boot} && service="$service-plymouth" + fi + echo $service +} + load_profile_config(){ [[ -f $1 ]] || return 1 @@ -431,6 +440,11 @@ load_profile_config(){ enable_openrc_live=('manjaro-live' 'mhwd-live' 'pacman-init') fi + if [[ ${displaymanager} != "none" ]]; then + enable_openrc+=('xdm') + enable_systemd+=("$(get_svc)") + fi + [[ -z ${tracker_url} ]] && tracker_url='udp://mirror.strits.dk:6969' [[ -z ${piece_size} ]] && piece_size=21 From 6c9b445aa2816b7de077921fbfc8c62adbc85456 Mon Sep 17 00:00:00 2001 From: udeved Date: Thu, 4 Aug 2016 21:11:28 +0200 Subject: [PATCH 12/17] buildiso: show DM in svc array --- bin/buildiso.in | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/bin/buildiso.in b/bin/buildiso.in index 98b51e7..61db818 100755 --- a/bin/buildiso.in +++ b/bin/buildiso.in @@ -26,7 +26,6 @@ show_profile(){ msg2 "work_dir: %s" "${work_dir}" msg2 "iso_dir: %s" "${iso_dir}" msg2 "iso_file: %s" "${iso_file}" - msg2 "displaymanager: %s" "${displaymanager}" msg2 "autologin: %s" "${autologin}" msg2 "nonfree_xorg: %s" "${nonfree_xorg}" msg2 "pxe_boot: %s" "${pxe_boot}" @@ -49,11 +48,11 @@ show_profile(){ if [[ ${initsys} == 'systemd' ]];then msg2 "enable_systemd: %s" "${enable_systemd[*]}" msg2 "enable_systemd_live: %s" "${enable_systemd_live[*]}" - msg2 "disable_systemd: %s" "${disable_systemd[*]}" + [[ -n ${disable_systemd[*]} ]] && msg2 "disable_systemd: %s" "${disable_systemd[*]}" else msg2 "enable_openrc: %s" "${enable_openrc[*]}" msg2 "enable_openrc_live: %s" "${enable_openrc_live[*]}" - msg2 "disable_openrc: %s" "${disable_openrc[*]}" + [[ -n ${disable_openrc[*]} ]] && msg2 "disable_openrc: %s" "${disable_openrc[*]}" fi if ${torrent};then msg2 "tracker_url: %s" "${tracker_url}" From 580464b9c1b24d1651d9871e438137e46301515b Mon Sep 17 00:00:00 2001 From: udeved Date: Fri, 5 Aug 2016 17:23:32 +0200 Subject: [PATCH 13/17] util-iso-cal: fix openrc services; add mhwdcfg util-iso: cosmetics with checksum msg --- lib/util-iso-calamares.sh | 48 +++++++++++++++++++++++++++++++++++---- lib/util-iso.sh | 2 +- 2 files changed, 45 insertions(+), 5 deletions(-) diff --git a/lib/util-iso-calamares.sh b/lib/util-iso-calamares.sh index 41c78a6..ff7774e 100644 --- a/lib/util-iso-calamares.sh +++ b/lib/util-iso-calamares.sh @@ -52,10 +52,10 @@ write_bootloader_conf(){ } write_services_conf(){ - local conf="$1/etc/calamares/modules/services.conf" - echo '---' > "$conf" - echo '' >> "$conf" if [[ ${initsys} == 'openrc' ]];then + local conf="$1/etc/calamares/modules/servicescfg.conf" + echo '---' > "$conf" + echo '' >> "$conf" echo 'services:' >> "$conf" echo ' enabled:' >> "$conf" for s in ${enable_openrc[@]};do @@ -71,6 +71,9 @@ write_services_conf(){ done fi else + local conf="$1/etc/calamares/modules/services.conf" + echo '---' > "$conf" + echo '' >> "$conf" echo 'services:' > "$conf" for s in ${enable_systemd[@]};do echo ' - name: '"$s" >> "$conf" @@ -210,7 +213,7 @@ write_settings_conf(){ echo " - initcpio" >> "$conf" echo " - users" >> "$conf" echo " - displaymanager" >> "$conf" - echo " - hardwarecfg" >> "$conf" + echo " - mhwdcfg" >> "$conf" echo " - networkcfg" >> "$conf" echo " - hwclock" >> "$conf" if [[ ${initsys} == 'systemd' ]];then @@ -232,6 +235,43 @@ write_settings_conf(){ echo "dont-chroot: false" >> "$conf" } +write_mhwdcfg_conf(){ + local conf="$1/etc/calamares/modules/mhwdcfg.conf" + echo "---" > "$conf" + echo "bus_types:" >> "$conf" + echo " - pci" >> "$conf" + echo " - usb" >> "$conf" + echo '' >> "$conf" + echo "identifiers:" >> "$conf" + echo " net:" >> "$conf" + echo " - '0200'" >> "$conf" + echo " - '0280'" >> "$conf" + echo " vid:" >> "$conf" + echo " - '0300'" >> "$conf" + echo '' >> "$conf" + if ${cal_netinstall};then + if ${cal_unpackfs};then + echo "local_repo: true" >> "$conf" + else + echo "local_repo: false" >> "$conf" + fi + else + echo "local_repo: true" >> "$conf" + fi + echo '' >> "$conf" + echo "repo_conf: /opt/live/pacman-gfx.conf" >> "$conf" + + if ${cal_netinstall};then + if ${cal_unpackfs};then + echo "local_repo: true" >> "$conf" + else + echo "local_repo: false" >> "$conf" + fi + else + echo "local_repo: true" >> "$conf" + fi +} + write_chrootcfg_conf(){ local conf="$1/etc/calamares/modules/chrootcfg.conf" mode='"0o755"' echo "---" > "$conf" diff --git a/lib/util-iso.sh b/lib/util-iso.sh index 7828392..b66b16a 100644 --- a/lib/util-iso.sh +++ b/lib/util-iso.sh @@ -172,7 +172,7 @@ make_iso() { make_checksum(){ msg "Creating [%s] sum ..." "${iso_checksum}" local cs=$(${iso_checksum}sum ${iso_dir}/$1) - msg2 "%s sum: %s" "${iso_checksum}" "${cs}" + msg2 "%s sum: %s" "${iso_checksum}" "${cs##*/}" echo "${cs}" > ${iso_dir}/$1.${iso_checksum} msg "Done [%s] sum" "${iso_checksum}" } From 8dfd7359d0a578334f589b1659e20679d4e90cf3 Mon Sep 17 00:00:00 2001 From: udeved Date: Fri, 5 Aug 2016 17:55:29 +0200 Subject: [PATCH 14/17] util-iso-cal: del code --- lib/util-iso-calamares.sh | 10 ---------- 1 file changed, 10 deletions(-) diff --git a/lib/util-iso-calamares.sh b/lib/util-iso-calamares.sh index ff7774e..44b4849 100644 --- a/lib/util-iso-calamares.sh +++ b/lib/util-iso-calamares.sh @@ -260,16 +260,6 @@ write_mhwdcfg_conf(){ fi echo '' >> "$conf" echo "repo_conf: /opt/live/pacman-gfx.conf" >> "$conf" - - if ${cal_netinstall};then - if ${cal_unpackfs};then - echo "local_repo: true" >> "$conf" - else - echo "local_repo: false" >> "$conf" - fi - else - echo "local_repo: true" >> "$conf" - fi } write_chrootcfg_conf(){ From 2098b2c0c629002c820f02b3f247562402e8dadc Mon Sep 17 00:00:00 2001 From: udeved Date: Fri, 5 Aug 2016 18:35:30 +0200 Subject: [PATCH 15/17] util-iso-cal: write mhwdcfg, fix welcome --- lib/util-iso-calamares.sh | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/lib/util-iso-calamares.sh b/lib/util-iso-calamares.sh index 44b4849..04c1933 100644 --- a/lib/util-iso-calamares.sh +++ b/lib/util-iso-calamares.sh @@ -168,7 +168,9 @@ write_welcome_conf(){ echo " - storage" >> "$conf" echo " - ram" >> "$conf" echo " - root" >> "$conf" - ${cal_netinstall} && echo " - internet" >> "$conf" + if ${cal_netinstall}; + echo " - internet" >> "$conf" + fi } write_settings_conf(){ @@ -311,6 +313,8 @@ configure_calamares(){ write_bootloader_conf "$1" + write_mhwdcfg_conf "$1" + write_unpack_conf "$1" write_displaymanager_conf "$1" From 3071817516a7e47966e2b8b76d907d2c31d37c5c Mon Sep 17 00:00:00 2001 From: udeved Date: Fri, 5 Aug 2016 18:37:29 +0200 Subject: [PATCH 16/17] util-iso-cal: fix silly syntax error --- lib/util-iso-calamares.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/util-iso-calamares.sh b/lib/util-iso-calamares.sh index 04c1933..23789fd 100644 --- a/lib/util-iso-calamares.sh +++ b/lib/util-iso-calamares.sh @@ -168,7 +168,7 @@ write_welcome_conf(){ echo " - storage" >> "$conf" echo " - ram" >> "$conf" echo " - root" >> "$conf" - if ${cal_netinstall}; + if ${cal_netinstall};then echo " - internet" >> "$conf" fi } From 4b30ded427a799bb5f6eea082644ec7c442e7e04 Mon Sep 17 00:00:00 2001 From: udeved Date: Sat, 6 Aug 2016 00:07:13 +0200 Subject: [PATCH 17/17] util-iso-cal: fix unpackfs.conf --- lib/util-iso-calamares.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/util-iso-calamares.sh b/lib/util-iso-calamares.sh index 23789fd..ce5d1ab 100644 --- a/lib/util-iso-calamares.sh +++ b/lib/util-iso-calamares.sh @@ -120,7 +120,7 @@ write_unpack_conf(){ echo " - source: \"/bootmnt/${iso_name}/${target_arch}/root-image.sqfs\"" >> "$conf" echo " sourcefs: \"squashfs\"" >> "$conf" echo " destination: \"\"" >> "$conf" - if [[ -f /bootmnt/${iso_name}/${target_arch}/${profile}-image.sqfs ]];then + if ! ${cal_netinstall};then echo " - source: \"/bootmnt/${iso_name}/${target_arch}/${profile}-image.sqfs\"" >> "$conf" echo " sourcefs: \"squashfs\"" >> "$conf" echo " destination: \"\"" >> "$conf"