+eT&@sddlmZmZddlZddlZddlZddlZddZdddZdd d Z d d Z d dZ ddZ ddZ ddZddZddZedkrejdejeeddndS))absolute_importprint_functionNcCstjd|rR|jrRtjd|jddd|jdddntjdd}|jdd |}tjd ||tjd <|jdd |tjdd }tj |d |jdd|}tjd||jdddr7tjd|jddddtjd)r?r zbind mounting %sFzoverlay mounting %srT r"zfound %s that needs bind mount)r'readr@r?r listdirrjoinisdirrrr&rr(stripr=r5) r$r%Zmountsr?r3r4r*r+r,r-rr.r/rrrrBs2       rBc Cstjdtjjds0tjddSddlm}|}t}|jdxt dD]}|j \}}}}} } t |rt ||rtj d|dS|d krit | rit ||ritjd ||j|qiqiWx)|D]!} t| |d | sdSqWx0|D](} t| s<t| |sddSq<q<Wx)|D]!} t|d | | sodSqoWd S) z$ setup aufs overlay over the rootfs setupAufsz /proc/mountsz(no /proc/mounts, can not do aufs overlayFr>)r?z/var/cache/apt/archivesz#mountpoint %s submount of systemdirr"zfound %s that needs bind mountz/needs_bind_mount/T)rrr rrr@r?r addr'r(r=r5Zwarningrr0r&) r$r?r3Zneeds_bind_mountr*r+r,r-rr.r/r4rrrrLs6    (     rL__main__levelz/tmp/upgrade-chroot-rwz/tmp/upgrade-chroot)Z __future__rrrr rr rrr&r0r5r=rArErBrL__name__Z basicConfigDEBUGprintrrrrs$     '    ( <