339048 |
01-Oct-2018 |
asomers |
MFC r336582:
makefs(8): add test case for PR 229929
Fix two failing makefs test cases by adding "-M 1m", which was already used for every other FFS test case. Add a new test case for the underlying issue: with no -M, -m, or -s options, makefs can underestimate image size.
PR: 229929 Reported by: Jenkins |
332983 |
25-Apr-2018 |
benno |
MFC r331463 (partial), r331467, r331468, r331843
r331463, r331467, and r331468 are all replaced by r331843 but are included for completeness' sake. r331463 also contained a change to release/amd64/mkisoimages.sh which I've left out since those changes were also obsoleted by a later commit which will be merged later.
r331843:
Synchronise with NetBSD's version of EFI handling for El Torito images.
Sponsored by: iXsystems, Inc. |
330976 |
15-Mar-2018 |
eadler |
MFC r303036,r303038,r306822,r307923,:
makefs: reorder 'usage' alphabetically
From NetBSD, Mon Aug 15 14:45:01 2011 +0000 (wiz)
Re-order `usage' alphabetically; rename option arguments in the manpage's `SYNOPSIS' section to match those from `usage' (not the other way around; the `usage'-line (and other parts of makefs.c) contain the correct names); minor punctuation improvements.
From Snader_LB.
makefs.8 1.36 makefs.c 1.30
Obtained from: NetBSD
------------------------------------------------------------------------ r303038 | emaste | 2016-07-19 18:40:54 +0000 (Tue, 19 Jul 2016) | 56 lines
makefs: sync NetBSD IDs with upstream for changes that we already have
May 22 21:51:39 2011 +0000 (christos):
From Nathan Whitehorn (nwhitehorn at freebsd dot org): Add code to generate bootable ISOs on Powermac and CHRP systems. Synthesize some partition maps (APM and MBR, respectively) pointing to (a) the whole disk, and (b) relevant El Torito boot images that have been added by other code. These partition maps are a little bit funny looking, but they seem to work. FreeBSD has been using this successfully in their release generation on powerpc, as well as generating all non-SPARC install media. SPARC support could probably be added as an extension of this patch.
makefs.8 1.33
Tue Aug 23 17:09:11 2011 +0000 (christos):
PR/45285: Martin Matuska: makefs does not properly convert ISO level 1 and 2 filenames (buffer overflow)
makefs does not properly verify the maximum filename length in the special "." case for both ISO level 1 and ISO level 2 filename conversion. This creates broken images or causes a buffer overflow (ISO level 2).
ISO level 1: If a filename contains only dots or up to 8 characters followed by dots the 8+3 limit check doesn't work.
ISO level 2: If a filename contains a dot in the first 30 characters and a dot on the 30th character, the length limit check doesn't work and the buffer is overflowed.
$ mkdir level1 $ touch level1/12345............ $ makefs -t cd9660 -o isolevel=1 test.iso level1
$ mkdir level2 $ touch level2/1234567890.2345678901234567.....34567890123456789012345 $ makefs -t cd9660 -o isolevel=2 test.iso level2
cd9660.c 1.32
Sun Oct 9 21:33:43 2011 +0000 (christos):
add support for setting the ufs label. (Nathan Whitehorn)
ffs.c 1.45 ffs.h 1.2 mkfs.c 1.22 makefs.8 1.37
Obtained from: NetBSD
------------------------------------------------------------------------ r306822 | emaste | 2016-10-07 19:12:15 +0000 (Fri, 07 Oct 2016) | 4 lines
makefs: diff reduction with NetBSD
Obtained from: NetBSD usr.sbin/makefs/cd9660.c 1.33
------------------------------------------------------------------------ r307923 | marcel | 2016-10-25 16:21:38 +0000 (Tue, 25 Oct 2016) | 7 lines
Allow building makefs(8) from another Makefile (such as one in a seperate directory hierarchy used to build tools). This boils down to replacing the use of ${.CURDIR} with either ${SRCDIR} or ${SRCTOP}. SRCDIR is defined as the directory in which the Makefile lives that bmake(1) is currently reading. Use SRCTOP when reaching outside of makefs's directory. |
329099 |
10-Feb-2018 |
kevans |
MFC Loader Fixes 2017q1: r311458,r312237,r312314,r312374,r312947,r313042, r313047,r313166,r313328,r313332,r313333,r313337,r313348,r313349,r313389, r313442,r313451,r313575,r313645,r313710,r314114,r314213,r314275,r314945, r314948,r315008,r315408,r315427,r315645,r315646,r315648,r315653,r315850, r316064,r316078,r316079,r316100,r316104,r316111,r316112,r316171,r316279, r316280,r316287,r316311,r316343,r316424,r316436
r311458: Use compiler driver to link BERI boot loaders
r312237: loader.efi: find_currdev() can leak memory
r312314: loader: move device path definitions to include/efidevp.h
r312374: loader: efi devpath api usage should be more aware of NULL pointers
r312947: Remove "-Xassembler -G0" from CFLAGS.
r313042: loader.efi environment related cleanups
r313047: loader: disk/part api needs to use uint64_t offsets
r313166: loader: libefi/env.c warnings in arm build
r313328: loader: Implement disk_ioctl() to support DIOCGSECTORSIZE and DIOCGMEDIASIZE.
r313332: loader: bcache read ahead block count should take account the large sectors
r313333: loader: Replace EFI part devices.
r313337: loader: 313329 missed ZFS guard in loader/main.c
r313348: loader: biosdisk fix for 2+TB disks
r313349: loader: disk io should not use alloca()
r313389: efipart is also using the '%S' printf format, add -Wno-format for it.
r313442: loader: possible NULL pointer dereference in efipart.c
r313451: loader: possible NULL pointer dereference in bcache.c
r313575: makefs: make the buffer functions look exactly like the kernel ones
r313645: loader: implement MEDIA_FILEPATH_DP support in efipart
r313710: loader: cstyle fixes and DIOCGMEDIASIZE should use uint64_t
r314114: Use LDFLAGS with CC instead of _LDFLAGS.
r314213: Remove control+r handling from geliboot's pwgets()
r314275: Remove unused macro from common/drv.c.
r314945: Some style(9) fixes. No functional changes.
r314948: Try to extract the RFC1048 data from PXE.
r315008: r314948 seems to be missing a variable or two that will break
r315408: loader: remove open_disk cache
r315427: loader: biosdisk should report IO error from INT13
r315645: loader: disk_cleanup was left in userboot_disk.c
r315646: loader: pxe.h constants have wrong values
r315648: libstand: verify value provided by nfs.read_size
r315653: loader: verify the value from dhcp.interface-mtu and use snprintf o set mtu
r315850: The original author abused Nd (one-line description, used by makewhatis)
r316064: Fix build with path names with 'align' or 'nop' in them.
r316078: gpt*boot: Save a bit more memory when LOADER_NO_GELI_SUPPORT is specified
r316079: Simply retire the sedification of the boot2.s file.
r316100: Remove -fno-guess-branch-probability and -fno-unit-at-a-time.
r316104: Use `NO_WCAST_ALIGN` instead of spelling it out as -Wno-cast-align in CFLAGS
r316111: loader: move bios getsecs into time.c
r316112: loader: ls command should display file types properly
r316171: xfsread inlined uses more space, so remove the inline tag.
r316279: loader: efipart should check disk size from partition table
r316280: loader: simplify efi_zfs_probe and avoid double probing for zfs.
r316287: Remove OLD_NFSV2 from loader and libstand
r316311: Add explicit_bzero() to libstand, and switch GELIBoot to using it
r316343: Implement boot-time encryption key passing (keybuf)
r316424: Fix sparc64 build broken by r316343 and r316076
r316436: Restore EFI boot environment functionality broken in r313333
PR: 216940 217298 217935 |
299461 |
11-May-2016 |
cem |
ffs_bswap: Copy one UFS dinode member at a time
No functional change.
Reported by: Coverity CIDs: 974635, 974636, 977396, 977397, 977398, 977399 Sponsored by: EMC / Isilon Storage Division
|
299094 |
04-May-2016 |
ngie |
Merge ^/user/ngie/release-pkg-fix-tests to unbreak how test files are installed after r298107
Summary of changes:
- Replace all instances of FILES/TESTS with ${PACKAGE}FILES. This ensures that namespacing is kept with FILES appropriately, and that this shouldn't need to be repeated if the namespace changes -- only the definition of PACKAGE needs to be changed - Allow PACKAGE to be overridden by callers instead of forcing it to always be `tests`. In the event we get to the point where things can be split up enough in the base system, it would make more sense to group the tests with the blocks they're a part of, e.g. byacc with byacc-tests, etc - Remove PACKAGE definitions where possible, i.e. where FILES wasn't used previously. - Remove unnecessary TESTSPACKAGE definitions; this has been elided into bsd.tests.mk - Remove unnecessary BINDIRs used previously with ${PACKAGE}FILES; ${PACKAGE}FILESDIR is now automatically defined in bsd.test.mk. - Fix installation of files under data/ subdirectories in lib/libc/tests/hash and lib/libc/tests/net/getaddrinfo - Remove unnecessary .include <bsd.own.mk>s (some opportunistic cleanup)
Document the proposed changes in share/examples/tests/tests/... via examples so it's clear that ${PACKAGES}FILES is the suggested way forward in terms of replacing FILES. share/mk/bsd.README didn't seem like the appropriate method of communicating that info.
MFC after: never probably X-MFC with: r298107 PR: 209114 Relnotes: yes Tested with: buildworld, installworld, checkworld; buildworld, packageworld Sponsored by: EMC / Isilon Storage Division
|
298107 |
16-Apr-2016 |
gjb |
Merge the projects/release-pkg branch to head.
This allows packaging the base system with pkg(8), including but not limited to providing the ability to provide upstream binary update possibilities for non-tier-1 architectures.
This merge is a requirement of the 11.0-RELEASE, and as such, thank you to everyone that has tested the project branch.
Documentation in build(7) etc. is still somewhat sparse, but updates to those parts will follow.
Sponsored by: The FreeBSD Foundation
|
290267 |
02-Nov-2015 |
ngie |
Clean up mtree keyword support a slight bit and add a few more default keywords
- Parameterize the mtree keywords as $DEFAULT_MTREE_KEYWORDS - Test with the extra mtree keywords, `mode,gid,uid`. - Add a note about mtrees with time support not working with makefs right now
MFC after: 1 week Sponsored by: EMC / Isilon Storage Division
|
290265 |
02-Nov-2015 |
ngie |
Add testcases for -t cd9660 -o isolevel=[1-3]
-- -o isolevel=1 currently fails because of path comparison issues, so mark it as an expected failure. -- -o isolevel=3 is not implemented, so expect it to fail as an out of bounds value [*].
PR: 203645 MFC after: 1 week X-MFC with: r290264 Sponsored by: EMC / Isilon Storage Division
|
290259 |
02-Nov-2015 |
ngie |
Sync makefs(8) content a bit with src/usr.sbin/makefs/makefs.8@1.53
Sections involving unimplemented filesystems (chfs, msdosfs, udf, v7fs) and options have been omitted.
MFC after: 1 week Obtained from: NetBSD Sponsored by: EMC / Isilon Storage Division
|
289899 |
24-Oct-2015 |
ngie |
Import the fix from NetBSD kern/48852 (sic) to fix rockridge encoding of device nodes
In particular, use st_rdev (the device type), not st_dev (the device inode), and fix the comparison to be correct with the st_rdev field
Bug 203648 MFC after: 2 weeks Submitted by: Thomas Schmitt <scdbackup@gmx.net> Coverity CID: 1008927 Sponsored by: EMC / Isilon Storage Division
|
289897 |
24-Oct-2015 |
ngie |
Add more cd9660/FFS makefs testcases
General changes: - Parameterize out the mount command. - Use mtree to verify the contents of an image (check_image_contents) instead of using diff (diff verifies content, but not file metadata). - Move common logic out to functions (common_cleanup, mount_image, check_image_contents) - Add stub testcases for makefs -D (crashes with SIGBUS, similar to bug # 192839) - Add a note about the ISO-9660 and rockridge specs - Add testcases that exercise: -- Creating disk images from an mtree and multiple directories. -- -F flag use (not really an extensive testcase right now)
cd9660-specific test changes:
- Remove an XXX comment about symlinks; I forgot that non-rockridge images turn symlinks into hardlinks. - Add testcases that exercise: -- -o allow-deep-trees -- -o allow-max-name stub testcase (doesn't seem to be implemented in makefs) -- -o preparer (existence in image; not conformance to spec) -- -o publisher (existence in image; not conformance to spec) -- -o rockridge (basic)
MFC after: 2 weeks Sponsored by: EMC / Isilon Storage Division
|
289743 |
22-Oct-2015 |
ngie |
Revise "create_test_inputs" to simplify the file structure as these testcases don't need to be nested as much as bin/ls/ls_tests.sh do when verifying ls -a, ls -A, etc. This allows the tests to make all paths relative to the top of the temporary directory instead of always tacking on $ATF_TMPDIR, thus complicating things unnecessarily
Create non-empty files in create_test_inputs as well now, similar to create_test_inputs2 in bin/ls/ls_tests.sh
Compare the input files to the output file contents using diff where possible: - Skip over the fifo comparison for now because it always fails - Skip over the symlink comparison on cd9660 because it always fails today
Sponsored by: EMC / Isilon Storage Division MFC after: 2 weeks X-MFC with: r289739
|
289203 |
13-Oct-2015 |
adrian |
makefs: introduce a new option to specify what to round the resulting image up to.
From ticket:
While trying to run FreeBSD/mips on some device having very small flash media, one is forced to compress file system with mkulzma(8) utility. It is desirable to specify small UFS block/fragment sizes like 4096/512 bytes for makefs(8) and big compression block size like 65535 bytes to mkulzma at the same time. Then one obtains very good comression ratios (like 75% and more) but faces the following problem.
geom_uncompress kernel module reports GEOM provider size rounded up to its compression block size. Generally, this changes original media size and now it fails to match the size of embedded UFS file system that leads to other problems, f.e. geom_label kernel module does not like this and skips the file system while tasting the GEOM and looking for UFS label.
This makes it impossible to refer to the file system using known UFS label instead of something like /dev/map/rootfs.uncompress.
The following patch introduces new command line option "-r roundup" for makefs that makes it round up the image to specified block size. Hence, geom_uncompress does not change GEOM media size for images rounded that way and geom_label accepts such GEOMs just fine.
With the patch applied, one can use following commands:
$ makefs -t ffs -r 65536 -o bsize=4096,fsize=512,label=flash optimization=space fs.img fs $ mkulzma -s 65536 -o fs.img.ulzma fs.img
PR: bin/203707 Submitted by: <eugen@grosbein.net>
|
271736 |
18-Sep-2014 |
davide |
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
|
266930 |
31-May-2014 |
jmg |
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..
|
260041 |
29-Dec-2013 |
marius |
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
|
258695 |
27-Nov-2013 |
jmallett |
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.
|
224762 |
10-Aug-2011 |
marius |
Sync makefs(8) ISO 9660 support with NetBSD: o cd9960 -> cd9660 o Move inclusion of sys/endian.h from cd9660_eltorito.c to cd9660.h since actual user is not cd9660_eltorito.c but iso.h and cd9660_eltorito.h.
Actually, include order/place of sys/endian.h doesn't matter on netbsd since it is always included by sys/types.h but it's not true on other system. This should fix cross build breakage on freebsd introduced by rev. 1.16 of cd9660_eltorito.c. Problem reported and fix suggested on twitter. o Fix fd leaks in error cases. Found by cppcheck. o RRIP RE length should be 4, not 0 o Apply fixes for PR bin/44114 (makefs(8) -t cd9660 -o rockridge creates corrupted cd9660fs), iso9660_rrip.c part: - cd9660_rrip_finalize_node() should check rr_real_parent in node->parent, not in node itself in RRIP_PL case - cd9660_rrip_initialize_node() should update only node passed as arg so handle RRIP_PL in DOTDOT case
Fixes malformed dotdot entries in deep (more than 8 level) directories moved into .rr_moved dir.
Should be pulled up to netbsd-5. (no official ISO has such deep dirs, but cobalt restorecd is affected)
Reviewed by: mm Approved by: re (kib) Obtained from: NetBSD MFC after: 3 days
|
224690 |
07-Aug-2011 |
mm |
Fix NetBSD PR bin/44114: makefs with -t cd9660 -o rockridge against directories with deep structure creates a corrupted cd9660 image.
http://gnats.netbsd.org/cgi-bin/query-pr-single.pl?number=44114
Fix NetBSD PR bin/45217: makefs creates ISO9660 images that violate the ECMA-119 (ISO9660) specification. This is caused by erroneously writing 32 bytes with value 0x20 to the volume_set_id field and 128 bytes with value 0x20 to the the following 37-byte fields in the PVD: copyright_file_id, abstract_file_id, bibliographic_file_id
This causes, among other unwanted results the reserved4 field to be overwritten with the value 0x20. To comply with the specification, this field muse be zero. As a result, all FreeBSD distribution images created with makefs have not been 100% valid ISO9660 files.
http://gnats.netbsd.org/cgi-bin/query-pr-single.pl?number=45217
Reviewed by: kientzle Approved by: re (kib) Obtained from: NetBSD MFC after: 3 days
|
223306 |
19-Jun-2011 |
marcel |
Add support for using mtree(5) manifest files to define the image to be created. The support is based on mtree version 2.0, as used in libarchive, but adds new features on top of it.
The current implementation is fully functional, but is envisioned to grow at least the following additional features over time: o Add support for the /include special command so that manifest files can be constructed using includable fragments. o Add support specifying a search path to locate content files. o Content file filters: commands that provide file contents on stdout.
The manifest file eliminates the need to first construct a tree as root in order to create an image and allows images (releases) to be created directly from object trees and/or source trees.
Reviewed by: deo Sponsored by: Juniper Networks, Inc
|
221536 |
06-May-2011 |
nwhitehorn |
Simplify this code somewhat by only writing a 512-byte-sector APM map. All firmwares can read it, we need to write one anyway for old OF versions, and if a 512-byte one is present, OS X ignores the 2048-byte one in favor of it.
|
217769 |
24-Jan-2011 |
mckusick |
The dump, fsck_ffs, fsdb, fsirand, newfs, makefs, and quot utilities include sys/time.h instead of time.h. This include is incorrect as per the manpages for the APIs and the POSIX definitions. This commit replaces sys/time.h where necessary with time.h.
The commit also includes some minor style(9) header fixup in newfs.
This commit is part of a larger effort by Garrett Cooper started in //depot/user/gcooper/posix-conformance-work/ -- to make FreeBSD more POSIX compliant.
Submitted by: Garrett Cooper yanegomi at gmail dot com
|
186261 |
18-Dec-2008 |
sam |
Apply the big hammer: o remove all of compat except for pwcache and strstuftoll; these might end up in libutil or similar so keep them in the subdir o mv getid.c up to the top level; this looks like something that'll be makefs-specific o eliminate private versions of .h files in sys; use system files instead o eliminate private ffs_tables.c; use the system version directly (might want to adopt const'ification at some point but that's the only diff I can see) o mv remaining code from sys to ffs and strip out unused bits; this now becomes part of makefs o add compat defs and shims to makefs.h o strip all vestiges of nbtool_config.h, compat_defs.h, etc. o fixup includes after file shuffling o rename system #defines that do implicit byte swapping to have an _swap suffix; e.g. DIRSIZ -> DIRSIZ_SWAP, cg_inosused -> cg_inosused_swap; if we ever add endian-agnostic support to the kernel these can go back to their original names o strip some netbsd'isms that aren't worth shim'ing (e.g. _DIAGASSERT)
Code compiles w/o complaints but is untested.
|
186256 |
17-Dec-2008 |
sam |
First step toward proper mtree integration: o use mtree code directly from ../mtree; s/spec(fp)/mtree_readspec(fp)/ (assume this will eventually go in usr.sbin) o nuke st_rdev use; there's no reason to create filesystems with device nodes o shim missing compat bits for inotype and nodetoino o remove now unneeded compat/mtree bits, pack_dev.?, and stat_flags.? o temporarily move getid.c code up to compat to keep this building
|