On Sat, Sep 15, 2012 at 03:34:58PM +0200, Julien Cristau wrote: > On Fri, Aug 31, 2012 at 20:02:48 +0000, Steve Langasek wrote: > > Provisional release team approval of the ifupdown/udev changes in particular > > could be helpful, as the maintainers may be wary of uploading these changes > > if they may not get into wheezy. > Care to attach the ifupdown and udev patches to this bug? Attached the current versions of the patches from the linked ifupdown/udev bugs. Thanks, -- Steve Langasek Give me a lever long enough and a Free OS Debian Developer to set it on, and I can move the world. Ubuntu Developer http://www.debian.org/ slangasek@ubuntu.com vorlon@debian.org
diff -r 04447c456b21 debian/changelog --- a/debian/changelog Thu Aug 16 23:23:11 2012 +0200 +++ b/debian/changelog Fri Aug 31 11:07:06 2012 -0700 @@ -1,3 +1,9 @@ +ifupdown (0.7.3) UNRELEASED; urgency=low + + * Add upstart support. + + -- Steve Langasek <vorlon@debian.org> Thu, 28 Jun 2012 15:23:57 -0700 + ifupdown (0.7.2) unstable; urgency=low * Don't install /etc/default/networking as executable (Closes: #679623). diff -r 04447c456b21 debian/control --- a/debian/control Thu Aug 16 23:23:11 2012 +0200 +++ b/debian/control Fri Aug 31 11:07:06 2012 -0700 @@ -4,7 +4,7 @@ Maintainer: Andrew O. Shadura <bugzilla@tut.by> Uploaders: Petter Reinholdtsen <pere@debian.org> Standards-Version: 3.9.3 -Build-Depends: debhelper (>= 8.1.0~), noweb +Build-Depends: debhelper (>= 9.20120410~), noweb Vcs-Hg: http://anonscm.debian.org/hg/collab-maint/ifupdown/ Vcs-Browser: http://anonscm.debian.org/hg/collab-maint/ifupdown/ diff -r 04447c456b21 debian/ifupdown.network-interface-container.upstart --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/debian/ifupdown.network-interface-container.upstart Fri Aug 31 11:07:06 2012 -0700 @@ -0,0 +1,19 @@ +# network-interface-container - woarkound for missing events in container +# +# This service emits missing net-device-added events for containers. +# It's needed in cases where devices are created before the container +# starts and so won't get a udev event. + +description "workaround for missing events in container" +start on container + +emits net-device-added + +task +script + case "$CONTAINER" in + lxc|lxc-libvirt) + initctl emit --no-wait net-device-added INTERFACE=lo || true + ;; + esac +end script diff -r 04447c456b21 debian/ifupdown.network-interface-security.upstart --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/debian/ifupdown.network-interface-security.upstart Fri Aug 31 11:07:06 2012 -0700 @@ -0,0 +1,34 @@ +# network-interface-security - configure network device security +# +# This is a one-time start-up script to load AppArmor profiles needed +# before the network comes up. + +description "configure network device security" + +# In order to avoid upstart bug LP: #447654, we cannot have an AND +# statement here (with the ORs). An "and virtual-filesystems" is desired +# here to make sure that the securityfs is mounted, but since each of the +# ORed services already require virtual-filesystems be mounted, this is safe: +start on (starting network-interface + or starting network-manager + or starting networking) + +# In order to handle the lack of upstart feature LP: #568860, we need to +# run multiple times, for each of the above "starting" service instances, or +# else another one might run while we're running, and not wait for us to +# finish. +instance $JOB${INTERFACE:+/}${INTERFACE:-} + +# Since we need these profiles to be loaded before any of the above services +# begin running, this service must be a pre-start so that its pre-start +# script finishes before the above services' start scripts begin. +pre-start script + [ -f /run/network-interface-security ] && exit 0 # already ran + [ -d /rofs/etc/apparmor.d ] && exit 0 # do not load on liveCD + [ -d /sys/module/apparmor ] || exit 0 # do not load without AppArmor + [ -x /sbin/apparmor_parser ] || exit 0 # do not load without parser + for link in /etc/apparmor/init/network-interface-security/* ; do + [ -L $link ] && /sbin/apparmor_parser -r -W $link || true + done + > /run/network-interface-security +end script diff -r 04447c456b21 debian/ifupdown.network-interface.upstart --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/debian/ifupdown.network-interface.upstart Fri Aug 31 11:07:06 2012 -0700 @@ -0,0 +1,30 @@ +# network-interface - configure network device +# +# This service causes network devices to be brought up or down as a result +# of hardware being added or removed, including that which isn't ordinarily +# removable. + +description "configure network device" + +emits net-device-up +emits net-device-down +emits static-network-up + +start on net-device-added +stop on net-device-removed INTERFACE=$INTERFACE + +instance $INTERFACE +export INTERFACE + +pre-start script + if [ "$INTERFACE" = lo ]; then + # bring this up even if /etc/network/interfaces is broken + ifconfig lo 127.0.0.1 up || true + initctl emit -n net-device-up \ + IFACE=lo LOGICAL=lo ADDRFAM=inet METHOD=loopback || true + fi + mkdir -p /run/network + exec ifup --allow auto $INTERFACE +end script + +post-stop exec ifdown --allow auto $INTERFACE diff -r 04447c456b21 debian/ifupdown.networking.upstart --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/debian/ifupdown.networking.upstart Fri Aug 31 11:07:06 2012 -0700 @@ -0,0 +1,66 @@ +# networking - configure virtual network devices +# +# This task causes virtual network devices that do not have an associated +# kernel object to be started on boot. + +description "configure virtual network devices" + +emits static-network-up +emits net-device-up + +start on (local-filesystems + and (stopped udevtrigger or container)) +stop on unmounted-remote-filesystems + +pre-start script + mkdir -p /run/network + ifup -a +end script + +post-stop script + log_warning_msg() { + echo $* + } + + # These checks were taken from the Debian ifupdown.networking.init script + check_network_file_systems() { + [ -e /proc/mounts ] || return 0 + + if [ -e /etc/iscsi/iscsi.initramfs ]; then + log_warning_msg "not deconfiguring network interfaces: iSCSI root is mounted." + exit 0 + fi + + while read DEV MTPT FSTYPE REST; do + case $DEV in + /dev/nbd*|/dev/nd[a-z]*|/dev/etherd/e*) + log_warning_msg "not deconfiguring network interfaces: network devices still mounted." + exit 0 + ;; + esac + case $FSTYPE in + nfs|nfs4|smbfs|ncp|ncpfs|cifs|coda|ocfs2|gfs|pvfs|pvfs2|fuse.httpfs|fuse.curlftpfs) + log_warning_msg "not deconfiguring network interfaces: network file systems still mounted." + exit 0 + ;; + esac + done < /proc/mounts + } + + check_network_swap() { + [ -e /proc/swaps ] || return 0 + + while read DEV MTPT FSTYPE REST; do + case $DEV in + /dev/nbd*|/dev/nd[a-z]*|/dev/etherd/e*) + log_warning_msg "not deconfiguring network interfaces: network swap still mounted." + exit 0 + ;; + esac + done < /proc/swaps + } + + check_network_file_systems + check_network_swap + ifdown -a +end script diff -r 04447c456b21 debian/ifupdown.upstart.if-down --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/debian/ifupdown.upstart.if-down Fri Aug 31 11:07:06 2012 -0700 @@ -0,0 +1,9 @@ +#!/bin/sh + +set -e + +initctl emit -n net-device-down \ + "IFACE=$IFACE" \ + "LOGICAL=$LOGICAL" \ + "ADDRFAM=$ADDRFAM" \ + "METHOD=$METHOD" diff -r 04447c456b21 debian/ifupdown.upstart.if-up --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/debian/ifupdown.upstart.if-up Fri Aug 31 11:07:06 2012 -0700 @@ -0,0 +1,48 @@ +#!/bin/sh +MARK_DEV_PREFIX="/run/network/ifup." +MARK_STATIC_NETWORK_EMITTED="/run/network/static-network-up-emitted" + +set -e + +# Let's ignore meta entries (ifup -a) +if [ "$ADDRFAM" = "meta" ]; then + return 0 +fi + +# lo emission handled by /etc/init/network-interface.conf +if [ "$IFACE" != lo ]; then + initctl emit -n net-device-up \ + "IFACE=$IFACE" \ + "LOGICAL=$LOGICAL" \ + "ADDRFAM=$ADDRFAM" \ + "METHOD=$METHOD" +fi + +get_auto_interfaces() { + # write to stdout a list of interfaces configured as 'auto' in interfaces(5) + local found="" + # stderr redirected as it outputs things like: + # Ignoring unknown interface eth0=eth0. + found=$(ifquery --list --allow auto 2>/dev/null) || return + set -- ${found} + echo "$@" +} + +all_interfaces_up() { + # return true if all interfaces listed in /etc/network/interfaces as 'auto' + # are up. if no interfaces are found there, then "all [given] were up" + local prefix="$1" iface="" + for iface in $(get_auto_interfaces); do + # if cur interface does is not up, then all have not been brought up + [ -f "${prefix}${iface}" ] || return 1 + done + return 0 +} + +# touch our own "marker" indicating that this interface has been brought up. +: > "${MARK_DEV_PREFIX}$IFACE" + +if all_interfaces_up "${MARK_DEV_PREFIX}" && + mkdir "${MARK_STATIC_NETWORK_EMITTED}" 2>/dev/null; then + initctl emit --no-wait static-network-up +fi diff -r 04447c456b21 debian/networking.init --- a/debian/networking.init Thu Aug 16 23:23:11 2012 +0200 +++ b/debian/networking.init Fri Aug 31 11:07:06 2012 -0700 @@ -114,6 +114,9 @@ case "$1" in start) + if init_is_upstart; then + exit 1 + fi process_options check_ifstate @@ -134,6 +137,9 @@ ;; stop) + if init_is_upstart; then + exit 0 + fi check_network_file_systems check_network_swap @@ -159,6 +165,9 @@ ;; force-reload|restart) + if init_is_upstart; then + exit 1 + fi process_options log_warning_msg "Running $0 $1 is deprecated because it may not re-enable some interfaces" diff -r 04447c456b21 debian/rules --- a/debian/rules Thu Aug 16 23:23:11 2012 +0200 +++ b/debian/rules Fri Aug 31 11:07:06 2012 -0700 @@ -52,6 +52,13 @@ override_dh_installinit: dh_installinit --name=networking --no-start -- start 40 S . start 35 0 6 . install -p -m 0644 debian/networking.defaults $(DESTDIR)/etc/default/networking + dh_installinit --name=network-interface-container --noscripts + dh_installinit --name=network-interface-security --noscripts + dh_installinit --name=network-interface --noscripts + dh_installinit --name=networking --noscripts + +override_dh_installifupdown: + dh_installifupdown --name=upstart override_dh_auto_clean: $(MAKE) clean
diff -Nru udev-175/debian/changelog udev-175/debian/changelog --- udev-175/debian/changelog 2012-08-17 10:24:27.000000000 +0000 +++ udev-175/debian/changelog 2012-08-28 19:08:49.000000000 +0000 @@ -1,3 +1,10 @@ +udev (175-7.1) UNRELEASED; urgency=low + + * Non-maintainer upload. + * Add upstart support. + + -- Steve Langasek <vorlon@debian.org> Tue, 28 Aug 2012 12:08:43 -0700 + udev (175-7) unstable; urgency=low * Clean up better /etc/udev/rules.d/ on purge. (Closes: #685065) diff -Nru udev-175/debian/rules udev-175/debian/rules --- udev-175/debian/rules 2012-08-12 15:49:52.000000000 +0000 +++ udev-175/debian/rules 2012-08-31 05:30:55.000000000 +0000 @@ -179,6 +179,10 @@ dh_installinit --no-start --update-rcd-params='start 03 S .' dh_installinit --no-start --update-rcd-params='start 36 S .' \ --name=udev-mtab + dh_installinit --name=udev-finish --no-start -- start 37 S . + dh_installinit --name=udevtrigger --no-start + dh_installinit --name=udevmonitor --no-start + dh_installinit --name=udev-fallback-graphics --no-start dh_strip dh_compress diff -Nru udev-175/debian/udev.init udev-175/debian/udev.init --- udev-175/debian/udev.init 2012-07-30 03:04:05.000000000 +0000 +++ udev-175/debian/udev.init 2012-08-31 15:54:48.000000000 +0000 @@ -160,6 +160,9 @@ case "$1" in start) + if init_is_upstart; then + exit 1 + fi if mountpoint -q $udev_root/; then log_failure_msg "$udev_root is already mounted" log_end_msg 1 @@ -189,6 +192,13 @@ ;; stop) + # make sure a manual invocation of the init script doesn't stop an + # upstart-controlled instance of udev + if [ -x /sbin/initctl ] && initctl version | grep -q upstart \ + && status udev | grep start + then + exit 0 + fi log_daemon_msg "Stopping the hotplug events dispatcher" "udevd" if start-stop-daemon --stop --name udevd --user root --quiet --oknodo --retry 5; then log_end_msg $? @@ -206,6 +216,9 @@ ;; restart) + if init_is_upstart; then + exit 1 + fi log_daemon_msg "Stopping the hotplug events dispatcher" "udevd" if start-stop-daemon --stop --name udevd --user root --quiet --oknodo --retry 5; then log_end_msg $? @@ -246,6 +259,9 @@ case "$1" in start) + if init_is_upstart; then + exit 1 + fi if mountpoint -q $udev_root/; then TMPFS_MOUNTED=1 elif [ -e "$udev_root/.udev/" ]; then @@ -314,6 +330,9 @@ ;; restart) + if init_is_upstart; then + exit 1 + fi log_daemon_msg "Stopping the hotplug events dispatcher" "udevd" if start-stop-daemon --stop --name udevd --user root --quiet --oknodo --retry 5; then log_end_msg $? diff -Nru udev-175/debian/udev.preinst udev-175/debian/udev.preinst --- udev-175/debian/udev.preinst 2011-11-14 02:18:40.000000000 +0000 +++ udev-175/debian/udev.preinst 2012-08-31 05:14:53.000000000 +0000 @@ -198,10 +198,21 @@ fi } +stop_on_upstart_upgrade() { + if which initctl >/dev/null && initctl version | grep -q upstart + then + # We have to stop udev before we can restart it under upstart in the + # postinst. + invoke-rc.d udev stop + fi +} + check_version() { # $2 is non-empty when installing from the "config-files" state [ "$2" ] || return 0 + if dpkg --compare-versions $2 lt 175-7.1; then + if dpkg --compare-versions $2 lt 175-1; then if dpkg --compare-versions $2 lt 168-2; then @@ -262,6 +273,9 @@ rm_conffile /etc/modprobe.d/blacklist.conf fi # 175-1 + + stop_on_upstart_upgrade + fi # 175-7.1 } case "$1" in diff -Nru udev-175/debian/udev.udev-fallback-graphics.upstart udev-175/debian/udev.udev-fallback-graphics.upstart --- udev-175/debian/udev.udev-fallback-graphics.upstart 1970-01-01 00:00:00.000000000 +0000 +++ udev-175/debian/udev.udev-fallback-graphics.upstart 2012-08-22 21:36:41.000000000 +0000 @@ -0,0 +1,21 @@ +# fallback-graphics - take actions to initiate fallback graphics +# +# if we have cold plugged everything and not yet seen a valid graphics +# device, +# shove a fallback framebuffer into the mix and hope for the best. + +description "load fallback graphics devices" + +# We only want this job to happen once per boot, hence 'startup and ...'. +start on (startup and + (graphics-device-added PRIMARY_DEVICE_FOR_DISPLAY=1 + or drm-device-added PRIMARY_DEVICE_FOR_DISPLAY=1 + or stopped udevtrigger or container)) + +task + +script + if [ "$PRIMARY_DEVICE_FOR_DISPLAY" = "" ]; then + modprobe -q -b vesafb + fi +end script diff -Nru udev-175/debian/udev.udev-finish.upstart udev-175/debian/udev.udev-finish.upstart --- udev-175/debian/udev.udev-finish.upstart 1970-01-01 00:00:00.000000000 +0000 +++ udev-175/debian/udev.udev-finish.upstart 2012-08-22 21:36:41.000000000 +0000 @@ -0,0 +1,30 @@ +# udev-finish - save udev log and update rules +# +# While udev runs we not only create the log file of initial device +# creation but udev rules may be generated, we need to copy both of +# these out of /dev and onto the root filesystem. + +description "save udev log and update rules" + +start on (startup + and filesystem + and started udev + and stopped udevtrigger + and stopped udevmonitor) + +task +script + # Save udev log in /var/log/udev + if [ -e /dev/.udev.log ] + then + mv -f /dev/.udev.log /var/log/udev || : + fi + + # Copy any rules generated while the root filesystem was read-only + for file in /dev/.udev/tmp-rules--* + do + [ -e "$file" ] || continue + cat "$file" >> "/etc/udev/rules.d/${file##*tmp-rules--}" + rm -f "$file" + done +end script diff -Nru udev-175/debian/udev.udevmonitor.upstart udev-175/debian/udev.udevmonitor.upstart --- udev-175/debian/udev.udevmonitor.upstart 1970-01-01 00:00:00.000000000 +0000 +++ udev-175/debian/udev.udevmonitor.upstart 2012-08-22 21:36:41.000000000 +0000 @@ -0,0 +1,13 @@ +# udevmonitor - log initial device creation +# +# The set of devices created in the "cold plug" pass is generally +# useful for debugging, so we monitor this and create a log file +# from that. + +description "log initial device creation" + +start on (startup + and starting udevtrigger) +stop on stopped udevtrigger + +exec /sbin/udevadm monitor -e >/dev/.udev.log diff -Nru udev-175/debian/udev.udevtrigger.upstart udev-175/debian/udev.udevtrigger.upstart --- udev-175/debian/udev.udevtrigger.upstart 1970-01-01 00:00:00.000000000 +0000 +++ udev-175/debian/udev.udevtrigger.upstart 2012-08-22 21:36:41.000000000 +0000 @@ -0,0 +1,16 @@ +# udevtrigger - cold plug devices +# +# By the time udevd starts, we've already missed all of the events for +# the devices populated in /sys. This task causes the kernel to resend +# them. + +description "cold plug devices" + +start on (startup + and started udev + and not-container) + +task + +exec udevadm trigger --action=add +post-stop exec udevadm settle diff -Nru udev-175/debian/udev.upstart udev-175/debian/udev.upstart --- udev-175/debian/udev.upstart 1970-01-01 00:00:00.000000000 +0000 +++ udev-175/debian/udev.upstart 2012-08-22 21:36:41.000000000 +0000 @@ -0,0 +1,14 @@ +# udev - device node and kernel event manager +# +# The udev daemon receives events from the kernel about changes in the +# /sys filesystem and manages the /dev filesystem. + +description "device node and kernel event manager" + +start on virtual-filesystems +stop on runlevel [06] + +expect fork +respawn + +exec /sbin/udevd --daemon
Attachment:
signature.asc
Description: Digital signature