summaryrefslogtreecommitdiffstats
path: root/remote
diff options
context:
space:
mode:
authorDirk2013-03-19 18:37:28 +0100
committerDirk2013-03-19 18:37:28 +0100
commit55551dba0187ae1e5d36215109ed8d247756e848 (patch)
tree4daf9bd5430255c7bcb739ff9006f167d2fcf966 /remote
parentStuff to activate swap ... (diff)
parentMerge branch 'master' of git.openslx.org:openslx-ng/tm-scripts (diff)
downloadtm-scripts-55551dba0187ae1e5d36215109ed8d247756e848.tar.gz
tm-scripts-55551dba0187ae1e5d36215109ed8d247756e848.tar.xz
tm-scripts-55551dba0187ae1e5d36215109ed8d247756e848.zip
Merge branch 'master' of git.openslx.org:openslx-ng/tm-scripts
...
Diffstat (limited to 'remote')
-rw-r--r--remote/modules/sshd/sshd.build4
-rwxr-xr-xremote/setup_target40
2 files changed, 36 insertions, 8 deletions
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/setup_target b/remote/setup_target
index eed033fe..e7370b1b 100755
--- a/remote/setup_target
+++ b/remote/setup_target
@@ -3,23 +3,37 @@
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 () {
@@ -134,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
@@ -221,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}"/* \