diff -Nru initramfs-tools-ubuntu-core-0.7.7~ppa6/debian/changelog initramfs-tools-ubuntu-core-0.7.7~ppa7/debian/changelog --- initramfs-tools-ubuntu-core-0.7.7~ppa6/debian/changelog 2015-09-12 10:59:12.000000000 +0000 +++ initramfs-tools-ubuntu-core-0.7.7~ppa7/debian/changelog 2015-09-14 17:36:57.000000000 +0000 @@ -1,3 +1,10 @@ +initramfs-tools-ubuntu-core (0.7.7~ppa7) vivid; urgency=medium + + * handle mounting of all /etc subdirs directly in initrd, not via fstab as + this can cause races (LP: #1495452) + + -- Oliver Grawert Mon, 14 Sep 2015 19:33:53 +0200 + initramfs-tools-ubuntu-core (0.7.7~ppa6) vivid; urgency=medium * drop the superfluous "blockdev --rereadpt" call and instead use udevadm diff -Nru initramfs-tools-ubuntu-core-0.7.7~ppa6/scripts/ubuntu-core-rootfs initramfs-tools-ubuntu-core-0.7.7~ppa7/scripts/ubuntu-core-rootfs --- initramfs-tools-ubuntu-core-0.7.7~ppa6/scripts/ubuntu-core-rootfs 2015-09-10 10:18:29.000000000 +0000 +++ initramfs-tools-ubuntu-core-0.7.7~ppa7/scripts/ubuntu-core-rootfs 2015-09-14 17:39:40.000000000 +0000 @@ -135,12 +135,22 @@ sync_dirs "$dstpath" . "$srcpath" fi - # Write the fstab entry - if [ "$5" = "none" ]; then - echo "$path $1 none bind 0 0" >> "$fstab" - else - echo "$path $1 none bind,$5 0 0" >> "$fstab" - fi + # mount all /etc dirs right now, not later when fstab is + # processed, as it will cause races. + case $1 in + /etc*) + [ -d "${rootmnt}/writable/system-data/$1" ] || mkdir -p "${rootmnt}/writable/system-data/$1" + mount -o bind "${rootmnt}/writable/system-data/$1" "${rootmnt}/$1" + ;; + *) + # Write the fstab entry + if [ "$5" = "none" ]; then + echo "$path $1 none bind 0 0" >> "$fstab" + else + echo "$path $1 none bind,$5 0 0" >> "$fstab" + fi + ;; + esac else continue fi @@ -287,10 +297,6 @@ echo "$other /writable/cache/system auto defaults,ro 0 0" >> "$fstab" fi - # Mount the systemd overlay so that we have a complete root partition during boot - mkdir -p "${rootmnt}/writable/system-data/etc/systemd/system" - mount -o bind "${rootmnt}/writable/system-data/etc/systemd/system" "${rootmnt}/etc/systemd/system" - # Apply customized content for user in "${rootmnt}"/writable/user-data/* do