Le support aux utilisateurs et les demandes de création de comptes externes doivent être faites depuis les issues du projet GitLab HEFR (https://gitlab.forge.hefr.ch/forge-hefr/gitlab-hefr)

Commit 838213fc authored by papauxg's avatar papauxg
Browse files

script to build 3.10 guest kernel

parent a0ddc6f8
#!/bin/bash
KERNEL_BUILD_DIR=linux-3-10-src
KERNEL_GIT_SRC=git://git.kernel.org/pub/scm/linux/kernel/git/stable/linux-stable.git
KERNEL_GIT_BRANCH=origin/linux-3.10.y
KERNEL_DEFCONFIG=vexpress_defconfig
KERNEL_CONFIG_FILE=linux-config-vexpress-a15
INST_PATH=linux-bins
MODULES_INST_PATH=${INST_PATH}/modules
DTB_FILE=${KERNEL_BUILD_DIR}/arch/arm/boot/dts/vexpress-v2p-ca15-tc1.dtb
BUILD_NB_THREADS=8
main() {
mkdir -p ${INST_PATH}
do_kernel
do_dtb
}
function do_kernel() {
kernel_fetch
cd ${KERNEL_BUILD_DIR}
kernel_patch
kernel_configure
kernel_compile
cd -
}
function do_dtb() {
echo "Creating dtb..."
# ${DTC_PATH} -O dtb -o ${DTB_FILE} ${DTS_FILE}
cp ${DTB_FILE} ${INST_PATH}
}
function kernel_patch() {
echo "Patching kernel..."
# nothing
}
function kernel_fetch() {
echo "Fetching kernel..."
if [ -d "$KERNEL_BUILD_DIR" ]; then
echo "Kernel directory already exists, using it..."
fi
git clone ${KERNEL_GIT_SRC} ${KERNEL_BUILD_DIR}
cd ${KERNEL_BUILD_DIR}
git checkout ${KERNEL_GIT_BRANCH} -b local/${KERNEL_GIT_BRANCH}
cd -
}
function kernel_configure() {
echo "Configuring kernel..."
# default config target set ?
if [[ ! -z "$KERNEL_DEFCONFIG" ]]
then
make ${KERNEL_DEFCONFIG}
fi
# default config file set ?
if [[ ! -z "$KERNEL_CONFIG_FILE" ]]
then
cp ../${KERNEL_CONFIG_FILE} .config
fi
}
function kernel_compile() {
echo "Compiling kernel..."
make -j${BUILD_NB_THREADS}
make -j${BUILD_NB_THREADS} modules
make modules_install INSTALL_MOD_PATH=../${MODULES_INST_PATH}
cp arch/arm/boot/zImage ../${INST_PATH}
}
# execute main function
main
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment