VirtualBox

Ignore:
Timestamp:
May 28, 2016 7:48:13 AM (9 years ago)
Author:
vboxsync
svn:sync-xref-src-repo-rev:
107552
Message:

bugref:8087: Additions/x11: support non-root X server: update the guest initramfs after building the Additions kernel modules so that the video driver can be used for the boot splash screen.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/VBox/Additions/linux/installer/vboxadd.sh

    r61206 r61260  
    3939SCRIPTNAME=vboxadd.sh
    4040QUICKSETUP=
     41
     42# These are getting hard-coded in more and more places...
     43test -z "${KERN_DIR}" && KERN_DIR="/lib/modules/`uname -r`/build"
     44test -z "${MODULE_DIR}" && MODULE_DIR="/lib/modules/`uname -r`/misc"
     45KERN_DIR_SUFFIX="${KERN_DIR#/lib/modules/}"
     46KERN_VER="${KERN_DIR_SUFFIX%/*}"
    4147
    4248if $MODPROBE -c 2>/dev/null | grep -q '^allow_unsupported_modules  *0'; then
     
    283289}
    284290
     291## Update the initramfs.  Debian and Ubuntu put the graphics driver in, and
     292# need the touch(1) command below.  Everyone else that I checked just need
     293# the right module alias file from depmod(1) and only use the initramfs to
     294# load the root filesystem, not the boot splash.  update-initramfs works
     295# for the first two and dracut for every one else I checked.  We are only
     296# interested in distributions recent enough to use the KMS vboxvideo driver.
     297## @param $1  kernel version to update for.
     298update_module_dependencies()
     299{
     300    depmod "${1}"
     301    test -d "/lib/modules/${1}/initrd" &&
     302        touch "/lib/modules/${1}/initrd/vboxvideo"
     303    test -n "${QUICKSETUP}" && return
     304    if type dracut >/dev/null 2>&1; then
     305        dracut -f "/boot/initramfs-${1}.img"
     306    elif type update-initramfs >/dev/null 2>&1; then
     307        update-initramfs -u -k "${1}"
     308    fi
     309}
     310
    285311# Remove any existing VirtualBox guest kernel modules from the disk, but not
    286312# from the kernel as they may still be in use
     
    337363    fi
    338364    succ_msg
    339     depmod
     365    update_module_dependencies "${KERN_VER}"
    340366    return 0
    341367}
     
    472498    # Delete old versions of VBox modules.
    473499    cleanup_modules
    474     depmod
     500    for i in /lib/modules/*; do
     501        update_module_dependencies "${i#/lib/modules}"
     502    done
    475503
    476504    # Remove old module sources
     
    489517    rmdir -p /etc/kernel/postinst.d /etc/kernel/prerm.d 2>/dev/null
    490518    rm /etc/udev/rules.d/60-vboxadd.rules 2>/dev/null
     519    rm -f /lib/modules/*/initrd/vboxvideo
    491520}
    492521
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