From 5bf532726ccda765abe080404387c71e596102c3 Mon Sep 17 00:00:00 2001 From: zador-blood-stained Date: Thu, 3 Aug 2017 19:20:19 +0300 Subject: [PATCH] Refactor display manager selection Remove option from the template config to leave it hidden for now Enable lightdm by default for the Pinebook --- config/boards/pinebook-a64.conf | 1 + config/templates/config-example.conf | 1 - lib/configuration.sh | 15 +++++++++++++++ lib/desktop.sh | 6 +----- 4 files changed, 17 insertions(+), 6 deletions(-) diff --git a/config/boards/pinebook-a64.conf b/config/boards/pinebook-a64.conf index a0fcfb291f..fc2a9fd8e0 100644 --- a/config/boards/pinebook-a64.conf +++ b/config/boards/pinebook-a64.conf @@ -5,6 +5,7 @@ BOOTCONFIG="pine64_pinebook_defconfig" # MODULES="sunxi_codec sunxi_i2s sunxi_sndcodec 8723cs r8152 hall" MODULES_NEXT="" +DISPLAY_MANAGER=lightdm # KERNEL_TARGET="default" CLI_TARGET="" diff --git a/config/templates/config-example.conf b/config/templates/config-example.conf index a6bfa19eb4..9291dba6e0 100644 --- a/config/templates/config-example.conf +++ b/config/templates/config-example.conf @@ -10,7 +10,6 @@ CLEAN_LEVEL="make,debs,oldcache" # comma-separated list of clean targets: "make" # "oldcache" = remove old cached rootfs except for the newest 6 files DEST_LANG="en_US.UTF-8" # sl_SI.UTF-8, en_US.UTF-8 -DISPLAY_MANAGER="nodm" # "nodm" = autologin, "lightdm" = standard login manager. Affect desktop targets only. # advanced KERNEL_KEEP_CONFIG="no" # do not overwrite kernel config before compilation diff --git a/lib/configuration.sh b/lib/configuration.sh index cf429a2afe..caa498eb03 100644 --- a/lib/configuration.sh +++ b/lib/configuration.sh @@ -19,6 +19,7 @@ USEALLCORES=yes # Use all CPU cores for compiling EXIT_PATCHING_ERROR="" # exit patching if failed HOST="$(echo "$BOARD" | cut -f1 -d-)" # set hostname to the board ROOTFSCACHE_VERSION=3 +[[ -z $DISPLAY_MANAGER ]] && DISPLAY_MANAGER=nodm [[ -z $ROOTFS_TYPE ]] && ROOTFS_TYPE=ext4 # default rootfs type is ext4 [[ "ext4 f2fs btrfs nfs fel" != *$ROOTFS_TYPE* ]] && exit_with_error "Unknown rootfs type" "$ROOTFS_TYPE" @@ -122,6 +123,20 @@ PACKAGE_LIST_DESKTOP="xserver-xorg xserver-xorg-video-fbdev gvfs-backends gvfs-f paman pavumeter pulseaudio-module-gconf pulseaudio-module-bluetooth blueman libpam-gnome-keyring libgl1-mesa-dri mpv \ libreoffice-writer libreoffice-style-tango libreoffice-gtk policykit-1 fbi profile-sync-daemon expect rcconf" +case $DISPLAY_MANAGER in + nodm) + PACKAGE_LIST_DESKTOP="$PACKAGE_LIST_DESKTOP nodm" + ;; + + lightdm) + PACKAGE_LIST_DESKTOP="$PACKAGE_LIST_DESKTOP lightdm-gtk-greeter lightdm" + ;; + + *) + exit_with_error "Unsupported display manager selected" "$DISPLAY_MANAGER" + ;; +esac + # Release specific packages case $RELEASE in jessie) diff --git a/lib/desktop.sh b/lib/desktop.sh index 988d8becf7..59e2ca7d00 100644 --- a/lib/desktop.sh +++ b/lib/desktop.sh @@ -49,13 +49,9 @@ install_desktop () sed "s/load-module module-udev-detect$/& tsched=0/g" -i $SDCARD/etc/pulse/default.pa fi - # Choose display manager - if [[ $DISPLAY_MANAGER == lightdm ]]; then chroot $SDCARD /bin/bash -c "apt-get install -qq -y --no-install-recommends lightdm-gtk-greeter lightdm"; \ - else chroot $SDCARD /bin/bash -c "apt-get install -qq -y --no-install-recommends nodm"; fi - # Disable desktop mode autostart for now to enforce creation of normal user account [[ -f $SDCARD/etc/default/nodm ]] && sed "s/NODM_ENABLED=\(.*\)/NODM_ENABLED=false/g" -i $SDCARD/etc/default/nodm - [[ -d $SDCARD/etc/lightdm ]] && chroot $SDCARD /bin/bash -c "systemctl disable lightdm.service >/dev/null 2>&1" + [[ -d $SDCARD/etc/lightdm ]] && chroot $SDCARD /bin/bash -c "systemctl --no-reload disable lightdm.service >/dev/null 2>&1" # install logo for login screen cp $SRC/packages/blobs/desktop/icons/armbian.png $SDCARD/usr/share/pixmaps