lm_sensors kernel patching problem

Yes, I am a linux noob, so lets get that straight :wink:

I am writing some software for a phyCORE-MCB5200B powerpc dev board.

I was able to compile the provided kernel, and flash it and everything works well, except the on-board I2C.

After reading some more documentation, I found out I need to include the lm_sensors in the kernel, then rebuild.

I have a provided kernel version 2.6.23.1 and I downloaded lm_sensors-2.8.8. (I read somewhere that would be a good version to use with that kernel)

When I run the mkpatch software as stated in the manual it says to use as an example, these command lines:

mkpatch/mkpatch.pl . /usr/src/linux > /tmp/sensors-patch

There is no linux directory under /usr/src/.

So here is my file structure and what I have tried;

~/kernel/linux-2.6.23.1 - this is where I configured my kernel
~/kernel/lm_sensors-2.8.8 - this is where lm_sensors resides.

While in the lm_sensors directory I type:

mkpatch/mkpatch.pl . ~/kernel/linux-2.6.23.1 > /tmp/sensors-patch

Which then tells me: Kernel root '…\linux-2.6.23.1" is not found.

Where is the kernel root or am I missing something else?

Thank you so much,
Joe

On 04/24/2013 05:56 PM, Axepraise wrote:
>
> When I run the mkpatch software as stated in the manual it says to use
> as an example, these command lines:
>
> mkpatch/mkpatch.pl . /usr/src/linux > /tmp/sensors-patch
>
> There is no linux directory under /usr/src/.

A distro will install its kernel in that directory, where linux is usually a
link to the real location of the directory where the kernel sources are installed.

> So here is my file structure and what I have tried;
>
> ~/kernel/linux-2.6.23.1 - this is where I configured my kernel
> ~/kernel/lm_sensors-2.8.8 - this is where lm_sensors resides.

Based on your description, I think ~/kernel/linux-2.6.23.1/ should replace
/usr/src/linux/. The only question is what user is implied by that ~.

> While in the lm_sensors directory I type:
>
> mkpatch/mkpatch.pl . ~/kernel/linux-2.6.23.1 > /tmp/sensors-patch
>
> Which then tells me: Kernel root '…\linux-2.6.23.1" is not found.
>
> Where is the kernel root or am I missing something else?

Is the kernel directory above located in /root/, or somewhere else?

Thanks for the speedy reply!

A distro will install its kernel in that directory, where linux is usually a
link to the real location of the directory where the kernel sources are installed.

I don’t know why there isn’t a link to the kernel src directory.

Based on your description, I think ~/kernel/linux-2.6.23.1/ should replace
/usr/src/linux/. The only question is what user is implied by that ~.

I agree, I tried that but it still did not work.

Is the kernel directory above located in /root/, or somewhere else?

It is located at absolute path: /home/joe/kernel/linux-2.6.23.1

Thanks,
joe

On 04/24/2013 07:06 PM, Axepraise wrote:
>
> Thanks for the speedy reply!
>
> A distro will install its kernel in that directory, where linux is
> usually a
> link to the real location of the directory where the kernel sources are
> installed.
>
> I don’t know why there isn’t a link to the kernel src directory.

A standard installation from the tarball does not need that link, and it does
not create it.

> Based on your description, I think ~/kernel/linux-2.6.23.1/ should
> replace
> /usr/src/linux/. The only question is what user is implied by that ~.
>
> I agree, I tried that but it still did not work.
>
>
> Is the kernel directory above located in /root/, or somewhere else?
>
> It is located at absolute path: /home/joe/kernel/linux-2.6.23.1

Were you user “joe” when you ran the command. The error message makes it look as
if you were root.

-=WELCOME=- new poster!

> I missing something else

you missed telling what operating system and version you installed…

i guess you might be using some version of SUSE Linux Enterprise
Server/Desktop (SLES/SLED)–is that correct, or are you using some
version of openSUSE, and which?

i ask, because i don’t think there is a supported openSUSE or SLE
version with is using a 2.6.x kernel.

if you are not sure, the following in a terminal will be definitive:

lsb_release -sircd

you could return the output from that to this thread please…and we
can advise more…

again, welcome


dd
http://tinyurl.com/DD-Caveat

Thank you!

I just realized I left that part out, I am sorry!

SUSE LINUX “open SUSE 11.1 (i586)” 11.1 n/a

Background:

We purchased a development kit from phytec.com it is the phyCORE-MPC5200B tiny I/O with linux.
The manual is written (as well as all of the scripts and software on the installation cd) for OpenSuse 10.0.
At first I tried the installation CD with OpenSuse 12.1 and it failed miserably.
I finally reformatted and installed OpenSuse 11.1 and all of the install scripts on the CD work well.

I was able to complete the manual setup and install the board support files for the host computer which is (OpenSuse 11.1)
You then un-tar the kernel (2.6.23.1) run make xconfig ARCH=powerpc and setup all the kernel needed files.
Cross compiled it for a powerpc: make ARCH=powerpc CROSS_COMPILE=powerpc-603e-linux-gnu- uImage.
This worked fine, made the image file and at that point you copy it to the /tftpboot directory.

