Linux, 工作, 生活, 家人

ARM, Linux

Build Ampere CentOS Kernel

Personal Note

Install Necessary Packages

Install packages, it should have to install other packages like openssl-dev.

get package ampere-8.3.0-20191025-dynamic-nosysroot-nativetools.tar.xz from Ampere customer connect or ampere development source web.

yum groupinstall "Development Tools"

yum -y install ncurses-devel
yum -y install hmaccalc zlib-devel binutils-devel elfutils-devel libelf-devel newt-devel python-devel
yum -y install audit-libs-devel numactl-devel pciutils-devel openssl-devel
yum -y install bc bison perl-ExtUtils-Embed.noarch xmlto asciidoc
rpm –ivh kernel-4.18.0-80.11.2.el8.<version>.src.rpm

mkdir -p /opt/amp
tar -xf ampere-8.3.0-20191025-dynamic-nosysroot-nativetools.tar.xz -C /opt/amp
export PATH=/opt/amp/ampere-8.3.0-20191025-dynamic-nosysroot/bin:$PATH;
which gcc

if gcc is not in /opt/amp, please check your directory in /opt/amy

Build Kernel

command to build kernel

cd /root/rpmbuild/SOURCES/
tar xvf linux-4.18.0-80.11.2.el8_0.tar.xz
cd linux-4.18.0-80.11.2.el8_0
cp ../kernel-aarch64-emag.config .config
make olddefconfig

Try build once and make sure everything is ok

make -j `nproc`

If buiild OK, generate RPM files.

make -j `nproc` rpm-pkg

if everything is ok, the RPM files will be on /root/rpmbuild/RPMS/aarch64/

Install RPM packages

yum localinstall kernel-4.18.0-1.aarch64.rpm kernel-headers-4.18.0-1.aarch64.rpm