ubuntu changelog/source获取方法

2021-05-19 20:22:46 浏览数 (1)

平时使用Ubuntu比较少,相关操作不甚熟悉,对ubuntu查看内核修复信息的一些方法做下记录

ubuntu查看某个版本的changelog方法:

代码语言:javascript复制
下载changelog文件并用vim查看即可:
apt-get changelog linux-image-3.13.0-117-generic -d

下载deb包,下载后默认存放在/var/cache/apt/archives/目录下

代码语言:javascript复制
apt-get -d install linux-image-3.13.0-117-generic

下载源码包到当前目录:

代码语言:javascript复制
apt-cache search linux-source
apt-get  source linux-image-3.13.0-117-generic  //新版本apt-get source linux-source-4.15.0
代码语言:javascript复制
例如:
root@VM-32-104-ubuntu:/home/ubuntu# apt-get  source linux-image-3.13.0-117-generic
Reading package lists... Done
Building dependency tree
Reading state information... Done
Picking 'linux-lts-trusty' as source package instead of 'linux-image-3.13.0-117-generic'
NOTICE: 'linux-lts-trusty' packaging is maintained in the 'Git' version control system at:
http://kernel.ubuntu.com/git-repos/ubuntu/ubuntu-precise.git lts-backport-trusty
Need to get 128 MB of source archives.
Get:1 http://mirrors.tencentyun.com/ubuntu/ precise-updates/main linux-lts-trusty 3.13.0-117.164~precise1 (dsc) [3,623 B]
Get:2 http://mirrors.tencentyun.com/ubuntu/ precise-updates/main linux-lts-trusty 3.13.0-117.164~precise1 (tar) [116 MB]
Get:3 http://mirrors.tencentyun.com/ubuntu/ precise-updates/main linux-lts-trusty 3.13.0-117.164~precise1 (diff) [11.4 MB]
Fetched 128 MB in 2s (52.7 MB/s)
gpgv: Signature made Tue 11 Apr 2017 12:10:18 AM CST using RSA key ID CBEECEA3
gpgv: Can't check signature: public key not found
dpkg-source: warning: failed to verify signature on ./linux-lts-trusty_3.13.0-117.164~precise1.dsc
dpkg-source: info: extracting linux-lts-trusty in linux-lts-trusty-3.13.0
dpkg-source: info: unpacking linux-lts-trusty_3.13.0.orig.tar.gz
dpkg-source: info: applying linux-lts-trusty_3.13.0-117.164~precise1.diff.gz
dpkg-source: info: upstream files that have been modified:
 linux-lts-trusty-3.13.0/Documentation/ABI/removed/net_dma
 linux-lts-trusty-3.13.0/Documentation/ABI/stable/sysfs-firmware-opal-dump
 linux-lts-trusty-3.13.0/Documentation/ABI/stable/sysfs-firmware-opal-elog
 linux-lts-trusty-3.13.0/Documentation/ABI/testing/ima_policy
 linux-lts-trusty-3.13.0/Documentation/ABI/testing/sysfs-firmware-efi
 linux-lts-trusty-3.13.0/Documentation/ABI/testing/sysfs-firmware-efi-runtime-ma
....

下载完成后linux-lts-trusty-3.13.0就是在linux-lts-trusty_3.13.0.orig.tar.gz基础上打过补丁的linux-image-3.13.0-117-generic版本对应的源码包:

代码语言:javascript复制
root@VM-32-104-ubuntu:/home/ubuntu/source# ls -al
total 124928
drwxr-xr-x  3 root   root      4096 Aug 11 13:10 .
drwxrwxrwx  8 ubuntu sudo      4096 Aug 11 13:10 ..
drwxr-xr-x 27 root   root      4096 Aug 11 13:10 linux-lts-trusty-3.13.0
-rw-r--r--  1 root   root  11352017 Apr 13  2017 linux-lts-trusty_3.13.0-117.164~precise1.diff.gz
-rw-r--r--  1 root   root      3623 Apr 13  2017 linux-lts-trusty_3.13.0-117.164~precise1.dsc
-rw-r--r--  1 root   root 116419243 Apr 16  2014 linux-lts-trusty_3.13.0.orig.tar.gz
linux-lts-trusty_3.13.0-117.164~precise1.diff.gz就是linux-lts-trusty-3.13.0与linux-lts-trusty_3.13.0.orig.tar.gz之间的diff信息。

另外apt-get source 每次下载出来的都是该版本最新的源码包,下载不到历史包,比如要下linux-image-3.13.0-32-generic的源码,实际上下载到的还是当前最新版本的linux-image-3.13.0-117-generic源码包:

代码语言:javascript复制
root@VM-32-104-ubuntu:/home/ubuntu/source/linux-image-3.13.0-32-generic# apt-get  source linux-image-3.13.0-32-generic
Reading package lists... Done
Building dependency tree
Reading state information... Done
Picking 'linux-lts-trusty' as source package instead of 'linux-image-3.13.0-32-generic'
NOTICE: 'linux-lts-trusty' packaging is maintained in the 'Git' version control system at:
http://kernel.ubuntu.com/git-repos/ubuntu/ubuntu-precise.git lts-backport-trusty
Need to get 128 MB of source archives.
Get:1 http://mirrors.tencentyun.com/ubuntu/ precise-updates/main linux-lts-trusty 3.13.0-117.164~precise1 (dsc) [3,623 B]
Get:2 http://mirrors.tencentyun.com/ubuntu/ precise-updates/main linux-lts-trusty 3.13.0-117.164~precise1 (tar) [116 MB]
Get:3 http://mirrors.tencentyun.com/ubuntu/ precise-updates/main linux-lts-trusty 3.13.0-117.164~precise1 (diff) [11.4 MB]
Fetched 128 MB in 10s (12.4 MB/s)
gpgv: Signature made Tue 11 Apr 2017 12:10:18 AM CST using RSA key ID CBEECEA3
gpgv: Can't check signature: public key not found
dpkg-source: warning: failed to verify signature on ./linux-lts-trusty_3.13.0-117.164~precise1.dsc
dpkg-source: info: extracting linux-lts-trusty in linux-lts-trusty-3.13.0
dpkg-source: info: unpacking linux-lts-trusty_3.13.0.orig.tar.gz
dpkg-source: info: applying linux-lts-trusty_3.13.0-117.164~precise1.diff.gz

下载历史源码包,参考ubuntu的源码git说明:

https://wiki.ubuntu.com/Kernel/Dev/KernelGitGuide?action=show&redirect=KernelTeam/KernelGitGuide

0 人点赞