Code Monkey home page Code Monkey logo

Comments (8)

euspectre avatar euspectre commented on August 19, 2024

Module.symvers for kpatch.ko is needed for building the patch rather than for loading it.

So could you try to build the binary patch again, after you have copied /root/kpatch/kmod/core/Module.symvers to /usr/local/lib/kpatch/4.19.113-300.el7.x86_64/?

Will kpatch-build complain now about Module.symvers?

Besides, please show the output of /sbin/modinfo /usr/local/lib/kpatch/4.19.113-300.el7.x86_64/kpatch.ko, let us see the kernel kpatch.ko was built for.

from kpatch.

euspectre avatar euspectre commented on August 19, 2024

By the way, which version of kpatch sources are you using to build kpatch.ko and the kpatch build tools? The latest revision from this git repo? Or some of the released versions?

from kpatch.

hongwentakkk avatar hongwentakkk commented on August 19, 2024

image

The problem is solved in the following way
mkdir -p /usr/local/lib/kpatch/4.19.113-300.el7.x86_64/
ln -s /usr/src/kernel/4.19.113-300.el7.x86_64/Module.symvers /usr/local/lib/kpatch/4.19.113-300.el7.x86_64/

why Directory /usr/local/lib/kpatch/4.19.113-300.el7.x86_64/ will not be created automatically,need to be created manually?

Under normal conditions , need to exist

/usr/local/lib/kpatch/4.19.113-300.el7.x86_64/Module.symvers and /usr/local/lib/kpatch/4.19.113-300.el7.x86_64/kpatch.ko

image

from kpatch.

euspectre avatar euspectre commented on August 19, 2024

It is really strange. Module.symvers is only used for building, it does not affect loading of the patch.

And, /usr/src/kernel/4.19.113-300.el7.x86_64/Module.symvers is the symvers file for the kernel, not for kpatch.ko. It is unrelated.

from kpatch.

euspectre avatar euspectre commented on August 19, 2024

Also, please see my comment #1285 (comment), it might help build patches in a more reliable way.

from kpatch.

hongwentakkk avatar hongwentakkk commented on August 19, 2024

image

Module.symvers is only used for building ,building error: not find Module.symvers;

loading of the patch error reson : not insert mod kpatch.ko ;insmod /root/kpatch/kmod/core/kpatch.ko is ok

The cause of the problem has been solved, thank you !

from kpatch.

euspectre avatar euspectre commented on August 19, 2024

why Directory /usr/local/lib/kpatch/4.19.113-300.el7.x86_64/ will not be created automatically,need to be created manually?

This should not be necessary. The patch module you have built, kpatch-meminfo-string.ko either requires kpatch.ko or does not. modinfo path/to/kpatch-meminfo-string.ko should tell that.

  • If kpatch-meminfo-string.ko does not actually need kpatch.ko, then kpatch-build should not try to load kpatch.ko. If it does, it looks like a bug.

  • If kpatch-meminfo-string.ko depends on kpatch.ko, kpatch load would try to find kpatch.ko in specific locations, see find_core_module in kpatch script:

find_core_module() {
	COREMOD="$SCRIPTDIR"/../kmod/core/kpatch.ko
	[[ -f "$COREMOD" ]] && return

	COREMOD="/usr/local/lib/kpatch/$(uname -r)/kpatch.ko"
	[[ -f "$COREMOD" ]] && return

	COREMOD="/usr/lib/kpatch/$(uname -r)/kpatch.ko"
	[[ -f "$COREMOD" ]] && return

	COREMOD="/usr/local/lib/modules/$(uname -r)/extra/kpatch/kpatch.ko"
	[[ -f "$COREMOD" ]] && return

	COREMOD="/usr/lib/modules/$(uname -r)/extra/kpatch/kpatch.ko"
	[[ -f "$COREMOD" ]] && return

	return 1
}

You can place kpatch.ko in any of these locations. If the chosen directories do not exist, then yes, it is up to you to create them.

from kpatch.

euspectre avatar euspectre commented on August 19, 2024

insmod /root/kpatch/kmod/core/kpatch.ko is ok

Ah, yes, if you have kpatch.ko in a non-standard location, then yes, loading it manually should help.

Glad it works for you now.

from kpatch.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.