partutil.c::getdiskinfo to use it to get disk geometry info.
Use DIOCGWEDGEINFO ioctl to get information about partition size, if disk
driver doesn't support it use old DIOCGDINFO. This patch adds support for
wedge like devices(lvm logical volumes, ZFS zvol partitions) to newfs and
other tools.
No objections on tech-userlevel@.
it's still reasonable and some kernel code seems to assume it
(otherwise some inode numbers of directories could be corrupted).
XXX: not sure if odd e2fs_ipg is valid or not in ext2fs spec.
- initialize inode generation numbers with random numbers for NFS
like newfs(8) as man page said
XXX: sys/ufs/ext2fs/ext2fs_alloc.c:ext2fs_valloc() seems to override
these generated numbers.
- replace a magic number with a macro
- fix several printf format
- fix possble block sizes for zap_old_sblock()
- use err(3) rather than errx(3) + strerror(errno)
- fix a typo
- misc cosmetics
This is based on the newfs(8) command for ffs, but
most ext2fs specific part is written from scratch.
Tested on alpha, cobalt, i386 and sgimips with some disks and vnd(4),
and at least cobalt's firmware can load boot files from an ext2fs
E2FS_REV0 partition created by this native newfs_ext2fs(8) command.
Closes PR bin/16175.