             false ->
               case release.profile.include_system_libs do
                 false ->
+                  Logger.debug "Stripping system libs from release tarball"
                   libs = Path.wildcard(Path.join([tmpdir, "lib", "*"]))
                   system_libs = Path.wildcard(Path.join("#{:code.lib_dir}", "*"))
                   for libdir <- :lists.subtract(libs, system_libs),

  end

  defp generate_overlay_vars(release) do
    [erts_vsn: Utils.erts_version(),
     release_name: release.name,
     release_version: release.version]
  end
end

               {'erts-#{erts_vsn}', '#{Path.join(output_dir, "erts-" <> erts_vsn)}'}]
          end
        ] ++ overlays, [:dereference, :compressed])
    Logger.debug "Tarball updated!"
    File.rm_rf!(tmpdir)
    :ok
  end

  defp apply_overlays(release, _name, output_dir) do
    Logger.debug "Applying overlays"
    overlay_vars = release.profile.overlay_vars ++ generate_overlay_vars(release)
    hook_overlays = [
      {:mkdir, "releases/<%= release_version %>/hooks"},
