Commit graph

70 commits

Author SHA1 Message Date
Ben Gras
fcce231cb7 Fix passwd entries, from old format to new.
Change-Id: I78278f0cdc6b9b87bf9b3a14970a462037589d87
2014-07-28 17:05:53 +02:00
Lionel Sambuc
18f97ad415 Workaround missing lchmod/lchown
Change-Id: I231a0010722619d389b763af35ff55f84ca9cb76
2014-07-28 17:05:20 +02:00
Lionel Sambuc
84d9c625bf Synchronize on NetBSD-CVS (2013/12/1 12:00:00 UTC)
- Fix for possible unset uid/gid in toproto
 - Fix for default mtree style
 - Update libelf
 - Importing libexecinfo
 - Resynchronize GCC, mpc, gmp, mpfr
 - build.sh: Replace params with show-params.
     This has been done as the make target has been renamed in the same
     way, while a new target named params has been added. This new
     target generates a file containing all the parameters, instead of
     printing it on the console.
 - Update test48 with new etc/services (Fix by Ben Gras <ben@minix3.org)
     get getservbyport() out of the inner loop

Change-Id: Ie6ad5226fa2621ff9f0dee8782ea48f9443d2091
2014-07-28 17:05:06 +02:00
Ben Gras
ad9df9a490 <sys/syslimits.h>
reduces differences, raise NAME_MAX

Change-Id: I2e5f6296e6539162c52fdf13fb1fd27a56587e0c
2014-03-03 20:47:06 +01:00
Lionel Sambuc
d3b0a89bab include/unistd.h: merged
Also removing lseek64, pread64, pwrite64.

Those functions have lost their "raison d'être", when off_t switched to
64bits.

Change-Id: I5aea35f01d6d10e3d6578a70323da7be5eca315a
2014-03-03 20:47:02 +01:00
Lionel Sambuc
afc1f71188 include/paths.h: merged
Change-Id: I5e2aa0bc99a596f82ef4224f22623bcb83cb98b5
2014-03-03 20:47:01 +01:00
Lionel Sambuc
3eaea2dc69 Updating usr.sbin/user
Change-Id: I5968d25f0a0efd590e6d664d3a2d182a87755e3d
2014-03-03 20:45:28 +01:00
Gerard
78da142dab Replaced common u64.h functions with operators.
Change-Id: I71b7b4879209eeff89ce5748d67102afebf871dc
2014-03-02 12:28:32 +01:00
Ben Gras
6c8f7fc3ba netbsd dirent.h, import sys/sys *.h, mfs cleanup
. add all sys/sys headers not already present to help compiling
	. take netbsd dirent.h and struct dirent; main result is
	  introducing d_type and d_namlen that have to be set by getdents()
	  in all FS code implementing it
	. d_off is gone
	. alignment of the struct has become 8 bytes instead of 4
	. remove _MAX_BLOCK_SIZE, _MIN_BLOCK_SIZE, _STATIC_BLOCK_SIZE
	. libminlib: cleanup unused yet duplicate code
	. mfs: throw out the long-broken v1, v2 support
	. new test for dirent contents filled by getdents()

Change-Id: I1459755c7ba5e5d1c9396d3a587ce6e63ddc283e
2014-03-01 09:04:59 +01:00
David van Moolenbroek
0cea0924a6 Import NetBSD vndconfig(8)
The tool has been changed heavily to match our VND driver model.

NetBSD is in the process of renaming it from vnconfig(8) to
vndconfig(8). To keep things in sync, we have to play along.

Change-Id: Ie86df184f03ab00573ea76b43c9caa0412e8321d
2014-03-01 09:04:54 +01:00
Ben Gras
a4a97fe8c9 mkfs.mfs, mkproto: minor features
. mkfs.mfs: -T option to set timestamp of files on FS
	. mkproto: normalize (sort) order of directory entries
	. mkproto bugfix: always print mode in 3 digits (%03o)

