diff options
| author | Simon Rettberg | 2013-03-19 19:42:41 +0100 |
|---|---|---|
| committer | Simon Rettberg | 2013-03-19 19:42:41 +0100 |
| commit | 61b94929a4d429a8480dcc06487c52be15db5e1f (patch) | |
| tree | 871d76618b66216ec5adb6446907a7ea8bde8ebd /remote | |
| parent | Tweak modules to work with openSUSE 12.1 (diff) | |
| parent | Enable /tmp on ID44 partition if available. (diff) | |
| download | tm-scripts-61b94929a4d429a8480dcc06487c52be15db5e1f.tar.gz tm-scripts-61b94929a4d429a8480dcc06487c52be15db5e1f.tar.xz tm-scripts-61b94929a4d429a8480dcc06487c52be15db5e1f.zip | |
Merge branch 'master' of ssh://openslx/openslx-ng/tm-scripts
Diffstat (limited to 'remote')
| -rw-r--r-- | remote/modules/busybox/busybox.build | 2 | ||||
| -rw-r--r-- | remote/modules/plymouth/plymouth.build | 2 | ||||
| -rw-r--r-- | remote/modules/sshd/sshd.build | 4 | ||||
| -rw-r--r-- | remote/modules/systemd/systemd.build | 18 | ||||
| -rw-r--r-- | remote/modules/systemd/systemd.conf | 2 | ||||
| -rwxr-xr-x | remote/rootfs/rootfs-stage31/data/init | 3 | ||||
| -rwxr-xr-x | remote/setup_target | 52 | ||||
| l--------- | remote/targets/stage31/busybox (renamed from remote/targets/stage3.1/busybox) | 0 | ||||
| l--------- | remote/targets/stage31/debug (renamed from remote/targets/stage3.1/debug) | 0 | ||||
| l--------- | remote/targets/stage31/hwinfo (renamed from remote/targets/stage3.1/hwinfo) | 0 | ||||
| l--------- | remote/targets/stage31/plymouth (renamed from remote/targets/stage3.1/plymouth) | 0 | ||||
| l--------- | remote/targets/stage31/rootfs-stage31 (renamed from remote/targets/stage3.1/rootfs-stage31) | 0 | ||||
| l--------- | remote/targets/stage32/busybox (renamed from remote/targets/stage3.2/busybox) | 0 | ||||
| l--------- | remote/targets/stage32/consolekit (renamed from remote/targets/stage3.2/consolekit) | 0 | ||||
| l--------- | remote/targets/stage32/dbus (renamed from remote/targets/stage3.2/dbus) | 0 | ||||
| l--------- | remote/targets/stage32/debug (renamed from remote/targets/stage3.2/debug) | 0 | ||||
| l--------- | remote/targets/stage32/kdm (renamed from remote/targets/stage3.2/kdm) | 0 | ||||
| l--------- | remote/targets/stage32/plymouth (renamed from remote/targets/stage3.2/plymouth) | 0 | ||||
| l--------- | remote/targets/stage32/policykit (renamed from remote/targets/stage3.2/policykit) | 0 | ||||
| l--------- | remote/targets/stage32/rootfs-stage32 (renamed from remote/targets/stage3.2/rootfs-stage32) | 0 | ||||
| l--------- | remote/targets/stage32/rsyslogd (renamed from remote/targets/stage3.2/rsyslogd) | 0 | ||||
| l--------- | remote/targets/stage32/sshd (renamed from remote/targets/stage3.2/sshd) | 0 | ||||
| l--------- | remote/targets/stage32/systemd (renamed from remote/targets/stage3.2/systemd) | 0 | ||||
| l--------- | remote/targets/stage32/xorg (renamed from remote/targets/stage3.2/xorg) | 0 |
24 files changed, 56 insertions, 27 deletions
diff --git a/remote/modules/busybox/busybox.build b/remote/modules/busybox/busybox.build index bc2adc64..d11a3828 100644 --- a/remote/modules/busybox/busybox.build +++ b/remote/modules/busybox/busybox.build @@ -14,7 +14,7 @@ build() if [ ! -e .built ]; then cd src pinfo "Running make" - make -j5 || perror "failed." + make || perror "failed." pinfo "Running make install" make CONFIG_PREFIX="${MODULE_DIR}"/build/"${PREFIX}" install || perror "failed" cd - diff --git a/remote/modules/plymouth/plymouth.build b/remote/modules/plymouth/plymouth.build index fbaa428a..d5e9c594 100644 --- a/remote/modules/plymouth/plymouth.build +++ b/remote/modules/plymouth/plymouth.build @@ -11,7 +11,7 @@ build() { pinfo "Running configure" ./configure --enable-systemd-integration --disable-gtk --disable-static --prefix=""|| perror "failed." pinfo "Running make" - make -j5 || perror "failed" + make || perror "failed" pinfo "Running make install" DESTDIR="${MODULE_BUILD_DIR}" make install || perror "failed" cd - diff --git a/remote/modules/sshd/sshd.build b/remote/modules/sshd/sshd.build index aa4241e6..0b198c6c 100644 --- a/remote/modules/sshd/sshd.build +++ b/remote/modules/sshd/sshd.build @@ -13,6 +13,8 @@ build() { fi } -post_copy() { +post_copy() { mkdir -p "${TARGET_BUILD_DIR}/var/run/sshd" + + chmod go-rwx "${TARGET_BUILD_DIR}/etc/ssh/*" } diff --git a/remote/modules/systemd/systemd.build b/remote/modules/systemd/systemd.build index bb58fc1c..57fb705e 100644 --- a/remote/modules/systemd/systemd.build +++ b/remote/modules/systemd/systemd.build @@ -3,8 +3,7 @@ fetch_source () { if [ ! -e .fetched_source ]; then download_untar "$URL" "src/" - local LIBKMOD_VERSION="kmod-12" - download_untar "http://www.kernel.org/pub/linux/utils/kernel/kmod/${LIBKMOD_VERSION}.tar.gz" "src/" + download_untar "$LIBKMOD_URL" "src/" touch .fetched_source fi } @@ -12,21 +11,22 @@ fetch_source () { build () { if [ ! -e .built ]; then #build libkmod - cd "src/$LIBKMOD_VERSION/" + cd "${MODULE_DIR}/src/$LIBKMOD_VERSION" + pwarning "$(pwd)" ./configure - make -j5 - make install - cd - + make || perror "make failed." + make install || perror "make install failed." + cd - &> /dev/null #build systemd - cd "src/$VERSION/" + cd "${MODULE_DIR}/src/$VERSION" pinfo "calling configure" ./configure --disable-manpages --enable-split-usr --sysconfdir="/etc" --enable-gtk-doc-html=no || perror "configure failed." pinfo "calling make" - make -j5 || perror "make failed." + make || perror "make failed." pinfo "calling make install" DESTDIR="${MODULE_BUILD_DIR}" make install || perror "make install failed." - cd - + cd - &> /dev/null touch .built fi } diff --git a/remote/modules/systemd/systemd.conf b/remote/modules/systemd/systemd.conf index c5e72aeb..634828bd 100644 --- a/remote/modules/systemd/systemd.conf +++ b/remote/modules/systemd/systemd.conf @@ -1,5 +1,7 @@ VERSION=systemd-197 URL=http://www.freedesktop.org/software/systemd/${VERSION}.tar.xz +LIBKMOD_VERSION="kmod-12" +LIBKMOD_URL="http://www.kernel.org/pub/linux/utils/kernel/kmod/${LIBKMOD_VERSION}.tar.gz" REQUIRED_DEPENDENCIES=" intltool gperf dbus diff --git a/remote/rootfs/rootfs-stage31/data/init b/remote/rootfs/rootfs-stage31/data/init index 0f522ef9..5f614bb3 100755 --- a/remote/rootfs/rootfs-stage31/data/init +++ b/remote/rootfs/rootfs-stage31/data/init @@ -15,6 +15,7 @@ export PATH=/bin:/sbin:/usr/bin:/usr/sbin export LD_LIBRARY_PATH=/usr/lib64 + mount -n -t tmpfs -o 'mode=755' run "/run" # mount the important standard directories @@ -28,6 +29,7 @@ echo "/sbin/mdev" > /proc/sys/kernel/hotplug ( hwinfo --netcard > /etc/netcard ) & # read kernel command line for debugging switch +DEBUG=0 read KCL < /proc/cmdline export KCL for opts in ${KCL}; do @@ -96,7 +98,6 @@ fi # setup network nwif="eth0" # set up loopback networking -[ $DEBUGLEVEL -eq 20 ] && echo "** starting ip config at $(sysup)" ip link set dev lo up 2>/dev/null ip addr add 127.0.0.1/8 dev lo 2>/dev/null ip link set dev $nwif up 2>/dev/null || { echo "No link for $nwif, dropping to shell.."; setsid sh -c 'exec sh </dev/tty1 >/dev/tty1 2>&1'; } diff --git a/remote/setup_target b/remote/setup_target index e3273f4d..e7370b1b 100755 --- a/remote/setup_target +++ b/remote/setup_target @@ -3,32 +3,44 @@ MODE_DIR="${ROOT_DIR}/remote" MODULES_DIR="${MODE_DIR}/modules" -# check for target directory -TARGET_DIR="${MODE_DIR}/targets/${TARGET}" -[ -d $TARGET_DIR ] || perror "Given target directory does not exist: $TARGET" -TARGET_BUILD_DIR="${MODE_DIR}/builds/${TARGET}" +KERNEL_DIR="${MODE_DIR}/builds/kernel" # Keep track of processed 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 + } +copy_kernel() { + + local KERNEL_VER="vmlinuz-$(uname -r)" + [ -e "${KERNEL_DIR}/${KERNEL_VER}" ] && return + + local TOOL_STR="$TOOL_STR copy_kernel:" + + [ ! -d "${KERNEL_DIR}" ] && mkdir -p ${KERNEL_DIR} + + pinfo "New kernel found. Copying '${KERNEL_VER}' to '${KERNEL_DIR}'." + pinfo "You may want to update your systems firmware/modules to match the current kernel." + + cp "/boot/${KERNEL_VER}" "${KERNEL_DIR}" || perror "Cannot copy kernel from '/boot/${KERNEL_VER}' to '${KERNEL_DIR}'" + +} read_config () { - unset REQUIRED_BINARIES - unset REQUIRED_LIBRARIES - unset REQUIRED_DIRECTORIES - unset REQUIRED_FILES - unset REQUIRED_MODULES - unset REQUIRED_PACKAGES - unset REQUIRED_DEPENDENCIES + + # unset previous variables from other config files + for VARNAME in "${!REQUIRED_*}"; do + unset $VARNAME + done local MODULE_CONFIG="${MODULE_DIR}/${MODULE}.conf" @@ -136,14 +148,20 @@ copy_files_with_deps () { generate_target() { initial_checks + copy_kernel + + TARGET=$1 + TARGET_DIR="${MODE_DIR}/targets/${TARGET}" + TARGET_BUILD_DIR="${MODE_DIR}/builds/${TARGET}" + [ -d $TARGET_DIR ] || perror "Given target directory does not exist: $TARGET_DIR" [[ $TARGET == builds || $TARGET == modules ]] && \ perror "Target directory cannot be named 'builds' nor 'modules'." - + pinfo "Generating '$TARGET_BUILD_DIR' for '$TARGET'" # if no arguments assume all. - if [ "x$1" = "x" -o "x$1" = "xall" ]; then + if [ "x$2" = "x" -o "x$2" = "xall" ]; then MODULES=$(ls ${TARGET_DIR}) set -- $MODULES else @@ -223,7 +241,13 @@ process_module() { } clean_modules() { - if [ "x$1" = "x" -o "x$1" = "xall" ]; then + + TARGET=$1 + TARGET_DIR="${MODE_DIR}/targets/${TARGET}" + TARGET_BUILD_DIR="${MODE_DIR}/builds/${TARGET}" + [ -d $TARGET_DIR ] || perror "Given target directory does not exist: $TARGET_DIR" + + if [ "x$2" = "x" -o "x$2" = "xall" ]; then if [ -d ${TARGET_BUILD_DIR} ]; then pinfo "Cleaning '${TARGET_BUILD_DIR}'" \ && rm -rf "${TARGET_BUILD_DIR}"/* \ diff --git a/remote/targets/stage3.1/busybox b/remote/targets/stage31/busybox index 4f45cedf..4f45cedf 120000 --- a/remote/targets/stage3.1/busybox +++ b/remote/targets/stage31/busybox diff --git a/remote/targets/stage3.1/debug b/remote/targets/stage31/debug index c05237d6..c05237d6 120000 --- a/remote/targets/stage3.1/debug +++ b/remote/targets/stage31/debug diff --git a/remote/targets/stage3.1/hwinfo b/remote/targets/stage31/hwinfo index 6007a018..6007a018 120000 --- a/remote/targets/stage3.1/hwinfo +++ b/remote/targets/stage31/hwinfo diff --git a/remote/targets/stage3.1/plymouth b/remote/targets/stage31/plymouth index 66a16832..66a16832 120000 --- a/remote/targets/stage3.1/plymouth +++ b/remote/targets/stage31/plymouth diff --git a/remote/targets/stage3.1/rootfs-stage31 b/remote/targets/stage31/rootfs-stage31 index 05a91970..05a91970 120000 --- a/remote/targets/stage3.1/rootfs-stage31 +++ b/remote/targets/stage31/rootfs-stage31 diff --git a/remote/targets/stage3.2/busybox b/remote/targets/stage32/busybox index 4f45cedf..4f45cedf 120000 --- a/remote/targets/stage3.2/busybox +++ b/remote/targets/stage32/busybox diff --git a/remote/targets/stage3.2/consolekit b/remote/targets/stage32/consolekit index 261968c7..261968c7 120000 --- a/remote/targets/stage3.2/consolekit +++ b/remote/targets/stage32/consolekit diff --git a/remote/targets/stage3.2/dbus b/remote/targets/stage32/dbus index dd148715..dd148715 120000 --- a/remote/targets/stage3.2/dbus +++ b/remote/targets/stage32/dbus diff --git a/remote/targets/stage3.2/debug b/remote/targets/stage32/debug index c05237d6..c05237d6 120000 --- a/remote/targets/stage3.2/debug +++ b/remote/targets/stage32/debug diff --git a/remote/targets/stage3.2/kdm b/remote/targets/stage32/kdm index 727ed5b5..727ed5b5 120000 --- a/remote/targets/stage3.2/kdm +++ b/remote/targets/stage32/kdm diff --git a/remote/targets/stage3.2/plymouth b/remote/targets/stage32/plymouth index 66a16832..66a16832 120000 --- a/remote/targets/stage3.2/plymouth +++ b/remote/targets/stage32/plymouth diff --git a/remote/targets/stage3.2/policykit b/remote/targets/stage32/policykit index 39b77c7f..39b77c7f 120000 --- a/remote/targets/stage3.2/policykit +++ b/remote/targets/stage32/policykit diff --git a/remote/targets/stage3.2/rootfs-stage32 b/remote/targets/stage32/rootfs-stage32 index 96dcbb86..96dcbb86 120000 --- a/remote/targets/stage3.2/rootfs-stage32 +++ b/remote/targets/stage32/rootfs-stage32 diff --git a/remote/targets/stage3.2/rsyslogd b/remote/targets/stage32/rsyslogd index 339d02f8..339d02f8 120000 --- a/remote/targets/stage3.2/rsyslogd +++ b/remote/targets/stage32/rsyslogd diff --git a/remote/targets/stage3.2/sshd b/remote/targets/stage32/sshd index 56b4e4b5..56b4e4b5 120000 --- a/remote/targets/stage3.2/sshd +++ b/remote/targets/stage32/sshd diff --git a/remote/targets/stage3.2/systemd b/remote/targets/stage32/systemd index 2dc58bd3..2dc58bd3 120000 --- a/remote/targets/stage3.2/systemd +++ b/remote/targets/stage32/systemd diff --git a/remote/targets/stage3.2/xorg b/remote/targets/stage32/xorg index a9494860..a9494860 120000 --- a/remote/targets/stage3.2/xorg +++ b/remote/targets/stage32/xorg |
