Commit Graph

77 Commits

Author SHA1 Message Date
Xin LI
65b4f27054 Don't leak 'var'.
Reported by:	clang static analyzer
2015-09-03 01:15:23 +00:00
Simon J. Gerraty
ccfb965433 Add META_MODE support.
Off by default, build behaves normally.
WITH_META_MODE we get auto objdir creation, the ability to
start build from anywhere in the tree.

Still need to add real targets under targets/ to build packages.

Differential Revision:       D2796
Reviewed by: brooks imp
2015-06-13 19:20:56 +00:00
Simon J. Gerraty
44d314f704 dirdeps.mk now sets DEP_RELDIR 2015-06-08 23:35:17 +00:00
Simon J. Gerraty
98e0ffaefb Merge sync of head 2015-05-27 01:19:58 +00:00
Christian Brueffer
8b36eba6c0 Fix a typo in the FFS maxbpg option, it was erroneously spelled maxbpf.
The error exists in the NetBSD upstream version as well and will be reported back.

PR:		196598
Submitted by:	Dan McGregor
MFC after:	1 week
2015-01-12 19:26:31 +00:00
Baptiste Daroussin
2df4d9628a Convert makefs to LIBADD
Add definition of libnetbsd in src.libnames.mk
2014-11-24 22:15:30 +00:00
Simon J. Gerraty
9268022b74 Merge from head@274682 2014-11-19 01:07:58 +00:00
Davide Italiano
9d5a327fb5 r258695 introduces a sanity check for makefs in order to verify that
the minimum image size specified is always less than the maximum
image size. If makefs(1) is invoked specifying minimum image size,
but not maximum one, the program exits with an error. Example:

