build linux image

Signed-off-by: Robert Nelson <robertcnelson@gmail.com>
default-cape-symlinks
Robert Nelson 1 year ago
parent 279bc06f60
commit be22c31c26

4
.gitignore vendored

@ -3,7 +3,11 @@ deploy/input/
deploy/hss-payload-generator
deploy/src.bin
deploy/u-boot.bin
deploy/.modules
deploy/*-modules.tar.gz
deploy/Image
mirror/
riscv-toolchain/
hart-software-services/
u-boot/
linux/

@ -0,0 +1,14 @@
image: robertcnelson/debian-bookworm-slim-riscv:latest
cache:
key: "$CI_PROJECT_NAME"
paths:
- mirror/x86_64-gcc-*-linux.tar.xz
- deploy/*.tar.xz
build:
tags:
- docker-amd64
stage: build
script:
- ./01_git_sync.sh

@ -7,6 +7,9 @@ HSS_REPO="https://github.com/polarfire-soc/hart-software-services.git"
UBOOT_BRANCH="linux4microchip+fpga-2023.02"
UBOOT_REPO="https://github.com/polarfire-soc/u-boot.git"
LINUX_BRANCH="linux4microchip+fpga-2023.06"
LINUX_REPO="https://github.com/linux4microchip/linux.git"
GIT_DEPTH="20"
if [ ! -f ./mirror/x86_64-gcc-11.4.0-nolibc-riscv64-linux.tar.xz ] ; then
@ -43,44 +46,11 @@ fi
echo "git clone -b ${UBOOT_BRANCH} ${UBOOT_REPO} ./u-boot/ --depth=${GIT_DEPTH}"
git clone -b ${UBOOT_BRANCH} ${UBOOT_REPO} ./u-boot/ --depth=${GIT_DEPTH}
exit 2
if [ -d ./opensbi ] ; then
rm -rf ./opensbi || true
fi
echo "git clone -b ${OPENSBI_BRANCH} https://github.com/riscv-software-src/opensbi.git ./opensbi/ --depth=${GIT_DEPTH}"
git clone -b ${OPENSBI_BRANCH} https://github.com/riscv-software-src/opensbi.git ./opensbi/ --depth=${GIT_DEPTH}
if [ -d ./BeagleBoard-DeviceTrees ] ; then
rm -rf ./BeagleBoard-DeviceTrees || true
fi
echo "git clone -b ${DTB_BRANCH} https://git.beagleboard.org/beagleboard/BeagleBoard-DeviceTrees.git"
git clone -b ${DTB_BRANCH} https://git.beagleboard.org/beagleboard/BeagleBoard-DeviceTrees.git
if [ -d ./linux ] ; then
rm -rf ./linux || true
fi
if [ -f ./.gitlab-runner ] ; then
#echo "git clone --reference-if-able /mnt/yocto-cache/git/linux-src/ -b ${LINUX_BRANCH} https://github.com/beagleboard/linux.git ./linux/ --depth=${GIT_DEPTH}"
#git clone --reference-if-able /mnt/yocto-cache/git/linux-src/ -b ${LINUX_BRANCH} https://github.com/beagleboard/linux.git ./linux/ --depth=${GIT_DEPTH}
echo "git clone --reference-if-able /mnt/yocto-cache/git/linux-src/ https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git ./linux/ --depth=${GIT_DEPTH}"
git clone --reference-if-able /mnt/yocto-cache/git/linux-src/ https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git ./linux/ --depth=${GIT_DEPTH}
else
#echo "git clone -b ${LINUX_BRANCH} https://github.com/beagleboard/linux.git ./linux/ --depth=${GIT_DEPTH}"
#git clone -b ${LINUX_BRANCH} https://github.com/beagleboard/linux.git ./linux/ --depth=${GIT_DEPTH}
echo "git clone https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git ./linux/ --depth=${GIT_DEPTH}"
git clone https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git ./linux/ --depth=${GIT_DEPTH}
fi
cd ./linux/
git pull --no-edit https://git.beagleboard.org/beaglev-ahead/linux.git v6.5-rc4-BeagleV-Ahead-dts-mmc-2 --no-rebase
cd ../
if [ -f ./.gitlab-runner ] ; then
rm -f ./.gitlab-runner || true
fi
echo "git clone -b ${LINUX_BRANCH} ${LINUX_REPO} ./linux/ --depth=${GIT_DEPTH}"
git clone -b ${LINUX_BRANCH} ${LINUX_REPO} ./linux/ --depth=${GIT_DEPTH}
#

@ -0,0 +1,36 @@
#!/bin/bash
CORES=$(getconf _NPROCESSORS_ONLN)
wdir=`pwd`
CC=${CC:-"${wdir}/riscv-toolchain/bin/riscv64-linux-"}
cd ./linux/
make ARCH=riscv CROSS_COMPILE=${CC} clean
make ARCH=riscv CROSS_COMPILE=${CC} mpfs_defconfig
#./scripts/config --enable CONFIG_OF_OVERLAY
echo "make -j${CORES} ARCH=riscv CROSS_COMPILE=${CC} Image modules dtbs"
make -j${CORES} ARCH=riscv CROSS_COMPILE=${CC} Image modules dtbs
KERNEL_UTS=$(cat "${wdir}/linux/include/generated/utsrelease.h" | awk '{print $3}' | sed 's/\"//g' )
make -s ARCH=riscv CROSS_COMPILE=${CC} modules_install INSTALL_MOD_PATH="${wdir}/deploy/tmp"
if [ -f "${wdir}/deploy/${KERNEL_UTS}-modules.tar.gz" ] ; then
rm -rf "${wdir}/deploy/${KERNEL_UTS}-modules.tar.gz" || true
fi
echo "Compressing ${KERNEL_UTS}-modules.tar.gz..."
echo "${KERNEL_UTS}" > "${wdir}/deploy/.modules"
cd "${wdir}/deploy/tmp" || true
tar --create --gzip --file "../${KERNEL_UTS}-modules.tar.gz" ./*
cd "${wdir}/linux/" || exit
rm -rf "${wdir}/deploy/tmp" || true
#cp -v ./arch/riscv/boot/dts/thead/th1520-beaglev-ahead.dts ../BeagleBoard-DeviceTrees/src/thead/
cp -v ./.config ../patches/linux/mpfs_defconfig
cp -v ./arch/riscv/boot/Image ../deploy/
#cp -v ./arch/riscv/boot/dts/thead/*.dtb ../deploy/
cd ../

File diff suppressed because it is too large Load Diff
Loading…
Cancel
Save