From 3c185578e17acb79216b4a573e0c8af9671a6c45 Mon Sep 17 00:00:00 2001 From: Simon Rettberg Date: Wed, 19 Feb 2014 19:50:46 +0100 Subject: Support loading selected drm gfx drivers only, based on pci ids --- remote/includes/kernel.inc | 4 +- .../data/etc/modprobe.d/vmwgfx-fbdev.conf | 5 ++ .../rootfs/rootfs-stage31/data/inc/drm.functions | 71 ++++++++++++++++++++++ remote/rootfs/rootfs-stage31/data/inc/functions | 4 ++ remote/rootfs/rootfs-stage31/data/init | 30 ++++----- remote/rootfs/rootfs-stage31/rootfs-stage31.build | 41 +++++++++---- remote/rootfs/rootfs-stage31/rootfs-stage31.conf | 6 +- remote/rootfs/rootfs-stage31/templates/drm.cfg | 6 ++ 8 files changed, 132 insertions(+), 35 deletions(-) create mode 100644 remote/rootfs/rootfs-stage31/data/etc/modprobe.d/vmwgfx-fbdev.conf create mode 100644 remote/rootfs/rootfs-stage31/data/inc/drm.functions create mode 100644 remote/rootfs/rootfs-stage31/templates/drm.cfg (limited to 'remote') diff --git a/remote/includes/kernel.inc b/remote/includes/kernel.inc index ccd10970..4eef36e5 100644 --- a/remote/includes/kernel.inc +++ b/remote/includes/kernel.inc @@ -99,8 +99,8 @@ copy_kernel_modules() { # generate modules map files # # first strip modules.order of all the modules we don't use - cat "${KERNEL_MODULES_DIR}/modules.order" | grep -E $(echo ${REQUIRED_KERNEL_MODULES} | tr '\ ' '|') \ - >> "${TARGET_BUILD_DIR}/${KERNEL_MODULES_DIR}/modules.order" + cat "${KERNEL_MODULES_DIR}/modules.order" | grep -E "$(echo ${REQUIRED_KERNEL_MODULES} | tr '\ ' '|' | tr '_' '.' | tr '-' '.')" \ + >> "${TARGET_BUILD_DIR}/${KERNEL_MODULES_DIR}/modules.order" # copy list of builtin kernel modules cp "${KERNEL_MODULES_DIR}/modules.builtin" "${TARGET_BUILD_DIR}/${KERNEL_MODULES_DIR}" # with modules.order and modules.builtin, we can run depmod for the rest of the files diff --git a/remote/rootfs/rootfs-stage31/data/etc/modprobe.d/vmwgfx-fbdev.conf b/remote/rootfs/rootfs-stage31/data/etc/modprobe.d/vmwgfx-fbdev.conf new file mode 100644 index 00000000..ebc4b49c --- /dev/null +++ b/remote/rootfs/rootfs-stage31/data/etc/modprobe.d/vmwgfx-fbdev.conf @@ -0,0 +1,5 @@ +# when vmwgfx is loaded via modprobe in stage31, this conf file is read, +# enables fbdev support for vmware so that +# fb doesnt break when switching tty's in minilinux running inside vmware +options vmwgfx enable_fbdev=1 + diff --git a/remote/rootfs/rootfs-stage31/data/inc/drm.functions b/remote/rootfs/rootfs-stage31/data/inc/drm.functions new file mode 100644 index 00000000..666f22a9 --- /dev/null +++ b/remote/rootfs/rootfs-stage31/data/inc/drm.functions @@ -0,0 +1,71 @@ + +# pass module name(s) relative path in /lib/modules with .ko extension, or special like @nvidia or @amd +load_gfx () { + local MOD FILES OFFSET RETVAL + RETVAL=1 # default: failure + while [ $# -gt 0 ]; do + MOD=$(echo $1) # trim :) + shift + [ -z "$MOD" ] && continue + if [ "x${MOD}" != "x${MOD#@}" ]; then + # starts with '@' - special + OFFSET=$(( ${#MOD} + 2 )) + FILES=$( grep "^$MOD\s" "/drm.cfg" | cut -c ${OFFSET}- ) + [ -z "$FILES" ] && drop_shell "Could not find entry for special $MOD" + if load_gfx $FILES; then + RETVAL=0 + else + # loading special case failed, try fallback if found + MOD="${MOD}_fallback" + OFFSET=$(( ${#MOD} + 2 )) + FILES=$( grep "^$MOD\s" "/drm.cfg" | cut -c ${OFFSET}- ) + [ -n "$FILES" ] && load_gfx $FILES && RETVAL=0 + fi + else # regular module name or filename + if [ "x${MOD%.ko}" == "x${MOD}" ]; then + # regular module name + modprobe "$MOD" && RETVAL=0 + else + # a .ko file + insmod "/lib/modules/$MOD" && RETVAL=0 + fi + fi + done + return $RETVAL +} + +setup_gfx () { + local KERN RETVAL CARD CARDS SUCCESS FILES DRM + # check which driver to load + CARDS=$(lspci | grep 'Class 03' | awk '{print $4}') + if [ -e "/drm.cfg" ] && [ -n "$CARDS" ]; then + SUCCESS="yes" + for CARD in $CARDS; do + # look up exact pci id of this card + echo Trying exact matching for drm drivers for $CARD + FILES=$(grep "^$CARD\s" "/drm.cfg" | cut -c 11-) + load_gfx $FILES && continue + # failed... try vendor id only + CARD=$(echo $CARD | cut -c 1-4) + echo Trying vendor matching for drm drivers for $CARD + FILES=$(grep "^$CARD\s" "/drm.cfg" | cut -c 6-) + load_gfx $FILES && continue + # everything failed for this card + echo Unknown PCI vendor id: $CARD + SUCCESS="no" + done + [ "x$SUCCESS" == "xyes" ] && return 0 + fi + # braindead fallback + echo "At least one gfx card has no known drm drivers.... will load them all :/" + KERN=$(uname -r) + RETVAL=1 + [ -z "$KERN" ] && KERN=$(ls '/lib/modules' | grep '\.' | tail -n 1) + for DRM in $(find "/lib/modules/$KERN/kernel/drivers/gpu/drm" -name "*.ko"); do + DRM="$(basename "$DRM")" + DRM="${DRM%.ko}" + modprobe "$DRM" && RETVAL=0 + done + return $RETVAL +} + diff --git a/remote/rootfs/rootfs-stage31/data/inc/functions b/remote/rootfs/rootfs-stage31/data/inc/functions index 161533ef..f07acc7d 100644 --- a/remote/rootfs/rootfs-stage31/data/inc/functions +++ b/remote/rootfs/rootfs-stage31/data/inc/functions @@ -11,6 +11,10 @@ # drop_shell "This is your error message." # drop_shell() { + if [ -n "$MUTED_OUTPUT" ]; then + exec 1>&4 2>&5 + reset + fi [ $# -gt 0 ] && echo $@ echo "CTRL + D will continue booting." setsid sh -c 'exec sh /dev/tty1 2>&1' diff --git a/remote/rootfs/rootfs-stage31/data/init b/remote/rootfs/rootfs-stage31/data/init index 95495684..368b3a64 100755 --- a/remote/rootfs/rootfs-stage31/data/init +++ b/remote/rootfs/rootfs-stage31/data/init @@ -56,25 +56,17 @@ for opts in ${KCL}; do esac done -setup_gfx () { - # read graphic and network adaptor configuration (without proprietary drivers yet) - # TODO: most ugly hack ever... needs to be improved when we add prop drivers - for DRM in /lib/modules/*/kernel/drivers/gpu/drm/*.ko /lib/modules/*/kernel/drivers/gpu/drm/*/*.ko; do - DRM="$(basename "$DRM")" - DRM="${DRM%.ko}" - #echo "Trying to load module $DRM" - modprobe "$DRM" 2>/dev/null - done - # start some kind of splash screen if activated - [ $SPLASH -eq 1 ] && setsid fbsplash -x -c -s /etc/splash.ppm -} - -if [ $SPLASH -eq 1 ]; then - exec 3>&1 4>&2 > /dev/null 2>&1 - echo "1 1 0 1" > /proc/sys/kernel/printk - setup_gfx +. "/inc/drm.functions" + +if [ "$SPLASH" -eq 1 ]; then + if setup_gfx; then + echo "1 1 0 1" > /proc/sys/kernel/printk + exec 4>&1 5>&2 > /dev/null 2>&1 + MUTED_OUTPUT=1 + setsid fbsplash -x -c -s /etc/splash.ppm + fi else - setup_gfx & + setup_gfx fi @@ -126,7 +118,7 @@ done echo "Switching root...." echo "$bench_result" > "${FUTURE_ROOT}/opt/openslx/.benchmark" # Prepare environment (HOME is needed as a hack for nss_ldap with ssl and no caching) -unset BOOT_IMAGE initrd KCL ip slxbase slxsrv IPINFO vga ip MAC BOOTIF DEBUG OLDPWD +unset BOOT_IMAGE initrd KCL ip slxbase slxsrv IPINFO vga ip MAC BOOTIF DEBUG OLDPWD MUTED_OUTPUT export HOME=/ export init="/usr/lib/systemd/systemd" export recovery= diff --git a/remote/rootfs/rootfs-stage31/rootfs-stage31.build b/remote/rootfs/rootfs-stage31/rootfs-stage31.build index f3eab5b6..3711e16d 100644 --- a/remote/rootfs/rootfs-stage31/rootfs-stage31.build +++ b/remote/rootfs/rootfs-stage31/rootfs-stage31.build @@ -4,6 +4,7 @@ fetch_source() { } build() { + local COPYLIST BIN_LOCATION DRM_MODULES FILE BIN MODNAME PCI_FILE ALIAS VENDOR DEVICE COPYLIST="list_binaries_and_files" [ -e "$COPYLIST" ] && rm -f "$COPYLIST" for BIN in $REQUIRED_BINARIES; do @@ -11,14 +12,38 @@ build() { [ -z "$BIN_LOCATION" ] && perror "Cannot find $BIN" get_link_chain "$BIN_LOCATION" >> "$COPYLIST" done - for FILE in $REQUIRED_FILES; do - get_link_chain "$FILE" >> "$COPYLIST" - done mkdir -p "$MODULE_BUILD_DIR/lib" find /lib /lib64 /usr/lib /usr/lib64 \( -name "libnss_dns*" -o -name "libresolv*" \) -exec cp -a {} "$MODULE_BUILD_DIR/lib/" \; tarcopy "$(cat "$COPYLIST" | sort -u)" "$MODULE_BUILD_DIR" + + # generate drm module loading database + pinfo "Generating PCI ID database for DRM drivers" + DRM_MODULES="$MODULES_DIR/kernel/build/lib/modules/$SYS_UTS_RELEASE/kernel/drivers/gpu/drm" + PCI_FILE="$MODULE_BUILD_DIR/drm.cfg" + [ -d "$DRM_MODULES" ] || perror "DRM dir not found at $DRM_MODULES" + cp "$MODULE_DIR/templates/drm.cfg" "$PCI_FILE" || perror "Could not copy drm.cfg from templates dir" + echo "# -- generated from kernel $SYS_UTS_RELEASE modules:" >> "$PCI_FILE" + for FILE in $(find "$DRM_MODULES" -name "*.ko"); do + MODNAME=$(basename "$FILE") + MODNAME=${MODNAME%.ko} + [ -z "$MODNAME" ] && perror "$FILE equals empty modname" + echo "# $MODNAME" >> "$PCI_FILE" + for ALIAS in $(modinfo "$FILE" | grep '^alias:' | grep -o 'pci:v.*' | tr '[A-F]' '[a-f]'); do + VENDOR=$(echo $ALIAS | cut -c 10-13) + if [ "x$(echo $ALIAS | cut -c 15)" == "x*" ]; then + # device wildcard + grep -q -i "^${VENDOR}\s" "$PCI_FILE" && continue + echo "${VENDOR} $MODNAME" >> "$PCI_FILE" + else + # specific device + DEVICE=$(echo $ALIAS | cut -c 19-22) + grep -q -i "^${VENDOR}:${DEVICE}\s" "$PCI_FILE" && continue + echo "${VENDOR}:${DEVICE} $MODNAME" >> "$PCI_FILE" + fi + done + done } post_copy() { @@ -29,13 +54,6 @@ post_copy() { copy_kernel_modules copy_firmware copy_kernel - - # when vmwgfx is loaded via modprobe in stage31, this conf file is read, - # enables fbdev support for vmware so that - # fb doesnt break when switching tty's in minilinux running inside vmware - # TODO: Why isn't this a simple static file in this module's data dir? - mkdir -p "$TARGET_BUILD_DIR/etc/modprobe.d" - echo "options vmwgfx enable_fbdev=1" > "${TARGET_BUILD_DIR}"/etc/modprobe.d/vmwgfx-fbdev.conf } # @@ -52,8 +70,5 @@ generate_rootfs() { # copy libc and ld-linux tarcopy "$(list_basic_libs)" "${TARGET_BUILD_DIR}" - - # copy required files - tarcopy "${REQUIRED_FILES}" "${TARGET_BUILD_DIR}" } diff --git a/remote/rootfs/rootfs-stage31/rootfs-stage31.conf b/remote/rootfs/rootfs-stage31/rootfs-stage31.conf index 02887e69..4b638678 100644 --- a/remote/rootfs/rootfs-stage31/rootfs-stage31.conf +++ b/remote/rootfs/rootfs-stage31/rootfs-stage31.conf @@ -68,8 +68,12 @@ REQUIRED_LIBRARIES=" libnss_dns libresolv " -REQUIRED_FILES=" +REQUIRED_SYSTEM_FILES=" /etc/protocols /etc/services /etc/localtime " +REQUIRED_FILES=" + /drm.cfg +" + diff --git a/remote/rootfs/rootfs-stage31/templates/drm.cfg b/remote/rootfs/rootfs-stage31/templates/drm.cfg new file mode 100644 index 00000000..f0a9db0c --- /dev/null +++ b/remote/rootfs/rootfs-stage31/templates/drm.cfg @@ -0,0 +1,6 @@ +# nvidia +10de:0193 @nvidia +# aliases +@nvidia nvidia/nvidia.ko nvidia/nvidia-uvm.ko +@nvidia_fallback nouveau + -- cgit v1.2.3-55-g7522 From a7559cf15811737c71ff2dd3e6c2a0c709c6cd12 Mon Sep 17 00:00:00 2001 From: Christian Rößler Date: Thu, 20 Feb 2014 15:38:54 +0100 Subject: [nvidia_libs] Module building libraries for nvidia GPU driver package. --- remote/modules/nvidia_libs/nvidia_libs.build | 120 +++++++++++++++++++++ remote/modules/nvidia_libs/nvidia_libs.conf | 25 +++++ remote/modules/nvidia_libs/nvidia_libs.conf.ubuntu | 10 ++ 3 files changed, 155 insertions(+) create mode 100644 remote/modules/nvidia_libs/nvidia_libs.build create mode 100644 remote/modules/nvidia_libs/nvidia_libs.conf create mode 100644 remote/modules/nvidia_libs/nvidia_libs.conf.ubuntu (limited to 'remote') diff --git a/remote/modules/nvidia_libs/nvidia_libs.build b/remote/modules/nvidia_libs/nvidia_libs.build new file mode 100644 index 00000000..4c8d68bc --- /dev/null +++ b/remote/modules/nvidia_libs/nvidia_libs.build @@ -0,0 +1,120 @@ +fetch_source() { + mkdir -p src 2>/dev/null + cd src || perror "Could not change into src directory." + download "$REQUIRED_URL" +} + +build() { + local KERNELSRCDIR="$MODULE_DIR/../kernel/ksrc" # kernel sources + local TEMPDIR="$MODULE_DIR/temp" + local ROOTLOWERDIR="/" + local ROOTUPPERDIR="$MODULE_DIR/build" + local ROOTBINDDIR="$TEMPDIR/rootbind" + local ROOTMOUNTDIR="$TEMPDIR/rootmount" + local BINDMOUNTS="/dev /proc /run /sys" + local NVIDIA="$MODULE_DIR/src/$REQUIRED_NVIDIA" + local NVIDIAEXTRACTDIR="$ROOTMOUNTDIR/NVIDIA" + local NVEXTRACTDIR="/NVIDIA" # This is relative to the chroot. + + make_dirs () { + [ -d "$TEMPDIR" ] && rm -rf "$TEMPDIR" + mkdir -p "$TEMPDIR" || perror "Could not create base directory for mount directories $TEMPDIR." + for DIR in "$ROOTBINDDIR" "$ROOTMOUNTDIR"; do + mkdir -p "$DIR" || perror "Could not create directory for mount directory $DIR." + done + } + + mount_dirs () { + pinfo "Executing bind- and overlay mounts ..." + mount -o bind "$ROOTLOWERDIR" "$ROOTBINDDIR" || perror "Could not mount (bind) $ROOTLOWERDIR to $ROOTBINDDIR." + mount -o remount,ro "$ROOTBINDDIR" || perror "Could not remount $ROOTBINDDIR ro read-only." + mount -t overlayfs overlayfs -o lowerdir="$ROOTBINDDIR",upperdir="$ROOTUPPERDIR" "$ROOTMOUNTDIR" \ + || perror "Could not mount (overlayfs) $ROOTLOWERDIR, $ROOTUPPERDIR to $BINDDIR." + pinfo "Executing bind mounts ($BINDMOUNTS) for chroot root dir ..." + for MOUNT in $BINDMOUNTS; do + mount -o bind "$MOUNT" "$ROOTMOUNTDIR/$MOUNT" || perror "Could not mount (bind) $MOUNTS into chroot root dir." + done + } + + # We inject a bashrc to be executed later within the chroot. + gen_bashrc () { + local COMMON_OPTIONS=' --no-nouveau-check --no-network --no-backup --no-rpms --no-runlevel-check --no-distro-scripts --no-cc-version-check --no-x-check --no-precompiled-interface --silent ' + + cat >"$ROOTMOUNTDIR/$HOME/.bashrc"<<-EOF + echo "chroot successful." + alias ll='ls -alF' # A little convenience for debugging purposes. + PS1='\[\e[1;33m\]chroot@\h:\w\$ \[\e[1;32m\]' # To recognize the chroot instantly when debugging (yellow on black). + cd "$NVEXTRACTDIR" + ./nvidia-installer $COMMON_OPTIONS --no-kernel-module # Do the work! + exit # Out-comment this for debugging: Then script stays in chroot. +EOF + } + + unpack_nvidia () { + [ -d "$NVIDIAEXTRACTDIR" ] && rm -rf "$NVIDIAEXTRACTDIR" + pinfo "Unpacking NVidia archive ($NVIDIA) ..." + sh "$NVIDIA" --extract-only --target "$NVIDIAEXTRACTDIR" || perror "Could not extract $NVIDIA to $NVIDIAEXTRACTDIR." + } + + umount_dirs () { + # Let's tidy the place, or at least the mounts: Otherwise these would stack up, and we do not like that, don't we. + for MOUNT in $BINDMOUNTS; do + umount "$ROOTMOUNTDIR/$MOUNT" || pwarning "Could not unmount $ROOTMOUNTDIR/$MOUNT!" + done + umount "$ROOTMOUNTDIR" || pwarning "Could not unmount $ROOTMOUNTDIR!" + umount "$ROOTBINDDIR" || pwarning "Could not unmount $ROOTBINDDIR!" + } + + clean_whiteouts () { + # The case of these overlay whiteouts should be investigated instead of just killing them. But for now... + pdebug "Searching for overlayfs-whiteouts ..." + for WHITEOUT in $(find "$MODULE_DIR/build" -lname "(overlay-whiteout)"); do + pdebug "Whiteout found: $WHITEOUT" + rm -f "$WHITEOUT" || perror "Could not delete whiteout $WHITEOUT!" + done + } + + clean_temp () { + rm -rf "$TEMPDIR" || perror "Could not clean/delete temp directory $TEMPDIR." + } + + # Main stuff + pinfo "Generating temporary directories ..." + make_dirs + pinfo "Mounting directories ..." + mount_dirs + + pinfo "Injecting .bashrc into later chroot ..." + gen_bashrc + + pinfo "Unpacking NVidia-Installer ..." + unpack_nvidia + + pinfo "Ready to chroot - compiling may take some time." + pdebug "--- chroot ---------------------------------------------------------------------" + pdebug "- -" + pdebug "- Notice: This may take a while! -" + pdebug "- -" + pdebug "- Please keep note the Nvidia installer _will_ complain about -" + pdebug "- several warnings and errors. It will do this in any case. -" + pdebug "- -" + pdebug "- This does _not_ mean the kernel module compilation was unsuccessful! -" + pdebug "- -" + pdebug "--------------------------------------------------------------------------------" + chroot "$ROOTMOUNTDIR" + pinfo "chroot terminated." + + pinfo "Unmount directories ..." + umount_dirs + + pinfo "Cleaning whiteouts ..." + clean_whiteouts + + pinfo "Cleaning / deleting temp directories." + clean_temp +} + +post_copy() { + : +} + diff --git a/remote/modules/nvidia_libs/nvidia_libs.conf b/remote/modules/nvidia_libs/nvidia_libs.conf new file mode 100644 index 00000000..0ef76cc3 --- /dev/null +++ b/remote/modules/nvidia_libs/nvidia_libs.conf @@ -0,0 +1,25 @@ +REQUIRED_VERSION="331.38" +REQUIRED_NVIDIA="NVIDIA-Linux-x86_64-$REQUIRED_VERSION.run" +REQUIRED_URL="http://download.nvidia.com/XFree86/Linux-x86_64/$REQUIRED_VERSION/$REQUIRED_NVIDIA" + +REQUIRED_FILES=" + /etc/OpenCL/vendors/nvidia.icd + /usr/share/nvidia/nvidia-application-profiles-331.38-rc + /usr/share/applications/nvidia-settings.desktop +" + +REQUIRED_DIRECTORIES=" + /usr/bin + /usr/lib + /usr/lib/vdpau + /usr/lib/xorg + /usr/lib/xorg/modules + /usr/lib/xorg/modules/drivers + /usr/lib/xorg/modules/extensions + /usr/lib/tls + /usr/lib/x86_64-linux-gnu + /usr/lib/x86_64-linux-gnu/mesa + /usr/lib32 + /usr/lib32/vdpau + +" diff --git a/remote/modules/nvidia_libs/nvidia_libs.conf.ubuntu b/remote/modules/nvidia_libs/nvidia_libs.conf.ubuntu new file mode 100644 index 00000000..1eccb199 --- /dev/null +++ b/remote/modules/nvidia_libs/nvidia_libs.conf.ubuntu @@ -0,0 +1,10 @@ +# libvdpau: While nvidia delivers a linvdpau within it's driver package, nvidia +# itself recommends using a distribution package if available. So, here we go. + +REQUIRED_CONTENT_PACKAGES=" + libvdpau1 +" + +REQUIRED_INSTALLED_PACKAGES=" + libvdpau1 +" -- cgit v1.2.3-55-g7522 From c4756f786d74fb6c3ba606a3ed80887cbbeb5c47 Mon Sep 17 00:00:00 2001 From: Christian Rößler Date: Thu, 20 Feb 2014 18:30:29 +0100 Subject: [nvidia_libs] Debug: Checkin für Joey:). --- remote/modules/nvidia_libs/nvidia_libs.build | 3 ++- remote/modules/nvidia_libs/nvidia_libs.conf | 40 +++++++++++++++------------- 2 files changed, 24 insertions(+), 19 deletions(-) (limited to 'remote') diff --git a/remote/modules/nvidia_libs/nvidia_libs.build b/remote/modules/nvidia_libs/nvidia_libs.build index 4c8d68bc..9dd4c0e2 100644 --- a/remote/modules/nvidia_libs/nvidia_libs.build +++ b/remote/modules/nvidia_libs/nvidia_libs.build @@ -76,6 +76,7 @@ EOF clean_temp () { rm -rf "$TEMPDIR" || perror "Could not clean/delete temp directory $TEMPDIR." + rm -rf "$ROOTUPPERDIR/NVIDIA" } # Main stuff @@ -98,7 +99,7 @@ EOF pdebug "- Please keep note the Nvidia installer _will_ complain about -" pdebug "- several warnings and errors. It will do this in any case. -" pdebug "- -" - pdebug "- This does _not_ mean the kernel module compilation was unsuccessful! -" + pdebug "- This does _not_ mean the library module compilation was unsuccessful! -" pdebug "- -" pdebug "--------------------------------------------------------------------------------" chroot "$ROOTMOUNTDIR" diff --git a/remote/modules/nvidia_libs/nvidia_libs.conf b/remote/modules/nvidia_libs/nvidia_libs.conf index 0ef76cc3..faec87ec 100644 --- a/remote/modules/nvidia_libs/nvidia_libs.conf +++ b/remote/modules/nvidia_libs/nvidia_libs.conf @@ -2,24 +2,28 @@ REQUIRED_VERSION="331.38" REQUIRED_NVIDIA="NVIDIA-Linux-x86_64-$REQUIRED_VERSION.run" REQUIRED_URL="http://download.nvidia.com/XFree86/Linux-x86_64/$REQUIRED_VERSION/$REQUIRED_NVIDIA" -REQUIRED_FILES=" - /etc/OpenCL/vendors/nvidia.icd - /usr/share/nvidia/nvidia-application-profiles-331.38-rc - /usr/share/applications/nvidia-settings.desktop -" +#REQUIRED_FILES=" +# /etc/OpenCL/vendors/nvidia.icd +# /usr/share/nvidia/nvidia-application-profiles-331.38-rc +# /usr/share/applications/nvidia-settings.desktop +#" -REQUIRED_DIRECTORIES=" - /usr/bin - /usr/lib - /usr/lib/vdpau - /usr/lib/xorg - /usr/lib/xorg/modules - /usr/lib/xorg/modules/drivers - /usr/lib/xorg/modules/extensions - /usr/lib/tls - /usr/lib/x86_64-linux-gnu - /usr/lib/x86_64-linux-gnu/mesa - /usr/lib32 - /usr/lib32/vdpau +#REQUIRED_DIRECTORIES=" +# /usr/bin +# /usr/lib +# /usr/lib/vdpau +# /usr/lib/xorg +# /usr/lib/xorg/modules +# /usr/lib/xorg/modules/drivers +# /usr/lib/xorg/modules/extensions +# /usr/lib/tls +# /usr/lib/x86_64-linux-gnu +# /usr/lib/x86_64-linux-gnu/mesa +# /usr/lib32 +# /usr/lib32/vdpau +# +#" +REQUIRED_DIRECTORIES=" + / " -- cgit v1.2.3-55-g7522 From 63cd79259b42b8e088024eef7027aa52018e5f19 Mon Sep 17 00:00:00 2001 From: Dirk Date: Fri, 21 Feb 2014 11:15:26 +0100 Subject: Setzen des Windows-Namens beim Booten aus Laufwerk B: --- remote/modules/vmchooser/data/bootpgm.exe | Bin 0 -> 8704 bytes 1 file changed, 0 insertions(+), 0 deletions(-) create mode 100644 remote/modules/vmchooser/data/bootpgm.exe (limited to 'remote') diff --git a/remote/modules/vmchooser/data/bootpgm.exe b/remote/modules/vmchooser/data/bootpgm.exe new file mode 100644 index 00000000..88f89418 Binary files /dev/null and b/remote/modules/vmchooser/data/bootpgm.exe differ -- cgit v1.2.3-55-g7522 From a60ffa79a5a2c08cfc0ce3146dcae2a7459d7bbb Mon Sep 17 00:00:00 2001 From: Dirk Date: Fri, 21 Feb 2014 11:23:55 +0100 Subject: Sorry, jetzt korrekte Verzeichnis. --- remote/modules/vmchooser/data/bootpgm.exe | Bin 8704 -> 0 bytes .../data/opt/openslx/vmchooser/data/bootpgm.exe | Bin 0 -> 8704 bytes 2 files changed, 0 insertions(+), 0 deletions(-) delete mode 100644 remote/modules/vmchooser/data/bootpgm.exe create mode 100644 remote/modules/vmchooser/data/opt/openslx/vmchooser/data/bootpgm.exe (limited to 'remote') diff --git a/remote/modules/vmchooser/data/bootpgm.exe b/remote/modules/vmchooser/data/bootpgm.exe deleted file mode 100644 index 88f89418..00000000 Binary files a/remote/modules/vmchooser/data/bootpgm.exe and /dev/null differ diff --git a/remote/modules/vmchooser/data/opt/openslx/vmchooser/data/bootpgm.exe b/remote/modules/vmchooser/data/opt/openslx/vmchooser/data/bootpgm.exe new file mode 100644 index 00000000..88f89418 Binary files /dev/null and b/remote/modules/vmchooser/data/opt/openslx/vmchooser/data/bootpgm.exe differ -- cgit v1.2.3-55-g7522 From 672d6dacea77c60b787a57499e2a4965ecc4a15d Mon Sep 17 00:00:00 2001 From: Simon Rettberg Date: Mon, 24 Feb 2014 11:58:58 +0100 Subject: [nvidia_libs] Fix indentation --- remote/modules/nvidia_libs/nvidia_libs.build | 54 ++++++++++++++-------------- 1 file changed, 27 insertions(+), 27 deletions(-) (limited to 'remote') diff --git a/remote/modules/nvidia_libs/nvidia_libs.build b/remote/modules/nvidia_libs/nvidia_libs.build index 9dd4c0e2..7e4e86c7 100644 --- a/remote/modules/nvidia_libs/nvidia_libs.build +++ b/remote/modules/nvidia_libs/nvidia_libs.build @@ -6,7 +6,7 @@ fetch_source() { build() { local KERNELSRCDIR="$MODULE_DIR/../kernel/ksrc" # kernel sources - local TEMPDIR="$MODULE_DIR/temp" + local TEMPDIR="$MODULE_DIR/temp" local ROOTLOWERDIR="/" local ROOTUPPERDIR="$MODULE_DIR/build" local ROOTBINDDIR="$TEMPDIR/rootbind" @@ -15,7 +15,7 @@ build() { local NVIDIA="$MODULE_DIR/src/$REQUIRED_NVIDIA" local NVIDIAEXTRACTDIR="$ROOTMOUNTDIR/NVIDIA" local NVEXTRACTDIR="/NVIDIA" # This is relative to the chroot. - + make_dirs () { [ -d "$TEMPDIR" ] && rm -rf "$TEMPDIR" mkdir -p "$TEMPDIR" || perror "Could not create base directory for mount directories $TEMPDIR." @@ -23,23 +23,23 @@ build() { mkdir -p "$DIR" || perror "Could not create directory for mount directory $DIR." done } - + mount_dirs () { pinfo "Executing bind- and overlay mounts ..." mount -o bind "$ROOTLOWERDIR" "$ROOTBINDDIR" || perror "Could not mount (bind) $ROOTLOWERDIR to $ROOTBINDDIR." mount -o remount,ro "$ROOTBINDDIR" || perror "Could not remount $ROOTBINDDIR ro read-only." mount -t overlayfs overlayfs -o lowerdir="$ROOTBINDDIR",upperdir="$ROOTUPPERDIR" "$ROOTMOUNTDIR" \ - || perror "Could not mount (overlayfs) $ROOTLOWERDIR, $ROOTUPPERDIR to $BINDDIR." + || perror "Could not mount (overlayfs) $ROOTLOWERDIR, $ROOTUPPERDIR to $BINDDIR." pinfo "Executing bind mounts ($BINDMOUNTS) for chroot root dir ..." for MOUNT in $BINDMOUNTS; do - mount -o bind "$MOUNT" "$ROOTMOUNTDIR/$MOUNT" || perror "Could not mount (bind) $MOUNTS into chroot root dir." + mount -o bind "$MOUNT" "$ROOTMOUNTDIR/$MOUNT" || perror "Could not mount (bind) $MOUNTS into chroot root dir." done } - + # We inject a bashrc to be executed later within the chroot. gen_bashrc () { local COMMON_OPTIONS=' --no-nouveau-check --no-network --no-backup --no-rpms --no-runlevel-check --no-distro-scripts --no-cc-version-check --no-x-check --no-precompiled-interface --silent ' - + cat >"$ROOTMOUNTDIR/$HOME/.bashrc"<<-EOF echo "chroot successful." alias ll='ls -alF' # A little convenience for debugging purposes. @@ -47,24 +47,24 @@ build() { cd "$NVEXTRACTDIR" ./nvidia-installer $COMMON_OPTIONS --no-kernel-module # Do the work! exit # Out-comment this for debugging: Then script stays in chroot. -EOF + EOF } - + unpack_nvidia () { - [ -d "$NVIDIAEXTRACTDIR" ] && rm -rf "$NVIDIAEXTRACTDIR" - pinfo "Unpacking NVidia archive ($NVIDIA) ..." - sh "$NVIDIA" --extract-only --target "$NVIDIAEXTRACTDIR" || perror "Could not extract $NVIDIA to $NVIDIAEXTRACTDIR." + [ -d "$NVIDIAEXTRACTDIR" ] && rm -rf "$NVIDIAEXTRACTDIR" + pinfo "Unpacking NVidia archive ($NVIDIA) ..." + sh "$NVIDIA" --extract-only --target "$NVIDIAEXTRACTDIR" || perror "Could not extract $NVIDIA to $NVIDIAEXTRACTDIR." } - + umount_dirs () { # Let's tidy the place, or at least the mounts: Otherwise these would stack up, and we do not like that, don't we. - for MOUNT in $BINDMOUNTS; do - umount "$ROOTMOUNTDIR/$MOUNT" || pwarning "Could not unmount $ROOTMOUNTDIR/$MOUNT!" - done - umount "$ROOTMOUNTDIR" || pwarning "Could not unmount $ROOTMOUNTDIR!" - umount "$ROOTBINDDIR" || pwarning "Could not unmount $ROOTBINDDIR!" + for MOUNT in $BINDMOUNTS; do + umount "$ROOTMOUNTDIR/$MOUNT" || pwarning "Could not unmount $ROOTMOUNTDIR/$MOUNT!" + done + umount "$ROOTMOUNTDIR" || pwarning "Could not unmount $ROOTMOUNTDIR!" + umount "$ROOTBINDDIR" || pwarning "Could not unmount $ROOTBINDDIR!" } - + clean_whiteouts () { # The case of these overlay whiteouts should be investigated instead of just killing them. But for now... pdebug "Searching for overlayfs-whiteouts ..." @@ -73,24 +73,24 @@ EOF rm -f "$WHITEOUT" || perror "Could not delete whiteout $WHITEOUT!" done } - + clean_temp () { rm -rf "$TEMPDIR" || perror "Could not clean/delete temp directory $TEMPDIR." rm -rf "$ROOTUPPERDIR/NVIDIA" } - + # Main stuff pinfo "Generating temporary directories ..." make_dirs pinfo "Mounting directories ..." mount_dirs - + pinfo "Injecting .bashrc into later chroot ..." gen_bashrc - + pinfo "Unpacking NVidia-Installer ..." unpack_nvidia - + pinfo "Ready to chroot - compiling may take some time." pdebug "--- chroot ---------------------------------------------------------------------" pdebug "- -" @@ -104,13 +104,13 @@ EOF pdebug "--------------------------------------------------------------------------------" chroot "$ROOTMOUNTDIR" pinfo "chroot terminated." - + pinfo "Unmount directories ..." umount_dirs - + pinfo "Cleaning whiteouts ..." clean_whiteouts - + pinfo "Cleaning / deleting temp directories." clean_temp } -- cgit v1.2.3-55-g7522 From 38794eb065bc351e8581b1d56906fba9d2685610 Mon Sep 17 00:00:00 2001 From: Simon Rettberg Date: Mon, 24 Feb 2014 12:49:06 +0100 Subject: [rfs-stage32] Don't check if addon is listen in SLX_ADDONS, just try to load it --- .../rootfs-stage32/data/opt/openslx/scripts/systemd-setup_slx_addons | 4 ---- 1 file changed, 4 deletions(-) (limited to 'remote') diff --git a/remote/rootfs/rootfs-stage32/data/opt/openslx/scripts/systemd-setup_slx_addons b/remote/rootfs/rootfs-stage32/data/opt/openslx/scripts/systemd-setup_slx_addons index 5bed4c7f..9b07acbd 100755 --- a/remote/rootfs/rootfs-stage32/data/opt/openslx/scripts/systemd-setup_slx_addons +++ b/remote/rootfs/rootfs-stage32/data/opt/openslx/scripts/systemd-setup_slx_addons @@ -56,10 +56,6 @@ fi if [ $# -eq 1 ]; then ADDON="$1" - # sanity check - [[ ! "$SLX_ADDONS" == *"$ADDON"* ]] && \ - { echo "$ADDON is not listed in SLX_ADDONS of your config file. Skipping it."; exit 1; } - # download the addon from the given URL ADDON_TARGET_PATH="${DOWNLOAD_DEST}/$(basename "$ADDON").sqfs" if ! download "${HTTP_BASE_PATH}/${ADDON}.sqfs" "${ADDON_TARGET_PATH}"; then -- cgit v1.2.3-55-g7522 From dc7e8e3a36f66211f9837790948840307416580d Mon Sep 17 00:00:00 2001 From: Simon Rettberg Date: Mon, 24 Feb 2014 15:51:58 +0100 Subject: [rfs-stage32] setup_partitons: Remove sleep 3 hack when waiting for partitions --- .../data/opt/openslx/scripts/systemd-setup_partitions | 11 ----------- 1 file changed, 11 deletions(-) (limited to 'remote') diff --git a/remote/rootfs/rootfs-stage32/data/opt/openslx/scripts/systemd-setup_partitions b/remote/rootfs/rootfs-stage32/data/opt/openslx/scripts/systemd-setup_partitions index ca7317d4..f9640589 100755 --- a/remote/rootfs/rootfs-stage32/data/opt/openslx/scripts/systemd-setup_partitions +++ b/remote/rootfs/rootfs-stage32/data/opt/openslx/scripts/systemd-setup_partitions @@ -90,17 +90,6 @@ mount_temp_fallback () { } fdisk -l | sed -n "/^\/dev\//p" > "/etc/disk.partition" -# This is an ugly hack as sometimes this script is run too early, -# and fdisk won't report any partitions then. I assumed this would be -# solved by launching this script after udev-trigger finished, but -# apparently then it can still happen that we run too soon. This should -# be removed once someone figures out what fdisk really needs to work -# properly. -if [ ! -s "/etc/disk.partition" ]; then - sleep 3 - echo "Retrying fdisk" - fdisk -l | sed -n "/^\/dev\//p" > "/etc/disk.partition" -fi echo "Partitions:" cat "/etc/disk.partition" -- cgit v1.2.3-55-g7522 From cf2c7ab198aaf983e07c456bb90ef87e2a8ec352 Mon Sep 17 00:00:00 2001 From: Simon Rettberg Date: Mon, 24 Feb 2014 15:55:56 +0100 Subject: [rfs-stage32] setup-slx-addons: Fix slxlog call when aufs fails, add -o ro to sqfs mount --- .../data/opt/openslx/scripts/systemd-setup_slx_addons | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'remote') diff --git a/remote/rootfs/rootfs-stage32/data/opt/openslx/scripts/systemd-setup_slx_addons b/remote/rootfs/rootfs-stage32/data/opt/openslx/scripts/systemd-setup_slx_addons index 9b07acbd..e4ecf9e7 100755 --- a/remote/rootfs/rootfs-stage32/data/opt/openslx/scripts/systemd-setup_slx_addons +++ b/remote/rootfs/rootfs-stage32/data/opt/openslx/scripts/systemd-setup_slx_addons @@ -66,13 +66,13 @@ if [ $# -eq 1 ]; then # now mount it to $BASE_MOUNT_POINT/ ADDON_MOUNT_POINT="${BASE_MOUNT_POINT}/$(basename "$ADDON")" mkdir -p "$ADDON_MOUNT_POINT" - mount -t squashfs "$ADDON_TARGET_PATH" "$ADDON_MOUNT_POINT" || \ + mount -t squashfs -o ro "$ADDON_TARGET_PATH" "$ADDON_MOUNT_POINT" || \ { slxlog --echo "addon-mount" "Failed to mount $ADDON_TARGET_PATH."; exit 1; } # now append it to / echo "Appending ${ADDON_MOUNT_POINT} to /" - if ! mount -o "remount,ins:2:${ADDON_MOUNT_POINT}=ro" / ; then # ins:2 makes sure the addon is after tmpfs and stage32, but before stage4 - slxlog --echo "Failed to append ${ADDON_MOUNT_POINT} to the aufs. Cleaning up..." + if ! mount -o "remount,ins:2:${ADDON_MOUNT_POINT}=rr" / ; then # ins:2 makes sure the addon is after tmpfs and stage32, but before stage4 + slxlog --echo "addon-aufs" "Failed to append ${ADDON_MOUNT_POINT} to the aufs. Cleaning up..." umount -l ${ADDON_MOUNT_POINT} || echo "Could not unmount ${ADDON_MOUNT_POINT}!" exit 1 fi -- cgit v1.2.3-55-g7522