Debian Customer PPA RFC (by quqi99)

作者:张华  发表于:2016-01-13
版权声明:能够随意转载,转载时请务必以超链接形式标明文章原始出处和作者信息及本版权声明

( http://blog.csdn.net/quqi99 )

Precondition

a, sudo apt install gnupg pbuilder ubuntu-dev-tools bzr-builddeb apt-file debhelper dh-systemd openstack-pkg-tools

b, GPG key
scp -r /home/hua/.gnupg [email protected]:~/
gpg --list-public           # or gpg --gen-key
export GPGKEY=XXXXXX
gpg --send-keys --keyserver keyserver.ubuntu.com $GPGKEY

c, SSH key
ssh-keygen -t rsa
https://launchpad.net/~/+editsshkeys

d, Bazaar
bzr whoami "<Email>"
bzr launchpad-login <lauchpad_id>

Get the source code

a, Add related ppa to /etc/apt/source.list
   ppa info can be found from lanchpad https://launchpad.net/~zhhuabj/+archivesubscriptions
   
b, Import the public key and update the repository
   sudo apt-key adv --keyserver keyserver.ubuntu.com --recv-keys <public-key>
   sudo apt-get update

c, Get the source code (pls don‘t add other repository when executing this step)
   #Get package from the ppa
   sudo apt-get source <package-name>    
   #Get package from official repo
   #pull-lp-source lsb trusty

#debcheckout --git-track=‘*‘ nova   #for openstack sru

d, dget *.dsc

Example:

sudo add-apt-repository cloud-archive:kilo
#uncomment deb-src in /etc/apt/sources.list.d/cloudarchive-kilo.list
$ cat /etc/apt/sources.list.d/cloudarchive-kilo.list
deb http://ubuntu-cloud.archive.canonical.com/ubuntu trusty-updates/kilo main
deb-src http://ubuntu-cloud.archive.canonical.com/ubuntu trusty-updates/kilo main

sudo rm /var/lib/apt/lists/* -vf && sudo apt-get update

rmadison libvirt

sudo apt-cache madison nova-compute  #See all versions
sudo apt-get source nova=1:2015.1.2-0ubuntu2~cloud

当中get-get source相当于:

#https://launchpad.net/~ubuntu-cloud-archive/+archive/ubuntu/kilo-staging/+packages?

field.name_filter=qemu&field.status_filter=superseded&field.series_filter=
wget https://launchpad.net/~ubuntu-cloud-archive/+archive/ubuntu/kilo-staging/+files/qemu_2.2+dfsg-5expubuntu9.6~cloud0.debian.tar.gz
wget https://launchpad.net/~ubuntu-cloud-archive/+archive/ubuntu/kilo-staging/+files/qemu_2.2+dfsg-5expubuntu9.6~cloud0.dsc
wget https://launchpad.net/~ubuntu-cloud-archive/+archive/ubuntu/kilo-staging/+files/qemu_2.2+dfsg.orig.tar.xz
dpkg-source -x qemu_2.2+dfsg-5expubuntu9.6~cloud0.dsc

Patch package

1, quilt configuration
   a, sudo apt-get install quilt devscripts dh-make
   b, Export to bash env
      export QUILT_PATCHES=debian/patches
      export QUILT_NO_DIFF_INDEX=1
      export QUILT_NO_DIFF_TIMESTAMPS=1
      export QUILT_REFRESH_ARGS="-p ab"
      export QUILT_PATCHES=debian/patches
      export QUILT_REFRESH_ARGS="-p ab --no-timestamps --no-index"

#git format-patch -1 2150d5d8e17323bc9fce11903da3afffda211d26
quilt import /bak/openstack/nova/0001-pci-eliminate-DB-lookup-PCI-requests-during-claim.patch

c, Creating a new patch.
      quilt new test.diff
      quilt add neutron/agent/linux/ovs_lib.py
      quilt refresh
      quilt rename -P test.diff test2.diff
      cat debian/patches/test.diff
      quilt pop -a

d, For the exsiting patch,
      Put the patch into ‘./debian/patches‘ directory
      Pppend it into ‘./debian/patch/series‘ file
      Use ‘quilt push -a‘ command to push all existing patches onto the source tree.
      quilt refresh

3, changelog
   dch -i #can be changed later by dch -e
   cat debian/changelog
   cat debian/copyright
   cat debian/rules
   cat debian/control

ppa name format:  <customername>[-<openstack-version>|-<ubuntu-release>]
   changelog format: <upstream-version>hf<lp-bug-number>v<date>.<buildnum>
   dch -b -Dprecise-updates -v1:2014.1.5-0ubuntu1.2hf123456v20150902.0
   nova (1:2014.1.5-0ubuntu1.2hf123456v20150902.0) precise-update; urgency=low
       * [HOTFIX] Fixes some catastrophic failure (LP: #123456)
         - blah blah blah
         - d/p/my-awesome-backport.patch

4, Edit ppa‘s dependancy in ‘Edit PPA dependencies‘ field.
   Eg:
   for Juno,    ~ubuntu-cloud-archive/ubuntu/juno-staging
   for grizzly, ~ubuntu-cloud-archive/grizzly-staging

5, Resolv the dependancy
   dpkg-checkbuilddeps
   
   add grizzly dependancy repository
   #sudo add-apt-repository ppa:ubuntu-cloud-archive/grizzly-staging
   deb http://ppa.launchpad.net/ubuntu-cloud-archive/grizzly-staging/ubuntu precise main
   deb-src http://ppa.launchpad.net/ubuntu-cloud-archive/grizzly-staging/ubuntu precise main
   sudo apt-get build-dep  quantum    # will read debian/control to resolv dependancy.
   sudo apt-get build-dep --no-install-recommends quantum

6, Build
   find . -name "*.pyc" -exec rm -rf {} \;
 
   #build signed source package
   debuild -S -k<your key here>

#build signed binary package
   debuild -b -k<your key here>

#build unsigned source package
   debuild -i -us -uc -S

#build unsigned binary package which can be tested by the command ‘dpkg -i <pac>.deb‘
   debuild -i -us -uc -b

debuild -S -sa --changes-option=-DDistribution=precise -k<GPGKEY>

#for openstack sru, 有时候这步不成功,须要先将patch用quilt格式化一下再用(quilt import, quilt push -a, quilt refresh)

sudo apt install build-essential devscripts quilt dh-autoreconf fakeroot dpkg-dev python-sphinx

gbp buildpackage -S -k$GPGKEY
   #gbp buildpackage -S -us -uc

2, debiandiff, 这步须要将老新build两次再用debdiff命令产生
   a, Use the existing debdiff, patch -p1 < ../trusty.debdiff
   b, Create new debdiff, http://packaging.ubuntu.com/html/traditional-packaging.html#creating-a-debdiff
      debuild -S                                              #build old source to generate dsc file
      debdiff old.dsc new.dsc                           #generate debdiff by comparing two sources

7, Upload to PPA
   export DEBEMAIL=<email>
   export DEBFULLNAME=<name, e.g. "Zhang">
   #Test PPA can be created in https://launchpad.net/~zhhuabj/+activate-ppa
   dput -f ppa:zhhuabj/trusty-sru-testing test.changes
  
   #openstack sru

git push --all lp:~<launchpad-id>/ubuntu/+source/nova
git push --tags lp:~<launchpad-id>/ubuntu/+source/nova

假设用git的话。须要先在~/.git_config中加入:

[url "git+ssh://[email protected]/"]
        insteadof = lp:

然后运行:git push lp:~zhhuabj/ubuntu/+source/nova

最后訪问: https://code.launchpad.net/~zhhuabj/ubuntu/+source/nova/+git/nova

8, sru进度查看

UA,    https://people.canonical.com/~ubuntu-archive/pending-sru.html

UCA, reqorts.qa.ubuntu.com/reports/ubuntu-server/cloud-archive/kilo_versions.html

附录一。sbuild

#sbuild, https://wiki.ubuntu.com/SimpleSbuild
#sudo add-apt-repository cloud-archive:liberty
cat /etc/apt/sources.list.d/ubuntu-cloud-archive-liberty-staging-trusty.list

deb http://ubuntu-cloud.archive.canonical.com/ubuntu liberty-updates/ubuntu main
# deb http://ppa.launchpad.net/ubuntu-cloud-archive/liberty-staging/ubuntu trusty main
# deb-src http://ppa.launchpad.net/ubuntu-cloud-archive/liberty-staging/ubuntu trusty main

schroot -l
schroot -c source:trusty-amd64 -u root         #这句会告成电脑没有声音,能够使用sudo killall pulseaudio解决
schroot -c trusty-amd64 -u root  #do work
apt-get build-dep libvirt-bin
sbuild -d trusty-amd64

附录二, pbuilder
#pbuilder https://wiki.ubuntu.com/PbuilderHowto   http://www.cr173.com/html/28930_1.html
sudo apt-get install pbuilder debootstrap devscripts apt-cacher-ng
echo ‘Acquire::http::Proxy "http://127.0.0.1:3142";‘ | sudo tee /etc/apt/apt.conf.d/01acng
$ sudo cat /etc/pbuilderrc 
MIRRORSITE=http://us.archive.ubuntu.com/ubuntu/
export http_proxy=http://127.0.0.1:3142/
export http_proxys=http://127.0.0.1:3142/

DEBFULLNAME=‘xxx‘
DEBEMAIL=‘[email protected]‘

DISTRIBUTION=‘trusty‘
OTHERMIRROR="deb http://us.archive.ubuntu.com/ubuntu/ ${DISTRIBUTION} universe"
OTHERMIRROR+="|deb http://us.archive.ubuntu.com/ubuntu/ ${DISTRIBUTION}-updates main universe"
OTHERMIRROR+="|deb http://us.archive.ubuntu.com/ubuntu/ ${DISTRIBUTION}-proposed main"
EXTRAPACKAGES=‘‘
EXTRAPACKAGES+=‘ vim sudo openssh-server bash-completion wget rsync git build-essential gdb crash apt-transport-https ca-certificates ubuntu-cloud-keyring‘

# Cloud Archive
#OS_RELEASE=‘liberty‘
#OTHERMIRROR+="|deb http://ubuntu-cloud.archive.canonical.com/ubuntu $DISTRIBUTION-updates/$OS_RELEASE main"

if [ -n "$OS_RELEASE" ]; then
    BASETGZ="/var/cache/pbuilder/$DISTRIBUTION-$OS_RELEASE-base.tgz"
else
    BASETGZ="/var/cache/pbuilder/$DISTRIBUTION-base.tgz"
fi

#sudo pbuilder --create --distribution trusty --architecture amd64 --basetgz /images/pbuilder/trusty-amd64-base.tgz --debootstrapopts --variant=buildd
sudo pbuilder --create --distribution trusty --architecture amd64 --debootstrapopts --variant=buildd

sudo cp /var/cache/pbuilder/trusty-base.tgz /var/cache/pbuilder/trusty-liberty-base.tgz

then uncomment OS_RELEASE, run ‘sudo pbuilder update‘ again

sudo pbuilder login --save-after-login  #equal to chroot
root# Add UCA repository  to source.list,

# ‘deb http://ubuntu-cloud.archive.canonical.com/ubuntu liberty-updates/ubuntu main‘ && apt-key adv --keyserver keyserver.ubuntu.com --recv-keys 8A6844A29F68104E

or apt-get install software-properties-common python-software-properties  &&  add-apt-repository cloud-archive:liberty
root# apt update
then exit chroot, press ctrl-d to save 
sudo pbuilder update   #run again when building the package every time

wget https://launchpad.net/debian/+archive/primary/+files/libvirt_1.2.14-3.dsc
wget https://launchpad.net/debian/+archive/primary/+files/libvirt_1.2.14.orig.tar.gz
wget https://launchpad.net/debian/+archive/primary/+files/libvirt_1.2.14-3.debian.tar.xz

#注意:上面的是debian包,须要先使用beyond compare工具和ubuntu的1.2.16对debian文件夹进行比較转化成ubuntu包,转换规则是:

1。 凡1.2.14有的,1.2.16没有的。删

2, 凡1.2.14没有的。1.2.16有的,增

3, 凡1.2.14与1.2.16不一致的以1.2.16为准

4。 debian/patch和debian/changlog能够不作处理

5, debian/control也是重点

#sudo pbuilder --build --distribution trusty --architecture amd64 ./libvirt_1.2.14-3.dsc

dpkg-source -x libvirt_1.2.14-3.dsc && cd libvirt-1.2.14 && sudo pdebuild

sudo debsign /var/cache/pbuilder/result/<package>_<version>.changes
sudo dput ppa:techtonik/backports /var/cache/pbuilder/result/<package>_<version>.changes

sudo apt-get autoclean
sudo apt-get update
sudo apt-get -f install

sudo apt update

cat /etc/apt/source.list

deb http://cn.archive.ubuntu.com/ubuntu/ xenial main restricted universe multiverse
deb http://cn.archive.ubuntu.com/ubuntu/ xenial-updates main restricted universe multiverse
deb http://cn.archive.ubuntu.com/ubuntu/ xenial-proposed main restricted universe multiverse
deb http://security.ubuntu.com/ubuntu xenial-security main restricted universe multiverse

#deb-src http://us.archive.ubuntu.com/ubuntu/ trusty main

## ubuntu ddebs

# deb http://ddebs.ubuntu.com/ xenial main restricted universe multiverse
# deb http://ddebs.ubuntu.com/ xenial-updates main restricted universe multiverse
# deb http://ddebs.ubuntu.com/ xenial-proposed main restricted universe multiverse
# deb http://ddebs.ubuntu.com/ xenial-security main restricted universe multiverse
## kernel ppa
# deb http://ppa.launchpad.net/canonical-kernel-team/ppa/ubuntu xenial main
# deb-src http://ppa.launchpad.net/canonical-kernel-team/ppa/ubuntu xenial main

Reference

1, https://help.launchpad.net/Packaging/UploadErrors  
2, https://wiki.canonical.com/STS/Engineering/Hotfix
3, http://packaging.ubuntu.com/html/fixing-a-bug.html#work-on-a-fix
4, http://packaging.ubuntu.com/html/traditional-packaging.html#creating-a-debdiff
5, http://blog.packagecloud.io/debian/debuild/packaging/2015/06/08/buildling-deb-packages-with-debuild/

6, https://wiki.ubuntu.com/OpenStack/StableReleaseUpdates
7, https://wiki.ubuntu.com/OpenStack/CorePackages
8, https://wiki.ubuntu.com/ServerTeam/OpenStack/SRUCadence

9, https://wiki.ubuntu.com/SimpleSbuild

时间: 2024-10-12 11:08:13

Debian Customer PPA RFC (by quqi99)的相关文章

freeCAD下载与安装

官方安装: freeCAD稳定版 freeCAD官方提供了几个稳定版本供开发者使用: Windows (XP, Vista and 7, 32 and 64bits), Mac OS X (Lion 10.7), 和 Debian-based Linux systems (Debian, Ubuntu, 32 and 64bits). 以下几个链接为freeCAD的稳定版本. 也有不稳定版本: FreeCAD Files page , 提供最前沿的新功能,工具,但可能更容易崩溃或包含与早期的版本

Debian常用設置

1. 更新軟件源 sudo cp /etc/apt/sources.list /etc/apt/sources.list_bak #備份 sudo vi /etc/apt/sources.list /etc/apt/sources.list 文件內容 # # deb cdrom:[Debian GNU/Linux 7 _Wheezy_ - Official Snapshot i386 LIVE/INSTALL Binary 20150114-04:45]/ wheezy main deb cdr

[转] Ubuntu/Linux Mint/Debian 安装 Java 8

本PPA由webupd8制作,支持Ubuntu 12.10, 12.04, 11.10, 11.04, 10.10 和 10.04以及对应的Linux Mint版本,Oracle Java 8包提供JDK8 和 JRE8. sudo add-apt-repository ppa:webupd8team/java sudo apt-get update sudo apt-get install oracle-java8-installer 安装后查看版本: $ java -version java

安装Debian 7.8 过程,以及该系统的配置过程

最近,我给自己的电脑安装了Debian操作系统,版本7.8 stable.Debian我相信大家都能了解,它是Ubuntu的基础,Ubuntu是基于Debian的unstable开发的.我安装这个系统时,里面包含的开源显卡驱动可以带动我的AMD显卡(14.04之前的Ubuntu是带动不了的,需要在bios禁用独显),所以一个大心病解除了. 我有着四年的Linux系统使用经验,但是惭愧的是,我对Linux基本还处于一无所知的状态.由于这个系统版本较多,所以我尝试安装了每一个主流版本:Ubuntu.

Building Ubuntu Kernels with Debug Symbols (by quqi99)

作者:张华  发表于:2016-02-25 版权声明:可以任意转载,转载时请务必以超链接形式标明文章原始出处和作者信息及本版权声明 ( http://blog.csdn.net/quqi99 ) 使用gdb或者crash时需要debug symbols, 可以从http://ddebs.ubuntu.com/pool/main/l/linux/下载,但有时候里面没有需要自己生成,下需方法使用了debian/rules脚本来为Ubuntu Kernel生成debug symbols, 所以它不需要

(转) IPv6相关RFC

转自http://blog.csdn.net/lucien_cc/article/details/12688477 IPv6 Spec RFC 2460 : Internet Protocol, Version 6 (IPv6) Specification RFC 5095: Deprecation of Type 0 Routing Headers in IPv6 RFC 5722 (更新RFC 2460): Handling of Overlapping IPv6 Fragments RFC

Debian/Ubuntu Linux 下安装LLVM/Clang 编译器

第一步,首先编辑 /etc/apt/sources.list,增加下面源: (加入源后务必执行apt-get update,假设有错误提示,先执行第二步,然后apt-get update) Debian平台: deb http://llvm.org/apt/wheezy/ llvm-toolchain-wheezy main deb-src http://llvm.org/apt/wheezy/ llvm-toolchain-wheezy main deb http://llvm.org/apt

ubuntu下使用ppa安装codeblocks集成开发环境

codeblocks是一个十分优秀的C/C++开发IDE,虽然后起之秀codelite目前来看大有超越之势哦. 不过在ubuntu下安装codeblocks却比较麻烦,不像其他linux发行版,比如suse,debian和fedora等在官网上有现成的bin文件可以直接下载安装. 下面简单介绍下如何在ubuntu下快速安装最新的codeblocks: 1.加入ppa源: sudo add-apt-repository ppa:pasgui/ppa 2.更新ppa源: sudo apt-get u

Debian上安装java

Debian 8 Jessie上安装命令: echo "deb http://ppa.launchpad.net/webupd8team/java/ubuntu trusty main" >> /etc/apt/sources.listecho "deb-src http://ppa.launchpad.net/webupd8team/java/ubuntu trusty main" >> /etc/apt/sources.listapt-k