Re: [RFC] Fixed installworld with noexec /tmp

看板FB_hackers作者時間11年前 (2014/06/10 08:01), 編輯推噓0(000)
留言0則, 0人參與, 最新討論串3/6 (看更多)
I am not familiar with that problem. I don't think my fix would help that issue as it was already using mktemp(1) to get a random directory in /tmp. Sent from my iPhone > On Jun 9, 2014, at 18:28, Adrian Chadd <adrian@freebsd.org> wrote: > > Would this fix instances of people building world on a shared box? > > (ie, multiple different srcdir/objdir/destdir, but same /tmp?) > > > -a > > >> On 9 June 2014 19:01, Bryan Drewery <bdrewery@freebsd.org> wrote: >> I've always had my /tmp mounted as noexec. Despite how useless this >> is, I and many others have had trouble with installworld due to it. >> >> You can see how frequent it occurs here: >> https://www.google.com/#q=freebsd+installworld+noexec >> >> A simple workaround, which I only just discovered from PR 58117, is to set >> TMPDIR >> to somewhere that can exec. >> >> This patch fixes it by using the OBJDIR rather than the assumed /tmp or >> TMPDIR. >> >> The purpose of the installworld code using INSTALLTMP is to use the >> pre-install >> binaries to do the install, rather than the newly built binaries. This is to >> ensure >> the binaries will run while system is in an inconsistent state with >> libraries and >> in case the kernel is not yet upgraded. My change adds continues to respect >> that by >> ensuring it uses the already-installed mkdir(1) and env(1) with full paths. >> >> http://people.freebsd.org/~bdrewery/patches/installworld-noexec.txt >> >> --- Makefile.inc1 >> +++ Makefile.inc1 >> @@ -191,7 +191,9 @@ TMPPATH= ${STRICTTMPPATH}:${PATH} >> # when in the middle of installing over this system. >> # >> .if make(distributeworld) || make(installworld) >> -INSTALLTMP!= /usr/bin/mktemp -d -u -t install >> +INSTALLTMPDIR= ${OBJTREE}${.CURDIR}/itmp >> +INSTALLTMP!= /bin/mkdir -p ${INSTALLTMPDIR} && /usr/bin/env \ >> + TMPDIR=${INSTALLTMPDIR} /usr/bin/mktemp -d -u -t install >> .endif >> >> # >> @@ -833,7 +835,7 @@ distributeworld installworld: _installcheck_world >> LOCAL_MTREE=${LOCAL_MTREE:Q} distrib-dirs >> .endif >> ${_+_}cd ${.CURDIR}; ${IMAKE} re${.TARGET:S/world$//}; \ >> - ${IMAKEENV} rm -rf ${INSTALLTMP} >> + ${IMAKEENV} rm -rf ${INSTALLTMPDIR} >> .if make(distributeworld) >> .for dist in ${EXTRA_DISTRIBUTIONS} >> find ${DESTDIR}/${DISTDIR}/${dist} -mindepth 1 -empty -delete >> >> The only downside I see is that failures can leave the stale tmpdir in >> the OBJDIR, which is why I remove the entire "itmp" dir once installworld >> finally does succeed. >> >> -- >> Regards, >> Bryan Drewery >> _______________________________________________ >> freebsd-hackers@freebsd.org mailing list >> http://lists.freebsd.org/mailman/listinfo/freebsd-hackers >> To unsubscribe, send any mail to "freebsd-hackers-unsubscribe@freebsd.org" _______________________________________________ freebsd-hackers@freebsd.org mailing list http://lists.freebsd.org/mailman/listinfo/freebsd-hackers To unsubscribe, send any mail to "freebsd-hackers-unsubscribe@freebsd.org"
文章代碼(AID): #1Jbag-AU (FB_hackers)
討論串 (同標題文章)
文章代碼(AID): #1Jbag-AU (FB_hackers)