>From 21080660aa30357370bd842102a7bec877f2faeb Mon Sep 17 00:00:00 2001 From: Richard Jones Date: Mon, 15 Feb 2010 14:01:46 +0000 Subject: [PATCH 1/6] Ubuntu: Add 5 patches to fix Ubuntu build. --- debian/control | 2 +- ...rt-install-kernel-to-debirf-default-scrip.patch | 110 ++++++++++++++++++++ ...apt-get-instead-of-aptitude-when-installi.patch | 27 +++++ ...se-service-udev-start-instead-of-running-.patch | 25 +++++ ...er-starting-udev-by-hand-instead-of-using.patch | 30 ++++++ ...ble-some-packages-which-are-broken-or-mis.patch | 62 +++++++++++ debian/patches/series | 5 + debian/rules | 1 + 8 files changed, 261 insertions(+), 1 deletions(-) create mode 100644 debian/patches/0001-Ubuntu-Revert-install-kernel-to-debirf-default-scrip.patch create mode 100644 debian/patches/0002-Ubuntu-Use-apt-get-instead-of-aptitude-when-installi.patch create mode 100644 debian/patches/0003-appliance-Use-service-udev-start-instead-of-running-.patch create mode 100644 debian/patches/0004-Ubuntu-Prefer-starting-udev-by-hand-instead-of-using.patch create mode 100644 debian/patches/0005-Ubuntu-Disable-some-packages-which-are-broken-or-mis.patch create mode 100644 debian/patches/series diff --git a/debian/control b/debian/control index 6221c72..ead367c 100644 --- a/debian/control +++ b/debian/control @@ -3,7 +3,7 @@ Section: libs Priority: extra Maintainer: Debian Libvirt Maintainers Uploaders: Richard Jones , Guido Günther -Build-Depends: debhelper (>= 7), autotools-dev, +Build-Depends: debhelper (>= 7), autotools-dev, quilt, debirf, libreadline-dev, squashfs-tools, cdbs, libaugeas-dev, qemu, mkisofs, libxml2-dev, pkg-config, # when building from git: diff --git a/debian/patches/0001-Ubuntu-Revert-install-kernel-to-debirf-default-scrip.patch b/debian/patches/0001-Ubuntu-Revert-install-kernel-to-debirf-default-scrip.patch new file mode 100644 index 0000000..e86f0e5 --- /dev/null +++ b/debian/patches/0001-Ubuntu-Revert-install-kernel-to-debirf-default-scrip.patch @@ -0,0 +1,110 @@ +From 89272f9356f12b65c0c1cc7ae15acbbc761f6bc3 Mon Sep 17 00:00:00 2001 +From: Richard Jones +Date: Mon, 21 Dec 2009 15:50:59 +0000 +Subject: [PATCH 1/5] Ubuntu: Revert install-kernel to debirf default script. + +--- + appliance/Makefile.am | 1 + + appliance/debian/modules/install-kernel | 1 + + appliance/debian/modules/install_kernel | 68 ------------------------------- + 3 files changed, 2 insertions(+), 68 deletions(-) + create mode 120000 appliance/debian/modules/install-kernel + delete mode 100755 appliance/debian/modules/install_kernel + +diff --git a/appliance/Makefile.am b/appliance/Makefile.am +index abb5086..78beec9 100644 +--- a/appliance/Makefile.am ++++ b/appliance/Makefile.am +@@ -109,6 +109,7 @@ endif + # Extra symlinks needed by the Debian appliance. + debirf_symlinks = \ + a0_prep-root \ ++ install-kernel \ + z0_remove-aptitude \ + z0_remove-locales \ + z1_clean-root +diff --git a/appliance/debian/modules/install-kernel b/appliance/debian/modules/install-kernel +new file mode 120000 +index 0000000..a1be2bc +--- /dev/null ++++ b/appliance/debian/modules/install-kernel +@@ -0,0 +1 @@ ++/usr/share/debirf/modules/install-kernel +\ No newline at end of file +diff --git a/appliance/debian/modules/install_kernel b/appliance/debian/modules/install_kernel +deleted file mode 100755 +index c1076ce..0000000 +--- a/appliance/debian/modules/install_kernel ++++ /dev/null +@@ -1,68 +0,0 @@ +-#!/bin/bash -e +- +-# debirf module: install-kernel +-# install a kernel package, indicated by the expected environment +-# variables: +-# DEBIRF_PATH +-# DEBIRF_ROOT +-# DEBIRF_KERNEL_PACKAGE +-# +-# *** REQUIRED MODULE *** +-# WARNING: this module is necessary for proper functioning of debirf. +-# +-# The debirf scripts were written by +-# Jameson Rollins +-# and +-# Daniel Kahn Gillmor . +-# +-# They are Copyright 2007, and are all released under the GPL, +-# version 3 or later. +- +-# clear out old modules if they exist, to avoid confusion +-rm -rf "$DEBIRF_ROOT/lib/modules" +- +-# download/copy in kernel package +-if [ -z "$DEBIRF_KERNEL_PACKAGE" ] ; then +- # determine kernel to install. assume arch of build host. +- +- # determine kernel arch. need everything after the kernel version +- # and debian version +- if [ -z "$DEBIRF_KERNEL_ARCH" ]; then +- KARCH=$(uname -r | cut -d- -f3-) +- else +- KARCH="$DEBIRF_KERNEL_ARCH" +- fi +- +- # determine the full kernel version from the dependency of the +- # generic 2.6-ARCH package in the debirf root (since it may be +- # different than what is installed on the build host) +- KNAME=$(debirf_exec apt-cache show linux-image-2.6-"$KARCH" | grep '^Depends: ' | sed 's/^Depends: //') +- +- # download only the desired kernel package directly into the apt +- # cache for dpkg extraction +- debirf_exec sh -c "cd /var/cache/apt/archives/ && aptitude download \"$KNAME\"" +-else +- # install kernel deb if given at command line +- debirf_exec sh -c "cd /var/cache/apt/archives/ && aptitude download \"$DEBIRF_KERNEL_PACKAGE\"" +-fi +- +-KPKG=$(basename "$DEBIRF_ROOT"/var/cache/apt/archives/linux-image-2.6.*) +- +-echo "extracting kernel package $KPKG..." +-debirf_exec dpkg --extract /var/cache/apt/archives/"$KPKG" / +- +-# install the module init tools, since they are needed for depmod +-debirf_exec apt-get --assume-yes install module-init-tools +- +-# depmod to create module list +-KVERS=$(ls -1 -t "$DEBIRF_ROOT/lib/modules" | head -n1) +-echo "generating modules.dep..." +-debirf_exec depmod -a "$KVERS" +- +-# extract kernel and debian stock initrd from the build root: +-mv "$DEBIRF_ROOT"/boot/vmlinu* "$DEBIRF_BUILDD" +- +-# remove kernel symlinks +-if [ -L "$DEBIRF_ROOT"/vmlinuz ] ; then +- rm "$DEBIRF_BUILDD"/vmlinuz +-fi +-- +1.6.3.3 + diff --git a/debian/patches/0002-Ubuntu-Use-apt-get-instead-of-aptitude-when-installi.patch b/debian/patches/0002-Ubuntu-Use-apt-get-instead-of-aptitude-when-installi.patch new file mode 100644 index 0000000..5dc5b61 --- /dev/null +++ b/debian/patches/0002-Ubuntu-Use-apt-get-instead-of-aptitude-when-installi.patch @@ -0,0 +1,27 @@ +From f152489d82e90d31b119af766b6e17cf4b8e9429 Mon Sep 17 00:00:00 2001 +From: Richard Jones +Date: Mon, 21 Dec 2009 15:52:36 +0000 +Subject: [PATCH 2/5] Ubuntu: Use apt-get instead of aptitude when installing guestfsd. + +--- + appliance/debian/modules/y0_install-guestfsd | 4 ++-- + 1 files changed, 2 insertions(+), 2 deletions(-) + +diff --git a/appliance/debian/modules/y0_install-guestfsd b/appliance/debian/modules/y0_install-guestfsd +index c95e4f0..3eb8ba9 100755 +--- a/appliance/debian/modules/y0_install-guestfsd ++++ b/appliance/debian/modules/y0_install-guestfsd +@@ -16,8 +16,8 @@ find $DEBIRF_ROOT/lib/modules/*/kernel -name '*.ko' $whitelist -a -exec rm '{}' + # install additional packages: + PKGLIST=$(< packagelist) + echo "Will add $PKGLIST" +-debirf_exec aptitude -R -y install $PKGLIST +-debirf_exec aptitude -y remove vim-tiny dhcp3-client iptables ++debirf_exec apt-get --assume-yes install $PKGLIST ++debirf_exec apt-get --assume-yes remove vim-tiny dhcp3-client iptables + + debirf_exec mkdir -p --mode=0777 /sysroot + +-- +1.6.3.3 + diff --git a/debian/patches/0003-appliance-Use-service-udev-start-instead-of-running-.patch b/debian/patches/0003-appliance-Use-service-udev-start-instead-of-running-.patch new file mode 100644 index 0000000..0c779c8 --- /dev/null +++ b/debian/patches/0003-appliance-Use-service-udev-start-instead-of-running-.patch @@ -0,0 +1,25 @@ +From fb16a5de51b966816629d6444735ee39ecd3ac66 Mon Sep 17 00:00:00 2001 +From: Richard Jones +Date: Mon, 21 Dec 2009 15:54:00 +0000 +Subject: [PATCH 3/5] appliance: Use 'service udev start' instead of running init script. + +--- + appliance/init | 2 +- + 1 files changed, 1 insertions(+), 1 deletions(-) + +diff --git a/appliance/init b/appliance/init +index b741a49..75eb03e 100755 +--- a/appliance/init ++++ b/appliance/init +@@ -8,7 +8,7 @@ mount -t proc /proc /proc + mount -t sysfs /sys /sys + + if [ -x /etc/init.d/udev ]; then +- /etc/init.d/udev start ++ service udev start + elif [ -x /sbin/start_udev ] && /sbin/start_udev; then + : + else +-- +1.6.3.3 + diff --git a/debian/patches/0004-Ubuntu-Prefer-starting-udev-by-hand-instead-of-using.patch b/debian/patches/0004-Ubuntu-Prefer-starting-udev-by-hand-instead-of-using.patch new file mode 100644 index 0000000..3781101 --- /dev/null +++ b/debian/patches/0004-Ubuntu-Prefer-starting-udev-by-hand-instead-of-using.patch @@ -0,0 +1,30 @@ +From 3928ae1654cde0fe40c3d8dad12aef0b38f83f1d Mon Sep 17 00:00:00 2001 +From: Richard Jones +Date: Mon, 21 Dec 2009 15:54:30 +0000 +Subject: [PATCH 4/5] Ubuntu: Prefer starting udev by hand, instead of using init script. + +--- + appliance/init | 7 ++++++- + 1 files changed, 6 insertions(+), 1 deletions(-) + +diff --git a/appliance/init b/appliance/init +index 75eb03e..f208f1e 100755 +--- a/appliance/init ++++ b/appliance/init +@@ -7,7 +7,12 @@ PATH=/sbin:/usr/sbin:$PATH + mount -t proc /proc /proc + mount -t sysfs /sys /sys + +-if [ -x /etc/init.d/udev ]; then ++if [ -x /sbin/udevd ]; then ++ echo -e '\000\000\000\000' > /proc/sys/kernel/hotplug ++ /sbin/udevd --daemon ++ /sbin/udevadm trigger ++ /sbin/udevadm settle --timeout=10 ++elif [ -x /etc/init.d/udev ]; then + service udev start + elif [ -x /sbin/start_udev ] && /sbin/start_udev; then + : +-- +1.6.3.3 + diff --git a/debian/patches/0005-Ubuntu-Disable-some-packages-which-are-broken-or-mis.patch b/debian/patches/0005-Ubuntu-Disable-some-packages-which-are-broken-or-mis.patch new file mode 100644 index 0000000..e0814ea --- /dev/null +++ b/debian/patches/0005-Ubuntu-Disable-some-packages-which-are-broken-or-mis.patch @@ -0,0 +1,62 @@ +From b220963a4769d69269a933b6813dce33af78dd6c Mon Sep 17 00:00:00 2001 +From: Richard Jones +Date: Mon, 21 Dec 2009 15:55:17 +0000 +Subject: [PATCH 5/5] Ubuntu: Disable some packages which are broken or missing on Ubuntu. + +--- + appliance/packagelist.in | 10 ++++++---- + 1 files changed, 6 insertions(+), 4 deletions(-) + +diff --git a/appliance/packagelist.in b/appliance/packagelist.in +index 7d790f0..119cd60 100644 +--- a/appliance/packagelist.in ++++ b/appliance/packagelist.in +@@ -21,15 +21,17 @@ + kernel + MAKEDEV + nilfs-utils ++ ntfs-3g + ntfsprogs + reiserfs-utils + scrub + libselinux + udev + util-linux-ng ++ zerofree + #elif DEBIAN == 1 + bsdmainutils +- btrfs-tools ++ /* Not on Ubuntu: btrfs-tools */ + /* Dependency problem prevents installation of these two: + gfs-tools + gfs2-tools +@@ -37,10 +39,12 @@ + hfsplus + iproute + libaugeas0 +- nilfs2-tools ++ /* Not on Ubuntu: nilfs2-tools */ ++ /* Fails to install on Ubuntu: ntfs-3g */ + reiserfsprogs + udev + util-linux ++ /* Not on Ubuntu: zerofree */ + #endif + + bash +@@ -54,7 +58,6 @@ lsof + lvm2 + module-init-tools + net-tools +-ntfs-3g + /* + Enabling this pulls out 140 extra packages + into the appliance: +@@ -64,4 +67,3 @@ parted + procps + strace + xfsprogs +-zerofree +-- +1.6.3.3 + diff --git a/debian/patches/series b/debian/patches/series new file mode 100644 index 0000000..cf785b1 --- /dev/null +++ b/debian/patches/series @@ -0,0 +1,5 @@ +0001-Ubuntu-Revert-install-kernel-to-debirf-default-scrip.patch +0002-Ubuntu-Use-apt-get-instead-of-aptitude-when-installi.patch +0003-appliance-Use-service-udev-start-instead-of-running-.patch +0004-Ubuntu-Prefer-starting-udev-by-hand-instead-of-using.patch +0005-Ubuntu-Disable-some-packages-which-are-broken-or-mis.patch diff --git a/debian/rules b/debian/rules index 3145d62..6d813b1 100755 --- a/debian/rules +++ b/debian/rules @@ -9,6 +9,7 @@ REPO=sid include /usr/share/cdbs/1/rules/debhelper.mk include /usr/share/cdbs/1/class/autotools.mk include /usr/share/cdbs/1/class/python-distutils.mk +include /usr/share/cdbs/1/rules/patchsys-quilt.mk DEBIAN_SKIP_TEST := \ SKIP_TEST_HEXDUMP_0 \ -- 1.6.3.3