- changed display manager to lightdm by default and remove nodm completly
- desktop login manager enabled by default, toogle can be done with armbian-config
- added URL to the build script and commit hash to /etc/armbian-release file
- added debconf-utils,html2text,mmc-utils,sunxi-tools to the base and additional pkg list
- added synaptic package manager and onboard keyboard to the desktop base
- changed motd console welcome text to: Welcome to Debian Stretch with Armbian Linux 5.1.6-sunxi
- added "logout" to the panel/menu
- added normal users to additional groups: disk tty users games
This commit is contained in:
Igor Pečovnik 2019-06-11 00:24:46 +02:00 committed by GitHub
parent 953a7f85ac
commit da86ab5df5
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
13 changed files with 128 additions and 89 deletions

View File

@ -8,7 +8,7 @@ BOOTCONFIG_DEV="pinebook_defconfig"
#
MODULES="sunxi_codec sunxi_i2s sunxi_sndcodec 8723cs r8152 hall"
MODULES_NEXT=""
DISPLAY_MANAGER=lightdm
DESKTOP_AUTOLOGIN="no"
#
KERNEL_TARGET="default,next,dev"
CLI_TARGET="stretch:next,dev"

View File

@ -5,7 +5,7 @@ BOOTCONFIG="teres_i_defconfig"
#
MODULES="sunxi_codec sunxi_i2s sunxi_sndcodec 8723cs r8152 hall"
MODULES_NEXT=""
DISPLAY_MANAGER=lightdm
DESKTOP_AUTOLOGIN="no"
#
KERNEL_TARGET="next,dev"
CLI_TARGET="stretch:next"

View File

@ -233,7 +233,8 @@ for line in "${buildlist[@]}"; do
MODULES_BLACKLIST_DEV MOUNT SDCARD BOOTPATCHDIR KERNELPATCHDIR buildtext RELEASE IMAGE_TYPE OVERLAY_PREFIX ASOUND_STATE \
ATF_COMPILER ATF_USE_GCC ATFSOURCE ATFDIR ATFBRANCH ATFSOURCEDIR PACKAGE_LIST_RM NM_IGNORE_DEVICES DISPLAY_MANAGER family_tweaks_bsp_s \
CRYPTROOT_ENABLE CRYPTROOT_PASSPHRASE CRYPTROOT_SSH_UNLOCK CRYPTROOT_SSH_UNLOCK_PORT CRYPTROOT_SSH_UNLOCK_KEY_NAME ROOT_MAPPER \
NETWORK HDMI USB WIRELESS ARMBIANMONITOR DEFAULT_CONSOLE FORCE_BOOTSCRIPT_UPDATE SERIALCON UBOOT_TOOLCHAIN2 toolchain2
NETWORK HDMI USB WIRELESS ARMBIANMONITOR DEFAULT_CONSOLE FORCE_BOOTSCRIPT_UPDATE SERIALCON UBOOT_TOOLCHAIN2 toolchain2 \
BUILD_REPOSITORY_URL BUILD_REPOSITORY_COMMIT DESKTOP_AUTOLOGIN
read -r BOARD BRANCH RELEASE BUILD_DESKTOP <<< "${line}"
((n+=1))

View File

