better handling of ramdisk_hack

Change-Id: I204460f030af207a506e6e31025ade20300dee54