OpenVZ Forum


Home » Mailing lists » Users » bash script to build kernels for Debian
bash script to build kernels for Debian [message #46165] Sun, 29 April 2012 20:55 Go to next message
coolcold is currently offline  coolcold
Messages: 11
Registered: May 2007
Location: Moscow, Russia
Junior Member
From: *parallels.com
Hello!

I've created script for myself to build Debian packaged kernels from
source in semi-automated way. Works for me, may be useful for others.

For building current stable version one just need to start script - it
will download kernel, patch, config and do compiliation.

Code is located on github and is accessible via
https://github.com/CoolCold/tools/blob/master/openvz/kernel/ create-ovz-kernel-for-debian.sh.

--
Best regards,
[COOLCOLD-RIPN]
Re: bash script to build kernels for Debian [message #46214 is a reply to message #46165] Thu, 03 May 2012 05:11 Go to previous messageGo to next message
kir is currently offline  kir
Messages: 1645
Registered: August 2005
Location: Moscow, Russia
Senior Member

From: *parallels.com
On 04/30/2012 12:55 AM, CoolCold wrote:
> Hello!
>
> I've created script for myself to build Debian packaged kernels from
> source in semi-automated way. Works for me, may be useful for others.
>
> For building current stable version one just need to start script - it
> will download kernel, patch, config and do compiliation.
>
> Code is located on github and is accessible via
> https://github.com/CoolCold/tools/blob/master/openvz/kernel/ create-ovz-kernel-for-debian.sh.
>

Looking good, thanks. Are you satisfied with the kernel you have this
way? I mean, are you using it in production, how many nodes etc.

A few minor suggestions for the script itself:

1. "#checking packages" better be moved before read -t 10, no need to
wait then see that we can't build

2. s/$(fgrep processor /proc/cpuinfo|wc -l)/$(grep -cw ^processor
/proc/cpuinfo)/

3. print_usage could be improved to not hardcode current defaults but
take it from KERNELINFO


Kir Kolyshkin
http://static.openvz.org/userbars/openvz-developer.png
Re: bash script to build kernels for Debian [message #46223 is a reply to message #46214] Thu, 03 May 2012 21:16 Go to previous message
coolcold is currently offline  coolcold
Messages: 11
Registered: May 2007
Location: Moscow, Russia
Junior Member
From: *parallels.com
On Thu, May 3, 2012 at 9:11 AM, Kir Kolyshkin <kir@openvz.org> wrote:
> On 04/30/2012 12:55 AM, CoolCold wrote:
>>
>> Hello!
>>
>> I've created script for myself to build Debian packaged kernels from
>> source in semi-automated way. Works for me, may be useful for others.
>>
>> For building current stable version one just need to start script - it
>> will download kernel, patch, config and do compiliation.
>>
>> Code is located on github and is accessible via
>>
>> https://github.com/CoolCold/tools/blob/master/openvz/kernel/ create-ovz-kernel-for-debian.sh.
>>
>
> Looking good, thanks. Are you satisfied with the kernel you have this way? I
> mean, are you using it in production, how many nodes etc.
Servers with kernel built exactly with this script in production which
I have is 3 and one of friend of mine (not much load, just 3 VEs for
tests), this number going to increase twice soon. But in general I'm
using kernels build with make-kpkg since 2008 .

>
> A few minor suggestions for the script itself:
>
> 1. "#checking packages" better be moved before read -t 10, no need to wait
> then see that we can't build
>
> 2. s/$(fgrep processor /proc/cpuinfo|wc -l)/$(grep -cw ^processor
> /proc/cpuinfo)/
1 & 2 done - https://github.com/CoolCold/tools/commit/a5a56976fb84de9c691 4072daa8daadad7d358bf

>
> 3. print_usage could be improved to not hardcode current defaults but take
> it from KERNELINFO

Not sure got your point about 3 - I'm considering that usage output as
some reference in general, not as exact values, that's why it contains
lines like:
echo "-R <rhelid> - specifies rhel version id, now latest rhel is 6,
previous was 5."
to make people know - it may be such or other way. Turning back to
your suggestion I think I can print default values at the end, like:
echo "-R <rhelid> - specifies rhel version id, now latest rhel is 6,
previous was 5. [Default is: ${KERNELINFO["rhelid"]} ]"
what do you think about this?

>
--
Best regards,
[COOLCOLD-RIPN]
Previous Topic: Install from USB: isolinux.bin is missing
Next Topic: Submission Deadline Extension
Goto Forum:
  


Current Time: Thu Dec 13 22:07:17 GMT 2018