anchor.diff:  
           mkdir image
           touch baseFiles
  +        layers=""
           if [[ -n "$fromImage" ]]; then
             echo "Unpacking base image..."
             tar -C image -xpf "$fromImage"
  -          # Do not import the base image configuration and manifest
  -          chmod a+w image image/*.json
  -          rm -f image/*.json
  -
  -          if [[ -z "$fromImageName" ]]; then
  -            fromImageName=$(jshon -k < image/repositories|head -n1)
  -          fi
  -          if [[ -z "$fromImageTag" ]]; then
  -            fromImageTag=$(jshon -e $fromImageName -k \
  -                           < image/repositories|head -n1)
  -          fi
  -          parentID=$(jshon -e $fromImageName -e $fromImageTag -u \
  -                     < image/repositories)
  -
  -          for l in image/*/layer.tar; do
  -            ls_tar $l >> baseFiles
  +          config=$(jq -r '.[0].Config' image/manifest.json)
  +          layers=$(jq -r '.[0].Layers | join(" ")' image/manifest.json)
  +          for l in $layers; do
  +            ls_tar image/$l >> baseFiles
             done
  +          chmod u+w image image/$config
  +          rm image/$config
           fi
   
           chmod -R ug+rw image
  
positive.code:         };
          inherit fromImage fromImageName fromImageTag;
  
          buildInputs = [ utillinux e2fsprogs jshon rsync ];
        } ''
        rm -rf $out
  
  
negative.code:       mount /dev/${vmTools.hd} disk
        cd disk
  
        layers=""
        if [[ -n "$fromImage" ]]; then
          echo "Unpacking base image..."
          mkdir image
          tar -C image -xpf "$fromImage"
          layers=$(jq -r '.[0].Layers | join(" ")' image/manifest.json)
        fi
  
        # Unpack all of the layers into the image.
        # Layer list is ordered starting from the base image
        lowerdir=""
        for layer in $layers; do
          echo "Unpacking layer $layer"
          layerDir=image/$(echo $layer | cut -d':' -f2)"_unpacked"
          mkdir -p $layerDir
          tar -C $layerDir -xpf image/$layer
          chmod a+w image/$layer
          rm image/$layer
  
          find $layerDir -name ".wh.*" -exec bash -c 'name="$(basename {}|sed "s/^.wh.//")"; mknod "$(dirname {})/$name" c 0 0; rm {}' \;
  
          # Get the next lower directory and continue the loop.
          lowerdir=$lowerdir''${lowerdir:+:}$layerDir
        done
  
        mkdir work
  