niXforums Forum Index
 FAQFAQ   SearchSearch   MemberlistMemberlist   UsergroupsUsergroups   RegisterRegister 
 ProfileProfile   PreferencesPreferences   Log in to check your private messagesLog in to check your private messages   Log inLog in 
·  nixdoc.net ·  man pages ·  Linux HOWTOs ·  FreeBSD Tips ·  Forums
navigation Forum index » *nix » BSD » FreeBSD » mail-lists » Architecture
Call for Review: more pristine environment for release build
Post new topic   Reply to topic Page 1 of 1 [4 Posts] View previous topic :: View next topic
Author Message
Ruslan Ermilov
*nix forums addict


Joined: 01 Jul 2002
Posts: 65

PostPosted: Thu Jul 25, 2002 7:01 am    Post subject: Re: Call for Review: more pristine environment for release build Reply with quote

On Thu, Jul 25, 2002 at 03:54:08PM +0900, Makoto Matsushita wrote:
Quote:

ru> This had only one disadvantage so far. I could no longer pass NO_WERROR
ru> globally through the environment; passing it with WORLD_FLAGS/KERNEL_FLAGS
ru> does not make it propagate to release.5. JFYI.

Ya, that's right, thanks.

Quick workaround is to put NO_WERROR to ${CHROOT}/etc/make.conf
(LOCAL_PATCHES can be used). However, maybe it is better to describe
explicitly in ${CHROOT}/mk if parent environment defines NO_WRROR.
I'll make a patch later (maybe this evening).

One possible thing (that I tried) is to add ${WORLD_FLAGS} to the

release.5's ${WMAKE} calls for crunchgen(1) generated binaries.

I don't recall if this broke -j there (if WORLD_FLAGS is supplied
with -j) or not, need to re-check.


Cheers,
--
Ruslan Ermilov Sysadmin and DBA,
ru@sunbay.com Sunbay Software AG,
ru@FreeBSD.org FreeBSD committer,
+380.652.512.251 Simferopol, Ukraine

http://www.FreeBSD.org The Power To Serve
http://www.oracle.com Enabling The Information Age
Back to top
Makoto Matsushita
*nix forums beginner


Joined: 21 Mar 2002
Posts: 9

PostPosted: Thu Jul 25, 2002 4:54 am    Post subject: Re: Call for Review: more pristine environment for release build Reply with quote

ru> This had only one disadvantage so far. I could no longer pass NO_WERROR
ru> globally through the environment; passing it with WORLD_FLAGS/KERNEL_FLAGS
ru> does not make it propagate to release.5. JFYI.

Ya, that's right, thanks.

Quick workaround is to put NO_WERROR to ${CHROOT}/etc/make.conf
(LOCAL_PATCHES can be used). However, maybe it is better to describe
explicitly in ${CHROOT}/mk if parent environment defines NO_WRROR.
I'll make a patch later (maybe this evening).

-- -
Makoto `MAR' Matsushita

To Unsubscribe: send mail to majordomo@FreeBSD.org
with "unsubscribe freebsd-arch" in the body of the message
Back to top
Ruslan Ermilov
*nix forums addict


Joined: 01 Jul 2002
Posts: 65

PostPosted: Thu Jul 25, 2002 4:42 am    Post subject: Re: Call for Review: more pristine environment for release build Reply with quote

On Sat, Jun 08, 2002 at 06:00:49PM +0900, Makoto Matsushita wrote:
Quote:

Current chroot sandbox inherits parent's environment variables.
However, there is only 'PATH' environment variable which should be
inherited from the parent. Since there are several _fixed_
directories to be listed in PATH, we can safely listed directories in
static.

Following patch enables that:
* PATH list is set statically.
* Use 'env -i' to eliminate parent environment variables when
starting chroot(Cool sandbox.

Note:
1) '/sbin' should be listed in PATH (/sbin/{u,}mount will be
there). I don't know about '/usr/sbin', but it is safe for
us IMHO.
2) 'chroot' should be full-path, since /bin/sh's default PATH
is "/bin:/usr/bin"; without full-path, env can't start chroot.

If there are no problems, I'll commit it later (maybe several days
after or so). Any comments, suggestions, and objections are welcome.

This had only one disadvantage so far. I could no longer pass NO_WERROR

globally through the environment; passing it with WORLD_FLAGS/KERNEL_FLAGS
does not make it propagate to release.5. JFYI.


Cheers,
--
Ruslan Ermilov Sysadmin and DBA,
ru@sunbay.com Sunbay Software AG,
ru@FreeBSD.org FreeBSD committer,
+380.652.512.251 Simferopol, Ukraine

http://www.FreeBSD.org The Power To Serve
http://www.oracle.com Enabling The Information Age
Back to top
Makoto Matsushita
*nix forums beginner


Joined: 21 Mar 2002
Posts: 9

PostPosted: Sat Jun 08, 2002 7:00 am    Post subject: Call for Review: more pristine environment for release build Reply with quote

Current chroot sandbox inherits parent's environment variables.
However, there is only 'PATH' environment variable which should be
inherited from the parent. Since there are several _fixed_
directories to be listed in PATH, we can safely listed directories in
static.

Following patch enables that:
* PATH list is set statically.
* Use 'env -i' to eliminate parent environment variables when
starting chroot(Cool sandbox.

Note:
1) '/sbin' should be listed in PATH (/sbin/{u,}mount will be
there). I don't know about '/usr/sbin', but it is safe for
us IMHO.
2) 'chroot' should be full-path, since /bin/sh's default PATH
is "/bin:/usr/bin"; without full-path, env can't start chroot.

If there are no problems, I'll commit it later (maybe several days
after or so). Any comments, suggestions, and objections are welcome.

Thanks in advance,
-- -
Makoto `MAR' Matsushita


