diff options
| author | Simon Rettberg | 2014-02-24 16:53:15 +0100 |
|---|---|---|
| committer | Simon Rettberg | 2014-02-24 16:53:15 +0100 |
| commit | 18f8589d166fff3abf04b980c36ea6af1c92829e (patch) | |
| tree | ed0e79cc3be383ceab5bfb19641233ccee9d19c7 | |
| parent | [rfs-stage31] Fix prompt of drop_shell call (diff) | |
| parent | [rfs-stage32] setup-slx-addons: Fix slxlog call when aufs fails, add -o ro to... (diff) | |
| download | tm-scripts-18f8589d166fff3abf04b980c36ea6af1c92829e.tar.gz tm-scripts-18f8589d166fff3abf04b980c36ea6af1c92829e.tar.xz tm-scripts-18f8589d166fff3abf04b980c36ea6af1c92829e.zip | |
Merge branch 'master' of dnbd3:openslx-ng/tm-scripts
| -rw-r--r-- | remote/includes/kernel.inc | 4 | ||||
| -rw-r--r-- | remote/modules/nvidia_libs/nvidia_libs.build | 121 | ||||
| -rw-r--r-- | remote/modules/nvidia_libs/nvidia_libs.conf | 29 | ||||
| -rw-r--r-- | remote/modules/nvidia_libs/nvidia_libs.conf.ubuntu | 10 | ||||
| -rw-r--r-- | remote/modules/vmchooser/data/opt/openslx/vmchooser/data/bootpgm.exe | bin | 0 -> 8704 bytes | |||
| -rw-r--r-- | remote/rootfs/rootfs-stage31/data/etc/modprobe.d/vmwgfx-fbdev.conf | 5 | ||||
| -rw-r--r-- | remote/rootfs/rootfs-stage31/data/inc/drm.functions | 71 | ||||
| -rw-r--r-- | remote/rootfs/rootfs-stage31/data/inc/functions | 4 | ||||
| -rwxr-xr-x | remote/rootfs/rootfs-stage31/data/init | 30 | ||||
| -rw-r--r-- | remote/rootfs/rootfs-stage31/rootfs-stage31.build | 41 | ||||
| -rw-r--r-- | remote/rootfs/rootfs-stage31/rootfs-stage31.conf | 6 | ||||
| -rw-r--r-- | remote/rootfs/rootfs-stage31/templates/drm.cfg | 6 | ||||
| -rwxr-xr-x | remote/rootfs/rootfs-stage32/data/opt/openslx/scripts/systemd-setup_partitions | 11 | ||||
| -rwxr-xr-x | remote/rootfs/rootfs-stage32/data/opt/openslx/scripts/systemd-setup_slx_addons | 10 |
14 files changed, 295 insertions, 53 deletions
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/modules/nvidia_libs/nvidia_libs.build b/remote/modules/nvidia_libs/nvidia_libs.build new file mode 100644 index 00000000..7e4e86c7 --- /dev/null +++ b/remote/modules/nvidia_libs/nvidia_libs.build @@ -0,0 +1,121 @@ +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." + 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 "- -" + 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 library 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..faec87ec --- /dev/null +++ b/remote/modules/nvidia_libs/nvidia_libs.conf @@ -0,0 +1,29 @@ +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 +# +#" + +REQUIRED_DIRECTORIES=" + / +" 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 +" diff --git a/remote/modules/vmchooser/data/opt/openslx/vmchooser/data/bootpgm.exe b/remote/modules/vmchooser/data/opt/openslx/vmchooser/data/bootpgm.exe Binary files differnew file mode 100644 index 00000000..88f89418 --- /dev/null +++ b/remote/modules/vmchooser/data/opt/openslx/vmchooser/data/bootpgm.exe 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 >/dev/tty1 2>&1' diff --git a/remote/rootfs/rootfs-stage31/data/init b/remote/rootfs/rootfs-stage31/data/init index 66155ecf..d88ef697 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 + 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" 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..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 @@ -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 @@ -70,13 +66,13 @@ if [ $# -eq 1 ]; then # now mount it to $BASE_MOUNT_POINT/<addon-name> 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 |
