Refactor display manager selection

Remove option from the template config to leave it hidden for now
Enable lightdm by default for the Pinebook
This commit is contained in:
zador-blood-stained 2017-08-03 19:20:19 +03:00
parent 4a909dec38
commit 5bf532726c
4 changed files with 17 additions and 6 deletions

View File

@ -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=""

View File

@ -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

View File

@ -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)

View File

@ -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