Index: Makefile
===================================================================
RCS file: /home/ncvs/src/release/Makefile,v
retrieving revision 1.686
diff -u -r1.686 Makefile
--- Makefile 8 Jun 2002 03:15:50 -0000 1.686
+++ Makefile 8 Jun 2002 08:44:07 -0000
@@ -392,7 +392,7 @@
.endif
# Don't remove this, or the build will fall over!
echo "export RELEASEDIR=${_R}" >> ${CHROOTDIR}/mk
- echo "export PATH=$${PATH}:${LOCALDIR}" >> ${CHROOTDIR}/mk
+ echo "export PATH=/bin:/usr/bin:/sbin:/usr/sbin:${LOCALDIR}" >> ${CHROOTDIR}/mk
echo "export TMPDIR=/tmp" >> ${CHROOTDIR}/mk
echo "export MAKEOBJDIRPREFIX=/usr/obj" >> ${CHROOTDIR}/mk
echo "export MANBUILDCAT=YES" >> ${CHROOTDIR}/mk
@@ -406,7 +406,7 @@
echo "make \$${_RELTARGET}" >> ${CHROOTDIR}/mk
echo "echo \">>> make ${.TARGET} for ${TARGET} finished on \`LC_ALL=C TZ=GMT date\`\"" >> ${CHROOTDIR}/mk
chmod 755 ${CHROOTDIR}/mk
- chroot ${CHROOTDIR} /mk
+ env -i /usr/sbin/chroot ${CHROOTDIR} /mk

clean:
rm -rf boot_crunch release.[0-9]

To Unsubscribe: send mail to majordomo@FreeBSD.org
with "unsubscribe freebsd-arch" in the body of the message
Back to top
Google

Back to top
Display posts from previous:   
Post new topic   Reply to topic Page 1 of 1 [4 Posts] View previous topic :: View next topic
The time now is Thu Jan 08, 2009 5:35 am | All times are GMT
navigation Forum index » *nix » BSD » FreeBSD » mail-lists » Architecture
Jump to:  

Similar Topics
Topic Author Forum Replies Last Post
No new posts User Environment - export PATH variable paalepu AIX 0 Tue Sep 12, 2006 8:12 pm
No new posts MySQL Max Build Policy Kaj Arnö MySQL 0 Fri Jul 21, 2006 2:08 pm
No new posts Removing db from environment mike.klaas@gmail.com Berkeley DB 0 Fri Jul 21, 2006 5:14 am
No new posts can I call a internal function directly? minrobin@gmail.com shell 2 Fri Jul 21, 2006 2:17 am
No new posts Upgrade sendmail on 5.4-RELEASE-p7 brent.bolin@gmail.com FreeBSD 3 Fri Jul 21, 2006 2:00 am

Payday Loans | Loans | Online Advertising | Problem Mortgage | Free Advertising
Copyright © 2004-2005 DeniX Solutions SRL
 
Other DeniX Solutions sites: Unix/Linux blog |  electronics forum |  medicine forum |  science forum | 
Privacy Policy


Powered by phpBB © 2001, 2005 phpBB Group
[ Time: 0.1381s ][ Queries: 20 (0.0487s) ][ GZIP on - Debug on ]