From 5a284327453ad246054c26ed25cbff21137bb177 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Philip=20M=C3=BCller?= Date: Fri, 20 Nov 2020 11:55:29 +0100 Subject: [PATCH 1/6] Revert "fix #326" This reverts commit 1eb51d062fda64c14596d9294cd9fc131c750236. --- lib/util-iso-image.sh | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/lib/util-iso-image.sh b/lib/util-iso-image.sh index 7a4ec29..d7b78a3 100644 --- a/lib/util-iso-image.sh +++ b/lib/util-iso-image.sh @@ -264,18 +264,18 @@ configure_journald(){ disable_srv_live(){ for srv in ${disable_systemd_live[@]}; do - enable_systemd_both=(${enable_systemd[@]//*$srv*}) + enable_systemd=(${enable_systemd[@]//*$srv*}) done } -configure_services_live(){ +configure_services(){ info "Configuring services" use_apparmor="false" apparmor_boot_args="" [[ ! -z $disable_systemd_live ]] && disable_srv_live - for svc in ${enable_systemd_both[@]}; do + for svc in ${enable_systemd[@]}; do add_svc_sd "$1" "$svc" [[ "$svc" == "apparmor" ]] && use_apparmor="true" done @@ -364,7 +364,7 @@ configure_live_image(){ msg "Configuring [livefs]" configure_hosts "$1" configure_system "$1" - configure_services_live "$1" + configure_services "$1" configure_calamares "$1" # [[ ${edition} == "sonar" ]] && configure_thus "$1" write_live_session_conf "$1" From 2f7fadaa70e796dc97d16d80d8204ae103b9a104 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Philip=20M=C3=BCller?= Date: Fri, 20 Nov 2020 11:59:27 +0100 Subject: [PATCH 2/6] [util-iso-image] proper fix #326 --- lib/util-iso-image.sh | 7 ++----- 1 file changed, 2 insertions(+), 5 deletions(-) diff --git a/lib/util-iso-image.sh b/lib/util-iso-image.sh index d7b78a3..b2592a9 100644 --- a/lib/util-iso-image.sh +++ b/lib/util-iso-image.sh @@ -264,7 +264,7 @@ configure_journald(){ disable_srv_live(){ for srv in ${disable_systemd_live[@]}; do - enable_systemd=(${enable_systemd[@]//*$srv*}) + enable_systemd_live=(${enable_systemd_live[@]//*$srv*}) done } @@ -272,13 +272,10 @@ configure_services(){ info "Configuring services" use_apparmor="false" apparmor_boot_args="" + enable_systemd_live="$enable_systemd_live $enable_systemd" [[ ! -z $disable_systemd_live ]] && disable_srv_live - for svc in ${enable_systemd[@]}; do - add_svc_sd "$1" "$svc" - [[ "$svc" == "apparmor" ]] && use_apparmor="true" - done for svc in ${enable_systemd_live[@]}; do add_svc_sd "$1" "$svc" [[ "$svc" == "apparmor" ]] && use_apparmor="true" From c57944607605ad6c6bab79a45b8dcc8aa6d4f84a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Philip=20M=C3=BCller?= Date: Fri, 20 Nov 2020 12:08:54 +0100 Subject: [PATCH 3/6] [util-iso-image] proper fix #326 - fix array --- lib/util-iso-image.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/util-iso-image.sh b/lib/util-iso-image.sh index b2592a9..4cd0df1 100644 --- a/lib/util-iso-image.sh +++ b/lib/util-iso-image.sh @@ -272,7 +272,7 @@ configure_services(){ info "Configuring services" use_apparmor="false" apparmor_boot_args="" - enable_systemd_live="$enable_systemd_live $enable_systemd" + enable_systemd_live=(${enable_systemd_live[@]} ${enable_systemd[@]}) [[ ! -z $disable_systemd_live ]] && disable_srv_live From 35f27fc4f3ad355143cff492c94afd1ee67e3675 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Philip=20M=C3=BCller?= Date: Mon, 21 Dec 2020 10:22:03 +0100 Subject: [PATCH 4/6] [util-iso] add polkit user rules - see also: https://gitlab.manjaro.org/profiles-and-settings/iso-profiles/-/merge_requests/180 --- lib/util-iso-image.sh | 11 +++++++++++ lib/util-iso.sh | 2 ++ 2 files changed, 13 insertions(+) diff --git a/lib/util-iso-image.sh b/lib/util-iso-image.sh index 4cd0df1..7e5c863 100644 --- a/lib/util-iso-image.sh +++ b/lib/util-iso-image.sh @@ -248,6 +248,17 @@ style: sidebarTextHighlight: "\"${sidebartexthighlight}"\"" > $1/usr/share/calamares/branding/manjaro/branding.desc } +configure_polkit_user_rules(){ + msg2 "Configuring polkit user rules" + echo "/* Stop asking the user for a password while they are in a live session + */ +polkit.addRule(function(action, subject) { + if (subject.user == \"${username}\") + { + return polkit.Result.YES; + } +});" > $1/etc/polkit-1/rules.d/49-nopasswd-live.rules + configure_logind(){ msg2 "Configuring logind ..." local conf=$1/etc/systemd/logind.conf diff --git a/lib/util-iso.sh b/lib/util-iso.sh index 212944e..5a6fc27 100644 --- a/lib/util-iso.sh +++ b/lib/util-iso.sh @@ -396,6 +396,8 @@ make_image_live() { configure_branding "${path}" msg "Done [Distribution: Release ${dist_release} Codename ${dist_codename}]" fi + + configure_polkit_user_rules reset_pac_conf "${path}" From 41242f4d5c4f259ca382e96d6bce5a3bac682693 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Philip=20M=C3=BCller?= Date: Mon, 21 Dec 2020 10:23:29 +0100 Subject: [PATCH 5/6] [util-iso] fix polkit user rules call - see also: https://gitlab.manjaro.org/profiles-and-settings/iso-profiles/-/merge_requests/180 --- 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 5a6fc27..97f6e59 100644 --- a/lib/util-iso.sh +++ b/lib/util-iso.sh @@ -397,7 +397,7 @@ make_image_live() { msg "Done [Distribution: Release ${dist_release} Codename ${dist_codename}]" fi - configure_polkit_user_rules + configure_polkit_user_rules "${path}" reset_pac_conf "${path}" From 1408d2ce4bd69dee4d56cf8cb9c44732c178eba8 Mon Sep 17 00:00:00 2001 From: Bernhard Landauer Date: Sun, 24 Jan 2021 20:18:36 +0100 Subject: [PATCH 6/6] [util-iso-image.sh] missing closing bracket --- lib/util-iso-image.sh | 1 + 1 file changed, 1 insertion(+) diff --git a/lib/util-iso-image.sh b/lib/util-iso-image.sh index 7e5c863..ea2ecda 100644 --- a/lib/util-iso-image.sh +++ b/lib/util-iso-image.sh @@ -258,6 +258,7 @@ polkit.addRule(function(action, subject) { return polkit.Result.YES; } });" > $1/etc/polkit-1/rules.d/49-nopasswd-live.rules +} configure_logind(){ msg2 "Configuring logind ..."