← Back to team overview

cloud-init-dev team mailing list archive

[Merge] lp:~vlastimil-holer/cloud-init/debian6 into lp:cloud-init

 

Vlastimil Holer has proposed merging lp:~vlastimil-holer/cloud-init/debian6 into lp:cloud-init.

Requested reviews:
  cloud init development team (cloud-init-dev)

For more details, see:
https://code.launchpad.net/~vlastimil-holer/cloud-init/debian6/+merge/149874

Few patches to make life on Debian 6 stable happier:

-----
* Added arguments to packages/bddeb:
  -d pass through '-d' to debuild
  --no-cloud-utils don't depend on cloud-utils package (default: False)

  These are essential for building on Debian 6, because there are
  no python-mocker (build dependency) and cloud-utils (install dependency)
  in squeeze and squeeze-backports.

* SysVinit startup scripts modified to run both on RHEL and Debian,
* (Unfortunately) New option INIT_SYSTEM=sysvinit_deb for Debian /etc/init.d/ directory
* Make separate Ubuntu and Debian APT source template (cc_apt_configure)
-----

I'm now generating working Debian 6 package following way:
INIT_SYSTEM=sysvinit_deb packages/bddeb -us -uc --no-cloud-utils -d
-- 
https://code.launchpad.net/~vlastimil-holer/cloud-init/debian6/+merge/149874
Your team cloud init development team is requested to review the proposed merge of lp:~vlastimil-holer/cloud-init/debian6 into lp:cloud-init.
=== modified file 'cloudinit/config/cc_apt_configure.py'
--- cloudinit/config/cc_apt_configure.py	2012-11-07 15:42:54 +0000
+++ cloudinit/config/cc_apt_configure.py	2013-02-21 16:42:25 +0000
@@ -140,10 +140,13 @@
 
 
 def generate_sources_list(codename, mirrors, cloud, log):
-    template_fn = cloud.get_template_filename('sources.list')
+    template_fn = cloud.get_template_filename('sources.list.%s' %
+                                              (cloud.distro.name))
     if not template_fn:
-        log.warn("No template found, not rendering /etc/apt/sources.list")
-        return
+        template_fn = cloud.get_template_filename('sources.list')
+        if not template_fn:
+            log.warn("No template found, not rendering /etc/apt/sources.list")
+            return
 
     params = {'codename': codename}
     for k in mirrors:

=== modified file 'packages/bddeb'
--- packages/bddeb	2012-11-13 19:13:12 +0000
+++ packages/bddeb	2013-02-21 16:42:25 +0000
@@ -36,10 +36,10 @@
     'prettytable': 'python-prettytable',
     'pyyaml': 'python-yaml',
 }
-DEBUILD_ARGS = ["-us", "-S", "-uc"]
-
-
-def write_debian_folder(root, version, revno):
+DEBUILD_ARGS = ["-us", "-S", "-uc", "-d"]
+
+
+def write_debian_folder(root, version, revno, append_requires=[]):
     deb_dir = util.abs_join(root, 'debian')
     os.makedirs(deb_dir)
 
@@ -58,7 +58,7 @@
     pkgs = [p.lower().strip() for p in stdout.splitlines()]
 
     # Map to known packages
-    requires = []
+    requires = append_requires
     for p in pkgs:
         tgt_pkg = PKG_MP.get(p)
         if not tgt_pkg:
@@ -87,6 +87,11 @@
                               " (default: %(default)s)"),
                         default=False,
                         action='store_true')
