So, the code you supplied can't be executed if you have separate partitions? Strictly that? If it can be placed in a separate partition then which one would you recommended from root, home, boot, opt?
Will your code still work for those users who prefer to have separate partitions?