Change-Id: Ice06d5f05500cd2ac9b063156c340b8f78fe6441
2013-11-19 15:58:05 +00:00
Gerard
f1b0deacf3 Replaced add64, add64u and add64ul with operators.
Change-Id: Ia537f83e15cb686f1b81b34d73596f4298b0a924
2013-11-13 13:11:33 +00:00
Thomas Cort
9a00643262 Importing usr.sbin/unlink
No Minix-specific changes needed

Change-Id: Iab2345f6a661e1c1f21f8ae1a414b88762de26fc
2013-11-09 20:37:49 -05:00
Thomas Cort
a852ef4bac Importing usr.sbin/link
No Minix-specific changes needed

Change-Id: If202c617d5fa72b1c4ad5515637cdc0ee6f2d6ca
2013-11-09 20:37:43 -05:00
Ben Gras
8dbe32610b mkfs.mfs -I: insert fs at offset feature
. use it in x86_hdimage.sh:
	  avoid copying big FS images into iso & hd images each time

Change-Id: I0775f43cd1821ea7be2fec5b96d107a68afb96d6
2013-11-08 11:59:47 +00:00
Ben Gras
09143af258 x86_hdimage.sh -i: crossbuild x86 release CD
. build writeisofs as a native tool too for it
        . also mkfs.mfs: make missing file in proto nonlethal
        . make setup script a little more self-sufficient
        . hdboot: use INSTALL_FILE instead of INSTALL so that the
          results get added to the METALOG

Change-Id: Id233e4c861f81046bf6c4be0510b8a3bf39ff9be
2013-11-07 13:44:22 +00:00
Lionel Sambuc
ffba9c2def Fix out of array bounds errors with -O3
When compiling with -O3 gcc seems to be a lot stricter on its checks for
index out of bounds error.

Change-Id: I5a63e1db6aa2375223ff13c6352643a9804fa93d
2013-10-08 11:43:31 +02:00
Ben Gras
3161c603a6 increase -Werror resilience
for bin/, commands/, libexec/, sbin/, test/, usr.bin/ and usr.sbin/.

Change-Id: I8fa12c3cd86865311cef71b7faa7cf4fa785174f
2013-08-21 13:53:39 +02:00
Thomas Cort
3c59273c97 Importing usr.sbin/i2cscan
Change-Id: I7b776d6e5f3fe4f7a1af353b995ef9e2e752c7ea
2013-07-15 11:11:13 -04:00
Qi Yong
61f6e2f5f0 fix some comment typo's
Change-Id: Ic9f4333613abb858bfc28f72685424557cf2cd40
2013-05-26 14:12:54 +00:00
Lionel Sambuc
e1acf37d77 usr.sbin/mkfs: Allow -b SIZE with proto file
Previously, if a proto file was given, the -b argument would be ignored.

Also added:
 - if the number of inodes is not given, then an estimation is used.
 - sanity checks where moved from one special case to the general case.

Change-Id: I2abfa52bf34206c9087c64b5bfc26af866eb47cb
2013-05-24 11:08:15 +02:00
Ben Gras
fd5f2edf35 mkfs: only complain about failing stat with -d
mkfs -d is a feature that needs a stat() of the mkfs binary, which
often fails (as mkfs is often not invoked with a full path or from
the same directory). it makes setup look a bit messy as the error
is always printed while installing the system, for each created FS,
even though the situation is harmless. This change only complains
when the stat is actually needed (-d).

Change-Id: I54ac01505aa97c1cbe40456c04a35aed5a7ee953
2013-05-23 12:09:38 +02:00
Antoine Leca
e35821b207 mkfs.mfs: various programs
Split in as many programs as needed to support various variants of MFS
Manual page updated (in mandoc format)
2013-05-13 11:18:15 +02:00
Antoine Leca
49fe5d1617 mkfs reloaded
* restored the zone>block stuff
* generalized the support for more-than-1-block bitmaps to also deal
  with big inodes maps in small blocks
* improved pexit() to printf-like syntax; also replaced pexit() with
  err() or errx() where there are no reference to proto lines
* unified the allocation of blocks to all use alloc_block() instead
  of raw malloc half of the time
* removed the V2_ d2_ etc. prefixes which are obscure and obsolete

