diff options
| author | Michael Neves | 2013-06-12 15:57:10 +0200 |
|---|---|---|
| committer | Michael Neves | 2013-06-12 15:57:10 +0200 |
| commit | 4b077a5012594cafd19020f43c586c3c15cc109a (patch) | |
| tree | 887f4c5bd32ff74793649c4255064eafbf6c2434 | |
| parent | [systemd] add configure flag for ACL support (diff) | |
| parent | Merge branch 'master' of simonslx:openslx-ng/tm-scripts (diff) | |
| download | tm-scripts-4b077a5012594cafd19020f43c586c3c15cc109a.tar.gz tm-scripts-4b077a5012594cafd19020f43c586c3c15cc109a.tar.xz tm-scripts-4b077a5012594cafd19020f43c586c3c15cc109a.zip | |
Merge branch 'master' of git.openslx.org:openslx-ng/tm-scripts
| -rw-r--r-- | helper/fileutil.inc | 40 | ||||
| -rw-r--r-- | helper/kernel.inc | 26 | ||||
| -rwxr-xr-x | mltk | 2 | ||||
| -rw-r--r-- | remote/modules/systemd/systemd.build | 7 | ||||
| -rw-r--r-- | remote/modules/systemd/systemd.conf | 1 | ||||
| -rw-r--r-- | remote/modules/xorg/xorg.conf.zypper | 27 | ||||
| -rw-r--r-- | remote/rootfs/rootfs-stage32/rootfs-stage32.build | 1 | ||||
| -rwxr-xr-x | remote/setup_target | 10 | ||||
| l--------- | remote/targets/stage32/german | 1 |
9 files changed, 77 insertions, 38 deletions
diff --git a/helper/fileutil.inc b/helper/fileutil.inc index fb1c8382..9a3c5aff 100644 --- a/helper/fileutil.inc +++ b/helper/fileutil.inc @@ -9,20 +9,7 @@ else perror "Could not determine this platform's packet manager" fi -# install given packet through system's packet manager -install_package() { - [ $# -eq 0 ] && perror "Sanity check failed: no argument given to install_package" - local PACKAGE_LIST="$@" - for PACKAGE in $PACKAGE_LIST; do - if [ "x$PACKET_MANAGER" == "xapt" ]; then - apt-get install -y $PACKAGE - elif [ "x$PACKET_MANAGER" == "xzypper" ]; then - zypper --no-refresh install -y $PACKAGE - fi - # TODO finish... - done -} - +# # copy list of files using tar tarcopy () { if [ $# -gt 0 -a "x$1" == "x-i" ]; then @@ -85,14 +72,27 @@ list_packet_files() { # goes through all package as given in the variable REQUIRED_INSTALLED_PACKAGES install_dependencies() { [ -z "$REQUIRED_INSTALLED_PACKAGES" ] && return - if [ "$PACKET_MANAGER" = "apt" ]; then - # install package, only if not already installed, TODO fix me - #dpkg -l $(echo $(echo "$REQUIRED_INSTALLED_PACKAGES")) &> /dev/null && return - apt-get install -y $REQUIRED_INSTALLED_PACKAGES || perror "Could not apt-get install $REQUIRED_INSTALLED_PACKAGES" - elif [ "$PACKET_MANAGER" = "zypper" ]; then - zypper --no-refresh install -y -n $REQUIRED_INSTALLED_PACKAGES || perror "Could not zypper install $REQUIRED_INSTALLED_PACKAGES" + install_packages "$REQUIRED_INSTALLED_PACKAGES" +} +# +# install given packet through system's packet manager +# uses PACKET_MANAGER as determined in helper/system.inc +# +install_packages() { + [ $# -eq 0 ] && perror "Sanity check failed: no argument given to install_package" + pdebug "ARGS: $@" + local PACKAGE_LIST="$@" + if [ "x$PACKET_MANAGER" == "xapt" ]; then + apt-get install -y ${PACKAGE_LIST} || \ + pwarning "install_package: apt-get failed with '$IRET' for package '$PACKAGE_LIST'" + elif [ "x$PACKET_MANAGER" == "xzypper" ]; then + zypper --no-refresh --non-interactive install ${PACKAGE_LIST} || \ + pwarning "install_package: zypper failed with '$IRET' for package '$PACKAGE_LIST'" + else + pinfo "No packet manager determined, this should not happen!" fi } + # # copies static data files from <MODULE>/data/ to <TARGET_BUILD_DIR> # diff --git a/helper/kernel.inc b/helper/kernel.inc index 6901c4b4..70294357 100644 --- a/helper/kernel.inc +++ b/helper/kernel.inc @@ -114,14 +114,31 @@ copy_firmware() { local FIRMWARE_LIST="" for FIRMWARE in ${REQUIRED_FIRMWARE}; do local FOUND=0 + # check for firmware in the build directory of the kernel for CANDIDATE in "${FIRMWARE_DIR}/${FIRMWARE}" "${FIRMWARE_DIR}/${KERNEL_NEW_VERSION}/${FIRMWARE}"; do if [ -e "${CANDIDATE}" ]; then - pdebug "Copying '${CANDIDATE}'" + pdebug "Copying from kernel build dir: '${CANDIDATE}'" FIRMWARE_LIST+=" ${CANDIDATE}" FOUND=1 fi done + # if we didn't found it in the kernel build directory, check for firmware in the system firmware directory + if [ $FOUND -ne 1 ]; then + for CANDIDATE in "/${FIRMWARE_DIR}/${FIRMWARE}" "/${FIRMWARE_DIR}/${KERNEL_VERSION}/${FIRMWARE}"; do + if [ -e "${CANDIDATE}" ]; then + if [ $(echo "${CANDIDATE}" | grep -c "${KERNEL_VERSION}") -eq 0 ]; then + pdebug "Copying from system: '${CANDIDATE}'" + FIRMWARE_LIST+=" ${CANDIDATE}" + else + pdebug "Copying from system: '${CANDIDATE}' to ${FIRMWARE_DIR}/${KERNEL_NEW_VERSION}/${FIRMWARE}" + FIRMWARE_LIST+=" /${FIRMWARE_DIR}/${KERNEL_VERSION}/${FIRMWARE}" + fi + FOUND=1 + fi + done + fi + [ $FOUND -ne 1 ] && pwarning "Neither '${FIRMWARE_DIR}/${FIRMWARE}' nor '${FIRMWARE_DIR}/${KERNEL_NEW_VERSION}/${FIRMWARE}' "\ " was found on the system. Skipping. (might cause problems on certain clients!)" done @@ -131,6 +148,13 @@ copy_firmware() { pinfo "Copying $COUNT firmware to target directory." tarcopy "${FIRMWARE_LIST}" "${TARGET_BUILD_DIR}" fi + + # post-process to fix the path of the firmwares found on the system unter /lib/firmware/$(uname -r) + # which have to be copied to /lib/firmware/${KERNEL_NEW_VERSION} + mkdir -p "${TARGET_BUILD_DIR}/lib/firmware/${KERNEL_NEW_VERSION}/" + mv "${TARGET_BUILD_DIR}/lib/firmware/${KERNEL_VERSION}/"* "${TARGET_BUILD_DIR}/lib/firmware/${KERNEL_NEW_VERSION}/" + rmdir "${TARGET_BUILD_DIR}/lib/firmware/${KERNEL_VERSION}/" || perror "something went very wrong..." + cd - >/dev/null } @@ -22,7 +22,7 @@ MLTK_PID="$$" # Checking for needed development tools, compilers etc. # Required: m4 make gcc g++ binutils -DEVTOOLS="gcc c++ g++ make m4 strip" # 'strip' as marker for binutils +DEVTOOLS="gcc c++ g++ make m4 strip git locate depmod" # 'strip' as marker for binutils for i in $DEVTOOLS; do which "$i" 2>/dev/null 1>&2 || { echo "Essential development tool $i not found - exiting."; exit 1; } done diff --git a/remote/modules/systemd/systemd.build b/remote/modules/systemd/systemd.build index 76f9ce6d..027024cf 100644 --- a/remote/modules/systemd/systemd.build +++ b/remote/modules/systemd/systemd.build @@ -47,5 +47,12 @@ post_copy() { # add nfs to modules-load list echo "nfs" > "${TARGET_BUILD_DIR}/etc/modules-load.d/nfs.conf" + + # add pam_systemd.so to pam modules directory + if [ -e "${MODULE_BUILD_DIR}/usr/lib/security/pam_systemd.so" ]; then + cp "${MODULE_BUILD_DIR}/usr/lib/security/pam_systemd.so" "${TARGET_BUILD_DIR}/lib/security/" + else + pdebug "No such file: ${MODULE_BUILD_DIR}/usr/lib/security/pam_systemd.so" + fi } diff --git a/remote/modules/systemd/systemd.conf b/remote/modules/systemd/systemd.conf index 7623b58e..1bf44782 100644 --- a/remote/modules/systemd/systemd.conf +++ b/remote/modules/systemd/systemd.conf @@ -107,4 +107,3 @@ REQUIRED_DIRECTORIES=" /usr/lib/systemd /usr/lib/tmpfiles.d " -REQUIRED_FILES=" /usr/lib/security/pam_systemd.so" diff --git a/remote/modules/xorg/xorg.conf.zypper b/remote/modules/xorg/xorg.conf.zypper index 33aba5eb..9f7d69e7 100644 --- a/remote/modules/xorg/xorg.conf.zypper +++ b/remote/modules/xorg/xorg.conf.zypper @@ -1,4 +1,5 @@ -REQUIRED_CONTENT_PACKAGES=" xorg-x11 +REQUIRED_CONTENT_PACKAGES=" + xorg-x11 xorg-x11-server xorg-x11-driver-input xorg-x11-driver-video @@ -24,7 +25,18 @@ REQUIRED_CONTENT_PACKAGES=" xorg-x11 xkbcomp dejavu-fonts libxcb-glx0 - kdm-branding-openSUSE" + kdm-branding-openSUSE + Mesa +" +REQUIRED_LIBRARIES=" + libI810XvMC + libxcb-glx + libIntelXvMC + i965_dri + vmwgfx_dri + i915_dri + i965_drv_video +" REQUIRED_BINARIES=" Xorg gtf cvt @@ -36,8 +48,11 @@ REQUIRED_BINARIES=" Xorg xkbbell xkbevd vmmouse_detect" -REQUIRED_DIRECTORIES=" /usr/lib - /usr/bin - /usr/share/X11 - /usr/share/fonts" +REQUIRED_DIRECTORIES=" + /usr/lib/udev + /usr/lib/xorg + /usr/bin + /usr/share/X11 + /usr/share/fonts +" REQUIRED_FILES="/var/adm/fillup-templates/sysconfig.displaymanager-kdm" diff --git a/remote/rootfs/rootfs-stage32/rootfs-stage32.build b/remote/rootfs/rootfs-stage32/rootfs-stage32.build index a796f738..4e16996b 100644 --- a/remote/rootfs/rootfs-stage32/rootfs-stage32.build +++ b/remote/rootfs/rootfs-stage32/rootfs-stage32.build @@ -97,6 +97,7 @@ post_copy() { mkdir -p "${TARGET_BUILD_DIR}/root" mkdir -p "${TARGET_BUILD_DIR}/home/demo" chown "$DEMO_ID:$DEMO_ID" "${TARGET_BUILD_DIR}/home/demo" + sed -i -r 's/^blacklist.*pcspkr/#&/g' "$TARGET_BUILD_DIR/etc/modprobe.d/blacklist.conf" echo "minilinux-$(hostname)" > "${TARGET_BUILD_DIR}/etc/hostname" # check for kernel modules, if not present copy from system diff --git a/remote/setup_target b/remote/setup_target index 286daf3a..46c1d978 100755 --- a/remote/setup_target +++ b/remote/setup_target @@ -7,18 +7,10 @@ MODULES_DIR="${MODE_DIR}/modules" PROCESSED_MODULES="" initial_checks () { - - # check for required tools - for BIN in git locate depmod - do - local TEST=$(which ${BIN}) - [ -z "$TEST" ] && pinfo "Installing $BIN..." && apt-get install $BIN - done - + : } read_config () { - # unset previous variables from other config files for VARNAME in ${!REQUIRED_*}; do unset $VARNAME diff --git a/remote/targets/stage32/german b/remote/targets/stage32/german new file mode 120000 index 00000000..4469f96e --- /dev/null +++ b/remote/targets/stage32/german @@ -0,0 +1 @@ +../../modules/german
\ No newline at end of file |
