WelcomeWelcome | FAQFAQ | DownloadsDownloads | WikiWiki

Author Topic: [Solved] linux-kernel-sources-env tweak?  (Read 2879 times)

aus9

  • Guest
[Solved] linux-kernel-sources-env tweak?
« on: July 08, 2018, 05:43:32 AM »
@ coreplayer2

I am not a real coder....andt sometimes think I know what I am talking about and then find out later I had my foot in mouth...heh heh So this a just a suggestion for your excellent kernel script. Let me show you what I have done to tweak it and leave it for your consideration....from a build script I do this

Quote
K=/usr/src/linux-4.14.10

(snip)


# kernel prepare
################
uname -r
# 4.14.10-tinycore64
# check our build will match string....NO
cd $K
make kernelversion
# 4.14.10
# fix it
########
sed 's|EXTRAVERSION =|EXTRAVERSION = -tinycore64|' -i $K/Makefile
make kernelversion
# should become 4.14.10-tinycore64, I lack the skills to script that
# into a "true" if then script.....so watch out please newbies like me
make scripts

I have done it....maybe wasting time as I built a out-of-tree kernel module and was concerned that magic version might mismatch.

Feel free to correct my thinking.

thanks for reading
« Last Edit: July 08, 2018, 10:08:55 PM by Rich »

Offline coreplayer2

  • Hero Member
  • *****
  • Posts: 3020
Re: [Solved] linux-kernel-sources-env tweak?
« Reply #1 on: July 08, 2018, 02:15:14 PM »
Is the extension not working as expectedly?


Sent from my iPhone using Tapatalk
« Last Edit: July 08, 2018, 10:09:10 PM by Rich »

aus9

  • Guest
Re: [Solved] linux-kernel-sources-env tweak?
« Reply #2 on: July 08, 2018, 09:06:32 PM »
hi thanks for dropping by.

I was concerned, in building a module on 64 bit that I might have an error if vermagic was not a match

ref
https://linux.die.net/lkmpg/x380.html

Quote
In other words, your kernel refuses to accept your module because version strings (more precisely, version magics) do not match

Are you suggesting that I should not have such concerns?

I could run my build script without that extra bit and see I suppose?
« Last Edit: July 08, 2018, 10:09:22 PM by Rich »

aus9

  • Guest
Re: [Solved] linux-kernel-sources-env tweak?
« Reply #3 on: July 08, 2018, 10:04:25 PM »
oh my gosh

While waiting for you reply.....I hashed out that sed stuff and rebuilt the module.

and vermagic still built correctly

Code: [Select]
modinfo 8188eu | grep vermagic
vermagic:       4.14.10-tinycore64 SMP mod_unload

and wicd shows I am connected.....after disconnecting my ethernet

sorry to have wasted time

Moderators.....can you mark this post as solved and remove [Suggestion] from subject line please.
« Last Edit: July 08, 2018, 10:11:00 PM by aus9 »

Offline coreplayer2

  • Hero Member
  • *****
  • Posts: 3020
[Solved] linux-kernel-sources-env tweak?
« Reply #4 on: July 09, 2018, 01:04:44 PM »
Hello aus9

Am glad everything is ok now.    Note that I rarely use SED, I favor “Parameter Substitution” instead, as the feature is considerably more efficient than sed and is already supported by ash & bash.


Sent from my iPhone using Tapatalk

Offline Rich

  • Administrator
  • Hero Member
  • *****
  • Posts: 11630
Re: [Solved] linux-kernel-sources-env tweak?
« Reply #5 on: July 09, 2018, 01:57:34 PM »
Hi coreplayer2
If you type  busybox  at the command line,  sed  is one of the included commands that pops up.

aus9

  • Guest
Re: [Solved] linux-kernel-sources-env tweak?
« Reply #6 on: July 09, 2018, 09:04:55 PM »
@ coreplayer2

if you forgive the slight offtopic but post is solved.....first I have heard of parameter substitution

just had a quick look at
https://opensource.com/article/17/6/bash-parameter-expansion

What I am interested in.....is a build script that might take  say one line
line 1 blah blah

and add a some empty lines and extra lines.

If you have the time can you give an example of that if its possible your way?

thanks for reading no matter what your decision is

Offline coreplayer2

  • Hero Member
  • *****
  • Posts: 3020
Re: [Solved] linux-kernel-sources-env tweak?
« Reply #7 on: July 10, 2018, 12:51:49 AM »
Hi aus9

I'm not sure I understand what you're asking but this link is a great resource
https://www.tldp.org/LDP/abs/html/parameter-substitution.html

Almost anything you can do with sed can be done better with parameter-substitution by the shell
« Last Edit: July 10, 2018, 12:53:44 AM by coreplayer2 »

aus9

  • Guest
Re: [Solved] linux-kernel-sources-env tweak?
« Reply #8 on: July 10, 2018, 04:45:22 AM »
ahh ok I had a quick look.....this may take me a while to digest.

If I have a go and fail....I will start a new post

thanks