While here, also
* used new-form definitions, and closer to KNF style in general
* used often-built-ins such as mem* or strncpy where relevant
* pruned a fair amount of constants which are irrelevant

Thanks to Thomas V. and Lionel who did a good amount of work with the
cross-compilation stuff and made that change to be much smoother.
2013-05-13 11:17:34 +02:00
Ben Gras
236a320240 mkfs.mfs: double indirect block support
. allows >4MB files for default 4k block size

Change-Id: I09277fc3704fac1a44af82202c11435dc7ae8d55
2013-04-27 16:25:45 +02:00
Kees Jongenburger
04ad4fa1a2 mkfs.mfs:add comment about the overflow check.
Change-Id: I1f09c3a62377164296037f6dc9b7874023123311
2013-04-19 13:10:06 +02:00
Kees Jongenburger
a4eca06cca mkfs.mfs:fix to allow to fill larger file systems.
Allow the number of written blocks to exceed 8 * block_size.

Change-Id: I301ce46a92d86c6220c3af2acee22db26a4b4496
2013-04-19 13:10:06 +02:00
Kees Jongenburger
15bb31ed99 mkfs.mfs:remove MFS V1 related headers.
Change-Id: I46a8128f54112ee0092ef60160d88cadd0038be0
2013-04-19 13:10:06 +02:00
Kees Jongenburger
1beca4b7f5 mkfs.mfs:remove some globals
Remove the gobal inocount, zonecount and blockcount.

Change-Id: I77d120bb79bcf183e0c6b5abed736343af7badf2
2013-04-19 13:10:06 +02:00
Thomas Cort
a0a1440a52 remove utimes() workarounds
With the addition of utimes(), we can remove the workarounds
and use the original NetBSD code for timestamping files.

Also restore use of -p & -r for install while building
2013-04-12 18:55:40 +00:00
Antoine Leca
9131e98a7d utimens(2) system call
Variant of utime(2) with struct timespec (with ns precision)
instead of time_t values; also allows for tv_nsec members
the values UTIME_NOW (force update to current time) or
UTIME_OMIT (allow to set either atim or mtim independently.)

Provides a superset of utimes(2), futimes(2), lutimes(2),
and futimens(2).
Provides the same subset of utimensat(2) as does NetBSD 6.
Also import utimens() and lutimeNS() from NetBSD-current.
2013-04-12 18:55:39 +00:00
Thomas Cort
8357e3a442 Importing usr.sbin/rdate
Import the NetBSD rdate command and remove the Minix rdate command.
The default behaviour for both is the same. The NetBSD version adds
options to just display the time, adjust the time using adjtime(),
and set the time without printing the time.

Porting Notes:
 - Compiles cleanly out of the box without any warnings
 - Path changes from /usr/bin/rdate to /usr/sbin/rdate
 - checked pkgsrc for any usages of rdate (none found)
 - checked src for any usages of rdate (none found)

Testing:
 - all command line options work (tested with time.nist.gov server)
 - Native and cross build OK

Change-Id: I613449763891a896527f337999c006a970c3924c
2013-04-08 08:37:04 +02:00
Lionel Sambuc
b622d2b795 mkfs.mfs fixup
For the special case of crossbuilding minix on minix.
2013-04-03 15:57:04 +02:00
Lionel Sambuc
f640210005 Removing obsolete _NBSD_LIBC define
Change-Id: Ia6ce84ccdf36cf6f64540b990baaa7d85c53533d
2013-02-26 09:44:24 +00:00
Lionel Sambuc
8e4736f2df Removing obsolete _MINIX define
Change-Id: Id33ac7e973d1c0e249b690fe44a597474fac6076
2013-02-26 09:44:20 +00:00
David van Moolenbroek
16440d9b8f installboot: allow installation into disk
Previously, installboot would require that the given target device is
a partition. This is not strictly necessary: MINIX3 can also be
installed (manually) into one or more primary partitions, requiring
that the installboot target be the entire disk. With this patch,
specifying a disk as target is now allowed, as long as the -f (force)
option is given.
2013-02-16 22:58:53 +01:00
Lionel Sambuc
96836647f8 Fixing cross build i386 on minix 2013-01-23 21:03:38 +01:00
Lionel Sambuc
0ac803292e Fix warnings trivial warnings.
Fix warnings about:
 . Unused variables
 . format mismatch in printf/scanf format string and arguments
 . Missing parenthesis around assignment as truth values
 . Clang warnings anout unknown GCC pragma
