!47 add make_compile_env.sh
From: @xiezhipeng1 Reviewed-by: @hanxinke Signed-off-by: @hanxinke
This commit is contained in:
commit
4282090fb1
@ -1,7 +1,7 @@
|
|||||||
Name: kpatch
|
Name: kpatch
|
||||||
Epoch: 1
|
Epoch: 1
|
||||||
Version: 0.9.1
|
Version: 0.9.1
|
||||||
Release: 18
|
Release: 19
|
||||||
Summary: A Linux dynamic kernel patching infrastructure
|
Summary: A Linux dynamic kernel patching infrastructure
|
||||||
|
|
||||||
License: GPLv2
|
License: GPLv2
|
||||||
@ -103,6 +103,12 @@ popd
|
|||||||
%{_mandir}/man1/*.1.gz
|
%{_mandir}/man1/*.1.gz
|
||||||
|
|
||||||
%changelog
|
%changelog
|
||||||
|
* Tue Oct 26 2021 Zhipeng Xie<xiezhipeng1@huawei.com> -1:0.9.1-19
|
||||||
|
- Type:enhancement
|
||||||
|
- ID:NA
|
||||||
|
- SUG:NA
|
||||||
|
- DESC:support make compile environment
|
||||||
|
|
||||||
* Tue Sep 28 2021 Zhipeng Xie<xiezhipeng1@huawei.com> -1:0.9.1-18
|
* Tue Sep 28 2021 Zhipeng Xie<xiezhipeng1@huawei.com> -1:0.9.1-18
|
||||||
- Type:bugfix
|
- Type:bugfix
|
||||||
- ID:NA
|
- ID:NA
|
||||||
|
|||||||
42
make_compile_env.sh
Normal file
42
make_compile_env.sh
Normal file
@ -0,0 +1,42 @@
|
|||||||
|
#!/bin/bash
|
||||||
|
rm -rf kpatch_compile_env
|
||||||
|
yum install -y strace vim git rpm-build bc elfutils-libelf-devel gdb-headless make gcc patch bison flex openssl-devel kernel-source-`uname -r` kernel-debuginfo-`uname -r` kernel-devel-`uname -r` --installroot=`pwd`/kpatch_compile_env/
|
||||||
|
mkdir -p kpatch_compile_env/kpatch
|
||||||
|
/bin/cp * kpatch_compile_env/kpatch/
|
||||||
|
cat > kpatch_compile_env/installkpatch.sh <<EOF
|
||||||
|
#!/bin/bash
|
||||||
|
mkdir -p ~/rpmbuild/SOURCES/
|
||||||
|
/bin/cp kpatch/* ~/rpmbuild/SOURCES/
|
||||||
|
rpmbuild -ba kpatch/kpatch.spec
|
||||||
|
rpm -Uvh ~/rpmbuild/RPMS/`arch`/kpatch*.rpm
|
||||||
|
cd /opt/patch_workspace
|
||||||
|
rm -rf kernel-source .config
|
||||||
|
ln -s /usr/src/linux-`uname -r`/ kernel-source
|
||||||
|
ln -s /usr/src/linux-`uname -r`/.config .config
|
||||||
|
ln -s /usr/lib/debug/lib/modules/`uname -r`/vmlinux vmlinux
|
||||||
|
rm -rf /dev/null
|
||||||
|
mknod /dev/null c 1 3
|
||||||
|
rm -rf /dev/zero
|
||||||
|
mknod /dev/zero c 1 5
|
||||||
|
rm -rf /dev/random
|
||||||
|
mknod /dev/random c 1 8
|
||||||
|
rm -rf /dev/tty
|
||||||
|
mknod /dev/tty c 5 0
|
||||||
|
EOF
|
||||||
|
chmod a+x kpatch_compile_env/installkpatch.sh
|
||||||
|
chroot kpatch_compile_env /installkpatch.sh
|
||||||
|
cat > kpatch_compile_env/chroot.sh <<EOF
|
||||||
|
mount -t proc proc \$(dirname \$0)/proc
|
||||||
|
chroot \$(dirname \$0)
|
||||||
|
EOF
|
||||||
|
cat > kpatch_compile_env/unchroot.sh <<EOF
|
||||||
|
umount \$(dirname \$0)/proc
|
||||||
|
EOF
|
||||||
|
cat > kpatch_compile_env/usr/bin/openEuler_history<<EOF
|
||||||
|
#!/bin/bash
|
||||||
|
EOF
|
||||||
|
chmod a+x kpatch_compile_env/chroot.sh
|
||||||
|
chmod a+x kpatch_compile_env/unchroot.sh
|
||||||
|
chmod a+x kpatch_compile_env/usr/bin/openEuler_history
|
||||||
|
tar -czf kpatch_compile_env.tar.gz kpatch_compile_env
|
||||||
|
rm -rf kpatch_compile_env
|
||||||
Loading…
x
Reference in New Issue
Block a user