VirtualBox

Changeset 44080 in vbox for trunk/src


Ignore:
Timestamp:
Dec 10, 2012 2:35:34 PM (12 years ago)
Author:
vboxsync
svn:sync-xref-src-repo-rev:
82592
Message:

lightdm-greeter: Implemented Guest Additions installation.

Location:
trunk/src/VBox
Files:
4 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/VBox/Additions/linux/Makefile.kmk

    r44075 r44080  
    126126
    127127VBOX_ADD_STRIP_SBIN += \
    128         VBoxService
     128        VBoxService \
     129        $(if $(VBOX_WITH_LIGHTDM_GREETER),vbox-greeter)
    129130
    130131VBOX_ADD_STRIP_LIB += \
     
    336337        $(QUIET)$(CP) -RPf -- $< $@
    337338
    338 
    339339INSTALLS += GuestDrivers-src
    340340GuestDrivers-src_INST = $(INST_ADDITIONS)src/
     
    358358        $(VBOX_REL_X11_ADD_INST)vboxvideo.ids \
    359359        selinux-fedora/vbox_x11.pp \
    360         selinux-fedora/vbox_accel.pp
     360        selinux-fedora/vbox_accel.pp \
     361    $(if $(VBOX_WITH_LIGHTDM_GREETER),lightdm-greeter/vbox-greeter.desktop)
    361362
    362363INSTALLS += lnx_add_inst-license
  • trunk/src/VBox/Additions/linux/installer/deffiles

    r41586 r44080  
    2626    /usr/bin/VBoxClient \
    2727    /usr/bin/VBoxControl \
     28    /usr/sbin/vbox-greeter \
    2829    /usr/sbin/vboxadd-timesync \
    2930    /usr/sbin/vboxadd-service \
     
    4445    /usr/lib/VBoxOGL.so \
    4546    /usr/lib64/VBoxOGL.so \
     47    /usr/share/xgreeters/vbox-greeter.desktop \
    4648    /etc/X11/Xsession.d/98vboxadd-xclient \
    4749    /etc/X11/xinit.d/98vboxadd-xclient \
  • trunk/src/VBox/Installer/linux/routines.sh

    r38924 r44080  
    621621    return 0
    622622}
     623
     624install_autologon() {
     625    info "Installing auto-logon support ..."
     626
     627    ## Parameters:
     628    # Greeter directory. Defaults to /usr/share/xgreeters.
     629    greeter_dir="$1"
     630    # LightDM config. Defaults to /etc/lightdm/lightdm.conf.
     631    lightdm_config="$2"
     632    # Whether to force installation if non-compatible distribution
     633    # is detected.
     634    force="$3"
     635   
     636    # Check for Ubuntu and derivates. @todo Debian?
     637    distros="Ubuntu UbuntuStudio Edubuntu Kubuntu Lubuntu Mythbuntu Xubuntu"
     638    ## @todo Map Linux Mint versions to Ubuntu ones.
     639
     640    ## @todo Move the distro check to a routine / globals as soon as
     641    ##       we have other distribution-dependent stuff.
     642    which lsb_release &>/dev/null
     643    if test "$?" -ne "0"; then
     644        info "Error: lsb_release not found (path set?), skipping auto-logon installation"
     645        return 1
     646    fi
     647    distro_name=$(lsb_release -si)
     648    distro_ver=$(lsb_release -sr)
     649
     650    for distro_cur in ${distros}; do
     651        if test "$distro_name" = "$distro_cur"; then
     652            distro_found="true"
     653            break
     654        fi
     655    done
     656
     657    if test -z "$distro_found"; then
     658        if ! test "$force" = "force"; then
     659            info "Error: Unsupported distribution \"$distro_name\" found, skipping auto-logon installation"
     660            return 1
     661        fi
     662        info "Warning: Unsupported distribution \"$distro_name\" found"
     663    else
     664        # Do we have Ubuntu 11.10 or greater?
     665        # Use AWK for comparison since we run on plan sh.
     666        echo | awk 'END { exit ( !('"$distro_ver >= 11.10"') ); }'
     667        if test "$?" -ne "0"; then
     668            if ! test "$force" = "force"; then
     669                info "Error: Version $distro_ver of \"$distro_name\" not supported, skipping auto-logon installation"
     670                return 1
     671            fi
     672            info "Warning: Unsupported \"$distro_name\" version $distro_ver found"
     673        fi
     674    fi
     675
     676    # Install dependencies (lightdm and FLTK 1.3+) using apt-get.
     677    which apt-get &>/dev/null
     678    if test "$?" -ne "0"; then
     679        info "Error: apt-get not found (path set?), skipping auto-logon installation"
     680        return 1
     681    fi
     682    info "Checking and installing necessary dependencies ..."
     683    apt-get -qqq -y install libfltk1.3 libfltk-images1.3 || return 1
     684    apt-get -qqq -y install lightdm || return 1
     685
     686    # Check for LightDM config.
     687    if ! test -f "$lightdm_config"; then
     688        info "Error: LightDM config \"$lightdm_config\" not found (LightDM installed?), skipping auto-logon installation"
     689        return 1
     690    fi
     691
     692    # Check for /usr/share/xgreeters.
     693    if ! test -d "$greeter_dir"; then
     694        if ! test "$force" = "force"; then
     695            info "Error: Directory \"$greeter_dir\" does not exist, skipping auto-logon installation"
     696            return 1
     697        fi
     698        info "Warning: Directory \"$greeter_dir\" does not exist, creating it"
     699        mkdir -p -m 755 "$greeter_dir" || return 1
     700    fi
     701   
     702    # Link to required greeter files into $greeter_dir.
     703    add_symlink "$INSTALLATION_DIR/share/VBoxGuestAdditions/vbox-greeter.desktop" "$greeter_dir/vbox-greeter.desktop"
     704
     705    # Backup and activate greeter config.
     706    if ! test -f "$lightdm_config.vbox-backup"; then
     707        info "Backing up LightDM configuration file ..."
     708        cp "$lightdm_config" "$lightdm_config.vbox-backup" || return 1
     709        chmod 644 "$lightdm_config.vbox-backup" || return 1
     710    fi
     711    sed -i -e 's/^\s*greeter-session\s*=/greeter-sessio**n=vbox-greeter/g' "$lightdm_config" || return 1
     712    chmod 644 "$lightdm_config" || return 1
     713
     714    info "Auto-logon installation successful"
     715    return 0
     716}
     717
     718remove_autologon() {
     719    if test -z "$LIGHTDM_CONFIG"; then
     720        return 0
     721    fi
     722    info "Un-installing auto-logon support ..."
     723
     724    # Switch back to original greeter.
     725    if test -f "$LIGHTDM_CONFIG.vbox-backup"; then
     726        mv "$LIGHTDM_CONFIG.vbox-backup" "$LIGHTDM_CONFIG"
     727        if test "$?" -ne "0"; then
     728            info "Warning: Could not restore original LightDM config \"$LIGHTDM_CONFIG\""
     729        fi
     730    fi
     731
     732    # Remove greeter directory (if not empty).
     733    rm "$LIGHTDM_GREETER_DIR" 2>/dev/null
     734
     735    return 0
     736}
     737
  • trunk/src/VBox/Installer/linux/run-inst.sh

    r40573 r44080  
    22#
    33# Oracle VM VirtualBox
    4 # VirtualBox Makeself installation starter script for Linux
     4# VirtualBox Makeself installation starter script
     5# for Linux Guest Additions
    56
    67#
    7 # Copyright (C) 2006-2009 Oracle Corporation
     8# Copyright (C) 2006-2012 Oracle Corporation
    89#
    910# This file is part of VirtualBox Open Source Edition (OSE), as
     
    2122# installation script.
    2223#
    23 
    2424PATH=$PATH:/bin:/sbin:/usr/sbin
    2525
     
    4343LOGFILE="/var/log/$PACKAGE.log"
    4444
     45INSTALLATION_LIGHTDM_CONFIG="/etc/lightdm/lightdm.conf"
     46INSTALLATION_LIGHTDM_GREETER_DIR="/usr/share/xgreeters"
     47
    4548. "./$ROUTINES"
    4649
     
    4952create_log "$LOGFILE"
    5053
     54## @todo r=andy: Explain options like "force" and "no_setup" -- not self-explanatory
     55#        to the user.
    5156usage()
    5257{
    5358    info ""
    54     info "Usage: install [<installation directory>] | uninstall [force] [no_setup]"
     59    info "Usage: $SELF install [<installation directory>] [--with-autologon] |"
     60    info "       uninstall"
     61    info "       [--force] [--no-setup]"
    5562    info ""
    5663    info "Example:"
     
    146153    done
    147154
     155    remove_autologon
     156
    148157    # Get rid of any remaining files
    149158    for i in $DEFAULT_FILE_NAMES; do
     
    192201# Sensible default actions
    193202ACTION="install"
     203WITH_AUTOLOGON=""
    194204DO_SETUP="true"
    195205NO_CLEANUP=""
     
    210220            ;;
    211221
    212         force)
     222        --lightdm-config)
     223            INSTALLATION_LIGHTDM_CONFIG="$2"
     224            shift
     225            ;;
     226
     227        --lightdm-greeter-dir)
     228            INSTALLATION_LIGHTDM_GREETER_DIR="$2"
     229            shift
     230            ;;
     231
     232        --with-autologon)
     233            WITH_AUTOLOGON="true"
     234            ;;
     235
     236        --force)
     237        force) # Keep for backwards compatibility.
    213238            FORCE_UPGRADE="force"
    214239            ;;
    215         no_setup)
     240
     241        --no-setup)
     242        no_setup) # Keep for backwards compatibility.
    216243            DO_SETUP=""
    217244            ;;
    218         no_cleanup)
     245
     246        --no-cleanup)
     247        no_cleanup) # Keep for backwards compatibility.
    219248            # Do not do cleanup of old modules when removing them.  For
    220249            # testing purposes only.
     
    222251            NO_CLEANUP="no_cleanup"
    223252            ;;
     253
    224254        *)
    225255            if [ "`echo $1|cut -c1`" != "/" ]; then
     
    292322BUILD_TYPE='$BUILD_TYPE'
    293323USERNAME='$USERNAME'
     324# LightDM greeter configuration
     325LIGHTDM_CONFIG='$INSTALLATION_LIGHTDM_CONFIG'
     326LIGHTDM_GREETER_DIR='$INSTALLATION_LIGHTDM_GREETER_DIR'
    294327EOF
    295328
     
    356389        esac
    357390    done
     391
     392# Load configuration values
     393test -r "$CONFIG_DIR/$CONFIG" && . "$CONFIG_DIR/$CONFIG"
     394
     395# Remove auto-logon support
     396remove_autologon
     397
     398# Remove configuration files
    358399rm "$CONFIG_DIR/$CONFIG_FILES" 2>/dev/null
    359400rm "$CONFIG_DIR/$CONFIG" 2>/dev/null
     
    365406test -n "$REMOVE_INSTALLATION_DIR" &&
    366407  echo "$INSTALLATION_DIR/" >> "$CONFIG_DIR/$CONFIG_FILES"
     408
     409# Install auto-logon support.
     410if test -n "$WITH_AUTOLOGON"; then
     411    ## @todo Make parameters configurable thru command line.
     412    install_autologon "$INSTALLATION_LIGHTDM_GREETER_DIR" "$INSTALLATION_LIGHTDM_CONFIG" "$FORCE_UPGRADE"
     413fi
     414
Note: See TracChangeset for help on using the changeset viewer.

© 2025 Oracle Support Privacy / Do Not Sell My Info Terms of Use Trademark Policy Automated Access Etiquette