summaryrefslogtreecommitdiffstats
path: root/remote/modules/kernel
diff options
context:
space:
mode:
authorSimon Rettberg2014-02-11 20:27:29 +0100
committerSimon Rettberg2014-02-11 20:27:29 +0100
commit7ca081e53dde3d0049e9a687b2dae63d5f907ca3 (patch)
tree4550f48b736c8307f5d863b256cdacdf5ddae910 /remote/modules/kernel
parent[printergui] Spool from VM to tmpfs home if possible, fall back to /tmp (diff)
parent[setup_target] pinfos within clean_kernel_module: Better location (output (diff)
downloadtm-scripts-7ca081e53dde3d0049e9a687b2dae63d5f907ca3.tar.gz
tm-scripts-7ca081e53dde3d0049e9a687b2dae63d5f907ca3.tar.xz
tm-scripts-7ca081e53dde3d0049e9a687b2dae63d5f907ca3.zip
Merge branch 'master' of simonslx:openslx-ng/tm-scripts
Diffstat (limited to 'remote/modules/kernel')
-rw-r--r--remote/modules/kernel/kernel.build42
-rw-r--r--remote/modules/kernel/kernel.conf.opensuse2
-rw-r--r--remote/modules/kernel/kernel.conf.ubuntu2
3 files changed, 19 insertions, 27 deletions
diff --git a/remote/modules/kernel/kernel.build b/remote/modules/kernel/kernel.build
index 197935f7..6e988434 100644
--- a/remote/modules/kernel/kernel.build
+++ b/remote/modules/kernel/kernel.build
@@ -1,23 +1,7 @@
fetch_source() {
- # get the source according to the distro
- if [ "x$PACKET_MANAGER" == "xapt" ]; then
- pdebug "apt-ing kernel source"
- apt-get install -y dpkg-dev || perror "Installing dpkg-dev failed."
- apt-get source linux-image-${KERNEL_CURRENT_VERSION} || perror "Fetching kernel source failed."
- [ -z "$(ls -d linux-*/)" ] && perror "Source directory not found."
- [ ! -e ksrc ] && ln -s "$(ls -d linux-*/)" "ksrc"
- elif [ "x$PACKET_MANAGER" == "xzypper" ]; then
- pdebug "zypping kernel source"
- zypper --no-refresh install -y kernel-source || perror "Fetching kernel source failed."
-
- # find src directory
- local SOURCE_DIR=$(rpm -ql kernel-source |grep -E -o '^/.*src/linux-[^/]+/' |head -1)
- [ -z "${SOURCE_DIR}" ] && perror "Could not determine directory of kernel source..."
- ln -sf "${SOURCE_DIR}" ksrc
- else
- pdebug "Packet manager not determined!"
- fi
-
+ pdebug "getting kernel sources via git ...."
+ [ -d ./ksrc ] && rm -rf ./ksrc # slightly brutal ...
+ git clone --depth 1 ${REQUIRED_GIT} ksrc || perror "Could not clone kernel git."
# check for aufs
local RSL=$(find ksrc/ -type d -name aufs)
if [ -z "$RSL" ]; then
@@ -26,10 +10,8 @@ fetch_source() {
else
pinfo "aufs detected in kernel source :)"
fi
-
# remember the current kernel version
echo "${KERNEL_CURRENT_VERSION}" > ksrc/KVERSION
-
}
build() {
@@ -39,7 +21,6 @@ build() {
pinfo "Updating kernel config..."
update_config
cp "${TARGET_CONFIG_FILE}" ksrc/.config
-
# make kernel with the new config
cd ksrc || perror "Could not cd to ksrc, was the kernel source fetched properly?"
pinfo "Preparing kernel for new config ('make oldconfig')"
@@ -48,6 +29,7 @@ build() {
else
make oldconfig || perror "make oldconfig failed"
fi
+
pinfo "Compiling kernel... (this will take some time)"
if gcc --version | grep "4\.7" && which distcc; then
pinfo "USING DISTCC"
@@ -85,6 +67,7 @@ update_config() {
# check for our wanted config parameter
local OPENSLX_WANTED_CONFIG="${ROOT_DIR}/data/kernel.wanted.config"
+
[ -e "${OPENSLX_WANTED_CONFIG}" ] || perror "$OPENSLX_WANTED_CONFIG does not exist! Please add a list of wanted kernel config parameters."
# copy basic config file
@@ -123,8 +106,9 @@ patch_aufs() {
pinfo "Getting branch origin/$NEEDED_BRANCH"
cd "$MODULE_DIR/aufs3-standalone" || perror "Could not CD to aufs3-standalone"
git checkout "origin/aufs$NEEDED_BRANCH"
- pinfo "Starting to patch..."
+ pinfo "Starting to patch... $NEEDED_BRANCH"
tarcopy "Documentation fs" "$MODULE_DIR/ksrc"
+
local AUFSH
if [ ! -e "include/linux/aufs_type.h" ]; then
[ ! -e "include/uapi/linux/aufs_type.h" ] && perror "No aufs_type.h in aufs3-git"
@@ -134,12 +118,16 @@ patch_aufs() {
else
AUFSH="include/linux/aufs_type.h"
fi
+
pinfo "Using $AUFSH"
- cp "$AUFSH" "$MODULE_DIR/ksrc/include/linux/" || perror "could not copy $AUFSH"
+ cp "$AUFSH" "$MODULE_DIR/ksrc/include/uapi/linux/" || perror "could not copy $AUFSH"
cd "$MODULE_DIR/ksrc" || perror "Could not CD to kernel-source dir ksrc"
- patch -p1 < "$MODULE_DIR/aufs3-standalone/aufs3-kbuild.patch" || perror "aufs3-standalone/aufs3-kbuild.patch failed"
- patch -p1 < "$MODULE_DIR/aufs3-standalone/aufs3-base.patch" || perror "aufs3-standalone/aufs3-base.patch failed"
- #patch -p1 < "$MODULE_DIR/aufs3-standalone/aufs3-proc_map.patch" || perror "aufs3-standalone/aufs3-proc_map.patch failed"
+
+ patch -p1 < "$MODULE_DIR/aufs3-standalone/aufs3-kbuild.patch" || perror "aufs3-standalone/aufs3-kbuild.patch failed!"
+ patch -p1 < "$MODULE_DIR/aufs3-standalone/aufs3-base.patch" || perror "aufs3-standalone/aufs3-base.patch failed!"
+ [ -f "$MODULE_DIR/aufs3-standalone/aufs3-mmap.patch" ] && patch -p1 < "$MODULE_DIR/aufs3-standalone/aufs3-mmap.patch" \
+ || pinfo "aufs3-mmap.patch: $? (hunk failed?)"
+
pinfo "Patched kernel source with aufs-${NEEDED_BRANCH}"
cd "$MODULE_DIR"
}
diff --git a/remote/modules/kernel/kernel.conf.opensuse b/remote/modules/kernel/kernel.conf.opensuse
new file mode 100644
index 00000000..a66564fe
--- /dev/null
+++ b/remote/modules/kernel/kernel.conf.opensuse
@@ -0,0 +1,2 @@
+REQUIRED_GIT_BRANCH="-b openSUSE-${SYS_VERSION}"
+REQUIRED_GIT="git://kernel.opensuse.org/kernel.git $REQUIRED_GIT_BRANCH"
diff --git a/remote/modules/kernel/kernel.conf.ubuntu b/remote/modules/kernel/kernel.conf.ubuntu
new file mode 100644
index 00000000..e9192f01
--- /dev/null
+++ b/remote/modules/kernel/kernel.conf.ubuntu
@@ -0,0 +1,2 @@
+REQUIRED_GIT_BRANCH="-b master"
+REQUIRED_GIT="git://kernel.ubuntu.com/ubuntu-archive/ubuntu-${SYS_CODENAME}.git $REQUIRED_GIT_BRANCH"