Imported some patches and debian a lot of script changes from actual 6.5.1