Age | Commit message (Collapse) | Author | Files | Lines |
|
Supported scenarios:
* internal libuuid (--enable-libuuid, default)
* external libuuid (--disable-libuuid)
- systems without pkg-config
- systems with pkg-config
* systems without libuuid at all (the library is optional for u-l-ng)
Signed-off-by: Karel Zak <kzak@redhat.com>
|
|
Signed-off-by: Karel Zak <kzak@redhat.com>
|
|
Signed-off-by: Karel Zak <kzak@redhat.com>
|
|
Signed-off-by: Karel Zak <kzak@redhat.com>
|
|
/dev/sdb1 originally initialized by cryptsetup:
and OLD mkswap:
# vol_id /dev/sdb1 | grep TYPE
ID_FS_TYPE=swap
# blkid -s TYPE /dev/sdb1
/dev/sdb1: TYPE="crypt_LUKS"
So, we have two different *valid* signatures on the device now!
NEW mkswap:
# blkid -s TYPE /dev/sdb1
/dev/sdb1: TYPE="swap"
# /lib/udev/vol_id /dev/sdb1 | grep TYPE
ID_FS_TYPE=swap
the bootbits (first 1024 bytes) was erased.
We shouldn't zap disk labels (BSD, SUN, ...) and boot loaders (on whole
disk):
# mkswap /dev/sdb2
mkswap: /dev/sdb2: warning: don't erase bootbits sectors
(BSD partition table detected). Use -f to force.
Setting up swapspace version 1, size = 4348 KiB
no label, UUID=69d87cef-71ac-4fb0-a689-ce3e930dea17
# mkswap /dev/sdb
mkswap: /dev/sdb: warning: don't erase bootbits sectors
on whole disk. Use -f to force.
Setting up swapspace version 1, size = 8188 KiB
no label, UUID=97757ad7-8a84-43d9-bcb4-16fefd93a2ac
Signed-off-by: Karel Zak <kzak@redhat.com>
|
|
The kernel has not supported v0 swap space format since 2.5.22. The
new version v1 is supported since 2.1.117.
Signed-off-by: Karel Zak <kzak@redhat.com>
|
|
mkswap (when built 32-bit) could not quite support the maximum size
of swap area (2^32 pages): change unsigned long pagecounts to unsigned
long long pagecounts, and fix maxpages for the case when more is asked.
Signed-off-by: Hugh Dickins <hugh@veritas.com>
|
|
Signed-off-by: Karel Zak <kzak@redhat.com>
|
|
We needn't to duplicate stuff from <sys/param.h>.
Signed-off-by: Karel Zak <kzak@redhat.com>
|
|
The current implementation causes a segmentation fault if
INCLUDE_FS_TESTS is defined, but the -x option is not specified.
The error is caused by the extract_dir variable being null.
Reported-by: Roy Peled <the.roy.peled@gmail.com>
Signed-off-by: Karel Zak <kzak@redhat.com>
|
|
mkfs.cramfs allocates memory based on a calculated upper-bound
of required filesystem size. If there are duplicate files
or hard links, the current implementation unnecessarily increases
the upper-bound per each copy of the file, even though cramfs does
not store copies of contents of identical files.
This patch improves the calculation of fslen_ub, the upper bound
of required filesystem size, by making the upper bound aware of
duplicate files.
This is very helpful for layouts that hold a lot of hard links,
which are seen as duplicate files by mkfs.cramfs. For example,
this drastically reduces the memory requirements for creating
a standard Busybox layout.
Signed-off-by: Roy Peled <the.roy.peled@gmail.com>
|
|
cramfs is an endianness dependent file system. So far, the cramfs
utilities did not support cramfs images of different endianness than
the host machine.
A separate utility, cramfsswap, was required in order to change the
endianness of the image before and after using cramfs utilities. The
extra utility introduced extra maintenance and an additional step in
the process.
This patch adds endianness support to mkfs.cramfs and fsck.cramfs.
fsck.cramfs now automatically detects the image endianness, and can
work on images of either endianness. mkfs.cramfs now accepts a new
optional parameter (-N) that allows creating the cramfs image in
either endianness.
Signed-off-by: Roy Peled <the.roy.peled@gmail.com>
Signed-off-by: Karel Zak <kzak@redhat.com>
|
|
The raw devices are in the raw/ subdirectory. It makes sense to use
the same subdirectory also for the control file. The old /dev/rawctl
is also supported as a fallback.
The #ifdef OLD_RAW_DEVS (/dev/raw<N>) is unsupported from now.
Signed-off-by: Karel Zak <kzak@redhat.com>
|
|
This patch renames bitops.h to minix_bitops.h to avoid possible
collisions with global include/bitops.h file.
Signed-off-by: Karel Zak <kzak@redhat.com>
|
|
[kzak@redhat.com: add ifndef _SWAPHEADER_H]
Signed-off-by: Matthias Koenig <mkoenig@suse.de>
Signed-off-by: Karel Zak <kzak@redhat.com>
|
|
blkdev_get_size returns size in bytes, so BLOCKS has to be
calculated accordingly.
Use stat value for size if device is not a block device.
Signed-off-by: Matthias Koenig <mkoenig@suse.de>
|
|
[kzak@redhat.com: - add setlocale(), ...
- remove tailing white spaces]
Signed-off-by: Pedro Ribeiro <p.m42.ribeiro@gmail.com>
Signed-off-by: Karel Zak <kzak@redhat.com>
|
|
Signed-off-by: Pedro Ribeiro <p.m42.ribeiro@gmail.com>
Signed-off-by: Karel Zak <kzak@redhat.com>
|
|
[kzak@redhat.com: - add setlocale(), ...]
Signed-off-by: Pedro Ribeiro <p.m42.ribeiro@gmail.com>
Signed-off-by: Karel Zak <kzak@redhat.com>
|
|
[kzak@redhat.com: - add missing setlocale(), ...]
Signed-off-by: Pedro Ribeiro <p.m42.ribeiro@gmail.com>
Signed-off-by: Karel Zak <kzak@redhat.com>
|
|
fsck.cramfs.c: In function ‘main’:
fsck.cramfs.c:676 warning: ‘length’ may be used uninitialized in this function
Signed-off-by: Karel Zak <kzak@redhat.com>
|
|
getpagesize() is said to be more portable than sysconf(_SC_PAGESIZE)
to anything Linux.
this patch helps klibc porting effort as the sysconf
multiplex API is not supported there.
also remove comment of the switch to sysconf in mkswap.c.
Signed-off-by: maximilian attems <max@stro.at>
|
|
helps klibc support, glibc compile tested.
Signed-off-by: maximilian attems <max@stro.at>
|
|
no longer use deprecated alias.
helps compiling util-linux-ng against klibc.
add pathnames.h include, where _PATH_MOUNTED is defined.
Signed-off-by: maximilian attems <max@stro.at>
|
|
[kzak@redhat.com: split the original patch to small patches]
Signed-off-by: Samuel Thibault <samuel.thibault@ens-lyon.org>
Signed-off-by: Karel Zak <kzak@redhat.com>
|
|
GNU/Hurd uses linux-like swapspace, so mkswap makes sense on
non-linux platforms too.
[kzak@redhat.com: split the original patch to small patches]
Signed-off-by: Samuel Thibault <samuel.thibault@ens-lyon.org>
Signed-off-by: Karel Zak <kzak@redhat.com>
|
|
Unfortunately, the current libselinux implementation of
is_selinux_enabled() returns -1 on error. This behavior is
undocumented.
The proper solution is to use "if (is_selinux_enabled() > 0)".
Signed-off-by: Karel Zak <kzak@redhat.com>
|
|
Signed-off-by: Karel Zak <kzak@redhat.com>
|
|
If the signature page write bumps into EINTR, it should finish the
write, instead of dying.
Addresses-Ubuntu-Bug: 206113
Signed-off-by: LaMont Jones <lamont@canonical.com>
Signed-off-by: Karel Zak <kzak@redhat.com>
|
|
Signed-off-by: Karel Zak <kzak@redhat.com>
|
|
Signed-off-by: James Youngman <jay@gnu.org>
Signed-off-by: Karel Zak <kzak@redhat.com>
|
|
[kzak@redhat.com: remove unnecessary volatile type qualifier]
Signed-off-by: James Youngman <jay@gnu.org>
Signed-off-by: Karel Zak <kzak@redhat.com>
|
|
Signed-off-by: Benno Schulenberg <bensberg@justemail.net>
|
|
Don't actually print %s in the error message, print the device name,
as was obviously intended. Also, print the error message
corresponding to the errno value.
[kzak@redhat.com: add __attribute__, coding style cleanups]
Signed-off-by: James Youngman <jay@gnu.org>
Signed-off-by: Karel Zak <kzak@redhat.com>
|
|
mkfs.minix.c:199: warning: ‘count_blocks’ defined but not used
Signed-off-by: Karel Zak <kzak@redhat.com>
|
|
mkswap.c:529: warning: pointer targets in assignment differ in signedness
mkswap.c:531: warning: pointer targets in assignment differ in signedness
mkswap.c:550: warning: pointer targets in passing argument 1 of `uuid_parse' differ in signedness
Signed-off-by: Karel Zak <kzak@redhat.com>
|
|
It should be in usrsbinexecdir, since formatting is usually a
privileged util-linux operation (like mkfs).
Reported-By: Jan Engelhardt <jengelh@computergmbh.de>
Signed-off-by: Karel Zak <kzak@redhat.com>
|
|
A friend of mine is looking into the possibility of cloning Debian
(and other) systems automatically and stomped over swap partitions
getting assigned new UUIDs every time the new harddisk is partitioned
and swap is created.
It's essential when partitions are to be recognised by their uuid and
not by their old device path anymore.
Addresses-Ubuntu-Bug: #66637
Signed-off-by: LaMont Jones <lamont@debian.org>
Signed-off-by: Karel Zak <kzak@redhat.com>
|
|
Signed-off-by: Stepan Kasal <skasal@redhat.com>
|
|
This patch also marks --getsize as deprecated option.
Signed-off-by: Karel Zak <kzak@redhat.com>
|
|
Signed-off-by: Karel Zak <kzak@redhat.com>
|
|
Use blkdev_get_size() function and some size related cleanup.
Signed-off-by: Matthias Koenig <mkoenig@suse.de>
|
|
Minix filesystem until version 2 has a fixed blocksize of 1024 bytes.
If you try to create a filsystem on a device with a physical sectorsize
larger than 1024 bytes, this resulting minix fs cannot be mounted,
because the physical sectorsize must be smaller than the filesystem
blocksize.
This patch adds a check for this and will refuse to create a filesystem
if the sectorsize is bigger than the blocksize.
Signed-off-by: Matthias Koenig <mkoenig@suse.de>
|
|
Here is a patch that disables linux-specific tools on non-linux targets.
Signed-Off-By: Samuel Thibault <samuel.thibault@ens-lyon.org>
Signed-Off-By: Karel Zak <kzak@redhat.com>
|
|
Signed-off-by: Karel Zak <kzak@redhat.com>
|
|
This patch replaces duplicate code with blkdev_ functions from
lib/blkdev.c.
The patch also fix the output from "blockdev --report". The Size field
was in 512-byte sectors instead in real size in bytes.
Signed-off-by: Karel Zak <kzak@redhat.com>
|
|
mkswap(8) man page is talking about KiB (2^10), but the mkswap binary
uses kB (10^3) in error messages. That's strange. Let's use KiB
everywhere.
Signed-off-by: Karel Zak <kzak@redhat.com>
|
|
Signed-off-by: Karel Zak <kzak@redhat.com>
|
|
Signed-off-by: Karel Zak <kzak@redhat.com>
|
|
Remove including of assert.h
Signed-off-by: Li Zefan <lizf@cn.fujitsu.com>
|