  The presence of short-lived radionuclides in the early solar system provides
important information about the astrophysical environment in which the solar
system formed. The discovery of now extinct $^{10}$Be in calcium-aluminum-rich
inclusions (CAIs) with Fractionation and Unidentified Nuclear isotope anomalies
(FUN-CAIs) suggests that a baseline concentration of $^{10}$Be in the early
solar system was inherited from the protosolar molecular cloud. In this paper,
we first show that the $^{10}$Be recorded in FUN-CAIs cannot have been produced
in situ by cosmic-ray (CR) irradiation of the FUN-CAIs themselves. We then show
that trapping of Galactic CRs (GCRs) in the collapsing presolar cloud core
induced a negligible $^{10}$Be contamination of the protosolar nebula.
Irradiation of the presolar molecular cloud by background GCRs produced a
steady-state $^{10}$Be/$^9$Be ratio ~2.3 times lower than the ratio recorded in
FUN-CAIs, which suggests that the presolar cloud was irradiated by an
additional source of CRs. Considering a detailed model for CR acceleration in a
supernova remnant (SNR), we find that the $^{10}$Be abundance recorded in
FUN-CAIs can be explained within two alternative scenarios: (i) the irradiation
of a giant molecular cloud by CRs produced by >50 supernovae exploding in a
superbubble of hot gas generated by a large star cluster of at least 20,000
members and (ii) the irradiation of the presolar molecular cloud by freshly
accelerated CRs escaped from an isolated SNR at the end of the Sedov-Taylor
phase. The second model naturally provides an explanation for the injection of
other short-lived radionuclides of stellar origin into the cold presolar
molecular cloud ($^{26}$Al, $^{41}$Ca and $^{36}$Cl) and is in agreement with
the solar system originating from the collapse of a molecular cloud shocked by
a supernova blast wave.