+    parser.add_argument("--no-cloud-utils", dest="no_cloud_utils",
+                        help=("don't depend on cloud-utils package"
+                              " (default: %(default)s)"),
+                        default=False,
+                        action='store_true')
 
     for ent in DEBUILD_ARGS:
         parser.add_argument(ent, dest="debuild_args", action='append_const',
@@ -128,7 +133,11 @@
         shutil.move(extracted_name, xdir)
 
         print("Creating a debian/ folder in %r" % (xdir))
-        write_debian_folder(xdir, version, revno)
+        if not args.no_cloud_utils:
+            append_requires=['cloud-utils']
+        else:
+            append_requires=[]
+        write_debian_folder(xdir, version, revno, append_requires)
 
         # The naming here seems to follow some debian standard
         # so it will whine if it is changed...

=== modified file 'packages/debian/control.in'
--- packages/debian/control.in	2012-11-13 17:08:45 +0000
+++ packages/debian/control.in	2013-02-21 16:42:25 +0000
@@ -18,8 +18,7 @@
 
 Package: cloud-init
 Architecture: all
-Depends: cloud-utils,
-         procps,
+Depends: procps,
          python,
 #for $r in $requires
          ${r},

=== modified file 'setup.py'
--- setup.py	2012-08-09 17:06:04 +0000
+++ setup.py	2013-02-21 16:42:25 +0000
@@ -38,11 +38,13 @@
 
 INITSYS_FILES = {
     'sysvinit': [f for f in glob('sysvinit/*') if is_f(f)],
+    'sysvinit_deb': [f for f in glob('sysvinit/*') if is_f(f)],
     'systemd': [f for f in glob('systemd/*') if is_f(f)],
     'upstart': [f for f in glob('upstart/*') if is_f(f)],
 }
 INITSYS_ROOTS = {
     'sysvinit': '/etc/rc.d/init.d',
+    'sysvinit_deb': '/etc/init.d',
     'systemd': '/etc/systemd/system/',
     'upstart': '/etc/init/',
 }

=== modified file 'sysvinit/cloud-config'
--- sysvinit/cloud-config	2012-07-09 20:21:34 +0000
+++ sysvinit/cloud-config	2013-02-21 16:42:25 +0000
@@ -29,15 +29,13 @@
 # Should-Start:      $time
 # Required-Stop:
 # Should-Stop:
-# Default-Start:     3 5
-# Default-Stop:
+# Default-Start:     2 3 4 5
+# Default-Stop:      0 1 6
 # Short-Description: The config cloud-init job
 # Description:       Start cloud-init and runs the config phase
 #	and any associated config modules as desired.
 ### END INIT INFO
 
-. /etc/init.d/functions
-
 # Return values acc. to LSB for all commands but status:
 # 0	  - success
 # 1       - generic or unspecified error
@@ -60,8 +58,9 @@
 cloud_init="/usr/bin/cloud-init"
 conf="/etc/cloud/cloud.cfg"
 
-# If there exists a sysconfig variable override file use it...
+# If there exist sysconfig/default variable override files use it...
 [ -f /etc/sysconfig/cloud-init ] && . /etc/sysconfig/cloud-init
+[ -f /etc/default/cloud-init ] && . /etc/default/cloud-init
 
 start() {
     [ -x $cloud_init ] || return 5
@@ -80,8 +79,6 @@
     return $RETVAL
 }
 
-. /etc/init.d/functions
-
 case "$1" in
     start)
         start

=== modified file 'sysvinit/cloud-final'
--- sysvinit/cloud-final	2012-07-09 20:21:34 +0000
+++ sysvinit/cloud-final	2013-02-21 16:42:25 +0000
@@ -29,15 +29,13 @@
 # Should-Start:      $time
 # Required-Stop:
 # Should-Stop:
-# Default-Start:     3 5
-# Default-Stop:
+# Default-Start:     2 3 4 5
+# Default-Stop:      0 1 6
 # Short-Description: The final cloud-init job
 # Description:       Start cloud-init and runs the final phase
 #	and any associated final modules as desired.
 ### END INIT INFO
 
-. /etc/init.d/functions
-
 # Return values acc. to LSB for all commands but status:
 # 0	  - success
 # 1       - generic or unspecified error
@@ -60,8 +58,9 @@
 cloud_init="/usr/bin/cloud-init"
 conf="/etc/cloud/cloud.cfg"
 
-# If there exists a sysconfig variable override file use it...
+# If there exist sysconfig/default variable override files use it...
 [ -f /etc/sysconfig/cloud-init ] && . /etc/sysconfig/cloud-init
+[ -f /etc/default/cloud-init ] && . /etc/default/cloud-init
 
 start() {
     [ -x $cloud_init ] || return 5
@@ -80,8 +79,6 @@
     return $RETVAL
 }
 
-. /etc/init.d/functions
-
 case "$1" in
     start)
         start

=== modified file 'sysvinit/cloud-init'
--- sysvinit/cloud-init	2012-10-04 22:14:47 +0000
+++ sysvinit/cloud-init	2013-02-21 16:42:25 +0000
@@ -29,15 +29,13 @@
 # Should-Start:      $time
 # Required-Stop:
 # Should-Stop:
