Support arbitrary legalnotice content and inject correct text when role='rpc'

Change-Id: I942729c86d639fd3a6a9bac7fbbc3811e6c58a8a
Merge "Support arbitrary legalnotice content and inject correct text when role='rpc'"