2013-01-14 11:44:31 +01:00
Lionel Sambuc
f14fb60209 Libraries updates and cleanup
* Updating common/lib
 * Updating lib/csu
 * Updating lib/libc
 * Updating libexec/ld.elf_so
 * Corrected test on __minix in featuretest to actually follow the
   meaning of the comment.
 * Cleaned up _REENTRANT-related defintions.
 * Disabled -D_REENTRANT for libfetch
 * Removing some unneeded __NBSD_LIBC defines and tests

Change-Id: Ic1394baef74d11b9f86b312f5ff4bbc3cbf72ce2
2013-01-14 11:36:26 +01:00
Thomas Veerman
ac7451d11b mkfs.mfs: __dead and __UNCONST are unknown on Linux
Including nbtool_config.h takes care of that deficiency when cross
compiling.
2012-11-26 16:18:32 +00:00
Thomas Veerman
d9f4f71916 Implement dynamic mtab support
With this patch /etc/mtab becomes obsolete.
2012-11-26 15:20:18 +00:00
Lionel Sambuc
b8a678ef1d Cross compile on minix support
* Remade patch so it works with minix patch tool.

 * New MINIX tar support -ox, so revert back to it

   In fetch scripts, tar had been replaced by bsdtar as the prebvious
   tar did not support the -o flag under minix, which is required to
   prevent usage of tar file stored user and group information.

   This introduces portability problems. As our new tar tool now
   support that flag revert back to improve portability.
2012-11-15 16:07:30 +01:00
Lionel Sambuc
d19d7d58aa Toolchain upgrade and portability improvements.
upgrade to NetBSD CVS release from 2012/10/17 12:00:00 UTC

Makefiles updates to imporve portability

Made sure to be consistent in the usage of braces/parenthesis at
least on a per file basis. For variables, it is recommended to
continue to use braces.
2012-11-15 16:07:29 +01:00
Lionel Sambuc
9152e1c5a7 Upgrading build system to new NetBSD revision
The tested targets are the followgin ones:
 * tools
 * distribution
 * sets
 * release

The remaining NetBSD targets have not been disabled nor tested
*at all*. Try them at your own risk, they may reboot the earth.

For all compliant Makefiles, objects and generated files are put in
MAKEOBJDIR, which means you can now keep objects between two branch
switching. Same for DESTDIR, please refer to build.sh options.

Regarding new or modifications of Makefiles a few things:
 * Read share/mk/bsd.README
 * If you add a subdirectory, add a Makefile in it, and have it called
   by the parent through the SUBDIR variable.
 * Do not add arbitrary inclusion which crosses to another branch of
   the hierarchy; If you can't do without it, put a comment on why.
   If possible, do not use inclusion at all.
 * Use as much as possible the infrastructure, it is here to make
   life easier, do not fight it.

Sets and package are now used to track files.
We have one set called "minix", composed of one package called "minix-sys"
2012-11-15 16:07:29 +01:00
Ben Gras
77b6e2dcaa mkfs: support indirect blocks in directories 2012-11-07 23:16:42 +01:00
Ben Gras
6463554619 mkfs: move directory entry manipulation 2012-11-07 23:16:41 +01:00
Ben Gras
960c93c6f7 mkfs: drop support for zone != block 2012-11-07 23:16:40 +01:00
Ben Gras
9d9a90c118 mkfs: drop support for running on DOS 2012-11-07 23:16:39 +01:00
Ben Gras
ca2255201b mkfs: separate inode retrieval function 2012-11-07 23:16:38 +01:00
Ben Gras
ba468a6052 mkfs: drop support for creating non-v3 FSes 2012-11-07 23:16:37 +01:00