-# Default-Start:     3 5
-# Default-Stop:
+# Default-Start:     2 3 4 5
+# Default-Stop:      0 1 6
 # Short-Description: The initial cloud-init job (net and fs contingent)
 # Description:       Start cloud-init and runs the initialization phase
 #	and any associated initial modules as desired.
 ### END INIT INFO
 
-. /etc/init.d/functions
-
 # Return values acc. to LSB for all commands but status:
 # 0	  - success
 # 1       - generic or unspecified error
@@ -60,8 +58,9 @@
 cloud_init="/usr/bin/cloud-init"
 conf="/etc/cloud/cloud.cfg"
 
-# If there exists a sysconfig variable override file use it...
+# If there exist sysconfig/default variable override files use it...
 [ -f /etc/sysconfig/cloud-init ] && . /etc/sysconfig/cloud-init
+[ -f /etc/default/cloud-init ] && . /etc/default/cloud-init
 
 start() {
     [ -x $cloud_init ] || return 5
@@ -80,8 +79,6 @@
     return $RETVAL
 }
 
-. /etc/init.d/functions
-
 case "$1" in
     start)
         start

=== modified file 'sysvinit/cloud-init-local'
--- sysvinit/cloud-init-local	2012-07-09 20:21:34 +0000
+++ sysvinit/cloud-init-local	2013-02-21 16:42:25 +0000
@@ -29,15 +29,13 @@
 # Should-Start:      $time
 # Required-Stop:
 # Should-Stop:
-# Default-Start:     3 5
-# Default-Stop:
+# Default-Start:     2 3 4 5
+# Default-Stop:      0 1 6
 # Short-Description: The initial cloud-init job (local fs contingent)
 # Description:       Start cloud-init and runs the initialization phases
 #	and any associated initial modules as desired.
 ### END INIT INFO
 
-. /etc/init.d/functions
-
 # Return values acc. to LSB for all commands but status:
 # 0	  - success
 # 1       - generic or unspecified error
@@ -60,8 +58,9 @@
 cloud_init="/usr/bin/cloud-init"
 conf="/etc/cloud/cloud.cfg"
 
-# If there exists a sysconfig variable override file use it...
+# If there exist sysconfig/default variable override files use it...
 [ -f /etc/sysconfig/cloud-init ] && . /etc/sysconfig/cloud-init
+[ -f /etc/default/cloud-init ] && . /etc/default/cloud-init
 
 start() {
     [ -x $cloud_init ] || return 5
@@ -80,8 +79,6 @@
     return $RETVAL
 }
 
-. /etc/init.d/functions
-
 case "$1" in
     start)
         start

=== added file 'templates/sources.list.debian.tmpl'
--- templates/sources.list.debian.tmpl	1970-01-01 00:00:00 +0000
+++ templates/sources.list.debian.tmpl	2013-02-21 16:42:25 +0000
@@ -0,0 +1,28 @@
+\## Note, this file is written by cloud-init on first boot of an instance
+\## modifications made here will not survive a re-bundle.
+\## if you wish to make changes you can:
+\## a.) add 'apt_preserve_sources_list: true' to /etc/cloud/cloud.cfg
+\##     or do the same in user-data
+\## b.) add sources in /etc/apt/sources.list.d
+\## c.) make changes to template file /etc/cloud/templates/sources.list.debian.tmpl
+\###
+
+# See http://www.debian.org/releases/stable/i386/release-notes/ch-upgrading.html
+# for how to upgrade to newer versions of the distribution.
+deb $mirror $codename main contrib non-free
+deb-src $mirror $codename main contrib non-free
+
+\## Major bug fix updates produced after the final release of the
+\## distribution.
+deb $security $codename/updates main contrib non-free
+deb-src $security $codename/updates main contrib non-free
+deb $mirror $codename-updates main contrib non-free
+deb-src $mirror $codename-updates main contrib non-free
+
+\## Uncomment the following two lines to add software from the 'backports'
+\## repository.
+\## N.B. software from this repository may not have been tested as
+\## extensively as that contained in the main release, although it includes
+\## newer versions of some applications which may provide useful features.
+# deb http://backports.debian.org/debian-backports $codename-backports main contrib non-free
+# deb-src http://backports.debian.org/debian-backports $codename-backports main contrib non-free

=== renamed file 'templates/sources.list.tmpl' => 'templates/sources.list.ubuntu.tmpl'

Follow ups