@ -22,7 +22,8 @@ EXIT_PATCHING_ERROR="" # exit patching if failed
HOST="$(echo "$BOARD" | cut -f1 -d-)" # set hostname to the board
ROOTFSCACHE_VERSION=4
CHROOT_CACHE_VERSION=6
[[ -z $DISPLAY_MANAGER ]] && DISPLAY_MANAGER=nodm
BUILD_REPOSITORY_URL=$(git remote get-url $(git remote 2>/dev/null) 2>/dev/null)
BUILD_REPOSITORY_COMMIT=$(git describe --match=d_e_a_d_b_e_e_f --always --dirty 2>/dev/null)
ROOTFS_CACHE_MAX=16 # max number of rootfs cache, older ones will be cleaned up
# TODO: fixed name can't be used for parallel image building
@ -136,7 +137,7 @@ PACKAGE_LIST="bc bridge-utils build-essential cpufrequtils device-tree-compiler
iw fake-hwclock wpasupplicant psmisc ntp parted rsync sudo curl linux-base dialog crda \
wireless-regdb ncurses-term python3-apt sysfsutils toilet u-boot-tools unattended-upgrades \
usbutils wireless-tools console-setup unicode-data openssh-server initramfs-tools \
ca-certificates resolvconf expect iptables automake nocache \
ca-certificates resolvconf expect iptables automake nocache debconf-utils html2text \
bison flex libwrap0-dev libssl-dev libnl-3-dev libnl-genl-3-dev"
@ -145,7 +146,7 @@ PACKAGE_LIST_ADDITIONAL="armbian-firmware alsa-utils btrfs-tools dosfstools ioto
ntfs-3g vim pciutils evtest htop pv lsof libfuse2 libdigest-sha-perl \
libproc-processtable-perl aptitude dnsutils f3 haveged hdparm rfkill vlan sysstat bash-completion \
hostapd git ethtool network-manager unzip ifenslave command-not-found libpam-systemd iperf3 \
software-properties-common libnss-myhostname f2fs-tools avahi-autoipd iputils-arping qrencode"
software-properties-common libnss-myhostname f2fs-tools avahi-autoipd iputils-arping qrencode mmc-utils sunxi-tools"
# Dependent desktop packages
@ -153,29 +154,13 @@ PACKAGE_LIST_DESKTOP="xserver-xorg xserver-xorg-video-fbdev gvfs-backends gvfs-f
x11-xserver-utils xfce4 lxtask xfce4-terminal thunar-volman gtk2-engines gtk2-engines-murrine gtk2-engines-pixbuf \
libgtk2.0-bin network-manager-gnome xfce4-notifyd gnome-keyring gcr libgck-1-0 p11-kit pasystray pavucontrol \
pulseaudio pavumeter bluez bluez-tools pulseaudio-module-bluetooth blueman libpam-gnome-keyring \
libgl1-mesa-dri policykit-1 profile-sync-daemon gnome-orca numix-gtk-theme"
libgl1-mesa-dri policykit-1 profile-sync-daemon gnome-orca numix-gtk-theme synaptic onboard lightdm lightdm-gtk-greeter"
# Recommended desktop packages
PACKAGE_LIST_DESKTOP_RECOMMENDS="mirage galculator hexchat xfce4-screenshooter network-manager-openvpn-gnome mpv fbi cups-pk-helper \
cups geany atril xarchiver"
case $DISPLAY_MANAGER in
nodm)
PACKAGE_LIST_DISPLAY_MANAGER="nodm"
;;
lightdm)
PACKAGE_LIST_DISPLAY_MANAGER="lightdm lightdm-gtk-greeter"
;;
*)
exit_with_error "Unsupported display manager selected" "$DISPLAY_MANAGER"
;;
esac
# Release specific packages
case $RELEASE in
@ -270,8 +255,8 @@ cat <<-EOF >> "${DEST}"/debug/output.log
## BUILD SCRIPT ENVIRONMENT
Repository: $(git remote get-url "$(git remote 2>/dev/null)" 2>/dev/null)
Version: $(git describe --match=d_e_a_d_b_e_e_f --always --dirty 2>/dev/null)
Repository: $REPOSITORY_URL
Version: $REPOSITORY_COMMIT
Host OS: $(lsb_release -sc)
Host arch: $(dpkg --print-architecture)

View File

