Skip site navigation (1)Skip section navigation (2)
Date:      Tue, 25 Jan 2005 20:11:49 +0100
From:      Jeremie Le Hen <jeremie@le-hen.org>
To:        Julian Elischer <julian@elischer.org>
Cc:        Jeremie Le Hen <jeremie@le-hen.org>
Subject:   Re: Cannot install kernel as user
Message-ID:  <20050125191149.GJ59685@obiwan.tataz.chchile.org>
In-Reply-To: <41F1AA9B.4070603@elischer.org>
References:  <20050121151747.GA36660@obiwan.tataz.chchile.org> <50158.208.4.77.66.1106323175.squirrel@208.4.77.66> <41F1AA9B.4070603@elischer.org>

next in thread | previous in thread | raw e-mail | index | archive | help
> It's also useful when doing a build inside a jail as flags cannot be 
> changed insode a jail.
> 
> I got around it by replacing 'chflags' in the jail by a shell script the 
> does nothing :-).

I thought over how getting neatly rid of this.  I would like to
introduce a `INSTALL_AS_USER' variable, as it exists in
ports/Mk/bsd.port.mk.  However I don't want to duplicate this code :

%%%
  .if exists(${DESTDIR}${KODIR})
          -thiskernel=`sysctl -n kern.bootfile` ; \
          if [ "`dirname "$$thiskernel"`" != ${DESTDIR}${KODIR} ] ; then \
                  chflags -R noschg ${DESTDIR}${KODIR} ; \
                  rm -rf ${DESTDIR}${KODIR} ; \
          else \
                  if [ -d ${DESTDIR}${KODIR}.old ] ; then \
                          chflags -R noschg ${DESTDIR}${KODIR}.old ; \
                          rm -rf ${DESTDIR}${KODIR}.old ; \
                  fi ; \
                  mv ${DESTDIR}${KODIR} ${DESTDIR}${KODIR}.old ; \
                  sysctl kern.bootfile=${DESTDIR}${KODIR}.old/"`basename "$$thiskernel"`" ; \
          fi
  .endif  
%%%

Your workaround might be a good start : create a dummy chflags(8) which
will be used when INSTALL_AS_USER is set.  Of course this will need to
introduce an internal variable, say ${CHFLAGS}.

My problem is actually that I don't know where to make this dummy
chflags(8) live in the source tree.  Ideas ?

Regards,
-- 
Jeremie Le Hen
jeremie@le-hen.org



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?20050125191149.GJ59685>