From 17721a939e99a22d22039a5e3b8c6d0d29694b5b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ramon=20Buld=C3=B3?= Date: Tue, 22 Sep 2015 07:36:28 +0200 Subject: [PATCH] Use volatile storage in live journal Move some livecd configuration to a function. Fix custom-image sed. --- lib/util-iso-image.sh | 21 ++++++++++++++++++--- lib/util-iso.sh | 4 ---- 2 files changed, 18 insertions(+), 7 deletions(-) diff --git a/lib/util-iso-image.sh b/lib/util-iso-image.sh index 86a9a86..697008d 100644 --- a/lib/util-iso-image.sh +++ b/lib/util-iso-image.sh @@ -102,8 +102,8 @@ configure_services(){ msg2 "Setting $svc ..." chroot $1 systemctl enable $svc &> /dev/null done - sed -i -e "s/^.*HandleSuspendKey.*/HandleSuspendKey=ignore/" $1/etc/systemd/logind.conf - sed -i -e "s/^.*HandleLidSwitch.*/HandleLidSwitch=ignore/" $1/etc/systemd/logind.conf + sed -i 's/#\(HandleSuspendKey=\)suspend/\1ignore/' $1/etc/systemd/logind.conf + sed -i 's/#\(HandleLidSwitch=\)suspend/\1ignore/' $1/etc/systemd/logind.conf msg3 "Done configuring [${initsys}]" ;; *) @@ -349,7 +349,21 @@ configure_sysctl(){ fi } -# Remove pamac auto-update when the network is up, it causes problems when booting in the livecd +# $1: chroot +configure_systemd_live(){ + if [[ ${initsys} == 'systemd' ]];then + msg2 "Configuring systemd for livecd" + sed -i 's/#\(Storage=\)auto/\1volatile/' $1/etc/systemd/journald.conf + sed -i 's/#\(HandleSuspendKey=\)suspend/\1ignore/' $1/etc/systemd/logind.conf + sed -i 's/#\(HandleHibernateKey=\)hibernate/\1ignore/' $1/etc/systemd/logind.conf + sed -i 's/#\(HandleLidSwitch=\)suspend/\1ignore/' $1/etc/systemd/logind.conf + # 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" + fi +} + +# Remove pamac auto-update when the network is up, it locks de pacman db when booting in the livecd # $1: chroot configure_pamac_live() { rm -f $1/etc/NetworkManager/dispatcher.d/99_update_pamac_tray @@ -379,6 +393,7 @@ configure_livecd_image(){ configure_accountsservice "$1" "${username}" configure_user "$1" configure_services_live "$1" + configure_systemd_live "$1" configure_calamares "$1" configure_thus "$1" configure_pamac_live "$1" diff --git a/lib/util-iso.sh b/lib/util-iso.sh index 4876358..84e62f6 100644 --- a/lib/util-iso.sh +++ b/lib/util-iso.sh @@ -292,10 +292,6 @@ make_image_livecd() { configure_livecd_image "${path}" ${is_custom_pac_conf} && clean_pacman_conf "${path}" - # 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" - umount_image "${path}" # Clean up GnuPG keys