@ -116,11 +116,8 @@ create_desktop_package ()
desktop_postinstall ()
{
# stage: install display manager
display_alert "Installing" "display manager: $DISPLAY_MANAGER" "info"
chroot "${SDCARD}" /bin/bash -c "DEBIAN_FRONTEND=noninteractive apt-get -o Dpkg::Options::=\"--force-confold\" -y -qq install $PACKAGE_LIST_DISPLAY_MANAGER" >> "${DEST}"/debug/install.log 2>&1
[[ -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 --no-reload disable lightdm.service >/dev/null 2>&1"
# disable display manager for first run
chroot "${SDCARD}" /bin/bash -c "systemctl --no-reload disable lightdm.service >/dev/null 2>&1"
# Compile Turbo Frame buffer for sunxi
if [[ $LINUXFAMILY == sun* && $BRANCH == default ]]; then

View File

@ -108,9 +108,25 @@ install_common()
# force change root password at first login
chroot "${SDCARD}" /bin/bash -c "chage -d 0 root"
# change console welcome text
echo -e "${DISTRIBUTION} ${RELEASE^} with Armbian Linux \\l \n" > "${SDCARD}"/etc/issue
echo "${DISTRIBUTION} ${RELEASE^} with Armbian Linux" > "${SDCARD}"/etc/issue.net
# enable few bash aliases enabled in Ubuntu by default to make it even
sed "s/#alias ll='ls -l'/alias ll='ls -l'/" -i "${SDCARD}"/etc/skel/.bashrc
sed "s/#alias la='ls -A'/alias la='ls -A'/" -i "${SDCARD}"/etc/skel/.bashrc
sed "s/#alias l='ls -CF'/alias l='ls -CF'/" -i "${SDCARD}"/etc/skel/.bashrc
# root user is already there. Copy bashrc there as well
cp "${SDCARD}"/etc/skel/.bashrc "${SDCARD}"/root
# display welcome message at first root login
touch "${SDCARD}"/root/.not_logged_in_yet
if [[ ${DESKTOP_AUTOLOGIN} != no ]]; then
# set desktop autologin
touch "${SDCARD}"/root/.desktop_autologin
fi
# NOTE: this needs to be executed before family_tweaks
local bootscript_src=${BOOTSCRIPT%%:*}
local bootscript_dst=${BOOTSCRIPT##*:}

View File

@ -13,8 +13,10 @@
#
if [[ $(basename "$0") == main.sh ]]; then
echo "Please use compile.sh to start the build process"
exit 255
fi
# default umask for root is 022 so parent directories won't be group writeable without this
@ -24,8 +26,8 @@ umask 002
# destination
DEST=$SRC/output
TTY_X=$(($(stty size | awk '{print $2}')-6)) # determine terminal width
TTY_Y=$(($(stty size | awk '{print $1}')-6)) # determine terminal height
TTY_X=$(($(stty size | awk '{print $2}')-6)) # determine terminal width
TTY_Y=$(($(stty size | awk '{print $1}')-6)) # determine terminal height
# We'll use this title on all menus
backtitle="Armbian building script, http://www.armbian.com | Author: Igor Pecovnik"
@ -40,21 +42,21 @@ backtitle="Armbian building script, http://www.armbian.com | Author: Igor Pecovn
# Load libraries
# shellcheck source=debootstrap-ng.sh
source "${SRC}"/lib/debootstrap-ng.sh # System specific install
source "${SRC}"/lib/debootstrap-ng.sh # system specific install
# shellcheck source=image-helpers.sh
source "${SRC}"/lib/image-helpers.sh # helpers for OS image building
source "${SRC}"/lib/image-helpers.sh # helpers for OS image building
# shellcheck source=distributions.sh
source "${SRC}"/lib/distributions.sh # System specific install
source "${SRC}"/lib/distributions.sh # system specific install
# shellcheck source=desktop.sh
source "${SRC}"/lib/desktop.sh # Desktop specific install
source "${SRC}"/lib/desktop.sh # desktop specific install
# shellcheck source=compilation.sh
source "${SRC}"/lib/compilation.sh # Patching and compilation of kernel, uboot, ATF
source "${SRC}"/lib/compilation.sh # patching and compilation of kernel, uboot, ATF
# shellcheck source=makeboarddeb.sh
source "${SRC}"/lib/makeboarddeb.sh # Create board support package
source "${SRC}"/lib/makeboarddeb.sh # create board support package
# shellcheck source=general.sh
source "${SRC}"/lib/general.sh # General functions
source "${SRC}"/lib/general.sh # general functions
# shellcheck source=chroot-buildpackages.sh
source "${SRC}"/lib/chroot-buildpackages.sh # Building packages in chroot
source "${SRC}"/lib/chroot-buildpackages.sh # building packages in chroot
# compress and remove old logs
mkdir -p "${DEST}"/debug
@ -65,22 +67,31 @@ date +"%d_%m_%Y-%H_%M_%S" > "${DEST}"/debug/timestamp
(cd "${DEST}"/debug && find . -name '*.tgz' -mtime +7 -delete) > /dev/null
if [[ $PROGRESS_DISPLAY == none ]]; then
OUTPUT_VERYSILENT=yes
elif [[ $PROGRESS_DISPLAY == dialog ]]; then
OUTPUT_DIALOG=yes
fi
if [[ $PROGRESS_LOG_TO_FILE != yes ]]; then unset PROGRESS_LOG_TO_FILE; fi
SHOW_WARNING=yes
if [[ $USE_CCACHE != no ]]; then
CCACHE=ccache
export PATH="/usr/lib/ccache:$PATH"
# private ccache directory to avoid permission issues when using build script with "sudo"
# see https://ccache.samba.org/manual.html#_sharing_a_cache for alternative solution
[[ $PRIVATE_CCACHE == yes ]] && export CCACHE_DIR=$SRC/cache/ccache
else
CCACHE=""
fi
# Check and install dependencies, directory structure and settings
@ -89,37 +100,44 @@ prepare_host
# if KERNEL_ONLY, KERNEL_CONFIGURE, BOARD, BRANCH or RELEASE are not set, display selection menu
if [[ -z $KERNEL_ONLY ]]; then
options+=("yes" "U-boot and kernel packages")
options+=("no" "Full OS image for flashing")
KERNEL_ONLY=$(dialog --stdout --title "Choose an option" --backtitle "$backtitle" --no-tags --menu "Select what to build" \
$TTY_Y $TTY_X $((TTY_Y - 8)) "${options[@]}")
KERNEL_ONLY=$(dialog --stdout --title "Choose an option" --backtitle "$backtitle" --no-tags \
--menu "Select what to build" $TTY_Y $TTY_X $((TTY_Y - 8)) "${options[@]}")
unset options
[[ -z $KERNEL_ONLY ]] && exit_with_error "No option selected"
fi
if [[ -z $KERNEL_CONFIGURE ]]; then
options+=("no" "Do not change the kernel configuration")
options+=("yes" "Show a kernel configuration menu before compilation")
KERNEL_CONFIGURE=$(dialog --stdout --title "Choose an option" --backtitle "$backtitle" --no-tags --menu "Select the kernel configuration" \
$TTY_Y $TTY_X $((TTY_Y - 8)) "${options[@]}")
KERNEL_CONFIGURE=$(dialog --stdout --title "Choose an option" --backtitle "$backtitle" --no-tags \
--menu "Select the kernel configuration" $TTY_Y $TTY_X $((TTY_Y - 8)) "${options[@]}")
unset options
[[ -z $KERNEL_CONFIGURE ]] && exit_with_error "No option selected"
fi
if [[ -z $BOARD ]]; then
WIP_STATE=supported
WIP_BUTTON='CSC/WIP/EOS/TVB'
STATE_DESCRIPTION=' - boards with high level of software maturity'
temp_rc=$(mktemp)
while true; do
options=()
if [[ $WIP_STATE == supported ]]; then
for board in "${SRC}"/config/boards/*.conf; do
options+=("$(basename "${board}" | cut -d'.' -f1)" "$(head -1 "${board}" | cut -d'#' -f2)")
done
else
for board in "${SRC}"/config/boards/*.wip; do
options+=("$(basename "${board}" | cut -d'.' -f1)" "\Z1(WIP)\Zn $(head -1 "${board}" | cut -d'#' -f2)")
done
@ -132,7 +150,9 @@ if [[ -z $BOARD ]]; then
for board in "${SRC}"/config/boards/*.tvb; do
options+=("$(basename "${board}" | cut -d'.' -f1)" "\Z1(TVB)\Zn $(head -1 "${board}" | cut -d'#' -f2)")
done
fi
if [[ $WIP_STATE != supported ]]; then
cat <<-'EOF' > "${temp_rc}"
dialog_color = (RED,WHITE,OFF)
@ -145,22 +165,27 @@ if [[ -z $BOARD ]]; then
else
echo > "${temp_rc}"
fi
BOARD=$(DIALOGRC=$temp_rc dialog --stdout --title "Choose a board" --backtitle "$backtitle" --scrollbar --colors \
--extra-label "Show $WIP_BUTTON" --extra-button --menu "Select the target board. Displaying:\n$STATE_DESCRIPTION" \
$TTY_Y $TTY_X $((TTY_Y - 8)) "${options[@]}")
BOARD=$(DIALOGRC=$temp_rc dialog --stdout --title "Choose a board" --backtitle "$backtitle" --scrollbar \
--colors --extra-label "Show $WIP_BUTTON" --extra-button \
--menu "Select the target board. Displaying:\n$STATE_DESCRIPTION" $TTY_Y $TTY_X $((TTY_Y - 8)) "${options[@]}")
STATUS=$?
if [[ $STATUS == 3 ]]; then
if [[ $WIP_STATE == supported ]]; then
[[ $SHOW_WARNING == yes ]] && show_developer_warning
STATE_DESCRIPTION=' - \Z1(CSC)\Zn - Community Supported Configuration\n - \Z1(WIP)\Zn - Work In Progress\n - \Z1(EOS)\Zn - End Of Support\n - \Z1(TVB)\Zn - TV boxes'
STATE_DESCRIPTION=' - \Z1(CSC)\Zn - Community Supported Configuration\n - \Z1(WIP)\Zn - Work In Progress
\n - \Z1(EOS)\Zn - End Of Support\n - \Z1(TVB)\Zn - TV boxes'
WIP_STATE=unsupported
WIP_BUTTON='matured'
EXPERT=yes
else
STATE_DESCRIPTION=' - boards with high level of software maturity'
WIP_STATE=supported
WIP_BUTTON='CSC/WIP/EOS'
EXPERT=no
fi
continue
elif [[ $STATUS == 0 ]]; then
@ -190,6 +215,7 @@ LINUXFAMILY="${BOARDFAMILY}"
[[ -z $KERNEL_TARGET ]] && exit_with_error "Board configuration does not define valid kernel config"
if [[ -z $BRANCH ]]; then
options=()
[[ $KERNEL_TARGET == *default* ]] && options+=("default" "Vendor provided / legacy (3.4.x - 4.4.x)")
[[ $KERNEL_TARGET == *next* ]] && options+=("next" "Mainline (@kernel.org) (4.x)")
@ -205,11 +231,15 @@ if [[ -z $BRANCH ]]; then
unset options
[[ -z $BRANCH ]] && exit_with_error "No kernel branch selected"
[[ $BRANCH == dev && $SHOW_WARNING == yes ]] && show_developer_warning
else
[[ $KERNEL_TARGET != *$BRANCH* ]] && exit_with_error "Kernel branch not defined for this board" "$BRANCH"
fi
if [[ $KERNEL_ONLY != yes && -z $RELEASE ]]; then
options=()
[[ $EXPERT = yes ]] && options+=("jessie" "Debian 8 Jessie / unsupported")
options+=("stretch" "Debian 9 Stretch")
@ -218,20 +248,23 @@ if [[ $KERNEL_ONLY != yes && -z $RELEASE ]]; then
options+=("bionic" "Ubuntu Bionic 18.04 LTS")
[[ $EXPERT = yes ]] && options+=("disco" "Ubuntu Disco 19.04 / unsupported")
RELEASE=$(dialog --stdout --title "Choose a release" --backtitle "$backtitle" --menu "Select the target OS release" \
$TTY_Y $TTY_X $((TTY_Y - 8)) "${options[@]}")
RELEASE=$(dialog --stdout --title "Choose a release" --backtitle "$backtitle" \
--menu "Select the target OS release" $TTY_Y $TTY_X $((TTY_Y - 8)) "${options[@]}")
unset options
[[ -z $RELEASE ]] && exit_with_error "No release selected"
fi
if [[ $KERNEL_ONLY != yes && -z $BUILD_DESKTOP ]]; then
options=()
options+=("no" "Image with console interface (server)")
options+=("yes" "Image with desktop environment")
BUILD_DESKTOP=$(dialog --stdout --title "Choose image type" --backtitle "$backtitle" --no-tags --menu "Select the target image type" \
$TTY_Y $TTY_X $((TTY_Y - 8)) "${options[@]}")
BUILD_DESKTOP=$(dialog --stdout --title "Choose image type" --backtitle "$backtitle" --no-tags \
--menu "Select the target image type" $TTY_Y $TTY_X $((TTY_Y - 8)) "${options[@]}")
unset options
[[ -z $BUILD_DESKTOP ]] && exit_with_error "No option selected"
fi
#shellcheck source=configuration.sh
@ -240,9 +273,13 @@ source "${SRC}"/lib/configuration.sh
# optimize build time with 100% CPU usage
CPUS=$(grep -c 'processor' /proc/cpuinfo)
if [[ $USEALLCORES != no ]]; then
CTHREADS="-j$((CPUS + CPUS/2))"
else
CTHREADS="-j1"
fi
start=$(date +%s)
@ -342,5 +379,11 @@ fi
end=$(date +%s)
runtime=$(((end-start)/60))
display_alert "Runtime" "$runtime min" "info"
# Make it easy to repeat build by displaying build options used
display_alert "Repeat Build Options" "BOARD=${BOARD} BRANCH=${BRANCH} RELEASE=${RELEASE} BUILD_DESKTOP=${BUILD_DESKTOP} KERNEL_ONLY=${KERNEL_ONLY} KERNEL_CONFIGURE=no" "info"
display_alert "Repeat Build Options" "./compile.sh BOARD=${BOARD} BRANCH=${BRANCH} \
$([[ -n $RELEASE ]] && echo "RELEASE=${RELEASE} ")\
$([[ -n $BUILD_DESKTOP ]] && echo "BUILD_DESKTOP=${BUILD_DESKTOP} ")\
$([[ -n $KERNEL_ONLY ]] && echo "KERNEL_ONLY=${KERNEL_ONLY} ")\
$([[ -n $KERNEL_CONFIGURE ]] && echo "KERNEL_CONFIGURE=${KERNEL_CONFIGURE} ")\
" "info"

View File

@ -284,6 +284,8 @@ create_board_package()
BOARD=$BOARD
BOARD_NAME="$BOARD_NAME"
BOARDFAMILY=${BOARDFAMILY}
BUILD_REPOSITORY_URL=${BUILD_REPOSITORY_URL}
BUILD_REPOSITORY_COMMIT=${BUILD_REPOSITORY_COMMIT}
VERSION=$REVISION
LINUXFAMILY=$LINUXFAMILY
BRANCH=$BRANCH

View File

@ -3,7 +3,8 @@ background = #888a85
theme-name = Numix
icon-theme-name = Numix
default-user-image=/usr/share/pixmaps/armbian.png
indicators = ~language;~power
indicators = ~language;~power;~a11y
screensaver-timeout = 0
font-name = Sans 11
user-background = false
user-background = false
keyboard = onboard --theme=ModelM

View File

@ -36,7 +36,7 @@
<value type="string" value="+shutdown"/>
<value type="string" value="+restart"/>
<value type="string" value="+separator"/>
<value type="string" value="-logout"/>
<value type="string" value="+logout"/>
<value type="string" value="-logout-dialog"/>
</property>
<property name="appearance" type="uint" value="1"/>

View File

@ -26,8 +26,8 @@
<property name="Engine" type="empty"/>
</property>
<property name="shutdown" type="empty">
<property name="ShowLogout" type="bool" value="false"/>
<property name="ShowLogout" type="bool" value="true"/>
<property name="ShowHibernate" type="bool" value="false"/>
<property name="ShowSuspend" type="bool" value="true"/>
</property>
</channel>
</channel>

View File

@ -46,12 +46,14 @@ add_user()
[ -z "$RealUserName" ] && return
echo "Trying to add user $RealUserName"
adduser $RealUserName || return
for additionalgroup in sudo netdev audio video dialout plugdev input bluetooth systemd-journal ssh; do
for additionalgroup in sudo netdev audio video disk tty users games dialout plugdev input bluetooth systemd-journal ssh; do
usermod -aG ${additionalgroup} ${RealUserName} 2>/dev/null
done
# fix for gksu in Xenial
touch /home/$RealUserName/.Xauthority
chown $RealUserName:$RealUserName /home/$RealUserName/.Xauthority
RealName="$(awk -F":" "/^${RealUserName}:/ {print \$5}" </etc/passwd | cut -d',' -f1)"
[ -z "$RealName" ] && RealName=$RealUserName
echo -e "\nDear ${RealName}, your account ${RealUserName} has been created and is sudo enabled."
@ -67,12 +69,9 @@ add_user()
}
if [ -f /root/.not_logged_in_yet ] && [ -n "$BASH_VERSION" ] && [ "$-" != "${-#*i}" ]; then
# detect desktop
desktop_nodm=$(dpkg-query -W -f='${db:Status-Abbrev}\n' nodm 2>/dev/null)
desktop_lightdm=$(dpkg-query -W -f='${db:Status-Abbrev}\n' lightdm 2>/dev/null)
if [ -n "$desktop_nodm" ]; then DESKTOPDETECT="nodm"; fi
if [ -n "$desktop_lightdm" ]; then DESKTOPDETECT="lightdm"; fi
# detect lightdm
desktop_lightdm=$(dpkg-query -W -f='${db:Status-Abbrev}\n' lightdm 2>/dev/null)
if [ "$IMAGE_TYPE" != "nightly" ]; then
echo -e "\n\e[0;31mThank you for choosing Armbian! Support: \e[1m\e[39mwww.armbian.com\x1B[0m\n"
@ -85,7 +84,7 @@ if [ -f /root/.not_logged_in_yet ] && [ -n "$BASH_VERSION" ] && [ "$-" != "${-#*
echo -e "\nThis image is provided \e[0;31mAS IS\x1B[0m with \e[0;31mNO WARRANTY\x1B[0m and \e[0;31mNO END USER SUPPORT!\x1B[0m.\n"
fi
echo "Creating a new user account. Press <Ctrl-C> to abort"
[ -n "$DESKTOPDETECT" ] && echo "Desktop environment will not be enabled if you abort the new user creation"
[ -n "$desktop_lightdm" ] && echo "Desktop environment will not be enabled if you abort the new user creation"
trap check_abort INT
while [ -f "/root/.not_logged_in_yet" ]; do
add_user
@ -105,21 +104,17 @@ if [ -f /root/.not_logged_in_yet ] && [ -n "$BASH_VERSION" ] && [ "$-" != "${-#*
fi
fi
# check whether desktop environment has to be considered
if [ "$DESKTOPDETECT" = nodm ] && [ -n "$RealName" ] ; then
sed -i "s/NODM_USER=\(.*\)/NODM_USER=${RealUserName}/" /etc/default/nodm
sed -i "s/NODM_ENABLED=\(.*\)/NODM_ENABLED=true/g" /etc/default/nodm
if [[ -f /var/run/resize2fs-reboot ]]; then
# Let the user reboot now otherwise start desktop environment
printf "\n\n\e[0;91mWarning: a reboot is needed to finish resizing the filesystem \x1B[0m \n"
printf "\e[0;91mPlease reboot the system now \x1B[0m \n\n"
elif [ -z "$ConfigureDisplay" ] || [ "$ConfigureDisplay" = "n" ] || [ "$ConfigureDisplay" = "N" ]; then
echo -e "\n\e[1m\e[39mNow starting desktop environment...\x1B[0m\n"
sleep 3
service nodm stop
sleep 1
service nodm start
fi
elif [ "$DESKTOPDETECT" = lightdm ] && [ -n "$RealName" ] ; then
if [ -n "$desktop_lightdm" ] && [ -n "$RealName" ] ; then
# 1st run goes without login
mkdir -p /etc/lightdm/lightdm.conf.d
cat <<-EOF > /etc/lightdm/lightdm.conf.d/22-armbian-autologin.conf
[Seat:*]
autologin-user=$RealUserName
autologin-user-timeout=0
user-session=xfce
EOF
ln -sf /lib/systemd/system/lightdm.service /etc/systemd/system/display-manager.service
if [[ -f /var/run/resize2fs-reboot ]]; then
# Let the user reboot now otherwise start desktop environment
@ -129,6 +124,11 @@ if [ -f /root/.not_logged_in_yet ] && [ -n "$BASH_VERSION" ] && [ "$-" != "${-#*
echo -e "\n\e[1m\e[39mNow starting desktop environment...\x1B[0m\n"
sleep 1
service lightdm start 2>/dev/null
if [ -f /root/.desktop_autologin ]; then
rm /root/.desktop_autologin
else
(sleep 20; rm /etc/lightdm/lightdm.conf.d/22-armbian-autologin.conf) &
fi
# logout if logged at console
[[ -n $(who -la | grep root | grep tty1) ]] && exit 1
fi
@ -139,4 +139,4 @@ if [ -f /root/.not_logged_in_yet ] && [ -n "$BASH_VERSION" ] && [ "$-" != "${-#*
printf "\e[0;91mPlease reboot the system now \x1B[0m \n\n"
fi
fi
fi
fi

View File

@ -22,11 +22,5 @@ done
. /etc/armbian-release
KERNELID=$(uname -r)
if [ $(echo $BOARD_NAME | wc -c) -ge 17 ]; then
TERM=linux toilet -f standard -F metal $(echo $BOARD_NAME | sed 's/Orange Pi/OPi/' | sed 's/NanoPi/NPi/')
else
TERM=linux toilet -f standard -F metal $BOARD_NAME
fi
printf '\nWelcome to \e[0;91mARMBIAN\x1B[0m %s %s %s %s\n' "$VERSION $IMAGE_TYPE $PRETTY_NAME $KERNELID"
TERM=linux toilet -f standard -F metal $(echo $BOARD_NAME | sed 's/Orange Pi/OPi/' | sed 's/NanoPi/NPi/' | sed 's/Banana Pi/BPi/')
echo -e "Welcome to $(echo $NAME | cut -d' ' -f1) $(if [[ $ID == debian ]]; then echo ${PRETTY_NAME##*\(} | rev | cut -c2- | rev | sed 's/.*/\u&/'; else echo -n ${VERSION_CODENAME^};fi) with \e[0;91mArmbian Linux\x1B[0m $KERNELID"