作者:张华  发表于: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 ubuntu@192.168.100.3:~/
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://zhhuabj@git.launchpad.net/"]
        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='xxx@xxx.com'

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

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

  1. freeCAD下载与安装

    官方安装: freeCAD稳定版 freeCAD官方提供了几个稳定版本供开发者使用: Windows (XP, Vista and 7, 32 and 64bits), Mac OS X (Lion ...

  2. How to Install JAVA 8 (JDK/JRE 8u111) on Debian 8 & 7 via PPA

    Oracle JAVA 8 Stable release has been released on Mar,18 2014 and available to download and install. ...

  3. Debian 中添加ppa

    在Debian8中默认没有"apt-add-repository"命令,所有也就没法安装ppa. 怎么破? sudo apt-get install software-proper ...

  4. debian/deepin 15.3安装jdk 1.7 (或jdk 7),配置默认环境

    一.前言 Deepin 15.3是基于Debian开发的,安装jdk 1.7有所不同,默认是openjdk-8-jdk,而我们玩一些编译需要的是jdk 7. 所以本文给出安装JDK 7的教程. 二.安 ...

  5. Install Debian note

    environment: already install xp,win7 and win8PE, left 87G space to install Debian, this space not fo ...

  6. Debian 8下vsftpd安装与配置

    Debian 8下vsftpd安装与配置 0.环境 root@remote:/# uname -r 3.16.0-4-amd64 root@remote:/e# lsb_release No LSB ...

  7. ZFS(一):ZFS在Debian GNU/Linux上的安装

    以下内容翻译自https://pthree.org/2012/04/17/install-zfs-on-debian-gnulinux/,并附有原文,由于是第一次翻译,如有任何翻译不恰当之处,欢迎指出 ...

  8. Debian系统常用配置

    每一次安装Linux之后总需要设置一下系统,下面把常用的设置总结一下,方便以后使用: 1.系统安装包选择 每一次找Linux的安装包时,总会纠结一下选哪个好,我在这里总结一下:安装Debian选择对应 ...

  9. (转) IPv6相关RFC

    转自http://blog.csdn.net/lucien_cc/article/details/12688477 IPv6 Spec RFC 2460 : Internet Protocol, Ve ...

随机推荐

  1. 大咖分享 | 一文解锁首届云创大会干货——上篇(文末附演讲ppt文件免费下载)

    日,第一届网易云创大会在杭州国际博览中心举办,本次大会由杭州滨江区政府和网易主办,杭州市两创示范工作领导小组办公室协办,网易云承办,以"商业匠心.技术创新"为主题,致力于打通技术创 ...

  2. 流式处理框架storm浅析(上篇)

    本文来自网易云社区 作者:汪建伟 前言 前一段时间参与哨兵流式监控功能设计,调研了两个可以做流式计算的框架:storm和spark streaming,我负责storm的调研工作.断断续续花了一周的时 ...

  3. 小甲鱼零基础入门PYTHON

     000.愉快的开始 00:17:37 ☆  001.我和Python的第一次亲密接触 00:13:26 ★  002.用Python设计第一个游戏 00:24:00 ★  003.小插曲之变量和字符 ...

  4. 聊聊、Highcharts 动态数据优化版

    好久没来博客园了,最近项目太紧.上一篇写了 <Highcharts 之[动态数据]>,不够完善,虽然横纵轴可以动态取数据,但是行业信息是固定的,不能随着大数据热点改变.废话不说,直接上代码 ...

  5. wpf Combobox模拟键盘按键

    private void RadComboBox_PreviewKeyUp(object sender, KeyEventArgs e) { try { var obj = (RadComboBox) ...

  6. pytorch下可采用visidom作为可视化工具

    2018/9/18更新  感觉tensorboardX插件更好用,已转用https://github.com/lanpa/tensorboardX 更新:新版visdom0.1.7安装方式为:cond ...

  7. 浅谈getStackTrace()方法(一)

    缘起: 今天看到有一个工具类中有一句: String msgToPrint = Thread.currentThread().getStackTrace()[1].getMethodName(); 输 ...

  8. java面试题之有哪几种方式可以让线程阻塞

    线程阻塞方式: 1.join 2.sleep 3.yield 4.改变线程的优先级 5.将线程设置成守护线程(jvm中的垃圾回收线程) 参考:https://blog.csdn.net/liyucho ...

  9. GC overhead limit exceeded,tomcat修改jvm内存

    tomcat修改jvm内存 内存大小:-Xms256M -Xmx512M -XX:PermSize=256m -XX:MaxNewSize=256m -XX:MaxPermSize=512m -Dja ...

  10. TroubleShoot: SharePoint 2013: ExecuteOrDelayUntilScriptLoaded 页面发布后不执行的问题

    SharePoint 2010 中的ExecuteOrDelayUntilScriptLoaded,在2013 中使用时没有效果的问题. Example: SharePoint 2013 Code: ...