I then use minicom to connect to the protoboard, type a couple of commands, it finds the uImage on the host computer and downloads it, flashes it and everything is good to go. (except the I2C).

So after going back and forth with phytec support, they said I need to include lm_sensors in the kernel then recompile the kernel.
According to the lm_sensors install, you run the mkpatch program to do that.
My problem is, I don’t know what path they want me to point to. It looks like it does a diff on the kernel config with its own cofing then spits out a new config that will be used when I rebuild the kernel.

It seems they want the “root” of the kernel.
so when I try to get mkpatch work, I used that and failed miserably. (my previous post)

So I guess what it comes down to is what does the second parameter in mk_patch want to point to?
A sub folder inside linux-2.6.23?
I assumed the “root” would be linux-2.6.23/, but it’s not working.

Thank you,
Joe

You generally compile as a normal user. You only need to be root to install.

On 04/25/2013 06:56 PM, Axepraise wrote:
>
>
> SUSE LINUX “open SUSE 11.1 (i586)” 11.1 n/a

openSUSE 11.1 met its end of life and support on January 14th 2011
(cite: http://en.opensuse.org/Lifetime) and in the intervening 27
months innumerable security patches have been issued to current
versions leaving your 11.1 riddled with common knowledge (to
krackers) security holes…

my recommendation would be to not connect that machine to any network
with potential bad actors in, or out of the organization.

i know nothing about phytec.com, but if you “purchased a development
kit from phytec.com” since anytime in 2010 which included unsupported
software . . . then . . . well i don’t know what…maybe they
included a caveat to NOT expect that system to be secure into the far
distant future, like past Jan 2011!! or not to network that system
with any other…

now to your problem: i can’t help you, there is no way i would ever
remember how the paths and kernel locations may (or may not) have
changed between openSUSE 10.x (the last in that series died in
October 2009!!) and the 11.1 you are trying to use…i think you
probably have to rely on phytec.com for whatever support you need…

oh, by the way: when openSUSE 11.1 was installed by folks back
between Dec 2008 (when it was released) and Jan 2011 it would have
been online updated the same day it was first installed, from repos
which have long since been removed from common use…so, the image
you have installed dates back to when 11.1 was first released and
your machine has missed patches for 52 months.

wait: i would guess (OPINION) your best bet at having a supported
and secure system would be to use SUSE Linux Enterprise Server or
Desktop (SLES or SLED) version 10 from the commercial side over at
www.suse.com, why not chat with the folks on their forums at
http://forums.suse.com/

sure, the security patch subscription will cost a little bit to
continue, but you can (at least) install an image which IS secure
today for free (there is a free download and trial period of 60 or
90 days…after which the security updates stop…)

heh: maybe phytec.com will refund enough to buy a few years worth (it
is not much for JUST the security patch support for SLE_…but, they
have levels of hand holding far above that)

ymmv (and i am NOT highly conversant on things SLE_)


dd
http://tinyurl.com/DD-Caveat

I think I like your idea, I would rather use the latest and hope it works!

OK, I blew out my old host laptop and installed OpenSUSE 12.3.

I downloaded one of the latest kernels, 3.8.

I updated the kernel with make xconfig ARCH=powerpc and selected all the options I need.

Now, how do I cross compile the kernel for PowerPC?
The old (phytec) board install cd, set up the cross compiler toolchain for me. and it does not work with OpenSuse12.3.

Can I use the stock gcc with switches, or do I have to download a special powerpc gcc?

Thanks,
Joe

On 04/27/2013 02:36 AM, Axepraise wrote:
> Now, how do I cross compile the kernel for PowerPC?

if openSUSE still (or again) supports PPC (i know it was dropped
some years back) your new question (assumming you have solved the "
kernel patching problem" noted in your subject line) should go into a
new thread in the Programming/Scripting - Questions about
programming, bash scripts, perl, php, cron jobs, ruby, python, etc.
fourm here http://tinyurl.com/5v695w4

because it would be in that forum you are likely to attract the
attention of cross compile x86-PCC gurus (if there are any around
still)…you may need to move to the mail list, here
http://en.opensuse.org/openSUSE:Communication_channels

or, you can stay here and wait for one of those to wander by and see
your subject line, not know it deals with PCC and not open the thread
and read and . . .


dd
openSUSE®, the “German Engineered Automobile” of operating systems!
http://goo.gl/PUjnL
http://tinyurl.com/DD-Caveat
http://tinyurl.com/DD-Hardware
http://tinyurl.com/DD-Software

There appears to be some PPC cross compiler stuff in the repos. But but that is a far as I know what to do I suppose there is a compiler switch. but that is a guess. Search YAST for PPC

On 04/27/2013 02:06 PM, gogalthorp wrote:
>
> There appears to be some PPC cross compiler stuff in the repos. But but
> that is a far as I know what to do I suppose there is a compiler switch.
> but that is a guess. Search YAST for PPC

I used to cross-compile kernels for PPC. As I recall, I got the cross-compiler
build chain after searching on Google. It did not come through YaST. I abandoned
the effort as it was impossible to install the resulting kernels across an NFS
link the way I do 32-bit i386 architecture, and building RPMs is such a drag.