首页
学习
活动
专区
圈层
工具
发布
社区首页 >问答首页 >在EC2上编译Ubuntu内核(没有错误,但是没有映像,重启后没有变化)

在EC2上编译Ubuntu内核(没有错误,但是没有映像,重启后没有变化)
EN

Stack Overflow用户
提问于 2011-11-11 02:12:53
回答 4查看 3.7K关注 0票数 3

我需要更新我的Ubuntu (10.04)服务器上的EC2内核定时器(与EBS)从250 on到1000 on,以提高voip通话质量。

据我所读,这样做的方法是下载内核源代码,配置它,然后安装它。

我已经找到了几个非常适合我的设置的教程,其中最好的是:

这就引出了以下几组命令,它们都运行良好,使.deb文件没有明显的错误。但是,当我重新启动服务器时,计时器频率还没有更新。

代码语言:javascript
复制
sudo apt-get build-dep linux-image-$(uname -r)
sudo apt-get build-dep linux
sudo apt-get install fakeroot build-essential
sudo apt-get install crash kexec-tools makedumpfile kernel-wedge
sudo apt-get install libncurses5 libncurses5-dev
sudo apt-get install libelf-dev asciidoc binutils-dev kernel-package

cd /usr/src
sudo apt-get source linux-image-$(uname -r)

cd linux-*
sudo make menuconfig
# Processor type and features -> Timer frequency -> change to 1000HZ -> Exit -> Exit -> Yes (Save)

fakeroot debian/rules clean
fakeroot debian/rules binary-headers
fakeroot debian/rules binary-indep   #This does the headers, docs, and source

#check deb 2-3 files were created
cd ..
ls *.deb

sudo dpkg -i linux-*.deb
#reboot

编辑

在irc #ubuntu内核上花了一些时间在jjohansen上,并且能够在他的帮助下发现我的错误--看起来我应该在清理和构建之间完成配置步骤。此外,他建议始终使用来自git的源代码,而不是包,因此,在上面的内容中,下面是要执行的新命令:

代码语言:javascript
复制
cd /usr/src
# This is 700mb so it takes a while to download and set up
git clone git://kernel.ubuntu.com/ubuntu/ubuntu-lucid.git
cd ubuntu*
git checkout --track -b ec2 origin/ec2

fakeroot debian/rules clean
fakeroot debian/rules editconfigs
fakeroot debian/rules binary
#Takes about 40min
EN

回答 4

Stack Overflow用户

回答已采纳

发布于 2011-11-12 01:14:44

Johansen (Canonical的内核黑客)认为,您应该能够使用Ubuntu在EC2实例上构建和运行自己的内核。

参见jjohansen在2009年提交的1000 had EC2内核请求中的说明:

https://bugs.launchpad.net/ubuntu-on-ec2/+bug/365233

您需要确保您是从最近使用pvgrub的Ubuntu开始的。

票数 2
EN

Stack Overflow用户

发布于 2011-11-12 23:32:45

感谢埃里克·哈蒙德的提醒,

您需要的内核将取决于您使用的Ubuntu版本。对于,您需要使用-ec2内核源代码。所需的支持被转移到正常的内核树中。

所以你需要

代码语言:javascript
复制
 sudo apt-get source linux-ec2

代码语言:javascript
复制
git clone git://kernel.ubuntu.com/ubuntu/ubuntu-lucid.git
代码语言:javascript
复制
cd into the source directory

fakeroot debian/rules clean
fakeroot debian/rules binary

对于Lucid,您还必须确保已经完成了更新,或者正在使用当前映像,因为在Lucid发布后添加了对pv的支持。

票数 1
EN

Stack Overflow用户

发布于 2012-03-09 01:38:38

参考Redzarf的终端命令,包括他的编辑和一些小的必要的添加,这里是为我工作的ec2香草安装的UbuntuServerCloudGuest10.04LTS( Lynx) 64x。

代码语言:javascript
复制
# Make yourself root
sudo su

# Update source list:
aptitude update

# Upgrade everything:
aptitude upgrade 

# Install dependencies:
apt-get build-dep linux-image-$(uname -r)
apt-get build-dep linux
apt-get install fakeroot build-essential
apt-get install crash kexec-tools makedumpfile kernel-wedge
apt-get install libncurses5 libncurses5-dev
apt-get install libelf-dev asciidoc binutils-dev kernel-package
apt-get install git-core

cd /usr/src
git clone git://kernel.ubuntu.com/ubuntu/ubuntu-lucid.git 
cd ubuntu*
git checkout --track -b ec2 origin/ec2
fakeroot debian/rules clean
fakeroot debian/rules editconfigs

# Configuration window should now appear, do the following:

Select YES

# Navigate to:
Processor type and features -> Timer frequency
# Select the 1000HZ frequency 
Exit 
Exit 
Yes (Save)

#After saving and returning to prompt it may ask you to do it again for i386, select yes and repeat!

# Recompile:
fakeroot debian/rules binary 

#Check if your deb 2-3 files were created
cd ..
ls *.deb
sudo dpkg -i linux-*.deb

#reboot
reboot

#Check your new Kernel version
uname -r

#Check if Kernel HZ value change persisted:
cat /boot/config-`uname -r` | grep HZ

#If value 1000HZ=yes:

Done!;)

--==<快速提示>==--

如果您运行的是“随需应变的微实例”,编译时间将花费大约7小时并花费$0.14!如果您想节省一些时间并在12 can 下重新编译$0.21,您可以这样做:

  • 预留一个高CPU超大型Spot实例(20x ec2计算单元,7GB内存)
  • 用上述命令重新编译内核(12分钟)
  • 一旦重新编译完成,获取spot实例的ebs卷的快照
  • 等待快照完成(几分钟)
  • 终止spot实例
  • 从快照创建新卷(nichname:卷X)也要注意卷ID!
  • 转到实例>创建新的EBS实例
代码语言:javascript
复制
- This will be the New instance your Asterisk server will be running on
- It must be from the same Base AMI, and same Zone as Volume X) -The New Instance will now be created along with a corresponding EBS Volume

  • 停止新实例
  • 转到卷>分离新实例的相应EBS卷
  • 分离后,删除该卷
  • 选择卷X>附加到新的EBS实例(设备ID必须是:/dev/sda1 1)
  • 转到实例>启动新实例
  • 如果你有弹性IP的话。
  • 检查是否一切正常
  • 如果所有东西都签出了,就创建另一个备份快照!

完成!;)

大声喊出来,感谢雷扎夫、埃里克·哈蒙德和约翰·约翰森!

票数 1
EN
页面原文内容由Stack Overflow提供。腾讯云小微IT领域专用引擎提供翻译支持
原文链接:

https://stackoverflow.com/questions/8088901

复制
相关文章

相似问题

领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档