Green’s Dictionary of Slang

pork and beans n.

1. a Portuguese [joc. pron.].

[US]Life in Boston & N.Y. (Boston, MA) 1 Oct. n.p.: A certain Pork and Beans is notified that we have enclosed a bill for $2 [...] which we wish to have settled.
[UK]N&Q 12 Ser. IX 458: In a very short time the expression ‘Pork and beans’ to denote the Portuguese achieved such success that the powers that be, fearing it might be regarded as an insult, issued a stringent order [...] that it and similar expressions were not to be used.
[UK](con. WWI) in Fraser & Gibbons Soldier and Sailor Words.
[UK](con. 1914–18) Brophy & Partridge Songs and Sl. of the British Soldier.
[UK] (ref. 1940s) B. Morrison Things My Mother Never Told Me 86: I’d not heard of the Portugese being Pork ’n’ Beans.

2. (US black) a means of living, one’s livelihood.

[US](con. 1940s) I. Freeman Out of the Burning (1961) 29: That bike is our pork and beans; ain’t no toy.