summaryrefslogtreecommitdiff
path: root/usr.sbin/makefs
AgeCommit message (Collapse)Author
2023-06-03adapt to ${CC_WNO_ADDRESS_OF_PACKED_MEMBER}lukem
Simplify CWARNFLAGS to use ${CC_WNO_ADDRESS_OF_PACKED_MEMBER} which works for both clang and gcc, and remove compiler-specific equivalents.
2023-06-03bsd.own.mk: rename GCC_NO_* to CC_WNO_*lukem
Rename compiler-warning-disable variables from GCC_NO_warning to CC_WNO_warning where warning is the full warning name as used by the compiler. GCC_NO_IMPLICIT_FALLTHRU is CC_WNO_IMPLICIT_FALLTHROUGH Using the convention CC_compilerflag, where compilerflag is based on the full compiler flag name.
2023-06-03bsd.own.mk: rename to CC_WNO_ADDRESS_OF_PACKED_MEMBERlukem
Provide a single variable CC_WNO_ADDRESS_OF_PACKED_MEMBER with options for both clang and gcc, to replace CLANG_NO_ADDR_OF_PACKED_MEMBER CC_NO_ADDR_OF_PACKED_MEMBER GCC_NO_ADDR_OF_PACKED_MEMBER Using the convention CC_compilerflag, where compilerflag is based on the full compiler flag name.
2023-04-18Move date setting into cd9660_populate_iso_dir_record so there is nochristos
path that leaves it unset. From FreeBSD https://reviews.freebsd.org/D39258
2023-04-18We previously attempted to emit Rock Ridge NM records only when the namechristos
represented by the Rock Ridge extensions would actually differ. We would omit the record for an all-upper-case directory name, however Linux (and perhaps other operating systems) map names with no NM record to lowercase. This affected only directories, as file names have an implicit ";1" version number appended and thus always differ. To solve, just emit NM records for all entries other than DOT and DOTDOT . We could continue to omit the NM record for directories that would avoid mapping (for example, one named 1234.567) but this does not seem worth the complexity. From FreeBSD https://reviews.freebsd.org/D39258
2023-04-18The boot catalog pointer is a DWord, but we previously populated it viachristos
cd9660_bothendian_dword which overwrote four unused bytes following it. See El Torito 1.0 (1995) Figure 7 for details. Found by Coverity on FreeBSD
2023-04-18See RRIP 4.1.4 Description of the "NM" System Use Entry for details.christos
From FreeBSD
2023-04-18The bit definitions for the TF_* timestamp bits (TF_MODIFY, etc.) werechristos
incorrect, and timestamps were written in the wrong order. See RRIP 4.1.6 Description of the "TF" System Use Entry for details. From: https://reviews.freebsd.org/D39221
2023-03-14In bwrite() if the write() returned -1, the associated errno waskre
being used after a (possible) call to printf (only happens when debugging) and a certain call to free() (via brelse()). Make a copy, and use that instead.
2023-03-14Use %zd to print ssize_t (%z[uxo] for size_t), rather than %jdkre
(just like the other adjacent printfs do) Should fix i386 build.
2023-03-13Don't brelse() if bread() fails. The kernel does this for us. Our bread()christos
implementation just exits on failure, but if it didn't we would double-free. From Ed Maste (https://reviews.freebsd.org/D39069)
2023-03-13modernize; release bpp and set it to NULL as the kernel does even if wechristos
never return here.
2023-01-07ufs: fixed signed/unsigned bugs affecting large file systemschs
Apply these commits from FreeBSD: commit e870d1e6f97cc73308c11c40684b775bcfa906a2 Author: Kirk McKusick <mckusick@FreeBSD.org> Date: Wed Feb 10 20:10:35 2010 +0000 This fix corrects a problem in the file system that treats large inode numbers as negative rather than unsigned. For a default (16K block) file system, this bug began to show up at a file system size above about 16Tb. To fully handle this problem, newfs must be updated to ensure that it will never create a filesystem with more than 2^32 inodes. That patch will be forthcoming soon. Reported by: Scott Burns, John Kilburg, Bruce Evans Followup by: Jeff Roberson PR: 133980 MFC after: 2 weeks commit 81479e688b0f643ffacd3f335b4b4bba460b769d Author: Kirk McKusick <mckusick@FreeBSD.org> Date: Thu Feb 11 18:14:53 2010 +0000 One last pass to get all the unsigned comparisons correct. In additional to the changes from FreeBSD, this commit includes quite a few related changes to appease -Wsign-compare.
2022-11-17Restore backward compatibility of UFS2 with previous NetBSD releases bychs
disabling support in UFS2 for extended attributes (including ACLs). Add a new variant of UFS2 called "UFS2ea" that does support extended attributes. Add new fsck_ffs operations "-c ea" and "-c no-ea" to convert file systems from UFS2 to UFS2ea and vice-versa (both of which delete all existing extended attributes in the process).
2022-10-26fix various typos in comments and makefs README file.andvar
2022-05-08Revert, sorry this was not intended to be committed.reinoud
2022-05-07When creating disc images, keep the proposed size a multiple of the blockingnrreinoud
for good measure; this prevents possible burning/copying issues on packet media.
2022-04-26Avoid warning by clang of unused variablereinoud
While here, use the computated obj_size even though it's always the same as its information length since we don't use extended attribute files or stream directories.
2022-04-26Fix endian bug that resulted in UniqueIDs of 0 in file identifiers; note thatreinoud
the the unique ID in a longad stored in a FID is 32 bit where in the file descriptor (fe/efe) its 64 bits long.
2022-04-26No need to use ceilf() when ceil() is already usedreinoud
2022-04-26Fix endian bug in makefs for udfreinoud
2022-04-10makefs(8): Fix tool build -- no libutil DPADD if HOSTPROG.riastradh
2022-04-09makefs(8): Needs -lm for ceil in udf as a host tool too.riastradh
2022-04-09makefs(8): Nix trailing whitespace.riastradh
Computed by machine, eyeballed by hand, so to speak.
2022-04-06udf.c uses math library functions.hauke
2022-04-06makefs: fix some typoswiz
2022-04-06new sentence, new linewiz
2022-04-06Refactor and rewrite of newfs_udf(8) and makefs(8) (-t udf) with a sharedreinoud
section for fsck_udf(8). Newfs_udf and makefs support predefined disc image profiles, harddisc partitions (disklabel and wedges on all generic block devices) and all optical media types on CD/DVD/BD writers. Newfs_udf and makefs now also support formatting of UDF 2.50 with a metadata partition.
2022-04-02Avoid integer overflow on systems with 32bit disk addresses.mlelstv
2022-03-06Make sure daddr_t is a 64 bit type when building tools.hgutch
(see also PR sw-bug/56742 ).
2022-02-11A component name is a counted string (cn_nameptr, cn_namelen),hannken
not a zero terminated string cn_nameptr. Change the following operations to work with counted strings: v7fs_file_lookup_by_name() v7fs_file_allocate() v7fs_file_deallocate() v7fs_directory_add_entry() v7fs_directory_remove_entry() v7fs_file_rename() v7fs_file_link() v7fs_dirent_filename() Adapt all vnode operations with component names as argument.
2021-12-21s/filname/filename/andvar
2021-11-12Explain cd9660 and udf exceptions on the rule that the default sectorsize isreinoud
512.
2021-10-23Sanitize the symbol namespace. NFC.thorpej
2021-10-23Factor out the lookup results from struct denode.hannken
No functional change.
2021-08-21s/helt/held+s/eroneously/erroneously/+s/splitted/split/+s/recommented/recomm ↵andvar
ended/
2021-04-03Add a -L option to follow all symbolic links. Useful if you have symlinkssimonb
in a makefs directory tree but want to refer to the actual file.
2020-11-15Add "efi" as a supported boot image type and derive the platform ID forjmcneill
the validation entry from the default boot image instead of hard-coding X86.
2020-11-10rock_ridge_move_count is only incremented and can never be negative so changereinoud
%08i to %08u. This removes a warning when compiling with tools outside ./build.sh
2020-09-06add support for new GCC 9 warnings that may be too much to fixmrg
right now. new address-of-packed-member and format-overflow warnings have new GCC_NO_ADDR_OF_PACKED_MEMBER amd GCC_NO_FORMAT_OVERFLOW variables to remove these warnings. apply to a bunch of the tree. mostly, these are real bugs that should be fixed, but in many cases, only by removing the 'packed' attribute from some structure that doesn't really need it. (i looked at many different ones, and while perhaps 60-80% were already properly aligned, it wasn't clear to me that the uses were always coming from sane data vs network alignment, so it doesn't seem safe to remove packed without careful research for each affect struct.) clang already warned (and was not erroring) for many of these cases, but gcc picked up dozens more.
2020-04-18Remove unused variable (to fix the build)martin
2020-04-18Believe the datablocks predictor when determining if data on a node getsreinoud
stored internal or not. Also make a note that the datablocks predictor takes NO extended attributes stored in the node into account In rare cases it could lead to confusion where the predictor would say it wouldn't fit internally when it could just have fitted. This would trigger the assertion. Now it will on rare accasions create a datablock even though it might have fitted.
2020-04-04Indent the makefs(8) options for UDF like the other filesystems described.reinoud
2020-03-26Fix the build, use %jd and (intmax_t) cast for big numbers, off_tkre
and ptrdiff_t aren't always the same size.
2020-03-25improve error messages.christos
2019-11-06Correct documentation of -m and -M.christos
From Ed Maste @ FreeBSD
2019-10-18 s/initalize/initialize/ in comment or printf message.msaitoh
2019-10-13introduce some common variables for use in GCC warning disables:mrg
GCC_NO_FORMAT_TRUNCATION -Wno-format-truncation (GCC 7/8) GCC_NO_STRINGOP_TRUNCATION -Wno-stringop-truncation (GCC 8) GCC_NO_STRINGOP_OVERFLOW -Wno-stringop-overflow (GCC 8) GCC_NO_CAST_FUNCTION_TYPE -Wno-cast-function-type (GCC 8) use these to turn off warnings for most GCC-8 complaints. many of these are false positives, most of the real bugs are already commited, or are yet to come. we plan to introduce versions of (some?) of these that use the "-Wno-error=" form, which still displays the warnings but does not make it an error, and all of the above will be re-considered as either being "fix me" (warning still displayed) or "warning is wrong."
2019-02-03- add or adjust /* FALLTHROUGH */ where appropriatemrg
- add __unreachable() after functions that can return but won't in this case, and thus can't be marked __dead easily
2018-09-03Rename min/max -> uimin/uimax for better honesty.riastradh
These functions are defined on unsigned int. The generic name min/max should not silently truncate to 32 bits on 64-bit systems. This is purely a name change -- no functional change intended. HOWEVER! Some subsystems have #define min(a, b) ((a) < (b) ? (a) : (b)) #define max(a, b) ((a) > (b) ? (a) : (b)) even though our standard name for that is MIN/MAX. Although these may invite multiple evaluation bugs, these do _not_ cause integer truncation. To avoid `fixing' these cases, I first changed the name in libkern, and then compile-tested every file where min/max occurred in order to confirm that it failed -- and thus confirm that nothing shadowed min/max -- before changing it. I have left a handful of bootloaders that are too annoying to compile-test, and some dead code: cobalt ews4800mips hp300 hppa ia64 luna68k vax acorn32/if_ie.c (not included in any kernels) macppc/if_gm.c (superseded by gem(4)) It should be easy to fix the fallout once identified -- this way of doing things fails safe, and the goal here, after all, is to _avoid_ silent integer truncations, not introduce them. Maybe one day we can reintroduce min/max as type-generic things that never silently truncate. But we should avoid doing that for a while, so that existing code has a chance to be detected by the compiler for conversion to uimin/uimax without changing the semantics until we can properly audit it all. (Who knows, maybe in some cases integer truncation is actually intended!)