# sudo -E makefs -M 538968064 -B be /home/davide/disk.img $DESTDIR
makefs: `/home/davide/tftproot/mips' minsize of 538968064 rounded up
to ffs bsize of 8192 exceeds maxsize 0.  Lower bsize, or round the
minimum and maximum sizes to bsize.

Assert then that minsize < maxsize iff maxsize is specified.
This change allows me to build MIPS images using makefs(1) and following
what specified in the wiki again.

Reviewed by:	jmallett, ngie
2014-09-18 03:11:59 +00:00
Bryan Drewery
5608fd23c2 Revert r267233 for now. PIE support needs to be reworked.
1. 50+% of NO_PIE use is fixed by adding -fPIC to INTERNALLIB and other
   build-only utility libraries.
2. Another 40% is fixed by generating _pic.a variants of various libraries.
3. Some of the NO_PIE use is a bit absurd as it is disabling PIE (and ASLR)
   where it never would work anyhow, such as csu or loader. This suggests
   there may be better ways of adding support to the tree. Many of these
   cases can be fixed such that -fPIE will work but there is really no
   reason to have it in those cases.
4. Some of the uses are working around hacks done to some Makefiles that are
   really building libraries but have been using bsd.prog.mk because the code
   is cleaner. Had they been using bsd.lib.mk then NO_PIE would not have
   been needed.

We likely do want to enable PIE by default (opt-out) for non-tree consumers
(such as ports). For in-tree though we probably want to only enable PIE
(opt-in) for common attack targets such as remote service daemons and setuid
utilities. This is also a great performance compromise since ASLR is expected
to reduce performance. As such it does not make sense to enable it in all
utilities such as ls(1) that have little benefit to having it enabled.

Reported by:	kib
2014-08-19 15:04:32 +00:00
Simon J. Gerraty
ee7b0571c2 Merge head from 7/28 2014-08-19 06:50:54 +00:00
Baptiste Daroussin
01c2b8ac0d use .Mt to mark up email addresses consistently (part2)
PR:		191174
Submitted by:	Franco Fichtner  <franco@lastsummer.de>
2014-06-20 09:57:27 +00:00
Bryan Drewery
864c53ead8 In preparation for ASLR [1] support add WITH_PIE to support building with -fPIE.
This is currently an opt-in build flag. Once ASLR support is ready and stable
it should changed to opt-out and be enabled by default along with ASLR.

Each application Makefile uses opt-out to ensure that ASLR will be enabled by
default in new directories when the system is compiled with PIE/ASLR. [2]

Mark known build failures as NO_PIE for now.

The only known runtime failure was rtld.

[1] http://www.bsdcan.org/2014/schedule/events/452.en.html
Submitted by:		Shawn Webb <lattera@gmail.com>
Discussed between:	des@ and Shawn Webb [2]
2014-06-08 17:29:31 +00:00
John-Mark Gurney
646fc9ccad convert to using the _daddr_t types like newfs was...
Put the superblock in the correct possition for UFS2... There is a bug
in FFS that if we don't put it here (for UFS2), it will forcefully
relocate the superblock, and I believe cause data loss..

I have a fix for that, but w/ how many releases are broken, we won't be
able to switch to the better _FLOPPY (block 0) for this for a while..
2014-05-31 20:26:34 +00:00
Simon J. Gerraty
fae50821ae Updated dependencies 2014-05-16 14:09:51 +00:00
Simon J. Gerraty
76b28ad6ab Updated dependencies 2014-05-10 05:16:28 +00:00
Simon J. Gerraty
3b8f084595 Merge head 2014-04-28 07:50:45 +00:00
Marcel Moolenaar
4ceda9d362 Timestamps may not have a decimal point.
While here, consistently use sbuf_new_auto().
2014-04-06 02:57:49 +00:00
Simon J. Gerraty
12a5ad4762 Allow comments at end of line.
Reviewed by: marcel
2014-03-04 20:09:23 +00:00
Marius Strobl
516e016844 Record the IEEE P1282 Rock Ridge version 1.12 POSIX File Serial Number,
i. e. the POSIX:5.6.1 st_ino field, which can be used to detect hard links
in the file system. This is also the default in mkisofs(8) and according to
its man page, no system only being able to cope with Rock Ridge version 1.10
is known to exist.

PR:		185138
Submitted by:	Kurt Lidl
MFC after:	1 week
2013-12-29 16:43:35 +00:00
Juli Mallett
5ad283b3c6 Provide a helpful diagnostic when the minimum size rounded to the block size
would exceed the maximum size.  This can be a difficult problem to diagnose
if one is, for instance, using -s with a fixed size in a script and the bsize
calculated for a filesystem image changes, necessitating a re-rounding of the
image size or a hand-setting of the bsize.  Previously one would get a
cryptic message about how the size exceeded the maximum size, which normally
only happens if the contents of the image are larger than specified.
2013-11-27 21:55:43 +00:00
Simon J. Gerraty
34b33809b7 Updated dependencies 2013-10-13 00:24:00 +00:00
Simon J. Gerraty
d1d0158641 Merge from head 2013-09-05 20:18:59 +00:00
Glen Barber
9ab90e8a58 Mark the makefs(8) '-p' flag as deprecated in preference for
the '-Z' flag for compatibility with NetBSD.

Submitted by:	Eric van Gyzen (via stable@)
MFC after:	3 days
2013-08-16 05:30:13 +00:00
Marius Strobl
1bce1a7401 - Set the System Identifier in the Primary Volume Descriptor to FreeBSD
rather than NetBSD.
- Correctly set the Expiration Time in the Primary Volume Descriptor;
  according to ISO 9660 8.4.26.1 unspecified date and time are denoted
  by the digit 0 in RBP 1 to 16 but the number 0 in RBP 17. [1]
- Merge iso9660_rrip.c rev. 1.11 from NetBSD: name_len should be read
  as unsigned byte. [2]
  Note: This is according to ISO 9660 9.1.10.
- Rock Ridge TF entries should use a length of 5, because after the 4
  bytes of generic SUSP header there is one byte of flags. See typedef
  of ISO_RRIP_TF in iso9660_rrip.h. [1]

Submitted by:	Thomas Schmitt [1]
Obtained from:	NetBSD [2]
MFC after:	3 days
2013-07-27 15:28:31 +00:00
Marius Strobl
2e17284732 Ensure that makefs.h is included when using ufs_bswap.h so the FFS_EI macro
is picked up when defined. Previously, ffs_subr.c was always built without
support for opposite endianess as it doesn't include makefs.h on its own.

MFC after:	3 days
2013-07-26 14:22:03 +00:00
Marcel Moolenaar
a92b168892 Set st_nlink in the stat structure within the inode to 1 as well.
The cd9660 file system uses that field for the link count and it
was 0. This impacts pwd_mkdb(8) as it checks for st_nlink not being
0 as part of closing a race.
2013-05-13 18:34:33 +00:00
Brooks Davis
43e8dbd316 Remove duplicated copies of various NetBSD compatibility shims used by
makefs and use libnetbsd, contrib/mtree, and contrib/mknod instead.

Sponsored by:	DARPA, AFRLo
MFC after:	1 month
2013-05-09 14:43:36 +00:00
Simon J. Gerraty
69e6d7b75e sync from head 2013-04-12 20:48:55 +00:00
Joel Dahl
b1edef175b Remove contractions. 2013-04-11 18:46:41 +00:00
Simon J. Gerraty
7cf3a1c6b2 Updated dependencies 2013-03-11 17:21:52 +00:00
Brooks Davis
1f0ed3c00e Support hardlinks in manifest files by the same logic as the treewalk
code.

Reviewed by:	marcel
Sponsored by:	DARPA, AFRL
2013-02-20 19:32:31 +00:00
Brooks Davis
17b3e6f746 Allow '.' components in manifest paths. They are always the first
component of mtree -C and install -M output and are easily skipped.

Reviewed by:	marcel
Sponsored by:	DARPA, AFRL
2013-02-20 15:28:40 +00:00
Brooks Davis
e9a03238b0 Fix the -N option in manifest mode by using pwcache(3). This also
speeds up image creation appreciably.

Reviewed by:	marcel
Sponsored by:	DARPA, AFRL
2013-02-20 15:25:40 +00:00
Brooks Davis
b0d9adde80 Add a -D flag that causes duplicate entries in an mtree manifest to be
treated as warnings rather than errors.

Reviewed by:	marcel
Sponsored by:	DARPA, AFRL
2013-02-20 15:18:42 +00:00
Simon J. Gerraty
f5f7c05209 Updated dependencies 2013-02-16 01:23:54 +00:00
Simon J. Gerraty
23090366f7 Sync from head 2012-11-04 02:52:03 +00:00
Simon J. Gerraty
31c0b21fed If no contents keyword is specified, the default for files is
the named file.

Approved by:	marcel (mentor)
2012-11-03 00:10:30 +00:00
Matthew D Fleming
b424efd5b1 Fix usr.bin/ and usr.sbin/ build with a 64-bit ino_t.
Original code by:	Gleb Kurtsou
2012-09-27 23:31:19 +00:00
Joel Dahl
b47c28f3ba Remove trailing whitespace. 2012-08-31 16:57:16 +00:00
Hiroki Sato
0f065c85a8 Sort options. 2012-08-22 19:27:42 +00:00
Marcel Moolenaar
7750ad47a9 Sync FreeBSD's bmake branch with Juniper's internal bmake branch.
Requested by: Simon Gerraty <sjg@juniper.net>
2012-08-22 19:25:57 +00:00
Hiroki Sato
99c841b11e Add -p flag to create the image as a sparse file.
Submitted by:	Shesha Sreenivasamurthy
PR:		bin/167779
2012-08-22 06:37:30 +00:00
Mateusz Guzik
1ec9bedabe Remove unused member of struct indir (in_exists) from UFS and EXT2 code.
Reviewed by:	mckusick
Approved by:	trasz (mentor)
MFC after:	1 week
2012-08-17 17:45:27 +00:00
Andreas Tobler
bff5cf1648 - Write the ISO9660 descriptor after the apm partition entries.
- Fill the needed pmPartStatus flags. At least the OpenBIOS
  implementation relies on these flags.

This commit fixes the panic seen on OS-X when inserting a FreeBSD/ppc disc.
Additionally OpenBIOS recognizes the partition where the boot code is located.
This lets us load a FreeBSD/ppc PowerMac kernel inside qemu.

PR:	powerpc/162091
MFC after:	1 week
2012-04-02 16:26:32 +00:00
Jung-uk Kim
688aaa098d Allow contents of multiple directories to be merged to the current image.
Note this patch was submitted to NetBSD and they already adopted it.

http://mail-index.netbsd.org/source-changes/2012/01/28/msg031078.html

MFC after:	1 week
2012-01-31 00:32:37 +00:00
Hiroki Sato
a22ed494f8 Fix a SIGSEGV problem in directory entry renaming. 2012-01-25 07:45:15 +00:00
Eitan Adler
43074f1626 Fix warning when compiling with gcc46:
error: variable 'parentrecnum' set but not used

Approved by:    dim, cperciva (mentor, blanket for pre-mentorship already-approved commits)
MFC after:      3 days
2012-01-20 01:38:35 +00:00
Eitan Adler
460c768f9a Fix a variety of warnings when compiling with gcc46
Approved by:	dim, cperciva (mentor, blanket for pre-mentorship already-approved commits)
MFC after:	3 days
2012-01-20 01:38:28 +00:00
Eitan Adler
92da524baa Fix warning when compiling with gcc46:
error: variable 'temp' set but not used

Approved by:	dim
Approved by:	cperciva (mentor, blanket for pre-mentorship already-approved commits)
MFC after:	3 days
2012-01-20 01:38:21 +00:00
Ulrich Spörlein
3df5ecac8c Spelling fixes for usr.sbin/ 2011-12-30 10:58:14 +00:00