Compare commits

..

22 commits

Author SHA1 Message Date
Karel Zak
c5b89a12ac mountsh: remove unused mfd,update help
Signed-off-by: Karel Zak <kzak@redhat.com>
2019-12-05 13:06:50 +01:00
Karel Zak
94b4f90018 mountsh: differentiate between flags and attributes
* use '|' for flags (e.g. CLOEXEC|CLONE|RECURSIVE)
* use ',' for attributes (e.g. noexec,nosuid,nodev)

Signed-off-by: Karel Zak <kzak@redhat.com>
2019-12-05 12:54:29 +01:00
Karel Zak
5e028ed26b mountsh: add open_tree
Signed-off-by: Karel Zak <kzak@redhat.com>
2019-12-05 12:41:21 +01:00
Karel Zak
da168ed89b mountsh: add openpath
Signed-off-by: Karel Zak <kzak@redhat.com>
2019-12-05 11:58:40 +01:00
Karel Zak
858fc55d20 lib/procutils: remove proc_next_fd() stuff
Signed-off-by: Karel Zak <kzak@redhat.com>
2019-12-03 14:00:11 +01:00
Karel Zak
b399f87c7b mountsh: don't use procutils to read fds
It's seems struct proc_fds is useless for another use-cases (utils).
Let's keep it without extra abstraction.

Signed-off-by: Karel Zak <kzak@redhat.com>
2019-12-03 13:51:55 +01:00
Karel Zak
12ce07a558 lib/strutils: return string from strrem() and strrep()
Signed-off-by: Karel Zak <kzak@redhat.com>
2019-12-03 13:51:21 +01:00
Karel Zak
4e70cf070e mountsh: fix named FD allocation
... nice brown-paper-bag bug.

Signed-off-by: Karel Zak <kzak@redhat.com>
2019-12-03 10:56:15 +01:00
Karel Zak
0b529eaf0a mountsh: fix segmentation fault
Signed-off-by: Karel Zak <kzak@redhat.com>
2019-12-02 13:12:13 +01:00
Karel Zak
7048ff3a3e mountsh: add command move_mount
- add two version
	- simple: move_mount <from-fd> <to-path> [<flags>]
	- full: move_mount <from-fd> <from-path>|"" <to-fd>|AT_FDCWD <to-path>|"" [<flags>]

- cleanup help output
- cleanup atrributes

Signed-off-by: Karel Zak <kzak@redhat.com>
2019-12-02 12:45:03 +01:00
Karel Zak
1e40bcdd9c mountsh: don't use default for close command
* be explicit with 'close'
* consolidate get_user_reply()

Signed-off-by: Karel Zak <kzak@redhat.com>
2019-11-29 13:27:26 +01:00
Karel Zak
df798805c0 mountsh: support named file descriptors
Let's make it more readable:

	>>> # abc = fsopen ext4
	>>> # fsconfig $abc flag ro
	>>> # fsconfig $abc string source /dev/sdc1
	>>> # fsconfig $abc create
	>>> # mnt = fsmount $abc ro,noexec
	>>> # fds
	 3 : fscontext [$abc]
	 4 : path [$mnt]

Signed-off-by: Karel Zak <kzak@redhat.com>
2019-11-29 13:02:51 +01:00
Karel Zak
457bd3e133 mountsh: make masks parsing more generic
Signed-off-by: Karel Zak <kzak@redhat.com>
2019-11-28 12:55:12 +01:00
Karel Zak
372195b111 mountsh: return mount fd
Signed-off-by: Karel Zak <kzak@redhat.com>
2019-11-28 12:43:13 +01:00
Karel Zak
789db6a95a mountsh: add fsmount command
Signed-off-by: Karel Zak <kzak@redhat.com>
2019-11-28 12:32:18 +01:00
Karel Zak
70b20258dc mountsh: consolidate FD use
Signed-off-by: Karel Zak <kzak@redhat.com>
2019-11-28 11:32:02 +01:00
Karel Zak
3ae6779e31 mountsh: add command fsconfig
Signed-off-by: Karel Zak <kzak@redhat.com>
2019-11-28 11:04:58 +01:00
Karel Zak
fea47ed0c9 mountsh:add command close
Signed-off-by: Karel Zak <kzak@redhat.com>
2019-11-27 13:06:26 +01:00
Karel Zak
aaab497afd mountsh: make prompt more visiable
Signed-off-by: Karel Zak <kzak@redhat.com>
2019-11-27 12:52:55 +01:00
Karel Zak
c4714fb5ec mountsh: add command fds
Signed-off-by: Karel Zak <kzak@redhat.com>
2019-11-27 12:37:30 +01:00
Karel Zak
29fe66e9cd lib/procutils: add funcs to read /proc/#/fd
Signed-off-by: Karel Zak <kzak@redhat.com>
2019-11-27 12:37:07 +01:00
Karel Zak
445973ab71 mountsh: add new command
This is new command for low-level work with new Linux mount API. The
idea is to have something to test and debug the API.

 mountsh # fsopen ext4
 new context [3] created
 mountsh # fsconfig 3 set source /dev/sda1
 mountsh # fsconfig 3 set flag ro
 mountsh # fsconfig 3 create
 mountsh # fsmount 3 MS_NODEV
 new mount [4] created
 mountsh # move_mount 4 /mnt

Note that this commit implements almost nothing from this idea :-)

Signed-off-by: Karel Zak <kzak@redhat.com>
2019-11-26 13:39:54 +01:00
1859 changed files with 209419 additions and 942795 deletions

View file

@ -1,85 +0,0 @@
#!/bin/bash
set -ex
export DEBIAN_FRONTEND=noninteractive
apt-get -y update --fix-missing
# Xenial uses btrfs-tools, but since Focal it's btrfs-progs
#
PACKAGES=(
bc
btrfs-progs
dnsutils
libcap-ng-dev
libncursesw5-dev
libpam-dev
libudev-dev
gtk-doc-tools
mdadm
ntp
socat
asciidoctor
meson
lcov
gpg-agent
git
squashfs-tools
iproute2
dmsetup
python3-dev
gawk
)
PACKAGES_OPTIONAL=(
libsystemd-daemon-dev
libsystemd-journal-dev
)
# scsi_debug
if [[ "$QEMU_USER" != "1" ]]; then
MODULES_PACKAGE="linux-modules-extra-$(uname -r)"
# may not exist anymore
if apt-cache show "$MODULES_PACKAGE" >/dev/null 2>&1; then
PACKAGES+=("$MODULES_PACKAGE")
fi
fi
if [[ "$TRANSLATE_MANPAGES" == "yes" ]];then
PACKAGES+=(po4a)
fi
apt install -y lsb-release software-properties-common
COMPILER="${COMPILER:?}"
RELEASE="$(lsb_release -cs)"
bash -c "echo 'deb-src http://archive.ubuntu.com/ubuntu/ $RELEASE main restricted universe multiverse' >>/etc/apt/sources.list"
# cov-build fails to compile util-linux when CC is set to gcc-*
# so let's just install and use the default compiler
if [[ "$COMPILER_VERSION" == "" ]]; then
if [[ "$COMPILER" != "none" ]]; then
PACKAGES+=("$COMPILER")
fi
elif [[ "$COMPILER" == clang ]]; then
# Latest LLVM stack deb packages provided by https://apt.llvm.org/
# Following snippet was borrowed from https://apt.llvm.org/llvm.sh
wget -O - https://apt.llvm.org/llvm-snapshot.gpg.key | apt-key add -
add-apt-repository -y "deb http://apt.llvm.org/$RELEASE/ llvm-toolchain-$RELEASE-$COMPILER_VERSION main"
PACKAGES+=(clang-$COMPILER_VERSION lldb-$COMPILER_VERSION lld-$COMPILER_VERSION clangd-$COMPILER_VERSION)
elif [[ "$COMPILER" == gcc ]]; then
# Latest gcc stack deb packages provided by
# https://launchpad.net/~ubuntu-toolchain-r/+archive/ubuntu/test
add-apt-repository -y ppa:ubuntu-toolchain-r/test
PACKAGES+=(gcc-$COMPILER_VERSION)
else
fatal "Unknown compiler: $COMPILER"
fi
apt-get -y update --fix-missing
apt-get -y build-dep util-linux
apt-get -y install "${PACKAGES[@]}"
apt-get -y install "${PACKAGES_OPTIONAL[@]}" || true

View file

@ -1,198 +0,0 @@
#!/bin/bash
set -ex
PHASES=(${@:-CONFIGURE MAKE INSTALL CHECK DISTCHECK})
COMPILER="${COMPILER:?}"
COMPILER_VERSION="${COMPILER_VERSION}"
CFLAGS=(-O1 -g)
CXXFLAGS=(-O1 -g)
LDFLAGS=()
COVERITY_SCAN_TOOL_BASE="/tmp/coverity-scan-analysis"
# The project is still called "karelzak/util-linux" on Coverity
# so it shouldn't be changed to "util-linux/util-linux"
COVERITY_SCAN_PROJECT_NAME="karelzak/util-linux"
if [[ "$COMPILER" == clang ]]; then
CC="clang${COMPILER_VERSION:+-$COMPILER_VERSION}"
CXX="clang++${COMPILER_VERSION:+-$COMPILER_VERSION}"
elif [[ "$COMPILER" == gcc ]]; then
CC="gcc${COMPILER_VERSION:+-$COMPILER_VERSION}"
CXX="g++${COMPILER_VERSION:+-$COMPILER_VERSION}"
fi
function coverity_install_script {
set +x # This is supposed to hide COVERITY_SCAN_TOKEN
local platform=$(uname)
local tool_url="https://scan.coverity.com/download/${platform}"
local tool_archive="/tmp/cov-analysis-${platform}.tgz"
echo -e "\033[33;1mDownloading Coverity Scan Analysis Tool...\033[0m"
wget -nv -O $tool_archive $tool_url --post-data "project=$COVERITY_SCAN_PROJECT_NAME&token=$COVERITY_SCAN_TOKEN" || return
echo -e "\033[33;1mExtracting Coverity Scan Analysis Tool...\033[0m"
mkdir -p $COVERITY_SCAN_TOOL_BASE
pushd $COVERITY_SCAN_TOOL_BASE
tar xzf $tool_archive || return
popd
set -x
}
function run_coverity {
set +x # This is supposed to hide COVERITY_SCAN_TOKEN
local results_dir="cov-int"
local tool_dir=$(find $COVERITY_SCAN_TOOL_BASE -type d -name 'cov-analysis*')
local results_archive="analysis-results.tgz"
local sha=$(git rev-parse --short HEAD)
local author_email=$(git log -1 --pretty="%aE")
local response status_code
echo -e "\033[33;1mRunning Coverity Scan Analysis Tool...\033[0m"
COVERITY_UNSUPPORTED=1 $tool_dir/bin/cov-build --dir $results_dir sh -c "make -j && make -j check-programs" || return
$tool_dir/bin/cov-import-scm --dir $results_dir --scm git --log $results_dir/scm_log.txt || return
echo -e "\033[33;1mTarring Coverity Scan Analysis results...\033[0m"
tar czf $results_archive $results_dir || return
echo -e "\033[33;1mUploading Coverity Scan Analysis results...\033[0m"
response=$(curl \
--silent --write-out "\n%{http_code}\n" \
--form project=$COVERITY_SCAN_PROJECT_NAME \
--form token=$COVERITY_SCAN_TOKEN \
--form email=$author_email \
--form file=@$results_archive \
--form version=$sha \
--form description="Daily build" \
https://scan.coverity.com/builds)
printf "\033[33;1mThe response is\033[0m\n%s\n" "$response"
status_code=$(echo "$response" | sed -n '$p')
if [ "$status_code" != "200" ]; then
echo -e "\033[33;1mCoverity Scan upload failed: $(echo "$response" | sed '$d').\033[0m"
return 1
fi
echo -e "\n\033[33;1mCoverity Scan Analysis completed successfully.\033[0m"
set -x
}
for phase in "${PHASES[@]}"; do
case $phase in
CONFIGURE)
opts=(
--disable-use-tty-group
--disable-makeinstall-chown
--enable-all-programs
--enable-werror
)
if [[ "$COVERAGE" == "yes" ]]; then
opts+=(--enable-coverage)
fi
if [[ "$SANITIZE" == "yes" ]]; then
opts+=(--enable-asan --enable-ubsan)
CFLAGS+=(-fno-omit-frame-pointer)
CXXFLAGS+=(-fno-omit-frame-pointer)
fi
if [[ "$COMPILER" == clang* && "$SANITIZE" == "yes" ]]; then
opts+=(--enable-fuzzing-engine)
CFLAGS+=(-shared-libasan)
CXXFLAGS+=(-shared-libasan)
fi
if [[ "$HOST_TRIPLET" != "" ]]; then
opts+=(--host "$HOST_TRIPLET")
fi
git config --global --add safe.directory "$PWD"
git clean -xdf
./autogen.sh
CC="$CC" CXX="$CXX" CFLAGS="${CFLAGS[@]}" CXXFLAGS="${CXXFLAGS[@]}" LDFLAGS="${LDFLAGS[@]}" ./configure "${opts[@]}"
;;
MAKE)
make -j"$(nproc)"
make -j"$(nproc)" check-programs
;;
INSTALL)
make install DESTDIR=/tmp/dest
;;
MESONCONF)
meson build
;;
MESONBUILD)
ninja -C build
;;
CODECHECK)
make checklibdoc
make checkxalloc
;;
CHECK)
if [[ "$SANITIZE" == "yes" ]]; then
# All the following black magic is to make test/eject/umount work, since
# eject execl()s the uninstrumented /bin/umount binary, which confuses
# ASan. The workaround for this is to set $LD_PRELOAD to the ASan's
# runtime DSO, which works well with gcc without any additional hassle.
# However, since clang, by default, links ASan statically, we need to
# explicitly state we want dynamic linking (see -shared-libasan above).
# That, however, introduces another issue - clang's ASan runtime is in
# a non-standard path, so all binaries compiled in such way refuse
# to start. That's what the following blob of code is for - it detects
# the ASan's runtime path and adds the respective directory to
# the dynamic linker cache.
#
# The actual $LD_PRELOAD sheanigans are done directly in
# tests/ts/eject/umount.
asan_rt_name="$(ldd ./kill | awk '/lib.+asan.*.so/ {print $1; exit}')"
asan_rt_path="$($CC --print-file-name "$asan_rt_name")"
echo "Detected ASan runtime: $asan_rt_name ($asan_rt_path)"
if [[ -z "$asan_rt_name" || -z "$asan_rt_path" ]]; then
echo >&2 "Couldn't detect ASan runtime, can't continue"
exit 1
fi
if [[ "$COMPILER" == clang* ]]; then
mkdir -p /etc/ld.so.conf.d/
echo "${asan_rt_path%/*}" > /etc/ld.so.conf.d/99-clang-libasan.conf
ldconfig
fi
fi
if [[ "$COVERAGE" == "yes" ]]; then
# Make (almost) everything under current directory readable/writable
# for everyone to allow gcov to write the .gcda files even with
# dropped privileges
find . tests/helpers/ -maxdepth 1 -type d ! -name . ! -name tests \
-exec setfacl -R -m 'd:g::rwX,d:o::rwX' -m 'g::rwX,o::rwX' '{}' \;
# Make sure we can access $PWD as an unpriv user
path="$PWD"
while [[ "$path" != / ]]; do
chmod o+rx "$path"
path="$(dirname "$path")"
done
fi
./tests/run.sh --show-diff
if [[ "$COVERAGE" == "yes" ]]; then
lcov --directory . --capture --initial --output-file coverage.info.initial
lcov --directory . --capture --output-file coverage.info.run --no-checksum --rc lcov_branch_coverage=1
lcov -a coverage.info.initial -a coverage.info.run --rc lcov_branch_coverage=1 -o coverage.info.raw
lcov --extract coverage.info.raw "$(pwd)/*" --rc lcov_branch_coverage=1 --output-file coverage.info
fi
;;
DISTCHECK)
make distcheck
;;
COVERITY)
coverity_install_script
run_coverity
;;
*)
echo >&2 "Unknown phase '$phase'"
exit 1
esac
done

View file

@ -1,235 +0,0 @@
name: Build test
on:
pull_request:
paths-ignore:
- 'Documentation/**'
- 'lib*/docs/**'
push:
branches:
- 'cibuild'
- 'master'
- 'next'
- 'stable/**'
paths-ignore:
- 'Documentation/**'
- 'lib*/docs/**'
permissions:
contents: read # to fetch code (actions/checkout)
jobs:
build:
runs-on: ubuntu-latest
concurrency:
group: ${{ github.workflow }}-${{ toJSON(matrix.env) }}-${{ github.ref }}
cancel-in-progress: true
strategy:
fail-fast: false
matrix:
env:
# gcc-13 has false-positives with ubsan
- { COMPILER: "gcc", COMPILER_VERSION: "11", SANITIZE: "yes" }
- { COMPILER: "gcc", COMPILER_VERSION: "13", SANITIZE: "no" }
- { COMPILER: "clang", COMPILER_VERSION: "16", SANITIZE: "yes" }
- { COMPILER: "clang", COMPILER_VERSION: "16", SANITIZE: "no" }
env: ${{ matrix.env }}
steps:
- name: Repository checkout
uses: actions/checkout@v1
- name: Ubuntu setup
run: sudo -E .github/workflows/cibuild-setup-ubuntu.sh
- name: Configure
run: .github/workflows/cibuild.sh CONFIGURE
- name: Code checks
run: .github/workflows/cibuild.sh CODECHECK
- name: Configure & Make
run: .github/workflows/cibuild.sh MAKE
- name: Check
run: sudo -E .github/workflows/cibuild.sh CHECK
- name: Make install
run: .github/workflows/cibuild.sh INSTALL
coveralls:
permissions:
contents: read # to fetch code (actions/checkout)
checks: write # to create new checks (coverallsapp/github-action)
runs-on: ubuntu-latest
if: github.repository == 'util-linux/util-linux'
concurrency:
group: ${{ github.workflow }}-coveralls-${{ github.ref }}
cancel-in-progress: true
env:
COMPILER: gcc
COMPILER_VERSION: 10
SANITIZE: no
COVERAGE: yes
steps:
- name: Repository checkout
uses: actions/checkout@v1
- name: Ubuntu setup
run: sudo -E .github/workflows/cibuild-setup-ubuntu.sh
- name: Configure & Make
run: .github/workflows/cibuild.sh CONFIGURE MAKE
- name: Check
run: sudo -E .github/workflows/cibuild.sh CHECK
- name: Coveralls
uses: coverallsapp/github-action@master
with:
github-token: ${{ secrets.GITHUB_TOKEN }}
path-to-lcov: ./coverage.info
meson:
needs: build
runs-on: ubuntu-latest
concurrency:
group: ${{ github.workflow }}-meson-${{ github.ref }}
cancel-in-progress: true
env:
COMPILER: gcc
COMPILER_VERSION: 10
SANITIZE: no
steps:
- name: Repository checkout
uses: actions/checkout@v1
- name: Ubuntu setup
run: sudo -E .github/workflows/cibuild-setup-ubuntu.sh
- name: Meson configure
run: .github/workflows/cibuild.sh MESONCONF
- name: Meson build
run: .github/workflows/cibuild.sh MESONBUILD
distcheck:
needs: build
runs-on: ubuntu-latest
concurrency:
group: ${{ github.workflow }}-distcheck-${{ github.ref }}
cancel-in-progress: true
env:
COMPILER: gcc
COMPILER_VERSION: 10
SANITIZE: no
TRANSLATE_MANPAGES: yes
steps:
- name: Repository checkout
uses: actions/checkout@v1
- name: Ubuntu setup
run: sudo -E .github/workflows/cibuild-setup-ubuntu.sh
- name: Configure
run: .github/workflows/cibuild.sh CONFIGURE
- name: Make distcheck
run: .github/workflows/cibuild.sh DISTCHECK
build-compat:
strategy:
fail-fast: false
matrix:
include:
- image: ubuntu:18.04
name: build (compat, ${{ matrix.image }})
runs-on: ubuntu-latest
concurrency:
group: ${{ github.workflow }}-build-compat-${{ github.ref }}
cancel-in-progress: true
env:
COMPILER: none
container:
image: ${{ matrix.image }}
steps:
- name: Repository checkout
uses: actions/checkout@v1
- name: Ubuntu setup
run: .github/workflows/cibuild-setup-ubuntu.sh
- name: Configure
run: .github/workflows/cibuild.sh CONFIGURE
- name: Code checks
run: .github/workflows/cibuild.sh CODECHECK
- name: Configure & Make
run: .github/workflows/cibuild.sh MAKE
- name: Check
run: .github/workflows/cibuild.sh CHECK
build-arch:
name: build (qemu-user, ${{ matrix.arch }})
runs-on: ubuntu-latest
concurrency:
group: ${{ github.workflow }}-${{ toJSON(matrix) }}-${{ github.ref }}
cancel-in-progress: true
strategy:
fail-fast: false
matrix:
include:
- arch: s390x
- arch: riscv64
steps:
- name: Repository checkout
uses: actions/checkout@v1
- uses: uraimo/run-on-arch-action@v2
with:
arch: ${{ matrix.arch }}
dockerRunArgs: --privileged -v /dev:/dev
distro: ubuntu_latest
run: |
export COMPILER=gcc
export COMPILER_VERSION=10
export SANITIZE=no
export QEMU_USER=1
# name: Ubuntu setup
.github/workflows/cibuild-setup-ubuntu.sh
git config --global --add safe.directory "$PWD"
# Configure & Make
.github/workflows/cibuild.sh CONFIGURE MAKE
# Check
.github/workflows/cibuild.sh CHECK
build-openwrt:
name: build (openwrt, ${{ matrix.target }})
runs-on: ubuntu-latest
concurrency:
group: ${{ github.workflow }}-${{ toJSON(matrix) }}-${{ github.ref }}
cancel-in-progress: true
strategy:
fail-fast: false
matrix:
include:
- target: ipq40xx
subtarget: generic
abi: musl_eabi
- target: ath79
subtarget: generic
abi: musl
- target: bcm63xx
subtarget: generic
abi: musl
- target: mpc85xx
subtarget: p2020
abi: musl
- target: archs38
subtarget: generic
abi: glibc
env:
COMPILER: none
steps:
- name: Repository checkout
uses: actions/checkout@v1
- name: Ubuntu setup
run: sudo -E .github/workflows/cibuild-setup-ubuntu.sh
- name: OpenWrt environment
run: |
OPENWRT_RELEASE=22.03.5
OPENWRT_SDK=openwrt-sdk-$OPENWRT_RELEASE-${{ matrix.target }}-${{ matrix.subtarget }}_gcc-11.2.0_${{ matrix.abi }}.Linux-x86_64
echo "COMPILER=$COMPILER" >> $GITHUB_ENV
echo "OPENWRT_RELEASE=$OPENWRT_RELEASE" >> $GITHUB_ENV
echo "OPENWRT_SDK=$OPENWRT_SDK" >> $GITHUB_ENV
- name: Download toolchain
run: |
curl -o ~/${{ env.OPENWRT_SDK }}.tar.xz -C - https://downloads.cdn.openwrt.org/releases/${{ env.OPENWRT_RELEASE }}/targets/${{ matrix.target }}/${{ matrix.subtarget }}/${{ env.OPENWRT_SDK }}.tar.xz
tar xf ~/${{ env.OPENWRT_SDK }}.tar.xz -C ~
- name: Configure
run: |
source .github/workflows/openwrt-sdk-env.sh ~/${{ env.OPENWRT_SDK }}
.github/workflows/cibuild.sh CONFIGURE
- name: Make
run: |
source .github/workflows/openwrt-sdk-env.sh ~/${{ env.OPENWRT_SDK }}
.github/workflows/cibuild.sh MAKE

View file

@ -1,59 +0,0 @@
---
# vi: ts=2 sw=2 et:
# See: https://google.github.io/oss-fuzz/getting-started/continuous-integration/
name: CIFuzz
on:
push:
branches:
- master
pull_request:
branches:
- master
paths:
- '**'
permissions:
contents: read # to clone the repo (google/oss-fuzz/infra/cifuzz/actions/run_fuzzers)
jobs:
Fuzzing:
permissions:
actions: read # to fetch the artifacts (google/oss-fuzz/infra/cifuzz/actions/run_fuzzers)
contents: read # to clone the repo (google/oss-fuzz/infra/cifuzz/actions/run_fuzzers)
runs-on: ubuntu-latest
if: github.repository == 'util-linux/util-linux'
concurrency:
group: ${{ github.workflow }}-${{ matrix.sanitizer }}-${{ matrix.architecture }}-${{ github.ref }}
cancel-in-progress: true
strategy:
fail-fast: false
matrix:
sanitizer: [address, undefined, memory]
architecture: [x86_64]
include:
- sanitizer: address
architecture: i386
steps:
- name: Build Fuzzers (${{ matrix.sanitizer }})
id: build
uses: google/oss-fuzz/infra/cifuzz/actions/build_fuzzers@master
with:
oss-fuzz-project-name: 'util-linux'
dry-run: false
allowed-broken-targets-percentage: 0
sanitizer: ${{ matrix.sanitizer }}
architecture: ${{ matrix.architecture }}
- name: Run Fuzzers (${{ matrix.sanitizer }})
uses: google/oss-fuzz/infra/cifuzz/actions/run_fuzzers@master
with:
oss-fuzz-project-name: 'util-linux'
fuzz-seconds: 180
dry-run: false
sanitizer: ${{ matrix.sanitizer }}
- name: Upload Crash
uses: actions/upload-artifact@v1
if: failure() && steps.build.outcome == 'success'
with:
name: ${{ matrix.sanitizer }}-${{ matrix.architecture }}-artifacts
path: ./out/artifacts

View file

@ -1,52 +0,0 @@
---
# vi: ts=2 sw=2 et:
name: "CodeQL"
on:
push:
branches:
- master
pull_request:
branches:
- master
permissions:
contents: read
jobs:
analyze:
name: Analyze
runs-on: ubuntu-22.04
concurrency:
group: ${{ github.workflow }}-${{ matrix.language }}-${{ github.ref }}
cancel-in-progress: true
permissions:
actions: read
security-events: write
strategy:
fail-fast: false
matrix:
language: ['cpp', 'python']
steps:
- name: Checkout repository
uses: actions/checkout@v3
- name: Initialize CodeQL
uses: github/codeql-action/init@v2
with:
languages: ${{ matrix.language }}
queries: +security-extended,security-and-quality
- name: Install dependencies
run: sudo -E .github/workflows/cibuild-setup-ubuntu.sh
env:
COMPILER: gcc
- name: Autobuild
uses: github/codeql-action/autobuild@v2
- name: Perform CodeQL Analysis
uses: github/codeql-action/analyze@v2

View file

@ -1,27 +0,0 @@
---
name: Coverity
on:
schedule:
# send data to Coverity daily at midnight
- cron: '0 0 * * *'
permissions:
contents: read # to fetch code (actions/checkout)
jobs:
build:
runs-on: ubuntu-latest
if: github.repository == 'util-linux/util-linux'
env:
COMPILER: gcc
COVERITY_SCAN_TOKEN: "${{ secrets.COVERITY_SCAN_TOKEN }}"
steps:
- name: Repository checkout
uses: actions/checkout@v1
- name: Ubuntu setup
run: sudo -E .github/workflows/cibuild-setup-ubuntu.sh
- name: Configure
run: .github/workflows/cibuild.sh CONFIGURE
- name: Coverity
run: .github/workflows/cibuild.sh COVERITY

View file

@ -1,27 +0,0 @@
# https://github.com/redhat-plumbers-in-action/differential-shellcheck#readme
---
name: Differential ShellCheck
on:
pull_request:
branches:
- master
permissions:
contents: read
jobs:
lint:
runs-on: ubuntu-latest
steps:
- name: Repository checkout
uses: actions/checkout@v3
with:
fetch-depth: 0
- name: Differential ShellCheck
uses: redhat-plumbers-in-action/differential-shellcheck@v4
with:
severity: warning
token: ${{ secrets.GITHUB_TOKEN }}

View file

@ -1,17 +0,0 @@
#!/bin/sh
sdk="$(realpath $1)"
STAGING_DIR="$(echo "$sdk"/staging_dir/toolchain-*)"
. "$STAGING_DIR/info.mk"
PATH="$sdk/staging_dir/host/bin:$PATH"
CC="$STAGING_DIR/bin/${TARGET_CROSS}gcc"
BISON_PKGDATADIR="$sdk/staging_dir/host/share/bison"
M4="$sdk/staging_dir/host/bin/m4"
HOST_TRIPLET="$("$CC" -dumpmachine)"
echo "Building for $HOST_TRIPLET from $sdk"
export STAGING_DIR PATH CC BISON_PKGDATADIR M4 HOST_TRIPLET

31
.gitignore vendored
View file

@ -1,7 +1,6 @@
#
# generic stuff
#
*.deps
*.gcda
*.gcno
*.gcov
@ -16,11 +15,6 @@
*.vim
*.[ao]
*~
*.1
*.3
*.5
*.8
*.stamp
.clang_complete
.deps
.dirstamp
@ -46,15 +40,10 @@ config/test-driver
configure
cscope.out
depcomp
GPATH
GRTAGS
GTAGS
GSYMS
INSTALL
install-sh
libtool
m4/*.m4
m4/libtool.m4.orig
Makefile
Makefile.in
missing
@ -62,7 +51,6 @@ mkinstalldirs
stamp-h
stamp-h.in
stamp-h1
syscalls.h
tags
test-suite.log
tests/run.sh.log
@ -75,18 +63,16 @@ ylwrap
#
/addpart
/agetty
/build*/
/blkdiscard
/blkid
/blkpr
/blkzone
/blkid
/blockdev
/cal
/cfdisk
/chcpu
/chfn
/chmem
/choom
/chmem
/chrt
/chsh
/col
@ -97,8 +83,6 @@ ylwrap
/delpart
/dmesg
/eject
/enosys
/fadvise
/fallocate
/fdformat
/fdisk
@ -119,7 +103,6 @@ ylwrap
/ipcmk
/ipcrm
/ipcs
/irqtop
/isosize
/kill
/last
@ -130,10 +113,8 @@ ylwrap
/look
/losetup
/lsblk
/lscpu
/lsfd
/lsipc
/lsirq
/lscpu
/lslocks
/lslogins
/lsmem
@ -148,13 +129,13 @@ ylwrap
/more
/mount
/mountpoint
/mountsh
/namei
/newgrp
/nologin
/nsenter
/partx
/pg
/pipesz
/pivot_root
/prlimit
/raw
@ -168,8 +149,8 @@ ylwrap
/runuser
/sample-*
/script
/scriptlive
/scriptreplay
/scriptlive
/setarch
/setpriv
/setsid
@ -184,7 +165,6 @@ ylwrap
/taskset
/test_*
/tunelp
/uclampset
/ul
/umount
/unshare
@ -193,7 +173,6 @@ ylwrap
/uuidgen
/uuidparse
/vipw
/waitpid
/wall
/wdctl
/whereis

View file

@ -1,60 +0,0 @@
---
# vi:ts=2 sw=2 et:
#
# Docs: https://packit.dev/docs/
specfile_path: .packit_rpm/util-linux.spec
files_to_sync:
- .packit.yaml
- src: .packit_rpm/util-linux.spec
dest: util-linux.spec
upstream_package_name: util-linux
downstream_package_name: util-linux
# `git describe` returns in util-linux's case 'v2.37.2-xxx' which breaks RPM version
# # detection (that expects 2.37.2-xxx'). Let's tweak the version string accordingly
upstream_tag_template: "v{version}"
srpm_build_deps: []
actions:
post-upstream-clone:
# Use a spec file from Fedora Rawhide
- "git clone https://src.fedoraproject.org/rpms/util-linux.git .packit_rpm --depth=1"
# Drop the "sources" file so rebase-helper doesn't think we're a dist-git
- "rm -fv .packit_rpm/sources"
# Drop all patches, since they're already included in the tarball
- "sed -ri '/^Patch[0-9]+:/d' .packit_rpm/util-linux.spec"
# Install additional dependencies we need for the build/tests
- "sed -i '/^### Dependencies/aBuildRequires: autoconf automake bc bison iproute libtool procps-ng socat' .packit_rpm/util-linux.spec"
# We need to call autogen, since we use a custom tarball
- "sed -i '/^unset LINGUAS/a./autogen.sh' .packit_rpm/util-linux.spec"
# Enable tests after build
- "sed -i '/^### Macros/a%define _with_check 1' .packit_rpm/util-linux.spec"
# Ignore unpackaged files
- "sed -i '1 i%define _unpackaged_files_terminate_build 0' .packit_rpm/util-linux.spec"
# Enable -Werror
- "sed -i 's/^%configure /%configure --enable-werror /' .packit_rpm/util-linux.spec"
create-archive:
# We need to override the default create-archive action, since we need to tweak
# the resulting tarball and add a .tarball-version file to it, otherwise
# util-linux fails to detect its version during build
- "bash -c 'echo $PACKIT_PROJECT_VERSION >.tarball-version'"
- "bash -c 'git archive --prefix ${PACKIT_PROJECT_NAME_VERSION}/ --add-file .tarball-version --output .packit_rpm/${PACKIT_PROJECT_NAME_VERSION}.tar.gz HEAD'"
- "bash -c 'echo .packit_rpm/${PACKIT_PROJECT_NAME_VERSION}.tar.gz'"
# Available targets can be listed via `copr-cli list-chroots`
jobs:
# Build test
- &copr
job: copr_build
trigger: pull_request
targets:
- fedora-rawhide-aarch64
- fedora-rawhide-i386
- fedora-rawhide-ppc64le
- fedora-rawhide-s390x
- fedora-rawhide-x86_64
- <<: *copr
trigger: commit
branch: master
- <<: *copr
trigger: release

View file

@ -1 +0,0 @@
disable=SC2034 # unused variable

241
.travis-functions.sh Executable file
View file

@ -0,0 +1,241 @@
#!/bin/bash
#
# .travis-functions.sh:
# - helper functions to be sourced from .travis.yml
# - designed to respect travis' environment but testing locally is possible
#
# Variables:
#
# TS_OPT_<name>_<something>=yes
# - forces tests/functions.sh:ts_has_option() to return "yes" for
# variable <something> in test <name>
#
# TESTS_OPTIONS=
# TESTS_PARALLEL=
# TESTS_COMMAND=
# - overwrites default from tests/Makemodule.am
#
# Do not use TS_* prefix for any travis or build-system stuff. This prefix is
# exclusively used by tests/ stuff.
#
if [ ! -f "configure.ac" ]; then
echo ".travis-functions.sh must be sourced from source dir" >&2
return 1 || exit 1
fi
## some config settings
# travis docs say we get 1.5 CPUs
MAKE="make -j2"
DUMP_CONFIG_LOG="short"
# workaround ugly warning on travis OSX,
# see https://github.com/direnv/direnv/issues/210
shell_session_update() { :; }
function xconfigure
{
which "$CC"
"$CC" --version
./configure "$@" $OSX_CONFOPTS
err=$?
if [ "$DUMP_CONFIG_LOG" = "short" ]; then
grep -B1 -A10000 "^## Output variables" config.log | grep -v "_FALSE="
elif [ "$DUMP_CONFIG_LOG" = "full" ]; then
cat config.log
fi
return $err
}
# TODO: integrate checkusage into our regular tests and remove this function
function make_checkusage
{
local tmp
if ! tmp=$($MAKE checkusage 2>&1) || test -n "$tmp"; then
echo "$tmp"
echo "make checkusage failed" >&2
return 1
fi
}
function check_nonroot
{
local make_opts="$MAKE_CHECK_OPTS --show-diff --parsable"
local conf_opts="\
--disable-use-tty-group \
--disable-makeinstall-chown \
--enable-all-programs"
if [ "$TRAVIS_OS_NAME" != "osx" ]; then
conf_opts="$conf_opts --enable-asan"
make_opts="$make_opts --memcheck-asan"
fi
xconfigure $conf_opts || return
$MAKE || return
osx_prepare_check
# TESTS_* overwrites default from tests/Makemodule.am
$MAKE check TESTS_OPTIONS="$make_opts" || return
make_checkusage || return
$MAKE install DESTDIR=/tmp/dest || return
}
function check_root
{
local make_opts="$MAKE_CHECK_OPTS --show-diff"
local conf_opts="--enable-all-programs"
if [ "$TRAVIS_OS_NAME" != "osx" ]; then
conf_opts="$conf_opts --enable-asan"
make_opts="$make_opts --memcheck-asan"
fi
xconfigure $conf_opts || return
$MAKE || return
# compile tests only
$MAKE check-programs || return
# Modify environment for OSX
osx_prepare_check
# TESTS_* overwrites default from tests/Makemodule.am
sudo -E $MAKE check "TESTS_PARALLEL=''" TESTS_OPTIONS="$make_opts" || return
# root on osx has not enough permission for make install ;)
[ "$TRAVIS_OS_NAME" = "osx" ] && return
# keep PATH to make sure sudo would find $CC
sudo env "PATH=$PATH" $MAKE install || return
}
function check_dist
{
xconfigure \
|| return
$MAKE distcheck || return
}
function travis_install_script
{
if [ "$TRAVIS_OS_NAME" = "osx" ]; then
osx_install_script
return
fi
# install required packages
sudo apt-get -qq update --fix-missing
sudo apt-get install -qq >/dev/null \
bc \
btrfs-tools \
dnsutils \
libcap-ng-dev \
libncursesw5-dev \
libpam-dev \
libudev-dev \
gtk-doc-tools \
mdadm \
ntp \
socat \
|| return
# install only if available (e.g. Ubuntu Trusty)
sudo apt-get install -qq >/dev/null \
libsystemd-daemon-dev \
libsystemd-journal-dev \
|| true
}
function osx_install_script
{
brew update >/dev/null
brew install gettext ncurses socat xz
brew link --force gettext
brew link --force ncurses
OSX_CONFOPTS="
--disable-ipcrm \
--disable-ipcs \
"
# workaround: glibtoolize could not find sed
export SED="sed"
}
function osx_prepare_check
{
[ "$TRAVIS_OS_NAME" = "osx" ] || return 0
# these ones only need to be gnu for our test-suite
brew install coreutils findutils gnu-tar gnu-sed
# symlink minimally needed gnu commands into PATH
mkdir ~/bin
for cmd in readlink seq timeout truncate find xargs tar sed; do
ln -s /usr/local/bin/g$cmd $HOME/bin/$cmd
done
hash -r
export TS_OPT_col_multibyte_known_fail=yes
export TS_OPT_colcrt_regressions_known_fail=yes
export TS_OPT_column_invalid_multibyte_known_fail=yes
}
function travis_before_script
{
set -o xtrace
./autogen.sh
ret=$?
set +o xtrace
return $ret
}
function travis_script
{
local ret
set -o xtrace
case "$MAKE_CHECK" in
nonroot)
check_nonroot
;;
root)
check_root
;;
dist)
check_dist
;;
*)
echo "error, check environment (travis.yml)" >&2
false
;;
esac
# We exit here with case-switch return value!
ret=$?
set +o xtrace
return $ret
}
function travis_after_script
{
local diff_dir
local tmp
# find diff dir from check as well as from distcheck
diff_dir=$(find . -type d -name "diff" | grep "tests/diff" | head -n 1)
if [ -d "$diff_dir" ]; then
tmp=$(find "$diff_dir" -type f | sort)
echo -en "dump test diffs:\n${tmp}\n"
echo "$tmp" | xargs cat
fi
}

55
.travis.yml Normal file
View file

@ -0,0 +1,55 @@
language: c
sudo: required
dist: trusty
git:
depth: 1500
compiler:
- gcc
- clang
env:
- MAKE_CHECK="nonroot"
- MAKE_CHECK="root"
- MAKE_CHECK="dist"
matrix:
include:
# test old Ubuntu 12.04 and OSX for compatibility
- dist: precise
compiler: gcc
env: PRECISE="yes" MAKE_CHECK="root"
- os: osx
osx_image: xcode7.3
compiler: clang
env: MAKE_CHECK="root"
branches:
only:
- master
- next
- /^stable.*/
- /^topic.*/
- /^travis.*/
before_install:
# print some host info
- env | grep -v "encrypted" | LC_ALL=C sort
# workaround travis-ci issue #5301
- unset PYTHON_CFLAGS
install:
- source ./.travis-functions.sh
- travis_install_script
before_script:
- travis_before_script
script:
- travis_script
after_script:
- travis_after_script

275
AUTHORS
View file

@ -15,7 +15,6 @@ PAST MAINTAINERS:
AUTHORS (merged projects & commands):
blkdiscard: Lukas Czerner <lczerner@redhat.com>
blkpr: zhenwei pi <pizhenwei@bytedance.com>
blkzone: Shaun Tancheff <shaun@tancheff.com>
Damien Le Moal <damien.lemoal@wdc.com>
fallocate: Eric Sandeen <sandeen@redhat.com>
@ -32,8 +31,6 @@ AUTHORS (merged projects & commands):
hardlink: Jakub Jelinek <jakub@redhat.com>
hwclock: Bryan Henderson <bryanh@giraffe-data.com>
ipcmk: Hayden James <hayden.james@gmail.com>
irqtop/lsirq: Zhenwei Pi <pizhenwei@bytedance.com>
Sami Kerola <kerolasa@iki.fi>
last/lastb: [merged from sysvinit]
Miquel van Smoorenburg <miquels@cistron.nl>
ldattach: Tilman Schmidt <tilman@imap.cc>
@ -42,9 +39,8 @@ AUTHORS (merged projects & commands):
libmount: Karel Zak <kzak@redhat.com>
libuuid: Theodore Ts'o <tytso@mit.edu>
lscpu: Cai Qian <qcai@redhat.com>
lsblk: Milan Broz <gmazyland@gmail.com>
lsblk: Milan Broz <mbroz@redhat.com>
Karel Zak <kzak@redhat.com>
lsfd: Masatake YAMATO <yamato@redhat.com>
lsipc: Ondrej Oprala <ooprala@redhat.com>
Karel Zak <kzak@redhat.com>
lslocks: Davidlohr Bueso <dave@gnu.org>
@ -73,7 +69,6 @@ AUTHORS (merged projects & commands):
Miquel van Smoorenburg
switch_root: Peter Jones <pjones@redhat.com>
Jeremy Katz <katzj@redhat.com>
uclampse: Qais Yousef <qais.yousef@arm.com>
unshare: Mikhail Gusarov <dottedmag@dottedmag.net>
utmpdump: [merged from sysvinit]
Danek Duvall <duvall@alumni.princeton.edu>
@ -87,14 +82,11 @@ AUTHORS (merged projects & commands):
CONTRIBUTORS:
95p <seven-master@hotmail.de>
Aaron Lu <aaron.lu@intel.com>
A. Bram Neijt <bneijt@gmail.com>
A. Costa <agcosta@gis.net>
Adam Jackson <ajax@redhat.com>
Adriaan de Groot <groot@kde.org>
Adrian Knoth <adi@drcomp.erfurt.thur.de>
Adrian Reber <areber@redhat.com>
Ævar Arnfjörð Bjarmason <avarab@gmail.com>
ahmogit <ahmogit@zplane.com>
Alain Guibert <alguibert+ulng@free.fr>
@ -102,82 +94,57 @@ CONTRIBUTORS:
Alan Jenkins <alan.christopher.jenkins@gmail.com>
Alan Wendt <alan@ezlink.com>
Alban Crequy <alban@kinvolk.io>
Alberto Ruiz <aruiz@gnome.org>
Alden Tondettar <alden.tondettar@gmail.com>
Alejandro Martinez Ruiz <alex@nowcomputing.com>
Alex <aleksandrosansan@gmail.com>
Alexander F Rødseth <xyproto@archlinux.org>
Alexander Kuleshov <kuleshovmail@gmail.com>
Alexander Shishkin <virtuoso@slind.org>
Alexander Troosh <trush@yandex.ru>
Alexandra Surdina <alexandrasurdina@gmail.com>
Alexandre Ghiti <alexandre.ghiti@canonical.com>
Alexandre Peixoto Ferreira <alexandref75@gmail.com>
Alex Bligh <alex@alex.org.uk>
Alexey Galakhov <agalakhov@gmail.com>
Alexey Gladkov <gladkov.alexey@gmail.com>
Alexey Obitotskiy <aleksey.obitotskiy@intel.com>
Alex Ivanov <yourbestfriend@openmailbox.org>
Alex Xu (Hello71) <alex_y_xu@yahoo.ca>
Ali Saidi <alisaidi@amazon.com>
Alison Chaiken <alison@she-devel.com>
Allon Mureinik <amureini@redhat.com>
Alon Bar-Lev <alon.barlev@gmail.com>
Alvaro M. Echevarria
Américo Wang <xiyou.wangcong@gmail.com>
Anatoly Pugachev <matorola@gmail.com>
Andrea Galbusera <gizero@gmail.com>
Andreas Bießmann <biessmann@corscience.de>
Andreas Dilger <adilger@sun.com>
Andreas Henriksson <andreas@fatal.se>
Andreas Hindborg <andreas.hindborg@wdc.com>
Andreas Schwab <schwab@linux-m68k.org>
Andreas Vogel <Andreas.Vogel@anvo-it.de>
Andrew G. Morgan <morgan@kernel.org>
Andre Wild <wild@linux.vnet.ibm.com>
Andrew McGill <list2008@lunch.za.net>
Andrew Nayenko <resver@gmail.com>
Andrew Price <anprice@redhat.com>
Andrew Savchenko <bircoph@altlinux.org>
Andrew Shapiro <anshapiro@gmail.com>
Andrew Vagin <avagin@openvz.org>
Andrew Wilcox <AWilcox@Wilcox-Tech.com>
Andrey Albershteyn <aalbersh@redhat.com>
Andrii Bordunov <andrew.bordunov@gmail.com>
Andrius Štikonas <andrius@stikonas.eu>
Andrzej Krzysztofowicz <ankry@mif.pg.gda.pl>
Andy Grover <agrover@redhat.com>
Andy Lutomirski <luto@amacapital.net>
Aner Perez <aner@mi-bohio.net>
Anna Jonna Ármannsdóttir <annajonna@gmail.com>
Anthony Iliopoulos <ailiop@suse.com>
Anthony Rumble <arumble@extro.ucc.su.OZ.AU>
Antoine Beaupré <anarcat@debian.org>
Anton Blanchard <anton@samba.org>
Antonio Ceballos Roa <aceballos@gmail.com>
Antonio Ospite <ao2@ao2.it>
Anton V. Boyarshinov <boyarsh@altlinux.org>
Anya <anya@neverten.org>
Aravind Ramesh <Aravind.Ramesh@wdc.com>
Ard Biesheuvel <ard.biesheuvel@linaro.org>
Arif E. Nugroho <arif_endro@yahoo.com>
Arkadiusz Miśkiewicz <arekm@maven.pl>
Armin Begovic <armin.begovic@hotmail.com>
Arnaud Mouiche <arnaud.mouiche@invoxia.com>
Arun Persaud <arun@nubati.net>
Attila Áfra <attila.afra@gmail.com>
Aurelien Aptel <aaptel@suse.com>
Aurelien Jarno <aurel32@debian.org>
Aurelien LAJOIE <orel@melix.net>
Austin English <austinenglish@gmail.com>
Awal Garg <awalgarg@gmail.com>
Bader Zaidan <bzaidan@studentsforliberty.org>
Balint Cristian <cbalint@redhat.com>
Bastian Friedrich <bastian.friedrich@collax.com>
Bastian Krause <bst@pengutronix.de>
Bauke Jan Douma <bjdouma@xs4all.nl>
benaryorg <binary@benary.org>
Ben Frankel <ben.frankel7@gmail.com>
Ben Hutchings <ben@decadent.org.uk>
Benjamin Robin <dev@benjarobin.fr>
Benjamin Romer <benjamin.romer@unisys.com>
@ -192,13 +159,12 @@ CONTRIBUTORS:
Bjarni Ingi Gislason <bjarniig@rhi.hi.is>
Björn Jacke <bj@sernet.de>
Bjørn Mork <bjorn@mork.no>
blacknon <blacknon@orebibou.com>
Bob Proulx <rwp@hprwp.fc.hp.com>
Boris Egorov <egorov@linux.com>
Borut Mrak <borutmrak@users.noreply.github.com>
Boyuan Yang <073plan@gmail.com>
Božidar Putanec <bozidarp@yahoo.com>
Brad Forschinger <bnjf@bnjf.id.au>
Bruno Heridet <delapouite@gmail.com>
Bryn M. Reeves <bmr@errorists.org>
B Watson <yalhcru@gmail.com>
Cai Qian <qcai@redhat.com>
@ -207,22 +173,13 @@ CONTRIBUTORS:
Carlos Santos <casantos@datacom.ind.br>
Casper Ti. Vector <caspervector@gmail.com>
Chandan B Rajenda <chandan@linux.vnet.ibm.com>
changlianzhi <changlianzhi@uniontech.com>
chanthmiao <chanthmiao@outlook.com>
chas williams - CONTRACTOR <chas@cmf.nrl.navy.mil>
Chen Qi <Qi.Chen@windriver.com>
Chistyj Arkadij <chstarkd@gmail.com>
Chow Loong Jin <hyperair@ubuntu.com>
Chris Down <chris@chrisdown.name>
Chris Frost <chris@frostnet.net>
Chris Hofstaedtler <zeha@debian.org>
Chris MacGregor <chrismacgregor@google.com>
Chris Metcalf <cmetcalf@mellanox.com>
Chris Morin <chris.morin2@gmail.com>
Christian Bartolomäus <use_v6@aglaz.de>
Christian Brauner <brauner@kernel.org>
Christian Finnberg <christian@finnberg.net>
Christian Göttsche <cgzones@googlemail.com>
Christian Hesse <mail@eworm.de>
Christian von Roques <roques@juliet.ka.sub.org>
Christian Wiese <chris@opensde.org>
@ -236,38 +193,29 @@ CONTRIBUTORS:
Claus Hindsgaul <claus_h@image.dk>
Cliff Wickman <cpw@sgi.com>
Clytie Siddall <clytie@riverland.net.au>
coastal-hiker <coastal-hiker@users.noreply.github.com>
Cody Maloney <cmaloney@theoreticalchaos.com>
Colin Watson <cjwatson@canonical.com>
Cong Wang <xiyou.wangcong@gmail.com>
Corentin Chary <corentincj@iksaif.net>
Cristian Rodríguez <crrodriguez@opensuse.org>
Csaba Kos <csaba.kos@gmail.com>
csbo98 <boliu98@foxmail.com>
Daan De Meyer <daan.j.demeyer@gmail.com>
Daisuke Yamashita <yamad@mb.infoweb.ne.jp>
Damien Goutte-Gattat <dgouttegattat@incenp.org>
Damien Le Moal <damien.lemoal@wdc.com>
dana <dana@dana.is>
Daniel Drake <drake@endlessm.com>
Daniele Pizzolli <dan+dev@toel.it>
Daniel Drake <dsd@laptop.org>
Daniel Kahn Gillmor <dkg@fifthhorseman.net>
Daniel Mierswa <impulze@impulze.org>
Daniel Nylander <po@danielnylander.se>
Daniel Peukert <daniel@peukert.cc>
Daniel Quinlan <quinlan@yggdrasil.com>
Daniel Shahaf <danielsh@apache.org>
Daniel Stodden <daniel.stodden@googlemail.com>
Daniel Thumim <dthumim@mit.edu>
Daniel Trebbien <dtrebbien@gmail.com>
Darren Salt <linux@youmustbejoking.demon.co.uk>
Darsey Litzenberger <dlitz@dlitz.net>
Dave Jones <davej@fedoraproject.org>
Dave Reisner <dreisner@archlinux.org>
David Anes <david.anes@suse.com>
David Brownell <david-b@pacbell.net>
David Cantrell <david@cantrell.org.uk>
David Engraf <david.engraf@sysgo.com>
David Flor <493294@mail.muni.cz>
David Holland <dholland@hcs.harvard.edu>
Davidlohr Bueso <davidlohr@hp.com>
David Miller <davem@davemloft.net>
@ -282,71 +230,43 @@ CONTRIBUTORS:
Dennis Jensen <dennis.h.jensen@siemens.com>
Diego Elio 'Flameeyes' Pettenò <flameeyes@gmail.com>
Dima Kogan <dkogan@cds.caltech.edu>
Dimitri John Ledkov <xnox@ubuntu.com>
Dirk Mueller <dmueller@suse.com>
Disconnect3d <dominik.b.czarnota@gmail.com>
Dmitriy Chestnykh <dm.chestnykh@gmail.com>
Dmitry V. Levin <ldv@altlinux.org>
Đoàn Trần Công Danh <congdanhqx@gmail.com>
Dong Hao <haodong@linux.vnet.ibm.com>
Dongli Zhang <dongli.zhang@oracle.com>
Dongsu Park <dongsu.park@profitbricks.com>
Douglas E. Quale
Doug Quale <quale@saavik.cs.wisc.edu>
Dov Grobgeld <dov.grobgeld@gmail.com>
Dr. David Alan Gilbert <dave@treblig.org>
Dusty Mabe <dusty@dustymabe.com>
Earl Chew <earl_chew@yahoo.com>
Ed Carp
Eduard Bloch <blade@debian.org>
edupont <emeric.dupont@agol.org>
Egor Chelak <egor.chelak@gmail.com>
Elan Ruusamäe <glen@delfi.ee>
Eli Schwartz <eschwartz@archlinux.org>
ellcs <me@ellcs.de>
Elliott Mitchell <ehem+util-linux@drgnwing.com>
Enze Li <lienze@kylinos.cn>
Eric Biggers <ebiggers@google.com>
Eric Desrochers <eric.desrochers@canonical.com>
Érico Nogueira <erico.erc@gmail.com>
Érico Rolim <erico.erc@gmail.com>
Eric Rannaud <e@nanocritical.com>
Eric Rasmussen <ear@usfirst.org>
Eric Sandeen <sandeen@redhat.com>
Eric Simpson <esimpson@ca.ibm.com>
Eric S. Raymond <esr@thyrsus.com>
Eric W. Biederman <ebiederm@xmission.com>
Erik Troan
Ernesto A. Fernández <ernesto.mnd.fernandez@gmail.com>
Erwan Velu <e.velu@criteo.com>
Eryu Guan <guaneryu@gmail.com>
Etienne Mollier <etienne.mollier@mailoo.org>
Eugene Yunak <eugene@yunak.eu>
Evan Green <evangreen86@gmail.com>
Evgeniy Yakushev <yen81@mail.ru>
Evgeny Vereshchagin <evvers@ya.ru>
Fabian Frederick <fabf@skynet.be>
Fabian Groffen <grobian@gentoo.org>
Fabian.Kirsch@dlr.de <Fabian.Kirsch@dlr.de>
Fabian Vogt <fvogt@suse.de>
Fabrice Fontaine <fontaine.fabrice@gmail.com>
Federico Simoncelli <fsimonce@redhat.com>
FeRD (Frank Dana) <ferdnyc@gmail.com>
Filipe Brandenburger <filbranden@google.com>
Flávio Leitner <fleitner@redhat.com>
Florentin Duneau <fduneau@gmail.com>
Florian Weimer <fweimer@redhat.com>
Florian Zumbiehl <florz@florz.de>
Forest Bond <forest@alittletooquiet.net>
Francesco Cosoleto <cosoleto@gmail.com>
Francisco Javier Tsao Santín <tsao@gpul.org>
Franck Bui <fbui@suse.com>
Franco Fichtner <franco@opnsense.org>
François Revol <revol@free.fr>
Fran Diéguez <frandieguez@ubuntu.com>
Frank Mayhar <fmayhar@google.com>
Frank Schaefer <kelledin@gmail.com>
Frantisek Sumsal <frantisek@sumsal.cz>
Frédéric Bothamy <frederic.bothamy@free.fr>
Frederick Grose <fgrose@sugarlabs.org>
Frédéric Marchal <fmarchal@perso.be>
@ -360,13 +280,9 @@ CONTRIBUTORS:
Gabriel de Perthuis <g2p.code@gmail.com>
Gabriele Giacone <1o5g4r8o@gmail.com>
Gabriel M. Schuyler <schuyler@easiest.com>
Gaël PORTAY <gael.portay@collabora.com>
Gao Xiang <hsiangkao@redhat.com>
Georg Schiesser <georg.schiesser@opentech.at>
Georgy Yakovlev <gyakovlev@gentoo.org>
Gerald Schaefer <gerald.schaefer@de.ibm.com>
Gerhard Schneider <gs@ilfb.tuwien.ac.at>
Gero Treuner <gero@70t.de>
Gerrit Renker <gerrit@erg.abdn.ac.uk>
Giacomo <giacomo.perale@gmail.com>
Gilles Espinasse <g.esp@free.fr>
@ -383,34 +299,22 @@ CONTRIBUTORS:
Gustavo Zacarias <gustavo@zacarias.com.ar>
Hajime Taira <htaira@redhat.com>
Hamish Coleman <hamish@zot.org>
Hannes Müller <>
Hannes Reinecke <hare@suse.de>
Hans de Goede <hdegoede@redhat.com>
Hans Holmberg <hans.holmberg@wdc.com>
Harald Hoyer <harald@redhat.com>
Harry Mallon <hjmallon@gmail.com>
Hayden James <hayden.james@gmail.com>
Heiko Carstens <heiko.carstens@de.ibm.com>
Heinrich Schuchardt <xypron.glpk@gmx.de>
heitbaum <rudi@heitbaum.com>
Helge Deller <deller@gmx.de>
Helmut Grohne <helmut@subdivi.de>
Hendrik Lönngren <wikibugs@googlemail.com>
Henne Vogelsang <hvogel@opensuse.org>
Hideki EIRAKU <hdk@igel.co.jp>
Hill Ma <maahiuzeon@gmail.com>
Hiroaki Sengoku <sengoku@senri.gcd.org>
H.J. Lu <hlu@eecs.wsu.edu>
H. Peter Anvin <hpa@zytor.com>
Huang Shijie <shijie@os.amperecomputing.com>
HUANG Wei <weih@opera.com>
Hugh Dickins <hughd@google.com>
Hugo Osvaldo Barrera <hugo@barrera.io>
Humberto Zuazaga
Huschaam Hussain <Huschaam.Hussain@hp.com>
Hushan Jia <hushan.jia@gmail.com>
Ian Jones <ian@contractcoder.biz>
Ian Kent <raven@themaw.net>
Ian Wienand <iwienand@redhat.com>
Icenowy Zheng <icenowy@aosc.io>
Igor Bazhitov <igor.bazhitov@gmail.com>
@ -420,29 +324,20 @@ CONTRIBUTORS:
Imre Kaloz <kaloz@openwrt.org>
Ingo Brückl <ib@wupperonline.de>
Isaac Dunham <ibid.ag@gmail.com>
Issam E. Maghni <issam.e.maghni@mailbox.org>
Ivan Delalande <colona@arista.com>
Ivan Mironov <mironov.ivan@gmail.com>
Jaakko Hyvätti <HYVATTI@cc.helsinki.fi>
Jakob Unterwurzacher <jakobunt@gmail.com>
Jakub Bogusz <qboosh@pld-linux.org>
Jakub Hrozek <jhrozek@redhat.com>
Jakub Wilk <jwilk@jwilk.net>
James Bottomley <James.Bottomley@HansenPartnership.com>
James Buren <ryuo@frugalware.org>
James Calligeros <jcalligeros99@gmail.com>
James Clarke <jrtc27@jrtc27.com>
James Hunt <james.hunt@ubuntu.com>
James Le Cuirot <chewi@aura-online.co.uk>
James Peach <jpeach@apache.org>
James Sanford <jsanfordgit@froop.com>
James Youngman <jay@gnu.org>
Jan Chren (rindeal) <dev.rindeal@gmail.com>
Jan Engelhardt <jengelh@inai.de>
Jan Engelhardt <jengelh@medozas.de>
Jan Kara <jack@suse.cz>
Jan Macku <jamacku@redhat.com>
Jann Horn <jannh@google.com>
Jan Samek <samekh@email.cz>
Jan Sarenik <jsarenik@redhat.com>
Jan (yac) Matějka <JMatejka@suse.cz>
Jan "Yenya" Kasprzak <kas@fi.muni.cz>
@ -453,35 +348,24 @@ CONTRIBUTORS:
Jason Vas Dias <jvdias@redhat.com>
Jean-Loup 'clippix' Bogalho <clippix@lse.epita.fr>
Jean-Philippe ROMAIN <jean-philippe.romain@st.com>
Jeff Layton <jlayton@kernel.org>
Jeff Mahoney <jeffm@suse.com>
Jeffrey Bastian <jbastian@redhat.com>
Jeffrey Ferreira <jeffpferreira@gmail.com>
Jens Kristian Søgaard <jens@mermaidconsulting.dk>
Jeremi Piotrowski <jpiotrowski@linux.microsoft.com>
Jeremy Fitzhardinge <jeremy@suite.sw.oz.au>
Jeremy Huntwork <jhuntwork@lightcubesolutions.com>
Jeremy Katz <katzj@fedoraproject.org>
Jeremy Linton <jeremy.linton@arm.com>
Jeremy Linton <lintonrjeremy@gmail.com>
Jeroen Oortwijn <oortwijn@gmail.com>
Jesper Dahl Nyerup <nyerup@one.com>
Jesse Thilo <jesse.thilo@pobox.com>
Jiaxun Yang <jiaxun.yang@flygoat.com>
jiazhenyuan <jiazhenyuan@uniontech.com>
Jim Meyering <jim@meyering.net>
Jim Patterson <jimp@wegrok.net>
Jindrich Makovicka <makovick@gmail.com>
Jindrich Novy <jnovy@redhat.com>
Jiro SEKIBA <jir@unicus.jp>
Joe Hansen <joedalton2@yahoo.dk>
Johan Herland <johan@herland.net>
Johannes Altmanninger <aclopte@gmail.com>
Johannes Berg <johannes@sipsolutions.net>
Johannes Nixdorf <mixi@shadowice.org>
Johannes Thumshirn <johannes.thumshirn@wdc.com>
John Baublitz <jbaublitz@redhat.com>
John Garry <john.garry@huawei.com>
John Groves <jgroves@micron.com>
John Keeping <john.keeping@lineone.net>
John Lindgren <john.lindgren@tds.net>
@ -491,17 +375,13 @@ CONTRIBUTORS:
Jonathan Liu <net147@gmail.com>
Jon Grant <jg@jguk.org>
Jon Ringle <jon@ringle.org>
Jookia <contact@jookia.org>
Jordi Mas i Hernàndez <jmas@softcatala.org>
Jörg Jenderek <joerg.jen.der.ek@gmx.net>
Joseph Parmelee <jparmele@wildbear.com>
Josep Puigdemont <josep.puigdemont@gmail.com>
Jose Riha <jose1711@gmail.com>
Josh Triplett <josh@joshtriplett.org>
Joshua Hudson <joshudson@gmail.com>
Joshua Watt <jpewhacker@gmail.com>
Josiah Worcester <josiahw@gmail.com>
Jouke Witteveen <j.witteveen@gmail.com>
Juerg Haefliger <juerg.haefliger@canonical.com>
Juha Laiho <jlaiho@ichaos.nullnet.fi>
Jun Hamano <junio@shadow.twinsun.com>
@ -509,7 +389,6 @@ CONTRIBUTORS:
Justin Chen <justinpopo6@gmail.com>
J William Piggott <elseifthen@gmx.com>
KaiGai Kohei <kaigai@kaigai.gr.jp>
Kai Lüke <kailueke@riseup.net>
Kalev Soikonen <ksop@hot.ee>
Kaligule <Code@schauderbasis.de>
Kay Sievers <kay.sievers@vrfy.org>
@ -522,13 +401,10 @@ CONTRIBUTORS:
Kevin E. Martin <martin@cs.unc.edu>
Kevin Fenzi <kevin@scrye.com>
kevin.granade@gmail.com <kevin.granade@gmail.com>
Kevin Hao <kexin.hao@windriver.com>
Kevin Locke <kevin@kevinlocke.name>
Khem Raj <raj.khem@gmail.com>
Kirill Elagin <kirelagin@gmail.com>
Kir Kolyshkin <kir@openvz.org>
Konstantin Khlebnikov <khlebnikov@yandex-team.ru>
kraptor <kraptor@kraptor.com>
Kunihiko IMAI <kimai@iodata.jp>
KyleMahlkuch <Kyle.Mahlkuch@ibm.com>
Lada Trimasova <ltrimas@synopsys.com>
@ -537,35 +413,23 @@ CONTRIBUTORS:
Laurent Vivier <laurent@vivier.eu>
Lauri Nurmi <lanurmi@iki.fi>
Lawrence Rust <lawrence@softsystem.co.uk>
Lennard Hofmann <lennard.hofmann@web.de>
Lennart Poettering <lennart@poettering.net>
Leon <adigitoleo@protonmail.com>
Liam Ryan <liamryandev@gmail.com>
Libor Bukata <lbukata@gmail.com>
Linus Torvalds <torvalds@linux-foundation.org>
lishengyu <lishengyu@uniontech.com>
Li Zefan <lizf@cn.fujitsu.com>
Lorenzo Beretta <vc.net.loreb@gmail.com>
LoSh <losh@example.com>
Lubomir Kundrak <lkundrak@redhat.com>
Lubomir Rintel <lkundrak@v3.sk>
Luca Boccassi <bluca@debian.org>
Luca Boccassi <luca.boccassi@microsoft.com>
Luca BRUNO <luca.bruno@coreos.com>
Luca Ceresoli <luca@lucaceresoli.net>
Luciano Chavez <lnx1138@us.ibm.com>
Ludwig Nussel <ludwig.nussel@suse.de>
Luiz Angelo Daros de Luca <luizluca@gmail.com>
Lukas Czerner <lczerner@redhat.com>
Łukasz Stelmach <l.stelmach@samsung.com>
Makoto Kato <makoto.kt@gmail.com>
Mamatha Inamdar <mamatha4@linux.vnet.ibm.com>
Manatsu Takahashi <takahashi.manatsu@gmail.com>
Mantas Mikulėnas <grawity@gmail.com>
Manuel Bentele <development@manuel-bentele.de>
Marc-Antoine Perennou <Marc-Antoine@Perennou.com>
Marcel Holtmann <marcel@holtmann.org>
Marcel Waldvogel <marcel.waldvogel@trifence.ch>
Marcin Juszkiewicz <marcin.juszkiewicz@linaro.org>
Marco Colombo <m.colombo@ed.ac.uk>
Marco d'Itri <md@Linux.IT>
@ -575,97 +439,72 @@ CONTRIBUTORS:
Marek Otahal <markotahal@gmail.com>
Marek Polacek <mmpolacek@gmail.com>
Mario Blättermann <mario.blaettermann@gmail.com>
Mark Barbone <mark.l.barbone@gmail.com>
Mark Hindley <mark@hindley.org.uk>
Mark McLoughlin <markmc@redhat.com>
Mark Sheppard <mark@ddf.net>
Mark Tinguely <mark.tinguely@hpe.com>
Markus Rinne <markus.ka.rinne@gmail.com>
Martin K. Petersen <martin.petersen@oracle.com>
Martin Roukala (né Peres) <martin.roukala@mupuf.org>
Martin Schlemmer <azarah@gentoo.org>
Martin Schulze <joey@infodrom.org>
Martin Steigerwald <ms@teamix.de>
Masami Hiramatsu <mhiramat@kernel.org>
Masami Ichikawa <masami256@gmail.com>
Masanari Iida <standby24x7@gmail.com>
Masatake YAMATO <yamato@redhat.com>
Masato Suzuki <masato.suzuki@wdc.com>
Masayoshi Mizuma <m.mizuma@jp.fujitsu.com>
Mateusz Marciniec <mateuszmar2@gmail.com>
Matthew Garrett <mjg59@srcf.ucam.org>
Matthew Harm Bekkema <id@mbekkema.name>
Matthew Krupcale <mkrupcale@matthewkrupcale.com>
Matthias Gerstner <matthias.gerstner@suse.de>
Matthias König <mk@phasorlab.de>
Mattias Nissler <mnissler@chromium.org>
Matti Niemenmaa <matti.niemenmaa+git@iki.fi>
Mauricio Faria de Oliveira <mfo@canonical.com>
Maurizio Lombardi <m.lombardi85@gmail.com>
maximilian attems <max@stro.at>
Maxim Levitsky <maximlevitsky@gmail.com>
Maxim V. Dziumanenko <mvd@mylinux.com.ua>
Max Klinger <max@fs.lmu.de>
Meelis Roos <mroos@linux.ee>
Merlin Büge <merlin.buege@tuhh.de>
MeggyCal <MeggyCal@users.noreply.github.com>
Mesutcan Kurt <mesutcank@gmail.com>
Michael Bunk <bunk@iat.uni-leipzig.de>
michael-dev <michael-dev@fami-braun.de>
Michael Forney <mforney@mforney.org>
Michael Glad <glad@daimi.aau.dk>
Michael Kerrisk (man-pages) <mtk.manpages@gmail.com>
Michael Kerrisk <mtk.manpages@gmail.com>
Michael Marineau <michael.marineau@coreos.com>
Michael Piefel <piefel@informatik.hu-berlin.de>
Michael Trapp <michael.trapp@sap.com>
Michał Bartoszkiewicz <mbartoszkiewicz@gmail.com>
Michal Humpula <michal.humpula@hudrydum.cz>
Michal Luscon <mluscon@redhat.com>
Michal Schmidt <mschmidt@redhat.com>
Michal Suchanek <msuchanek@suse.de>
Michal Suchanek <hramrach@gmail.com>
Michel Robitaille <robitail@IRO.UMontreal.CA>
Mike Frysinger <vapier@gentoo.org>
Mike Gilbert <floppym@gentoo.org>
Mike Hommey <mh@glandium.org>
Mikel Olasagasti Uranga <hey_neken@mundurat.net>
Mike Place <mp@saltstack.com>
Mikhail Gusarov <dottedmag@dottedmag.net>
Mikhail Vorobyov <m.vorobyov@cs.msu.ru>
Miklos Szeredi <mszeredi@suse.cz>
Mikulas Patocka <mpatocka@redhat.com>
Milan Bouchet-Valat <nalimilan@club.fr>
Milan Broz <gmazyland@gmail.com>
Milan Broz <mbroz@redhat.com>
Ming Lei <tom.leiming@gmail.com>
Miquel van Smoorenburg <miquels@maestro.htsa.aha.nl>
Mitchum DSouza
Moritz Muehlenhoff <jmm@inutil.org>
M.S.Colclough <m.s.colclough@bham.ac.uk>
Namhyung Kim <namhyung@gmail.com>
Naohiro Aota <naohiro.aota@wdc.com>
Narthorn <narthorn@gmail.com>
Natanael Copa <ncopa@alpinelinux.org>
Nate Clark <nate@neworld.us>
Nathan Rossi <nathan.rossi@xilinx.com>
Nathan Sharp <nwsharp@live.com>
NeilBrown <neilb@suse.com>
Neil Horman <nhorman@tuxdriver.com>
nick black <dankamongmen@gmail.com>
nick black <nick.black@sprezzatech.com>
Nick Holloway <Nick.Holloway@pyrites.org.uk>
Nicolai Dagestad <nicolai@dagestad.fr>
Nicolai Langfeldt <janl@math.uio.no>
Nicolas Boichat <nicolas@boichat.ch>
Nicolas Caramelli <caramelli.devel@gmail.com>
Nicolas Melot <nicolas.melot@ericsson.com>
Nicolas Provost <nprovost@quadriv.com>
Niklas Hambüchen <mail@nh2.me>
Nik Nyby <nikolas@gnu.org>
Nikolay Borisov <nborisov@suse.com>
Nikolay Sivov <nsivov@codeweavers.com>
Nilgün Belma Bugüner <nilgun@buguner.name.tr>
nl6720 <nl6720@gmail.com>
Noel Cragg <noel@squeezehead.com>
Noel Kuntze <noel@familie-kuntze.de>
Norbert Buchmuller <norbi@nix.hu>
OGAWA Hirofumi <hirofumi@mail.parknet.co.jp>
Oliver Falk <oliver@linux-kernel.at>
@ -676,8 +515,6 @@ CONTRIBUTORS:
osexp2000 <osexp2000@gmail.com>
Pádraig Brady <P@draigBrady.com>
Pali Rohár <pali.rohar@gmail.com>
panchenbo <panchenbo@uniontech.com>
Pankaj Raghav <p.raghav@samsung.com>
Pascal Terjan <pterjan@mandriva.com>
Patrice Dumas <pertusus@free.fr>
Patrick Plagwitz <patrick.plagwitz@fau.de>
@ -686,17 +523,13 @@ CONTRIBUTORS:
Paul Eggert <eggert@cs.ucla.edu>
Paul Fox <pgf@laptop.org>
Paulius Zaleckas <paulius.zaleckas@teltonika.lt>
Paul Laffitte <plaffitt@gmail.com>
Paul Menzel <paulepanter@users.sourceforge.net>
Paul M <paul@chezp4ul.fr>
Paul Sarena <paul@sarena.ca>
Pavel Butsykin <pbutsykin@virtuozzo.com>
Pavel Maryanov <acid@jack.kiev.ua>
pcpa <paulo.cesar.pereira.de.andrade@gmail.com>
Pedro Albuquerque <pmra@protonmail.com>
Pedro Miguel Carvalho <PedroMC@pmc.com.pt>
Pedro Ribeiro <p.m42.ribeiro@gmail.com>
Pedro Tammela <pctammela@mojatatu.com>
peppe <g1pi@libero.it>
Peter Breitenlohner <peb@mppmu.mpg.de>
Peter Cordes <peter@cordes.ca>
@ -707,32 +540,21 @@ CONTRIBUTORS:
Peter Rajnoha <prajnoha@redhat.com>
Peter Tobias <tobias@server.et-inf.fho-emden.de>
Peter Tyser <ptyser@xes-inc.com>
Peter Ujfalusi <peter.ujfalusi@linux.intel.com>
Peter Volkov <pva@gentoo.org>
Peter Wu <peter@lekensteyn.nl>
Petr Písař <petr.pisar@atlas.cz>
Petr Štetiar <ynezz@true.cz>
Petr Uzel <petr.uzel@suse.cz>
Petr Vorel <pvorel@suse.cz>
Phan Vinh Thinh <teppi82@gmail.com>
Philip Hazelden <philip.hazelden@gmail.com>
Philippe Reynes <philippe.reynes@softathome.com>
Philipp Marek <philipp.marek@linbit.com>
Philip Prindeville <philipp@redfish-solutions.com>
Philipp Thomas <pth@suse.de>
Phillip Susi <psusi@ubuntu.com>
Phil Ruffwind <rf@rufflewind.com>
Pierre Hauweele <antegallya@gmail.com>
Pierre Labastie <pierre.labastie@neuf.fr>
Pietro Castelli
Pino Toscano <toscano.pino@tiscali.it>
Platon Pronko <platon7pronko@gmail.com>
Portisch <hugo.portisch@yahoo.de>
Po-Yu Chuang <ratbert@faraday-tech.com>
Prarit Bhargava <prarit@redhat.com>
Qais Yousef <qais.yousef@arm.com>
Quentin Rameau <quinq@fifth.space>
Radka Skvarilova <rskvaril@redhat.com>
Rafael Aquini <aquini@redhat.com>
Rafael Ferreira <rafael.f.f1@gmail.com>
Rafael Fontenelle <rafaelff@gnome.org>
@ -747,11 +569,9 @@ CONTRIBUTORS:
Randy Dunlap <randy.dunlap@oracle.com>
Raphael S. Carvalho <raphaelsc@cloudius-systems.com>
Rasmus Villemoes <rasmus.villemoes@prevas.dk>
ratijas <me@ratijas.tk>
Raul Gutierrez Segales <rgs@itevenworks.net>
Ray Wang <wanglei1123@gmail.com>
Rian Hunter <rian@alum.mit.edu>
Richard Allen <rsaxvc@rsaxvc.net>
Richard Fuchs <rfuchs@sipwise.com>
Richard Tollerton <rich.tollerton@ni.com>
Richard Weinberger <richard@nod.at>
@ -762,11 +582,8 @@ CONTRIBUTORS:
Rick Sladkey <jrs@world.std.com>
Riku Voipio <riku.voipio@iki.fi>
Rik van Riel <riel@redhat.com>
Ritika Srivastava <ritika.srivastava@oracle.com>
ritikrajdev <ritikrajdev761@gmail.com>
Robert Förster <Dessa@gmake.de>
Robert Millan <rmh@debian.org>
Roberto Bergantinos Corpas <rbergant@redhat.com>
Robert Schiele <rschiele@gmail.com>
Roddy Shuler <roddy@endlessm.com>
Rodrigo Campos <rodrigo@sdfg.com.ar>
@ -776,46 +593,31 @@ CONTRIBUTORS:
Romain Bouvier <skunnyk@alteroot.org>
Romain Izard <romain.izard.pro@gmail.com>
Romain Naour <romain.naour@gmail.com>
Ronan Pigott <ronan@rjp.ie>
Ronny Chevalier <chevalier.ronny@gmail.com>
Ron Sommeling <sommel@sci.kun.nl>
Rosen Penev <rosenp@gmail.com>
Ross Biro <biro@yggdrasil.com>
Ross Burton <ross.burton@arm.com>
Rostislav Skudnov <rostislav@tuxera.com>
Roy Peled <the.roy.peled@gmail.com>
Ruediger Meier <ruediger.meier@ga-group.nl>
Rui Zhao (renyuneyun) <renyuneyun@gmail.com>
Rupesh Girase <rgirase@redhat.com>
Ryan Finnie <ryan@finnie.org>
Samanta Navarro <ferivoz@riseup.net>
Sami Kerola <kerolasa@iki.fi>
Sami Liedes <sami.liedes@iki.fi>
Sami Loone <sami@loone.fi>
Samir Benmendil <me@rmz.io>
Sam James <sam@gentoo.org>
Sam Morris <sam@robots.org.uk>
Samuel Dionne-Riel <samuel@dionne-riel.com>
Samuel Ortiz <sameo@linux.intel.com>
Samuel Thibault <samuel.thibault@aquilenet.fr>
Samuel Thibault <samuel.thibault@ens-lyon.org>
Sam Varshavchik <mrsam@courier-mta.com>
Sam Voss <sam.voss@gmail.com>
Sander van Malssen <svm@kozmix.ow.nl>
Santiago Vila Doncel <sanvila@unex.es>
Sascha Sommer <ssommer@suse.de>
Sassan Panahinejad <sassan@sassan.me.uk>
Scott James Remnant <scott@ubuntu.com>
Scott Moser <smoser@ubuntu.com>
Scott Shambarger <devel@shambarger.net>
Scott Telford <st@epcc.ed.ac.uk>
Sean Anderson <seanga2@gmail.com>
Sebastian Andrzej Siewior <sebastian@breakpoint.cc>
Sebastian Krahmer <krahmer@suse.de>
Sebastian Pucilowski <smopucilowski@gmail.com>
Sebastian Rasmussen <sebras@gmail.com>
Sebastian Schrader <sebastian.schrader@ossmail.de>
Sébastien Helleu <flashcode@flashtux.org>
Seong-ho Cho <darkcircle.0426@gmail.com>
Serge Hallyn <serge.hallyn@ubuntu.com>
Sergei Antonov <saproj@gmail.com>
Sergey Gusarov <laborer2008@gmail.com>
@ -823,69 +625,46 @@ CONTRIBUTORS:
Sevan Janiyan <venture37@geeklan.co.uk>
sgargel <sgargel@yahoo.it>
Shachar Shemesh <shachar@debian.org>
Shahid Laher <govellius@gmail.com>
Shaun Tancheff <shaun@tancheff.com>
Shigeki Morishima <s.morishima@fujitsu.com>
Shigeki Morishima <s.morishima@jp.fujitsu.com>
Shin'ichiro Kawasaki <shinichiro.kawasaki@wdc.com>
Shunsuke Nakamura <nakamura.shun@jp.fujitsu.com>
Simon Mihevc <simonmihevc@email.si>
Sinan Kaya <sinan.kaya@microsoft.com>
sluidfoe <sluidfoe@gmail.com>
Smitty <me@smitop.com>
Sol Boucher <sboucher@cmu.edu>
Søren Holm <sgh@sgh.dk>
Soumendra Ganguly <soumendraganguly@gmail.com>
SOUMENDRA GANGULY <soumendra@indra.local>
s.p@orbitalfox.com <s.p@orbitalfox.com>
Stanislav Brabec <sbrabec@suse.cz>
Stefan Krah <stefan@bytereef.org>
Stefan Schubert <schubi@suse.de>
Stef Walter <stefw@redhat.com>
Stepan Kasal <skasal@redhat.com>
Štěpán Němec <snemec@redhat.com>
Stéphane Aulery <lkppo@free.fr>
Stephan Maka <stephan@spaceboyz.net>
Stephan Müller <fruktopus@gmail.com>
Stephen Gallimore
Stephen Hemminger <shemminger@vyatta.com>
Stephen Kitt <steve@sk2.org>
Stephen Tweedie <sct@dcs.ed.ac.uk>
Steve Grubb <sgrubb@redhat.com>
Steve Kenton <skenton@ou.edu>
Steven Honeyman <stevenhoneyman@users.noreply.github.com>
Steven J. Magnani <steve@digidescorp.com>
Steven S. Dick <ssd@nevets.oau.org>
Steven Smith <sos22@archy.org.uk>
Steve Philp
Stewart Smith <stewart@linux.vnet.ibm.com>
Sukadev Bhattiprolu <sukadev@linux.vnet.ibm.com>
Sumanth Korikkar <sumanthk@linux.ibm.com>
Sven Eckelmann <sven.eckelmann@gmx.de>
Sven Jost <sven.jost@googlemail.com>
Sven Wiltink <swiltink@transip.nl>
Sweet Tea Dorminy <sweettea@mit.edu>
taiyu <taiyu.len@gmail.com>
Takeshi Hamasaki <hmatrjp@users.sourceforge.jp>
tamz <totemz@protonmail.com>
Temuri Doghonadze <temuri.doghonadze@gmail.com>
Terry Burton <tez@terryburton.co.uk>
Thayne McCombs <thayne@lucidchart.com>
Theodore Ts'o <tytso@mit.edu>
Thiébaud Weksteen <tweek@google.com>
Thierry Reding <thierry.reding@avionic-design.de>
Thierry Vignaud <thierry.vignaud@gmail.com>
Thomas Abraham <tabraham@suse.com>
Thomas Bächler <thomas@archlinux.org>
Thomas Deutschmann <whissi@gentoo.org>
Thomas Fehr <fehr@suse.de>
Thomas Haller <thaller@redhat.com>
Thomas Kaiser <ThomasKaiser@users.noreply.github.com>
Thomas Petazzoni <thomas.petazzoni@free-electrons.com>
Thomas Schwinge <thomas@codesourcery.com>
Thomas Voss <mail@thomasvoss.com>
Thomas Weißschuh <thomas@t-8ch.de>
Thorsten Glaser <tg@mirbsd.org>
Thorsten Kukuk <kukuk@suse.com>
Thorsten Wilmer <wilmer.thorsten@gmail.com>
Tilman Schmidt <tilman@imap.cc>
Tim Gardner <tim.gardner@canonical.com>
@ -893,57 +672,37 @@ CONTRIBUTORS:
Timo Juhani Lindfors <timo.lindfors@iki.fi>
Timo Warns <Warns@Pre-Sense.DE>
Tim Waugh <twaugh@redhat.com>
Tj <hacker@iam.tj>
Tobias Klauser <tklauser@distanz.ch>
Tobias Stoeckmann <tobias@stoeckmann.org>
Todd Lewis <todd_lewis@unc.edu>
Todd Lewis <utoddl@email.unc.edu>
ToddRK <ToddRK@example.com>
Tomas Winkler <tomas.winkler@intel.com>
Tom Gundersen <teg@jklm.no>
Tomislav Krznar <tomislav.krznar@gmail.com>
Tommi Kyntola <kynde@iki.fi>
Tommy Thorn
Tomoaki Teshima <tomoaki.teshima@gmail.com>
Tom Prince <tom.prince@ualberta.net>
Toni Uhlig <matzeton@googlemail.com>
Tony Asleson <tasleson@redhat.com>
Toomas Losin <tlo@lenrek.net>
Topi Miettinen <toiwoton@gmail.com>
Torsten Hilbrich <torsten.hilbrich@secunet.com>
Toshi Kani <toshi.kani@hp.com>
Trần Ngọc Quân <vnwildman@gmail.com>
Tycho Andersen <tycho@tycho.ws>
u2386 <hugo.cavan2386@gmail.com>
utoddl <todd_lewis@unc.edu>
Vaclav Dolezal <vdolezal@redhat.com>
Valerie Aurora <vaurora@redhat.com>
Vasant Hegde <hegdevasant@linux.vnet.ibm.com>
Vasilis Liaskovitis <vliaskovitis@suse.com>
Vicente Jimenez Aguilar <googuy@gmail.com>
Victor Dodon <dodonvictor@gmail.com>
Viktor Rosendahl (BMW) <viktor.rosendahl@gmail.com>
Ville Skyttä <ville.skytta@iki.fi>
Vincent Deffontaines <vincent@gryzor.com>
Vincent McIntyre <vincent.mcintyre@csiro.au>
Vincent Smeets <Vincent.VSmeets@GMail.com>
Vincent Stehlé <vincent.stehle@arm.com>
Vinnie Magro <vmagro@fb.com>
Vitezslav Cizek <vcizek@suse.cz>
Vladimir Brednikov <vbrednikov@gmail.com>
Vladimir Slavik <vslavik@redhat.com>
Vladimir 'φ-coder/phcoder' Serbinenko <phcoder@gmail.com>
Vojtěch Eichler <vojta.eich@gmail.com>
Vojtech Trefny <vtrefny@redhat.com>
Volker Kuhlmann <v.kuhlmann@elec.canterbury.ac.nz>
Volker Schatz <oss@volkerschatz.com>
Vratislav Podzimek <vpodzime@redhat.com>
Waldemar Brodkorb <wbx@openadk.org>
WANG Chao <wcwxyz@gmail.com>
Wang Shilong <wshilong@ddn.com>
WANG Xuerui <git@xen0n.name>
Wanlong Gao <wanlong.gao@gmail.com>
Warner Losh <imp@FreeBSD.org>
Wayne Pollock <profwaynepollock@gmail.com>
Wayne R. Roth <wayneroth42@gmail.com>
Wei-Lun Chao <bluebat@member.fsf.org>
@ -952,33 +711,21 @@ CONTRIBUTORS:
Wieland Hoffmann <themineo@gmail.com>
William Pitcock <nenolod@dereferenced.org>
Will Johansson <will.johansson@gmail.com>
Will Jordan <will.jordan@gmail.com>
Wojtek Kaniewski <wojtekka@toxygen.net>
Wolfgang Richter <wolf@cs.cmu.edu>
Wolfram Sang <wsa@kernel.org>
W. Trevor King <wking@tremily.us>
WUEBBELS, Josef <Josef.WUEBBELS@mtu.de>
Wylmer Wang <wantinghard@gmail.com>
W.Z. Venema
Xi Ruoyao <xry111@xry111.site>
Yann Droneaud <yann@droneaud.fr>
Yannick Le Pennec <yannick.lepennec@live.fr>
Yegor Yefremov <yegorslists@googlemail.com>
Yonatan Goldschmidt <yon.goldschmidt@gmail.com>
YmrDtnJu <YmrDtnJu@users.noreply.github.com>
Yoshihiro Takahashi <ytakahashi@miraclelinux.com>
Yousong Zhou <yszhou4tech@gmail.com>
Yuri Chornoivan <yurchor@ukr.net>
Yuriy M. Kaminskiy <yumkam@gmail.com>
Yuriy Nazarov <nazarov.yuriy.pavlovich@gmail.com>
Yu Zhiguo <yuzg@cn.fujitsu.com>
Zachary Catlin <z@zc.is>
Zac Medico <zmedico@gentoo.org>
Zane van Iperen <zane@zanevaniperen.com>
Zbigniew Jędrzejewski-Szmek <zbyszek@in.waw.pl>
Zdenek Behan <rain@matfyz.cz>
Zeeshan Ali (Khattak) <zeeshanak@gnome.org>
zhanchengbin <zhanchengbin1@huawei.com>
zhenwei pi <pizhenwei@bytedance.com>
Zhi Li <lizhi1215@gmail.com>
Мирослав Николић <miroslavnikolic@rocketmail.com>
наб <nabijaczleweli@nabijaczleweli.xyz>

View file

@ -1,3 +1,3 @@
See version control history.
https://git.kernel.org/pub/scm/utils/util-linux/util-linux.git/log
http://git.kernel.org/?p=utils/util-linux/util-linux.git;a=log

View file

@ -1,74 +1,43 @@
See also:
https://github.com/util-linux/util-linux/issues?q=is%3Aissue+is%3Aopen+label%3ATODO
all
---
- use gettext() for column names on output in libsmartcols based tools and
accept trantated as well as original names on command line (lsblk -o NAME,SIZE).
https://github.com/util-linux/util-linux/issues/1291
tests
-----
- add MacOS to GitHub Actions (.github/workflows/cibuild.yml). Note, we have used
Mac in Travis-CI (see .travis.yml).
- add Coverity to GitHub Actions (see for example .github/workflows/coverity.yml
in systemd repo).
fstrim
------
- "fstrim --fstab" uses root= from /proc/cmdline to get root FS when it's missing
in fstab file. This is fragile (due to missing root= or the root FS is not
accessible). The best seems to parse mountinfo and use mnt_table_get_root_fs()
as a fallback solution. https://github.com/util-linux/util-linux/issues/1266.
script (lib/pty-session.c)
--------------------------
- (!) add #ifdefs and optional code for non-signalfd() systems
docs
----
- use terminal hyperlinks (for example for --help)
try on terminal: printf 'For more details see \e]8;;man:fdisk(8)\e\\fdisk(8)\e]8;;\e\\.\n'
https://gist.github.com/egmontkob/eb114294efbcd5adb1944c9f3cb5feda
rev
---
- support huge input lines (for example read input by small fixed buffer
rather than try allocate all buffer for a whole line)
see: https://github.com/util-linux/util-linux/issues/972
Note that items with (!) have high priority.
col
---
- use unsigned sizes for columns and lines
- check for limits to avoid segfaults
- make it more robust
https://github.com/util-linux/util-linux/issues/749
https://github.com/karelzak/util-linux/issues/749
cal
---
- add option to print calendar in vertical way
https://github.com/karelzak/util-linux/issues/604
- support another --reforms, see for example freebsd version
https://github.com/freebsd/freebsd/blob/master/usr.bin/ncal/ncal.c#L72
lscpu
-----
- add "Boost/Turbo: true|false" based on /sys/devices/system/cpu/intel_pstate/no_turbo and
/sys/devices/system/cpu/cpufreq/boost
- add --freq output to visualise CPU use, see https://github.com/util-linux/util-linux/issues/1314
- read cpuid and uname information from file if --sysroot is specified, then
we can prepare regression tests completely independent on hw and architecture.
lsblk
-----
- currently it does not show mountpoint for all devices in btrfs RAID. It's because
/proc/#/mountinfo contains reference to the one device only. Maybe we can add some
btrfs specific code to provide a better output for FS based stacks. Not sure.
https://bugzilla.redhat.com/show_bug.cgi?id=1084453
nsenter(1)
----------
- read the default UID and GID from the target process.
http://thread.gmane.org/gmane.linux.utilities.util-linux-ng/9553/focus=9585
hwclock
------
- use /var/lib/hwclock/drift to store hw-clock drift numbers.
- use /etc/adjtime as read-only for UTC/LOCAL information only
- the /var/lib/hwclock/drift should be implemented backwardly compatible,
it means use the file only if exists, otherwise follow /etc/adjtime
- see topic/hwclock-drift-file branch
bash completion
---------------
@ -80,23 +49,21 @@ bash completion
libmount (mount/umount)
-----------------------
- mnt_context_get_excode() does not return error messages from /sbin/[u]mount.<type>
external helpers. It is disadvantages in same cases (non-terminal programs).
The solution is to use pipe(), keep output from helper in memory and return it later
by mnt_context_get_excode() (or mnt_context_get_helper_output(), etc.). This feature
should be optional and disabled by default.
see: https://github.com/util-linux/util-linux/issues/1208
- add --onlyonce to force mount(8) to check if mountpoint is already used. Now
"already mounted" detection is used for --all only. The problem is if you
call "mount <mountpoint>" more than once for in fstab defined tmpfs (or network
filesystem etc.). In this case kernel does not return EBUSY, but a new instance
of the FS is created. https://github.com/util-linux/util-linux/issues/448
of the FS is created. https://github.com/karelzak/util-linux/issues/448
(... just idea, maybe wrong idea)
- Extend mount(8) command line for mount flags modification without remount:
"mount modify --clear noexec --set nodev,private,ro /mnt"
This functionality should be implemented by mount_setattr() syscall.
- support CAP_SYS_ADMIN; for mount(2) syscall the CAP_SYS_ADMIN is good
enough. Unfortunately, mount(8) does more things like check for filesystem
type (but it's usually done by udev, so root perms are unnecessary), create
loop devices, write to /run/mount/utab or /etc/mtab, etc.
It would be nice to improve libmount to check for CAP_SYS_ADMIN if suid not
set and allow to use it for simple tasks where no another operation is
necessary.
partx
-----
@ -110,17 +77,15 @@ getopt
Currently, it outputs -- for every option it doesn't recognize but leaving the
option as it is could beneficial wrapper scripts which could then pass the
options they don't recognize as they are to the command they are wrapping.
https://github.com/util-linux/util-linux/issues/701
https://github.com/karelzak/util-linux/issues/701
docs
----
- (!) use something better than gtk-doc for libmount and libblkid (doxygen?)
- (!) use something better than gtk-doc for libmount and libblkid (doxyden?)
- (!) add API documentation to libuuid
- Improve line breaks in man pages and review markup
login-utils:
-----------
@ -136,28 +101,11 @@ login-utils:
* note that shadow-utils newgpr(1) provides support for syslog and audit log.
libsmartcols / column -t
------------------------
- add column --table-header-color
- add support for border of table
* extend 'struct libscols_symbols', use box-drawing chars UTF8/ASCII
* add scols_table_enable_border()
column(1):
- add "--output-width unlimited" and no call cols_table_set_termwidth() and
cols_table_set_termforce() in this case. See https://github.com/util-linux/util-linux/issues/1618
libblkid
--------
- extend ZFS proper to scan for more uberblocks if BLKID_SUBLKS_MAGIC flag is set.
This solution will make wipefs(8) more usable as ZFS is extremely variable with
additional root blocks locations. See https://github.com/util-linux/util-linux/issues/1228
- (!) add support for BitLocker Drive Encryption
https://github.com/util-linux/util-linux/issues/617
https://github.com/karelzak/util-linux/issues/617
https://github.com/libyal/libbde/blob/master/documentation/BitLocker%20Drive%20Encryption%20(BDE)%20format.asciidoc
- (!) add support for dasd PT (used for example on s390)
@ -172,7 +120,13 @@ libfdisk
* add "nested-label:" block to sfdisk --dump
* add "nested-partitiontable" to sfdisk --JSON
* support nested labels parsing from dump
see https://github.com/util-linux/util-linux/issues/850
see https://github.com/karelzak/util-linux/issues/850
sfdisk
------
- don't backup PT in interactive mode before write to the devices is requested,
see https://github.com/karelzak/util-linux/issues/852
misc
----

View file

@ -2,13 +2,6 @@ The following is a list of commands or features that are deprecated. All
deprecated utils are in maintenance mode and we keep them in source tree for
backward compatibility only.
what: column --table-empty-lines
why: renamed to --keep-empty-lines
since: v2.37
--------------------------
what: hwclock --debug
why: renamed to --verbose, and may be repurposed later.
since: v2.32
@ -121,4 +114,4 @@ Copyright (C) 1997 The Open Group
line
pg
https://pubs.opengroup.org/onlinepubs/7908799/xcu/intro.html#tag_001_003_003
http://pubs.opengroup.org/onlinepubs/7908799/xcu/intro.html#tag_001_003_003

View file

@ -2,15 +2,8 @@ The common case
./autogen.sh && ./configure && make
If something fails read the last lines. Typical reason to
fail is a missing dependency, such as libtool or gettext.
make install-strip
Note that on the production systems it is strongly recommended to use
"make install-strip" to install binaries and libraries. The result
from the standard "make install" may produce large binaries with
unnecessary symbols.
If something fails read the last lines. Typical reason to
fail is a missing dependency, such as libtool or gettext.
Autotools

View file

@ -9,8 +9,8 @@ CONTENTS
Sending Patches
* send your patches to the mailing list (see ../README) or by
github.com pull request.
* send your patches to the mailing list.
See ../README.
* email is accepted as an inline patch with, or without, a git pull
request. Pull request emails need to include the patch set for review
@ -31,10 +31,6 @@ Sending Patches
* don't include generated (autotools) files in your patches.
Hint: use 'git clean -Xd'.
* don't include po/ (translations) changes to the upstream patches.
The po/ stuff is maintained on https://translationproject.org/domain/util-linux.html
and updated always before the next release.
* neutrality: the files in util-linux should be distribution-neutral.
Packages like RPMs, DEBs, and the rest, are not provided. They should
be available from the distribution.
@ -47,7 +43,7 @@ Repositories & Branches
We use this repository for master and stable branches only.
* Backup repository at github.com:
git clone git://github.com/util-linux/util-linux.git
git clone git://github.com/karelzak/util-linux.git
We use this repository to backup kernel.org and for pull requests,
issues tracking and topic branches. The master and stable branches are
@ -57,13 +53,10 @@ Repositories & Branches
* Branches:
master - development for the next release
stable/* - stable maintenance releases
Github only:
next - optionally used when master branch is frozen due to -rcN releases
topic/* - long time development
master - development for the next release
next - optionally used when master branch is frozen due to -rcN releases
topic/* - long time development
stable/* - stable maintenance releases
Patching Process
@ -162,7 +155,7 @@ Coding Style
* the preferred coding style is based on the linux kernel coding-style.
Available here:
https://docs.kernel.org/process/coding-style.html
http://git.kernel.org/cgit/linux/kernel/git/torvalds/linux.git/plain/Documentation/process/coding-style.rst
* use 'FIXME:' with a good description, if you want to inform others
that something is not quite right, and you are unwilling to fix the
@ -244,5 +237,5 @@ Standards Compliance
The Single UNIX(TM) Specification, Version 2
Copyright (C) 1997 The Open Group
https://pubs.opengroup.org/onlinepubs/7908799/xcuix.html
http://pubs.opengroup.org/onlinepubs/7908799/xcuix.html

View file

@ -1,2 +1,188 @@
Since v2.37 util-linux project uses asciidoc format to maintain man pages.
See man-common/manpage-stub.adoc for more details.
.\" This is a util-linux manual page example in troff format.
.\"
.\" The .TH macro expects the following arguments:
.\" title section date footer header
.\" The title is usually the command name.
.\" The section must match the filename extension.
.\" The date is the month and year when the last update happened.
.\" The footer is fixed to "util-linux".
.\" The header is a textual description of the section:
.\" 1 "User Commands"
.\" 2 "System calls"
.\" 3 "Programmer's Manual"
.\" 4 "Special Files"
.\" 5 "File Formats"
.\" 6 "Games"
.\" 7 "Miscellanea"
.\" 8 "System Administration"
.\"
.\" Please read `man 7 groff_man' to see how to use the various macros.
.\"
.TH EXAMPLE "1" "April 2016" "util-linux" "User Commands"
.SH NAME
example \- a util-linux man-page howto
.SH SYNOPSIS
.B example
[options]
.I argument
.SH DESCRIPTION
Each manual page needs some sort of description of the command.
Write such here.
.SH OPTIONS
.TP
\fB\-n\fR, \fB\-\-no\-argument\fR
This option does not use an argument.
.TP
\fB\-\-optional\fR[\fI=argument\fR]
Tell in this description that the
.I argument
is optional, and what happens when it is or is not given. Notice that the word
.I argument
is not abbreviated as is customary in the usage text. For example, when the
usage text uses the argument
.IR num ,
the manual page should say
.IR number .
.IP
Notice that after release v2.28 it was decided that introducing new options
taking optional arguments should be limited to long-only options. This is
done primarily to avoid problematic behaviour of short options. Imagine for
example normal option
.B \-n
and optional option
.BR \-o .
One will expect
.B command \ \-no
and
.B command \ \-on
to be the same, but in fact the former is two separate options while the
later will use
.B n
as option argument of
.BR -o .
So it is best to avoid short forms of optional options altogether.
.TP
\fB\-r\fR, \fB\-\-required\fR \fIargument\fR
Tell in this description that the
.I argument
is required.
.TP
\fB\-V\fR, \fB\-\-version\fR
Display version information and exit.
.TP
\fB\-h\fR, \fB\-\-help\fR
Display help text and exit.
.SH NOTES
Tell details that users might need to know. For example, kernel feature or
version requirements.
.PP
The man-page source lines should not exceed 80 characters in length.
.PP
Do not leave empty lines in the groff input. If you need a break or a new
paragraph, use the appropriate groff macros. See
.BR groff_man (7)
how to use man page macros.
.PP
The use cases of
.I italic
(which is underlined on a terminal) and
.B bold
are not strictly defined. The main convention is that
.I symbolic arguments
use italic, and
.B commands
and
.B literal arguments
use bold, and
.I other highlights
use
.B either
one.
.\"
.\" The manual page comments are undervalued way of adding clarifications
.\" quite not belong to the manual, questions, TODO items etc. Feel free
.\" to use them.
.\"
.PP
When in the source a new sentence begins somewhere midline, it should use a
double space before its initial letter. This is done because \fBgroff\fR
uses a double space after a sentence when this sentence ends at the end of
an input line and the next sentence begins on the next line.
Unless a double space is used before other sentence starts as well, the
spacing style will be inconsistent.
.SH ENVIRONMENT
Tell which environment variables affect, and how, the execution of the command.
.TP
.B EXAMPLE_PATH
Configuration file path. Notice that well-known environment variables, such as
.BR HOME ,
do not need explanation.
.SH FILES
Tell which file(s) the command uses.
.TP
.B $EXAMPLE_PATH
.TQ
.B $HOME/.example.conf
.TQ
.B /etc/example.conf
What are these files, in which order are they read, and will the evaluation
end or continue if one of them is found.
In case the explanation is not simple, write a separate "Special Files"
manual page that tells about syntax, meaning of key-value settings, etc.
This "Special Files" manual page then needs to be referred in the
.B SEE ALSO
section.
.TP
.B /var/log/example.log
Another file.
.SH EXAMPLES
Write typical and/or clever use examples here. The below examples are stupid,
and you should never write them in a real man page.
.TP
.B example -h
Output help screen.
.TP
.B example -V
Output version information.
.SH "EXIT STATUS"
This section can be left out if the command has only two return values,
.B 0
for success and
.B 1
for failure. Use of
.B sysexits.h
return values must be mentioned, but does not need to be explained.
.PP
.RS
.PD 0
.TP
.B 0
success
.TP
.B 1
failure
.TP
.B 2
tell why this could happen
.TP
.B 3
etc
.PD
.RE
.SH AUTHORS
.MT rjh@\:example.org
Random J. Hacker
.ME
.br
.MT fred@\:example.com
Fred Foobar
.ME
.SH "SEE ALSO"
.BR groff_man (7),
.BR foo (1),
.BR bar (8)
.SH AVAILABILITY
The example command is part of the util-linux package and is available from
.UR https://\:www.kernel.org\:/pub\:/linux\:/utils\:/util-linux/
Linux Kernel Archive
.UE .

View file

@ -12,7 +12,7 @@ Setup
1. Find a git server that can be reached from anywhere in internet
anonymously. Github is for example a popular choice.
2. Create your own util-linux contributor repository, and push an upstream
2. Create your own util-linux contributor repository, and push a upstream
clone to there.
3. In these instructions the upstream remote repository is called
@ -43,7 +43,7 @@ is needed to stay up to date with upstream.
git checkout master
git branch textual
# spent here most of the effort
git push yourgit textual:textual
git push yourbranch textual:textual
5. Do not worry if you used stupid-and-wrong branch name, it can be fixed
before submission.
@ -128,17 +128,7 @@ git rebase -i master
# change something
git push -f yourgit textual:textual
4. You have two ways how to send your pull request:
4.1 Github pull request
This is recommended way for your small and trivial changes, or for
work-in-progress projects (rewrites, new commands, etc.). All you
need is to press "pull request" button on GitHub.
4.2. Send your work to the mailing list
Assuming the changes look good send them to mail list. Yes, the all
4. Assuming the changes look good send them to mail list. Yes, the all
of them! Sending pull request with github is not visible for project
contributors, and they will not have change to review your changes.

View file

@ -67,14 +67,6 @@
Please, be careful and use these tests only for development and never on
production system.
fuzz targets
------------
The fuzz targets can be built and run along with the other tests (after installing
clang):
$ ./tools/config-gen fuzz
$ make check
environment variables
---------------------
@ -124,29 +116,31 @@ TS_OPT_testdir_[testscript_]memcheck="<yes|no>"
External services
-----------------
Coveralls coverage reports
Travis CI - automatically executed for all github commits.
URL: https://coveralls.io/github/util-linux/util-linux
URL: https://travis-ci.org/karelzak/util-linux/
lgtm CI - automatically executed security code analysis
See .travis.yml for more details.
URL: https://lgtm.com/projects/g/util-linux/util-linux/
We require "sudo" to install additional stuff and to run the tests with
UID=0, it means that tests are executed on travis "legacy infrastructure".
Coverity Scan
URL: https://scan.coverity.com/projects/karelzak-util-linux
Drone.io - automatically executed for all github commits.
Fossies codespell report
URL: https://drone.io/github.com/karelzak/util-linux
URL: https://fossies.org/linux/test/util-linux-master.tar.gz/codespell.html
The drone.io does not use any in-tree config file (like travis-ci), the
currently used configuration (maintained by Drone.io web UI):
OSS-Fuzz
MAKE_CHECK="root"
MAKE_CHECK_OPTS="--skip-loopdevs --exclude=mount/move"
source ./.travis-functions.sh
travis_install_script || exit
travis_before_script || exit
ret=0
travis_script || ret=$?
travis_after_script
exit $ret
URL: https://google.github.io/oss-fuzz/
URL: https://oss-fuzz-build-logs.storage.googleapis.com/index.html#util-linux
URL: https://oss-fuzz.com/coverage-report/job/libfuzzer_asan_util-linux/latest
CIFuzz
URL: https://google.github.io/oss-fuzz/getting-started/continuous-integration/
URL: https://github.com/util-linux/util-linux/actions?query=workflow%3ACIFuzz
yes, it shares the setup functions with travis-ci.

View file

@ -1,7 +1,7 @@
Release schedule
----------------
The util-linux package uses the <major>.<minor>.<maintenance> version
The util-linux package uses the <major>.<minor>.<maintenaince> version
numbering scheme. Since the major version is pretty much fixed, any
release means an increment of the minor number. The minor version is
incremented roughly twice per year. The easiest way to estimate when

View file

@ -1,540 +0,0 @@
Util-linux 2.35 Release Notes
=============================
Release highlights
------------------
agetty(8) now provides a new command-line option --show-issue to print issue
file(s) on the current terminal in the same way how it will be printed when
agetty(8) executed regularly.
agetty(8) supports /run/issue and /usr/lib/issue files and directrories now.
dmesg(1) escapes unprintable and potentially unsafe characters by default. The
new command-line option --noescape disables this feature.
kill(1) now uses pidfd kernel feature to implement a new command-line option
--timeout. The option allows sending a sequence of follow-up signals with
defined timeouts without the possibility of race.
script(1) now used the same PTY code as su(1) --pty. script(1) has also been
massively extended to support new logging features like log signals, stdin or
additional session information. The new features are implemented by the new
timing file format. The changes are backwardly compatible, and the original
timing file format is still the default.
scriptreplay(1) now allows to extract stdin or session summary from script(1)
logs.
scriptlive(1) this NEW COMMAND re-execute stdin log by a shell in PTY session.
mount(8) and libmount now provides built-in dm-verity support if linked with
libcryptsetup. This new feature is EXPERIMENTAL and disabled by default; use
--with-cryptsetup to enable.
libmount now uses poll() syscall to verify /proc/self/mountinfo file consistence
and it re-read the file if modified during previous read call.
mount(8) now provides a new command-line option --target-prefix to mount, for
example, fstab to an alternative location. This feature is usable, for example,
for chroots or containers.
mount(8) now allows to use -o together with --all, for example, "mount --all
-o ro --target-prefix /foo" will mount real-only all filesystems from fstab to
/foo.
lsblk(8) provides new columns FSVER (filesystem version) and PARTTYPENAME
(human-readable partition type).
lsblk(8) reads device properties from /dev/<devname> text file when executed
with --sysroot. This is usable for tests and dumps.
sfdisk(8) uses progress bar for --move-data and data move is now significantly
faster than in previous versions as it does not use fsync during the data move
(use --move-use-fsync to disable this feature).
Changes between v2.34 and v2.35
-------------------------------
agetty:
- Remove superfluous fflush() [Stanislav Brabec]
- add --show-issue to review issue output [Karel Zak]
- add support for /run/issue and /usr/lib/issue [Karel Zak]
- keep freed issue file pointer zeroized [Karel Zak]
- return proper value if compiled without ISSUEDIR support [Patrick Steinhardt]
- simplify code in dolog() preprocessor blocks [Sami Kerola]
bash-completion:
- (unshare) add --map-current-user [Karel Zak]
- Add fallback for symlinks/images [Kevin Locke]
- Add non-canonical device fallback [Kevin Locke]
- Standardize fsck/mkfs file/device [Kevin Locke]
- update for new script tools [Karel Zak]
- update options [Sami Kerola]
- update script, scriptlive, and scriptreplay files [Sami Kerola]
blkid:
- (man) add note about udev to --list-one [Karel Zak]
- retport block size of a filesystem [Mikulas Patocka]
build-sys:
- .gitignore hwclock-parse-date.c [Karel Zak]
- Include <stdlib.h> in ./configure wchar_t test [Florian Weimer]
- add --with-cryptsetup to config-gen.d/all.conf [Karel Zak]
- add UL_REQUIRES_ARCH() [Karel Zak]
- add missing NR underscore to UL_CHECK_SYSCALL() [Sami Kerola]
- add missing header [Karel Zak]
- check for linux/capability.h [Karel Zak]
- cleanup prefixed used for tests [Karel Zak]
- fix UTIL_LINUX_PT_SGI_H macro [lgtm scan] [Karel Zak]
- fix build with pty [Karel Zak]
- fix out-of-tree build for hwclock [Karel Zak]
- fix typo [Karel Zak]
- improve hwclock CMOS dependences [Karel Zak]
- introduce $sysconfstaticdir [Karel Zak]
- make scriptlive optional [Samuel Thibault]
- release++ (v2.35-rc1) [Karel Zak]
- release++ (v2.35-rc2) [Karel Zak]
- remove duplicate includes [Karel Zak]
- support 'none' for parallel tests [Karel Zak]
- use parse-date() only for hwclock [Karel Zak]
cal:
- (man) make -w, -m and --iso relation more obvious [Karel Zak]
cfdisk:
- check mnt_table_parse_fstab() return code [coverity scan] [Karel Zak]
chfn:
- don't append extra tailing commas [Karel Zak]
choom:
- improve docs [Karel Zak]
chsh:
- replace getpw unsafe functions with xgetpw [Quentin Rameau]
cleanup:
- Remove some spurious spaces [Elliott Mitchell]
colcrt:
- make seek to \n more robust [Karel Zak]
column:
- fix outputing empty column at the end of line [Yousong Zhou]
- pass control struct to local_wcstok() [Sami Kerola]
cript:
- always use decimal point numbers in logs [Karel Zak]
disk-utils:
- docs fix sfdisk(8) man page typo [Matthew Krupcale]
dmesg:
- add --noescape [Karel Zak]
- do not stop on \0 [Karel Zak]
- fix output hex encoding [Karel Zak]
doc:
- howto-man-page.txt Use font macros instead of font escapes [Bjarni Ingi Gislason]
docs:
- Fix adjtime documentation [Pierre Labastie]
- add GPLv3 text [Karel Zak]
- add bjd-pfq to AUTHORS (rev.c co-author) [Karel Zak]
- add irqtop to TODO [Karel Zak]
- add non-signalfd PTY request to TODO [Karel Zak]
- add sfdisk --dump and --backup improvements to TODO [Karel Zak]
- add v2.35-ReleaseNotes [Karel Zak]
- correct su.1 runuser reference from section 8 to 1 [Sami Kerola]
- fix mixtyped constant. [Andrius Štikonas]
- fix typos [fossies codespell scan] [Karel Zak]
- remove implemented TODO items [Karel Zak]
- try to find broken man references and fix them [Sami Kerola]
- update AUTHORS file [Karel Zak]
- update howto-tests.txt [Karel Zak]
- update v2.35-ReleaseNotes [Karel Zak]
- update year in libs docs [Karel Zak]
- we have 2019 already [Karel Zak]
eject:
- use O_EXCL on default [Karel Zak]
fallocate:
- fallocate.1 List gfs2 as supporting punch-hole [Andrew Price]
fdformat:
- cast before lseek [lgtm scan] [Karel Zak]
fdisk:
- Correct handling of hybrid MBR [Elliott Mitchell]
- add hint about --wipe to warning [Karel Zak]
- cleanup wipe warning [Karel Zak]
- fix quit dialog for non-libreadline version [Karel Zak]
- make quit question more usable [Karel Zak]
- use 'r' to return from MBR to GPT [Karel Zak]
fsfreeze:
- remove unnecessary condition [lgtm scan] [Karel Zak]
fstrim:
- fix systemd service protection [Karel Zak]
- ignore non-directory mountpoints [Karel Zak]
hexdump:
- add header file guards [lgtm scan] [Karel Zak]
hwclock:
- add SPDX-License-Identifier(s) [Karel Zak]
- report rtc open() errors on --verbose [Karel Zak]
- use CMOS clock only if available [Carlos Santos]
include:
- add some missing licence stuff to header files [Karel Zak]
include/all-io:
- remove unnecessary condition [lgtm scan] [Karel Zak]
include/closestream:
- avoid close more than once [Karel Zak]
- fix assignment to read-only standard streams [Patrick Steinhardt]
include/pidfd-utils:
- small cleanup [Karel Zak]
include/strutils:
- add strdup_between_structs() [Karel Zak]
- add strrealloc() [Karel Zak]
include/xalloc:
- ensure xstrdup() and xstrndup() returns nonnull attribute [Sami Kerola]
- reindent function bodies to unify indentation [Sami Kerola]
- use multiline function declarations [Sami Kerola]
isosize:
- move ISO size functions into a shared header [Daniel Drake]
kill:
- add another ifdef [Karel Zak]
- add missing ifdefs [Karel Zak]
- deallocate follow_ups [assan] [Karel Zak]
- make man page more informative about --timeout [Karel Zak]
- report features on -V, add lish_header initialization [Karel Zak]
- use pidfd system calls to implement --timeout option [Sami Kerola]
last:
- replace strncat() with more robust mem2strcpy() [Sami Kerola]
lib:
- add _PATH_TMP fallback [Karel Zak]
- add missing license headers [Karel Zak]
lib/fileutils:
- add close_all_fds() [Karel Zak]
lib/loopdev.c:
lib/path:
- add ul_path_stat(), fix absolute paths [Karel Zak]
- fix missing header for `struct stat` [Patrick Steinhardt]
- make sure ul_path_read_buffer() derminate result [Karel Zak]
lib/pty:
- allow use callback from mainloop [Karel Zak]
- make sure we not use closed FD [Karel Zak]
- reset mainloop timeout on signal [Karel Zak]
- save sigmask, add API to free all resources [Karel Zak]
lib/pty-session:
- add generic PTY container code [Karel Zak]
- add log callbacks [Karel Zak]
- add loggin callback to code, follow return codes [Karel Zak]
- fix compilation [Karel Zak]
- improve debug messages [Karel Zak]
- make wait_child callback optional [Karel Zak]
- simplify example/test code [Karel Zak]
lib/pwdutils:
- add xgetpwuid [Quentin Rameau]
lib/randutils:
- re-licensing back to BSD [Karel Zak]
lib/timeutils:
- add %Y-%m-%dT%H %M %S to parse_timestamp() [Karel Zak]
lib/ttyutils:
- avoid checking same thing twice [Sami Kerola]
libblkid:
- (drbd) fix comment formatting [Karel Zak]
- (drbd) simplify padding [Karel Zak]
- (xfs) external log check for regular xfs on more sectors [Mauricio Faria de Oliveira]
- (xfs) fix sector size calculation [Karel Zak]
- (zfs) don't probe whole-disk areas covered by partitions [Karel Zak]
- Fix documentation in libblkid header [John Baublitz]
- check for medium on CDMROMs probing [Karel Zak]
- check number of test_blkid_save arguments correctly [Sami Kerola]
- check status for the current CDROM slot [Karel Zak]
- do not interpret NTFS as MBR [Karel Zak]
- fix address sanitizer issues [Sami Kerola]
- fix file descriptor leak in blkid_verify() [Karel Zak]
- improve MD I/O size calculation [lgtm scan] [Karel Zak]
- improve handling of ISO files with partition tables [Daniel Drake]
- improve identification of ISO9660 partition [Daniel Drake]
- improve vfat entries calculation [lgtm scan] [Karel Zak]
- open device in nonblock mode. [Michal Suchanek]
- remove unnecessary condition [lgtm scan] [Karel Zak]
- udf Fix reporting UDF 2.60 revision for Mac OS X disks [Pali Rohár]
libdisk:
- write sample output to stdout [Karel Zak]
libfdisk:
- (MBR) use 0xEA partition type by BootLoaderSpecification [Karel Zak]
- (bsd) cast before ask [lgtm scan] [Karel Zak]
- (docs) add notes about fdisk_enable_wipe() [Karel Zak]
- (gpt) add GUID for APFS containers [Ernesto A. Fernández]
- (gpt) cast number of entries [lgtm scan] [Karel Zak]
- (gpt) fix hybrid MBR detection, fix 'w' [Karel Zak]
- (script) support shortcuts in the type= field [Karel Zak]
- Fix double free of *_chs strings in fdisk_partition [Vojtech Trefny]
- Space before first partition may not be aligned [Evan Green]
- add fdisk_assign_device_by_fd() [Karel Zak]
- add fdisk_script_set_table() [Karel Zak]
- add sector-size to dump [Karel Zak]
- cleanup fdisk_deassign_device() docs [Karel Zak]
- consolidate strdup() use [Karel Zak]
- don't use FAT as MBR [Karel Zak]
- don't use NTFS as MBR [Karel Zak]
- fix fdisk_script_get_table() [Karel Zak]
- fix typos [Marcos Mello]
- fix variable shadowing [Sami Kerola]
- improve Sun partitions calculation [lgtm scan] [Karel Zak]
- improve partition copy on resize [Karel Zak]
- move GPT partition types to include/ [Karel Zak]
- refer to partx(8) rather than to kpartx(8) [Karel Zak]
- use grain as small as possible [Karel Zak]
libfidk:
- (dos) fix tiny partitions calculation [Karel Zak]
libmount:
- (monitor) remove dead code [coverity scan] [Karel Zak]
- Add libselinux dependency to pkgconfig file [Masami Hiramatsu]
- Keep the mnt_tab info for the existent dest in mnt_copy_fs() [Kevin Hao]
- Recognize more FUSE pseudofs (avfsd, lxcfs, vmware-vmblock) [Darsey Litzenberger]
- add support for verity devices via libcryptsetup [Luca Boccassi]
- add target prefix support [Karel Zak]
- add verity to mount -V output [Karel Zak]
- allow use -o together with --all [Karel Zak]
- cleanup strdup() use in context, add reg.test [Karel Zak]
- do not obscure return code when checking verity options [Luca Boccassi]
- don't access struct member, use API [Karel Zak]
- don't use /proc/mounts fallback if filename specified [Karel Zak]
- fix comment referring to passno field [Patrick Steinhardt]
- fix free() call on error [Karel Zak]
- fix mnt_context_next_remount() [Karel Zak]
- fix potential null pointer dereference [Sami Kerola]
- fix typo [Karel Zak]
- fix typo in mnt_context_prepare_helper() [lgtm scan] [Karel Zak]
- improve X-mount.mkdir for non-root users [Karel Zak]
- improve mountinfo reliability [Karel Zak]
- make sure optsmode is initialized [Karel Zak]
- move context fs merge to separate function [Karel Zak]
- save current FS setting as template [Karel Zak]
- use fmemopen() in more robust way [coverity scan] [Karel Zak]
- use strdup_between_structs() [Karel Zak]
- use vsnprintf() in more robust way [coverity scan] [Karel Zak]
libsmartcols:
- cleanup and extend padding functionality [Karel Zak]
libuuid:
- add header file guard [lgtm scan] [Karel Zak]
login:
- reduce file-descriptors cleanup overhead [Karel Zak]
- simplify string handling [Sami Kerola]
login-utils:
- add header file guards [lgtm scan] [Karel Zak]
losetup:
- Typo fix [Stanislav Brabec]
lsblk:
- add FSVER (filesystem version) column [Karel Zak]
- add FSVER to --fs [Karel Zak]
- add PARTTYPENAME column [Karel Zak]
- fix -E segfault [Karel Zak]
- force to print PKNAME for partition [Karel Zak]
- never fallback to udev/blkid on --sysroot [Karel Zak]
- on --sysroot read attributes from /dev/<devname> text file [Karel Zak]
- read also GROUP,OWNER and MODE from dumps [Karel Zak]
- update man description of -f / --fs for current columns [Vladimir Slavik]
lscpu:
- (man) add note about cache sizes [Karel Zak]
- Add HiSilicon aarch64 tsv110 cpupart [John Garry]
- add a new columns to --cache [Karel Zak]
- make code more readable [lgtm scan] [Karel Zak]
- prefer memcpy() to manual pointer arithmetic [Sami Kerola]
- top-level DMI function refactoring [Karel Zak]
lslogins:
- assume unterminated strings in wtmp/btmp [coverity scan] [Karel Zak]
man:
- improve script and scriptreplay formatting style [Sami Kerola]
man pages:
- Add a comma after "e.g." and "i.e." [Bjarni Ingi Gislason]
- Change a HYPHEN-MINUS (-) to a minus (\-) for options and numbers [Bjarni Ingi Gislason]
- Fix misuse of two-fonts macros [Bjarni Ingi Gislason]
- Make the number of .RS/.RE equal [Bjarni Ingi Gislason]
misc:
- fix typos [codespell] [Sami Kerola]
- replaces atexit(close_stdout) with new close_stdout_atexit() [Karel Zak]
mkswap:
- cast before lseek [lgtm scan] [Karel Zak]
mount:
- (dm-verity) update man page [Karel Zak]
- (man) document --target-prefix [Karel Zak]
- (man) small typo fixes [Merlin Büge]
- add --target-prefix [Karel Zak]
- add verity example to man page [Karel Zak]
- no exit on EPERM, continue without suid [Karel Zak]
mountpoint:
- add --nofollow option [Sami Kerola]
nologin:
- Prevent error from su -c [Stanislav Brabec]
- silently ignore well known shell command-line options [Sami Kerola]
partx:
- document -d vs. --nr and fix test [Karel Zak]
- don't report ENXIO as error on -d [Karel Zak]
po:
- add pt.po (from translationproject.org) [Pedro Albuquerque]
- merge changes [Karel Zak]
- remove possibility to translate static option arguments [Sami Kerola]
- update cs.po (from translationproject.org) [Petr Písař]
- update de.po (from translationproject.org) [Mario Blättermann]
- update es.po (from translationproject.org) [Antonio Ceballos Roa]
- update fr.po (from translationproject.org) [Frédéric Marchal]
- update hr.po (from translationproject.org) [Božidar Putanec]
- update ja.po (from translationproject.org) [Takeshi Hamasaki]
- update pl.po (from translationproject.org) [Jakub Bogusz]
- update pt.po (from translationproject.org) [Pedro Albuquerque]
- update pt_BR.po (from translationproject.org) [Rafael Fontenelle]
- update zh_CN.po (from translationproject.org) [Boyuan Yang]
po/update-potfiles:
- fallback to `find` when git doesn't work [Jan Chren (rindeal)]
renice:
- fix --help text [Karel Zak]
- fix arguments description in --help [Karel Zak]
script:
- add --echo [Karel Zak]
- add --log-in [Karel Zak]
- add --logging-format [Karel Zak]
- add debug messages around waitpid() [Karel Zak]
- add missing exit() [Karel Zak]
- add more information to timing log [Karel Zak]
- add multistream timing file initialization [Karel Zak]
- add note about --log-in and passwords [Karel Zak]
- add option --log-out [Karel Zak]
- add option --log-timing [Karel Zak]
- allow to use the same log for more streams [Karel Zak]
- cleanup info logging [Karel Zak]
- cleanup logs freeing [Karel Zak]
- cleanup usage [Karel Zak]
- default to new format when new features expected [Karel Zak]
- document SIGUSR1 [Karel Zak]
- fix ECHO use, improve shell exec [Karel Zak]
- fix man page on --logging-format [Karel Zak]
- fix signalfd use [Karel Zak]
- fix typos [codespell] [Sami Kerola]
- follow --logging-format on -t [Karel Zak]
- listen to SIGUSR1, flush logs on the signal [Karel Zak]
- log additional information [Karel Zak]
- log file usage refactoring [Karel Zak]
- make --help more readable [Karel Zak]
- make optional argument more robust [Karel Zak]
- remove unused variable [Karel Zak]
- report also timing file, do it only once [Karel Zak]
- support multi-stream logging [Karel Zak]
- use lib/pty-session [Karel Zak]
- write signals to timing file [Karel Zak]
scriptlive:
- add --command, cleanup shell exec [Karel Zak]
- add man page [Karel Zak]
- add new command to re-execute script(1) typescript [Karel Zak]
- free resource at the and [Karel Zak]
- keep ECHO flag, improve welcome message [Karel Zak]
- remove unnecessary variables [Karel Zak]
- run shell in PTY [Karel Zak]
- terminate session at end of the log [Karel Zak]
- translate error messages too [Karel Zak]
scriptreplay:
- (man) add missing --log-* oprions [Karel Zak]
- (utils) detect empty steps [Karel Zak]
- add --cr-mode [Karel Zak]
- add --log-{in,out,io} options [Karel Zak]
- add --stream [Karel Zak]
- add --stream to the man page [Karel Zak]
- add --summary [Karel Zak]
- add -T, --log-timing [Karel Zak]
- check for EOF [Karel Zak]
- cleanup usage() [Karel Zak]
- fix error path [Karel Zak]
- fix io data log use [Karel Zak]
- fix typo [Karel Zak]
- make data log file optional for --summary [Karel Zak]
- make sure timing file specified [Karel Zak]
- move all utils to script-playutils.{c,h} [Karel Zak]
- print info and signals [Karel Zak]
- restrict header name size [Karel Zak]
- rewrite to support new timing file format [Karel Zak]
- skip unwanted steps [Karel Zak]
- use struct timeval for delay [Karel Zak]
setpwnam:
- use more appropriate allocation size types [Sami Kerola]
setterm:
- cleanup usage() and man page [Karel Zak]
- fix --clear [Karel Zak]
sfdisk:
- (--move-data) add simple progress bar [Karel Zak]
- (--move-data) add speed to progress bar, don't use POSIX_FADV_DONTNEED [Karel Zak]
- (--move-data) keep step size based on optimal I/O [Karel Zak]
- (--move-data) make log optional [Karel Zak]
- (man) add note about interactive mode) [Karel Zak]
- (move-data) improve MiB/s progress bar [Karel Zak]
- add --move-use-fsync, disable fsync() by default [Karel Zak]
- add -J between mutually exclusive options [Karel Zak]
- check fdisk_script_set_header() return code [coverity scan] [Karel Zak]
- make --no-act usable for --move-data too [Karel Zak]
- mark --dump and --list-free as mutually exclusive [Karel Zak]
- remove never read value [clang scan] [Karel Zak]
- write all message to stdout [Karel Zak]
strutils:
- fix double free in strrealloc() [coverity scan] [Karel Zak]
su:
- (pty) remove unnecessary call [Karel Zak]
- More descriptive error message on malformed user entry [Jakub Hrozek]
- fix error message [Karel Zak]
- silence a useless warning [Jouke Witteveen]
- use lib/pty-session.c code for --pty [Karel Zak]
sys-utils/manuals:
- Make the number of the paired macros ".RS" and ".RE" equal [Bjarni Ingi Gislason]
term-utils:
- add header file guards [lgtm scan] [Karel Zak]
tests:
- (blkid) update regression tests (due to BLOCK_SIZE) [Karel Zak]
- (chfn) force to bash [Karel Zak]
- (col) avoid hardcoding of errno string [Patrick Steinhardt]
- (colcrt) fix reliance on EILSEQ in POSIX locale [Patrick Steinhardt]
- (colcrt) use env to set locale [Karel Zak]
- (column) use actually invalid multibytes to test encoding [Patrick Steinhardt]
- (fdisk) avoid hardcoding of errno string [Patrick Steinhardt]
- (fdisk) make sure we use the same sizes for MD devices [Karel Zak]
- (fdisk) update padding in output [Karel Zak]
- (getopt) remove unwanted paths from error output [Karel Zak]
- (libfdisk) remove reliance on buffer behaviour of standard streams [Patrick Steinhardt]
- (libmount) make X-* and x-* more robust [Karel Zak]
- (libsmartcols) add padding tests [Karel Zak]
- (lsblk) gather also udev attributes for new dumps [Karel Zak]
- (sfdisk) update move output [Karel Zak]
- Add test for current version (v5) of XFS filesystem [Anatoly Pugachev]
- Skip fdisk/mbr-nondos-mode on Sparc as unsupported [Karel Zak, Anatoly Pugachev]
- add --parsable, remove TS_OPT_parsable [Karel Zak]
- add missing 'ts_check_prog xz' [Karel Zak]
- add mount --all tests [Karel Zak]
- add new test for chfn gecos [Radka Skvarilova]
- add remaining stderr outputs [Karel Zak]
- add script and scriptlive replay [Karel Zak]
- another prompt fix [Karel Zak]
- commit add missing file [Karel Zak]
- don't show diff for TS_KNOWN_FAIL [Karel Zak]
- fix --unbuffered mode with ASAN [Karel Zak]
- fixes blkid/md-raidX-whole on Sparc [Anatoly Pugachev]
- improve unbuffer check [Karel Zak]
- lscpu s390 nested virtualization [Radka Skvarilova]
- make scriptlive output more portable [Karel Zak]
- mark mdadm tests as TS_KNOWN_FAIL [Karel Zak]
- mark scriptlive as KNOWN_FAILED [Karel Zak]
- remove device name from blkdiscard output [Karel Zak]
- remove option --posix [Karel Zak]
- remove reliance on buffer behaviour of stderr/stdout streams [Patrick Steinhardt]
- remove unbuffered ts_run feature [Karel Zak]
- split stdout and stderr [Karel Zak]
- upadet scriptlive output [Karel Zak]
- update fdisk output [Karel Zak]
- update sfdisk dumps [Karel Zak]
- update sfdisk wipe output [Karel Zak]
- use env and support both unbuffer/stdbuf [Patrick Steinhardt]
- use subtests for mountpoint(1) [Karel Zak]
travis:
- don't call tests in parallel for root [Karel Zak]
- fix sudo command line [Karel Zak]
- force non-parallel for root [Karel Zak]
unshare:
- add --keep-caps option [James Peach]
- add --map-current-user option [James Peach]
- cleanup capabilities code [lgtm scan] [Karel Zak]
- fix --map-current-user short option (-c) [Matthew Harm Bekkema]
verity:
- add new verity.roothashfile option [Luca Boccassi]
- add support for Forward Error Correction options [Luca Boccassi]
- ensure that hash_device and root_hash[_file] are passed together or not at all [Luca Boccassi]
wdctl:
- add control struct [Karel Zak]
- default to /dev/watchdog0 [Karel Zak]
- remove duplicate include of <unistd.h> [Patrick Steinhardt]
- remove printing from main() [Karel Zak]
- rename watch dog info struct [Karel Zak]
wipefs:
- Allow explicitly enable/disablement [Sam Voss]
- Allow explicitly enable/disablement [Sam Voss]

View file

@ -1,641 +0,0 @@
Util-linux 2.36 Release Notes
=============================
Release highlights
------------------
blkdiscard(8) refuses to proceed if filesystem or RAID signatures are found in
interactive mode (executed on a terminal). The option --force is required to
the discard data.
irqtop(1) and lsirq(1) are NEW COMMANDS to monitor kernel interrupts.
cal(1) provides a new --vertical command line option to output calendar
in vertical mode.
blkzone(8) implements open/close/finish commands now.
unshare(1) and nsenter(1) commands support the time namespace now.
agetty(8) now supports multiple paths in the option --issue-file.
The commands fdisk(8), sfdisk(8), cfdisk(8), mkswap(8) and wipefs(8) now
support block devices locking by flock(2) to better behave with udevd or other
tools. For more details see https://systemd.io/BLOCK_DEVICE_LOCKING/. This
feature is controlled by a new command line option --lock and
$LOCK_BLOCK_DEVICE environmental variable.
dmesg(1) supports a new command line option --follow-new to wait and print only
new kernel messages.
fdisk(8) provides a new command line option --list-details to print more
information about partition table. Another new command line option is
--noauto-pt. It's usable to don't automatically create default partition table
on empty devices.
The command fdisk(8) and sfdisk(8) support user-friendly aliases for partition
types. For example "echo 'size=10M type=uefi' | sfdisk /dev/sda" creates EFI
system partition on sda.
fstrim(8) supports new command line option --listed-in to specify alternatives
where to read list of the filesystems. This option makes fstrim systemd service
file more portable between distributions.
libfdisk provides API to relocate GPT backup header. This feature is usable to
generate small, but still valid images for containers and resize the image later.
This new feature is exported to command line by "sfdisk --relocate".
mount(8) now supports mount by ID= tag. The tag is a block device identifier as
used by udevd in /dev/disk/by-id. It's usually WWN or another HW related
identifier. This feature is designed for users who need to avoid filesystem or
partition table dependence in fstab. The udevd is required for this tag.
login(1) supports list of "message of the day" files and directories in the
option MOTD_FILE= in /etc/login.defs now. The default value is
/usr/share/misc/motd:/run/motd:/etc/motd.
All tools which read /etc/login.defs is possible to compile with libeconf now.
The build system provides a new option --disable-hwclock-gplv3 to avoid optional
GPLv3 code in the command hwclock(8).
The build system supports a new option --with-cryptsetup=dlopen to use dlopen
for libcryptsetup in libmount dm-verity support. This is a temporary workaround
to avoid collisions between JSON libraries and to reduce dependencies overhead in
libmount. Note that dm-verity support is still EXPERIMENTAL and disabled by
default.
more(1) has been refactored to meet 21st century codding standards. Thanks to
Sami Kerola.
Thanks to Michael Kerrisk for massive man pages cleanup, and thanks to Evgeny
Vereshchagin for work on better integration with CIFuzz and Travis.
Changes between v2.35 and v2.36
-------------------------------
Manual pages:
- ipcmk.1, ipcs.1, lsipc.1 explicitly mention "System V" [Michael Kerrisk (man-pages)]
- fdisk.8 fix typo [Shigeki Morishima]
- Standardize on AUTHORS as section title [Michael Kerrisk (man-pages)]
- Standardize on CONFORMING TO as section title [Michael Kerrisk (man-pages)]
- Standardize on ENVIRONMENT as section title [Michael Kerrisk (man-pages)]
- Standardize on EXAMPLE as section title [Michael Kerrisk (man-pages)]
- Standardize on EXIT STATUS as section title [Michael Kerrisk (man-pages)]
- Standardize on OPTIONS as section title [Michael Kerrisk (man-pages)]
- ipcmk.1, ipcrm.1, ipcs.1, lsipc.1 SEE ALSO add sysvipc(7) [Michael Kerrisk (man-pages)]
- kill.1 improve the description of the --timout option [Michael Kerrisk (man-pages)]
- kill.1 various language, spelling, and formatting fixes [Michael Kerrisk (man-pages)]
- login.1 SEE ALSO add utmp(5), lastlog(8) [Michael Kerrisk (man-pages)]
- login.1 formatting fixes [Michael Kerrisk (man-pages)]
- login.1 various minor wording fixes [Michael Kerrisk (man-pages)]
- losetup.8 Fix "--direct-io" defaults [Rupesh Girase]
- mount.8 Miscellaneous wording, grammar, and formatting fixes [Michael Kerrisk (man-pages)]
- mount.8 Rewrite FILESYSTEM-SPECIFIC MOUNT OPTIONS intro [Michael Kerrisk (man-pages)]
- mount.8 SEE ALSO add some obvious references [Michael Kerrisk (man-pages)]
- mount.8 Typo fix (remove an accidental paragraph break) [Michael Kerrisk (man-pages)]
- mount.8, umount.8 Clarify that "namespace" means "mount namespace" [Michael Kerrisk (man-pages)]
- mount.8, umount.8 Consistently format pathnames with italic [Michael Kerrisk (man-pages)]
- nsenter.1 clarify the intro discussion [Michael Kerrisk]
- nsenter.1 note that 'file' can be a bind mount [Michael Kerrisk]
- nsenter.1, unshare.1 add a reference to time_namespaces(7) [Michael Kerrisk]
- nsenter.1, unshare.1 remove repeated references to clone(2) [Michael Kerrisk]
- nsenter.1, unshare.1 update references to *_namespaces(7) pages [Michael Kerrisk]
- order AUTHORS / COPYRIGHT / SEE ALSO / AVAILABILITY consistently [Michael Kerrisk (man-pages)]
- order ENVIRONMENT / FILES / CONFORMING TO consistently [Michael Kerrisk (man-pages)]
- order NOTES / HISTORY / BUGS / EXAMPLE consistently [Michael Kerrisk (man-pages)]
- rename EXAMPLE section to EXAMPLES [Michael Kerrisk (man-pages)]
- rename RETURN VALUES to RETURN VALUE [Michael Kerrisk (man-pages)]
- reword su.1 description [Karel Zak]
- runuser.1 Various wording and formatting fixes [Michael Kerrisk (man-pages)]
- runuser.1, su.1 miscellaneous wording and formatting fixes [Michael Kerrisk (man-pages)]
- script.1 Miscellaneous wording, grammar, and formatting fixes [Michael Kerrisk (man-pages)]
- scriptlive.1 Miscellaneous wording, grammar, and formatting fixes [Michael Kerrisk (man-pages)]
- scriptreplay.1 Miscellaneous wording, grammar, and formatting fixes [Michael Kerrisk (man-pages)]
- setpriv.1 Minor formatting and typo fixes [Michael Kerrisk (man-pages)]
- setpriv.1 Various minor wording and formatting fixes [Michael Kerrisk (man-pages)]
- setpriv.1 warn users of restrictions on capability changes [Michael Kerrisk (man-pages)]
- umount.8 use "filesystem" consistently [Michael Kerrisk (man-pages)]
- unshare.1 EXAMPLES improve persistent mount namespace example [Michael Kerrisk (man-pages)]
- unshare.1 clarify description and example for --mount=<path> [Michael Kerrisk (man-pages)]
- unshare.1 clarify that --pid=<file> requires --fork [Michael Kerrisk (man-pages)]
- unshare.1 fix examples, part 1 [Michael Kerrisk]
- unshare.1 fix examples, part 2 [Michael Kerrisk]
- unshare.1 fix examples, part 3 [Michael Kerrisk]
- unshare.1 improve intro paragraphs [Michael Kerrisk]
- unshare.1 typo fix [Michael Kerrisk (man-pages)]
- use the term "exit status" [Michael Kerrisk (man-pages)]
- various reword "allow(s) to" [Michael Kerrisk (man-pages)]
- wording fix "another" ==> "other" [Michael Kerrisk (man-pages)]
Subject:
- docs change from nofill to fill mode [Bjarni Ingi Gislason]
- docs disk-utils change "allows to <verb>" to "allows <verb>ing" [Bjarni Ingi Gislason]
- docs remove unnecessary paragraph macros [Bjarni Ingi Gislason]
agetty:
- (man) add "white" color name [Karel Zak]
- (man) fix typo [Karel Zak]
- extend --issue-file to support multiple paths [Karel Zak]
- ignore ^C [Karel Zak]
- save the original speed on --keep-baud [Karel Zak]
bash-completion:
- chmod -x [Karel Zak]
- release preparations [Sami Kerola]
- umount explicitly needs gawk [Wolfram Sang]
- update irqtop and lsirq completions [Sami Kerola]
bash-completion/umount:
- shell charaters escape [Etienne Mollier]
blkdiscard:
- (man) offset and length must be sector aligned [Lukas Czerner]
- Refuse to proceed if signatures are found [Lukas Czerner]
- use O_EXCL, add --force [Karel Zak]
blkzone:
- Add --force option [Shin'ichiro Kawasaki]
- add open/close/finish commands [Aravind Ramesh]
- deny destructive ioctls on busy blockdev [Johannes Thumshirn]
- ioctl related code refactoring [Damien Le Moal]
- remove unnecessary initializations [Karel Zak]
blockdev:
- Don't fail on missing start sector [Stanislav Brabec]
build-sys:
- Fix autogenerated URL in ChangeLog [Chris Hofstaedtler]
- add $LDADD and libcommon to test_logindefs_LDADD [Karel Zak]
- add --disable-hwclock-gplv3 [Karel Zak]
- add --enable-ubsan to make it possible to build util-linux with UBSan [Evgeny Vereshchagin]
- add --enable-werror [Karel Zak]
- add --enable-werror to devel build scenarios [Karel Zak]
- add -Waddress-of-packed-member [Karel Zak]
- add missing LDADD to blkid test [Karel Zak]
- cleanup $vendordir use [Karel Zak]
- fix blkdiscard blkid.h use [Karel Zak]
- fix chfn-chsh configure help text [Karel Zak]
- fix irqtop compilation with -lslang [Karel Zak]
- make lsirq and irqtop optional [Karel Zak]
- release++ (v2.36-rc1) [Karel Zak]
- release++ (v2.36-rc2) [Karel Zak]
- remove redundard includes [Karel Zak]
- remove unneeded include of generated file [Zbigniew Jędrzejewski-Szmek]
- rename automake variable to match define name [Zbigniew Jędrzejewski-Szmek]
cal:
- Add column mode [Aurelien LAJOIE]
- Add helper functions for left align [Aurelien LAJOIE]
- Add test, all are checked against ncal [Aurelien LAJOIE]
- Add weekdays into cal_control [Aurelien LAJOIE]
- Correctly center the year [Aurelien LAJOIE]
- Remove todo [Aurelien LAJOIE]
- Update man page [Aurelien LAJOIE]
- correctly set the week width [Aurelien LAJOIE]
- use a const char* [Aurelien LAJOIE]
- use size_t to calculate width [lgtm scan] [Karel Zak]
cfdisk:
- add --lock and LOCK_BLOCK_DEVICE [Karel Zak]
chfn:
- Make readline prompt for each field on a separate line [Damien Goutte-Gattat]
chrt:
- Use sched_setscheduler system call directly [jonnyh64]
chsh:
- (man) fix default behavior description [Karel Zak]
col:
- fix output when first line does not have newline character [Sami Kerola]
cryptsetup:
- add option to use via dlopen in libmount [Luca Boccassi]
ctrlaltdel:
- display error message indicated by errno [Sami Kerola]
disk-utils:
- Add reference to ufiformat(8) [Wojtek Kaniewski]
dmesg:
- add --follow-new [Konstantin Khlebnikov]
- adjust timestamps according to suspended time [Konstantin Khlebnikov]
doc:
- Fix some warnings from "test-groff" for manuals [Bjarni Ingi Gislason]
- disk-utils/* Fix some warnings from "mandoc -T lint" [Bjarni Ingi Gislason]
- libuuid/man/* Fix some warnings from "mandoc -T lint" [Bjarni Ingi Gislason]
- login-utils/* Fix some warnings from "mandoc -T lint" [Bjarni Ingi Gislason]
- misc-utils/* Fix some warnings from "mandoc -T lint" [Bjarni Ingi Gislason]
- schedutils/* Fix some warnings from "mandoc -T lint" [Bjarni Ingi Gislason]
- sys-utils/* fix some warnings from "mandoc -T lint" [Bjarni Ingi Gislason]
- term-utils/* fix some warnings from "mandoc -T lint" [Bjarni Ingi Gislason]
- text-utils/* fix some warnings from "mandoc -T lint" [Bjarni Ingi Gislason]
docs:
- (man) remove double quotes (") in .SH lines [Michael Kerrisk (man-pages)]
- Correct ChangeLog URL to history log. [Anatoly Pugachev]
- Fix dead references to kernel documentation [Yannick Le Pennec]
- Improve grammar [Ben Frankel]
- Some minor fixes in some manuals [Bjarni Ingi Gislason]
- add blkdiscard to ReleaseNotes [Karel Zak]
- add note about AsciiDocs [Karel Zak]
- add rev(1) to TODO [Karel Zak]
- add swap to 1st fstab field [Karel Zak]
- add terminal hyperlinks to TODO [Karel Zak]
- add v2.36-ReleaseNotes [Karel Zak]
- fix release notes file name [Karel Zak]
- fix spacing in irqtop and lsirq manual pages [Sami Kerola]
- improve size arguments description in --help output [Karel Zak, ed]
- kill.1 add note about shell-internal kill implementations [Sami Kerola]
- mark some branches as github-only [Karel Zak]
- mention Coverity Scan and the Fossies codespell report [Evgeny Vereshchagin]
- misc-utils change "allows to <verb>" to "allows <verb>ing" [Bjarni Ingi Gislason]
- nsenter(1) fix further details in PID namespace section [Stephen Kitt]
- remove drone.io, add lgtm.com [Karel Zak]
- remove irqtop TODO item [Sami Kerola]
- remove trailing space in strings [Bjarni Ingi Gislason]
- renice(1) Add chrt(1) to SEE ALSO [Jann Horn]
- reword others "allow to" [Karel Zak]
- update AUTHORS file [Karel Zak]
- update ReleaseNotes [Karel Zak]
- update v2.36-ReleaseNotes [Karel Zak]
eject:
- fix compiler warning [-Wformat-overflow] [Karel Zak]
exfat:
- Fix parsing exfat label [Pali Rohár]
fdisk:
- add --list-details [Karel Zak]
- add --lock and LOCK_BLOCK_DEVICE [Karel Zak]
- add --noauto-pt [Karel Zak]
- add support for parttype aliases [Karel Zak]
- better wording for '-B' in the man page [Wolfram Sang]
- improve list-types readability [Karel Zak]
- make sure label defined for some menu entries [Karel Zak]
- specify in '--help' that we can have multiple devices with '-l' [Wolfram Sang]
- update expected test outputs with command outputs [Sami Kerola]
findmnt:
- make xalloc use mroe robust [Karel Zak]
fix typo:
- yourbranch -> yourgit [Soumendra Ganguly]
flock:
- Add new example using shell IO redirection [Jookia]
- make examples in man page more readable [Karel Zak]
fsck.cramfs:
- fix macro usage [Zbigniew Jędrzejewski-Szmek]
fstrim:
- add --listed-in <file[ file ..]> [Karel Zak]
- do not use Protect setting in systemd service [Karel Zak]
- randomize timer start time across 100 minutes [Sami Kerola]
- rename --quite to --quite-unsupported [Karel Zak]
- run service and timer only if /etc/fstab is present [Luca BRUNO]
getopt:
- use examples installation directory in man page [Sami Kerola]
hexdump:
- fix typo, dcl instead of dc1 [Karel Zak]
hwclock:
- fix audit exit status [Karel Zak]
- improve use of settimeofday() portability [Karel Zak]
- make glibc 2.31 compatible [J William Piggott, Karel Zak]
- update yacc file [Sami Kerola]
ilib/strutils:
- fix rounding in size_to_human_string() [Karel Zak]
include:
- add remove_entry() to env.h [Sami Kerola]
- cleanup pidfd inckudes [Karel Zak]
include/c:
- add USAGE_ARGUMENT [Karel Zak]
include/nls:
- remove unnecessary declaration [Karel Zak]
ipcs:
- ipcs.1 ipcs no longer needs read permission on IPC resources [Michael Kerrisk]
iqrtop:
- cleanup header [Karel Zak]
irctop:
- move source code to sys-utils/ directory [Sami Kerola]
irqtop:
- add bash-completion [Sami Kerola]
- add manual page [Sami Kerola]
- add struct irq_output [Karel Zak]
- add total and delta as own columns [Sami Kerola]
- avoid function like pre-processor definitions [Sami Kerola]
- change the update delay to use struct timeval [Sami Kerola]
- cleanup command line options [Karel Zak]
- cleanup man page [Karel Zak]
- cleanup sort stuff [Karel Zak]
- cleanup struct irq_stat use [Karel Zak]
- display number of new interupts in-between updates [Sami Kerola]
- do not use fixed size /proc/interrupts line buffer [Sami Kerola]
- don't print header for --once [Karel Zak]
- fix all warnings [zhenwei pi]
- fix open file descriptor leak [Sami Kerola]
- hide cursor when in interactive mode [Sami Kerola]
- implement a new utility to display kernel interrupt [zhenwei pi]
- improve header [Sami Kerola]
- include hostname and timestamp to output header [Sami Kerola]
- init README [zhenwei pi]
- keep WINDOW pointer in functions only [Karel Zak]
- keep table in functions only [Karel Zak]
- make util-linux build-system to build the command [Sami Kerola]
- minor cleanup [Karel Zak]
- move WINDOW back to control struct [Karel Zak]
- move independent code to irq-common.c [Karel Zak]
- move screen update to a separate function [Sami Kerola]
- remove dead code [Karel Zak]
- remove unnecessary code [Karel Zak]
- reorder function [Karel Zak]
- separate normal and ncurses way [Karel Zak]
- separate screen and scols code [Karel Zak]
- simplify terminal resizing [Karel Zak]
- small cleanup in main() [Karel Zak]
- tidy coding style and update usage() text [Sami Kerola]
- trim white spaces from end of name field [Sami Kerola]
- use -J for JSON [Karel Zak]
- use epoll event loop [Sami Kerola]
- use lib/monotonic.c to determine uptime [Sami Kerola]
- use libsmartcols [Sami Kerola]
- use memory allocation that check errors [Sami Kerola]
- use name instead of desc as irq name field referal [Sami Kerola]
- use runtime control structure [Sami Kerola]
- use util-linux libcommon facilities [Sami Kerola]
kill:
- include sys/types.h before checking SYS_pidfd_send_signal [Sami Kerola]
last:
- fix use of non-terminated utmp->ut_line [Karel Zak]
lib/blkdev:
- add support for --lock and LOCK_BLOCK_DEVICE [Karel Zak]
lib/color-names:
- add "white" between human-readable [Karel Zak]
lib/mangle:
- check for the NULL string argument [Gaël PORTAY]
lib/mbsalign:
- add function to calculate width [Karel Zak]
lib/path:
- add ul_path_is_accessible() [Karel Zak]
lib/pwdutils:
- add xgetgrnam [Matthew Harm Bekkema]
lib/randutils:
- use explicit data types for bit ops [Karel Zak]
lib/strutils:
- add test for strdup_to_struct_member() [Karel Zak]
- fix floating point exception [Karel Zak]
- fix parse_size() for large numbers [Karel Zak]
- fix uint64_t overflow [Karel Zak]
- remove unnecessary include [Karel Zak]
- use directly err() [Karel Zak]
lib/sysfs:
- fix prefix use in sysfs_devname_is_hidden() [Karel Zak]
libblkid:
- (docs) add missing references [Karel Zak]
- (docs) document new function [Karel Zak]
- Add support for zonefs [Damien Le Moal]
- Fix UTF-16 support in function blkid_encode_to_utf8() [Pali Rohár]
- add dax capability detection in topology probing [Anthony Iliopoulos]
- fix compiler warning [-Wsign-compare] [Karel Zak]
- fix fstatat() use in blkid__scan_dir() [Karel Zak]
- move UTF encoding function to lib/ [Karel Zak]
- remove blkid_llseek() [Karel Zak]
- remove unnecessary uuid.h [Karel Zak]
libfdisk:
- (docs) add missing comment [Karel Zak]
- (docs) add missing references [Karel Zak]
- (docs) document new functions [Karel Zak]
- (docs) fix typos [Karel Zak]
- (dos) be more explicit in fdisk_verify_disklabel() output [Karel Zak]
- (dos) be more robust about max number of partitions [Karel Zak]
- (dos) fix default partition start [Karel Zak]
- (gpt) add GPT debug mask [Karel Zak]
- (gpt) add functionality to move backup header [Karel Zak]
- (gpt) cleanup and consolidate write code [Karel Zak]
- (gpt) cleanup entries array size calculations [Karel Zak]
- (gpt) fix compiler warning [-Wmaybe-uninitialized] [Karel Zak]
- (gpt) partition name default to empty string [Karel Zak]
- (script) accept sector-size, ignore unknown headers [Karel Zak]
- (script) fix memory leak [Karel Zak]
- (script) fix partno_from_devname() [Karel Zak]
- (script) fix segmentation fault [Gaël PORTAY]
- add Linux /var, /var/tmp and root verity GPT partition types [nl6720]
- add fdisk_set_disklabel_id_from_string() [Karel Zak]
- add missing comments [Karel Zak]
- add partition type aliases and shortcuts [Karel Zak]
- fix __copy_partition() [Karel Zak]
- fix alignment logic for tiny partitions [Karel Zak]
- fix const char mess [Karel Zak]
- fix partition calculation for BLKPG_* ioctls [Karel Zak]
- fix pointer wraparound warning [Sami Kerola]
- make sure we check for maximal number of partitions [Karel Zak]
- make sure we use NULL after free [Karel Zak]
- remove unwanted assert() [Karel Zak]
- use ul_encode_to_utf8() [Karel Zak]
libfdisk, unshare:
- fix gcc-4.9.4 warnings [Toni Uhlig]
libmount:
- (docs) add missing references [Karel Zak]
- (docs) fix typo, remove unused reference [Karel Zak]
- (parser) fix memory leak on error before end-of-file [Karel Zak]
- (umount) FS lookup refactoring [Karel Zak]
- (umount) fix FD leak [Karel Zak]
- (verity) remove unnecessary empty lines [Karel Zak]
- Avoid triggering autofs in lookup_umount_fs_by_statfs [Fabian Vogt]
- add support for ID= [Karel Zak]
- add support for signed verity devices [Luca Boccassi]
- do not unnecessarily chmod utab.lock [Tycho Andersen]
- fix condition for mountinfo filter [Karel Zak]
- fix mount -a EBUSY for cifs [Roberto Bergantinos Corpas]
- fix x- options use for non-root users [Karel Zak]
- improve smb{2,3} support [Karel Zak]
- make mnt_context_find_umount_fs() more extendable [Karel Zak]
- move "already mounted" code to separate function [Karel Zak]
- smb2 is unsupported alias [Karel Zak]
- try read-only mount on write-protected superblock too [Karel Zak]
- use mnt_stat_mountpoint() on more places [Karel Zak]
libsmartcols:
- (docs) add missing references [Karel Zak]
- (docs) fix reference [Karel Zak]
- (sample) check scols_line_refer_data() return code [coverity scan] [Karel Zak]
- (sample) check scols_line_set_data() return code [coverity scan] [Karel Zak]
- (sample) remove unnecessary check [coverity scan] [Karel Zak]
- (sample) remove unused variable [Karel Zak]
- (smaple) check scols_line_set_data() return code [coverity scan] [Karel Zak]
- don't calculate with encoding on scols_table_enable_noencoding() [Karel Zak]
libuuid:
- (test) cleanup unused memory [coverity scan] [Karel Zak]
- (test) close fd [coverity scan] [Karel Zak]
- (test) make sure UUID is terminated [coverity scan] [Karel Zak]
- add uuid_parse_range() [Zane van Iperen]
- add uuid_parse_range() to man page and symbol-table [Karel Zak]
- ensure variable is initialized [cppcheck] [Sami Kerola]
- improve uuid_unparse() performance [Aurelien LAJOIE]
- remove function alias [Karel Zak]
login:
- add MOTD_FIRSTONLY= [Karel Zak]
- add support for directories in MOTD_FILE= [Karel Zak]
- avoid lseek() with pread() and pwrite() [Sami Kerola]
- cleanup -f in usage() and comments [Karel Zak]
- cleanup get_hushlogin_status() use [Karel Zak]
- fix -f description in the man-page [Karel Zak]
- fixed invalid sizeof usage [Toni Uhlig]
- keep default MOTD_FILE= backwardly compatible [Karel Zak]
- use PAM_SILENT to propagate hushlogin to PAM [Karel Zak]
logindefs:
- use xalloc.h, code cleanup [Karel Zak]
lsblk:
- Add SERIAL column to the SCSI output mode. [Milan Broz]
- Fall back to ID_SERIAL [Sven Wiltink]
- Ignore hidden devices [Ritika Srivastava]
- add dax (direct access) capability column [Anthony Iliopoulos]
- fix -P regression from v2.34 [Karel Zak]
lscpu:
- Adapt MIPS cpuinfo [Jiaxun Yang]
- Add shared cached info for s390 lscpu -C [Sumanth Korikkar]
- cleanup caches code [Karel Zak]
- fix SIGSEGV on archs without drawers & books [Karel Zak]
- use official name for HiSilicon tsv110 [Karel Zak]
lsirq:
- add -P option [Karel Zak]
- add -n option [Karel Zak]
- add new command [Karel Zak]
- mark --json and --pairs options mutually exclusive [Sami Kerola]
lslogins:
- remove unnecessary brackets [Karel Zak]
- use lastlog as wtmp fallback [Sami Kerola]
lsmem:
- make it without leaks for non-error output [Karel Zak]
- report inaccessible /sys/devices/system/memory [Karel Zak]
lsns:
- add time namespace support [Adrian Reber]
manual pages:
- adjtime_config.5 format pathname with .I [Michael Kerrisk (man-pages)]
mkswap:
- add --lock and LOCK_BLOCK_DEVICE [Karel Zak]
more:
- add display_file() to show files and stdin [Sami Kerola]
- avoid defining special characters locally [Sami Kerola]
- avoid libmagic telling an empty file is binary [Sami Kerola]
- do not allocate shell command buffer from stack [Sami Kerola]
- do not reset parent process terminal in execute() [Sami Kerola]
- drop setuid permissions before executing anything [Sami Kerola]
- fix SIGSTOP and SIGCONT handling [Sami Kerola]
- fix moving backwards so that it can reach begining of the file [Sami Kerola]
- make execute() more robust and timely [Sami Kerola]
- make page and arrow up/down to update view [Sami Kerola]
- move code blocks from more_key_command() to functions [Sami Kerola]
- move currently open file to control structure [Sami Kerola]
- move runtime usage output to a function [Sami Kerola]
- refactor and clarify code [Sami Kerola]
- remove kill_line() in favor of erase_prompt() [Sami Kerola]
- remove underlining related code [Sami Kerola]
- replace siglongjmp() and signal() calls with signalfd() [Sami Kerola]
- restructure print_buf() if-else with continue [Sami Kerola]
- simplify initterm() [Sami Kerola]
- target all standard streams when calling fflush() [Sami Kerola]
- tell in run time help what the 'v' will execute as editor [Sami Kerola]
- use getopt_long() to parse options [Sami Kerola]
- use libmagic to identify binary files [Sami Kerola]
- use off_t and cc_t to clarify what variables attempt to represent [Sami Kerola]
- use single exit path to ensure resource freeing is unified [Sami Kerola]
mount:
- (man) cleanup devices identifiers section [Karel Zak]
- Update man page Synopsis [Marcel Waldvogel]
- support "-o move" on command line [Karel Zak]
nsenter:
- add support for the time namespace [Adrian Reber]
po:
- merge changes [Karel Zak]
- update cs.po (from translationproject.org) [Petr Písař]
- update de.po (from translationproject.org) [Mario Blättermann]
- update es.po (from translationproject.org) [Antonio Ceballos Roa]
- update fr.po (from translationproject.org) [Frédéric Marchal]
- update hr.po (from translationproject.org) [Božidar Putanec]
- update ja.po (from translationproject.org) [Takeshi Hamasaki]
- update pl.po (from translationproject.org) [Jakub Bogusz]
- update pt.po (from translationproject.org) [Pedro Albuquerque]
- update pt_BR.po (from translationproject.org) [Rafael Fontenelle]
- update uk.po (from translationproject.org) [Yuri Chornoivan]
- update zh_CN.po (from translationproject.org) [Boyuan Yang]
pylibmount:
- cleanup and sync UL_RaiseExc [Karel Zak]
rename:
- fix regression for symlink with non-existing target [Mauricio Faria de Oliveira]
- tests add more symlink checks [Mauricio Faria de Oliveira]
rev:
- (man) add note about limitations [Karel Zak]
- report line on error [Karel Zak]
script:
- fix minor warning [Sami Kerola]
scriptlive:
- fix man page formatting [Jakub Wilk]
- fix typo [Jakub Wilk]
scriptlive, scriptreplay:
- cleanup --maxdelay man page description [Karel Zak]
setarch:
- add arm and aarch64 architectures to transition rules [Alexey Gladkov]
- fix stderr handling in uname26 tests [Helge Deller]
- make verify_arch_domain extendable [Alexey Gladkov]
sfdisk:
- (man) add note about type and shortcuts collision [Karel Zak]
- (man) fix typo [Gaël PORTAY]
- add --disk-id to change disk UUID/ID [Karel Zak]
- add --lock and LOCK_BLOCK_DEVICE [Karel Zak]
- add --relocate command [Karel Zak]
- avoid unneeded empty lines with '--list-free' [Wolfram Sang]
- extend --part-type, support aliases [Karel Zak]
- fix --append to PT with gaps [Karel Zak]
- fix previous --append patch, improve man page [Karel Zak]
- fix ref-counting for the script [Karel Zak]
- make sure we do not overlap on --move [Karel Zak]
- only report I/O errors on --move-data [Karel Zak]
- remove broken step alignment for --move [Karel Zak]
su, runuser:
- (man) add more info about PATH and PAM [Karel Zak]
swapoff:
- cleanup EXIT STATUS [Karel Zak]
- do not use 1 exist status at all [Karel Zak]
sys-utils:
- mount.8 split a long line into two [Bjarni Ingi Gislason]
test_tiocsti:
- check ioctl() return code [coverity scan] [Karel Zak]
tests:
- Add UDF hdd image with emoji label created by mkudffs 2.2 [Pali Rohár]
- Fix for misc/fallocate test build failure. [Mark Hindley]
- Fix mountpoint test failure in build chroots. [Mark Hindley]
- add STATIC binaries to build-sys tests [Karel Zak]
- add checksum for cramfs/mkfs for BE 8192 (sparc64) [Anatoly Pugachev]
- add sanitize_env() check [Sami Kerola]
- add sfdisk --dump test [Karel Zak]
- add zonefs blkid test [Karel Zak]
- cleanup cramfs checksums [Karel Zak]
- cleanup fdisk based stuff [Karel Zak]
- don't use ASAN in build tests [Karel Zak]
- explain why MD tests with metadata v0.90 are KNOWN-FAIL [Karel Zak]
- fixes eject/umount on SPARC [Anatoly Pugachev]
- fixes fdisk/align-512-* tests [Anatoly Pugachev]
- fixes libmount/ on SPARC [Anatoly Pugachev]
- fixes mount tests on SPARC [Anatoly Pugachev]
- ignore the python libmount tests when they're run under UBSan [Evgeny Vereshchagin]
- sfdisk fill correctly gaps if default start requested [Karel Zak]
- skip "blkid/dm-err" when `mknod` doesn't work [Evgeny Vereshchagin]
- turn off detect_leaks on s390x, use more asan options [Evgeny Vereshchagin]
- update build-sys tests [Karel Zak]
- update fdisk outputs due to sizes rounding change [Karel Zak]
travis:
- build util-linux on arm64, ppc64le and s390x [Evgeny Vereshchagin]
- don't ask for Ubuntu release on XOS [Karel Zak]
- ignore memory leaks in checkusage [Evgeny Vereshchagin]
- install all the "official" build dependencies [Evgeny Vereshchagin]
- install llvm-* to get llvm-symbolizer [Evgeny Vereshchagin]
- integrate util-linux with Coverity Scan [Evgeny Vereshchagin]
- make it easier to switch to the next clang/gcc [Evgeny Vereshchagin]
- switch to Bionic [Evgeny Vereshchagin]
- switch to a newer version of macOS [Evgeny Vereshchagin]
- switch to clang-10 [Evgeny Vereshchagin]
- switch to gcc-10 [Evgeny Vereshchagin]
- turn off -Werror on precise and osx [Evgeny Vereshchagin]
- turn on -Werror [Evgeny Vereshchagin]
- turn on CIFuzz [Evgeny Vereshchagin]
- turn on UBsan on Travis CI to see how it goes [Evgeny Vereshchagin]
umount:
- don't try it as non-suid if not found mountinfo entry [Karel Zak]
unshare:
- (man) add note about signals on --fork [Karel Zak]
- Fix PID and TIME namespace persistence [michael-dev]
- Support names for map-user/group options [Matthew Harm Bekkema]
- allow custom uid/gid mappings in userns [Matthew Harm Bekkema]
- fix help message indentation [Adrian Reber]
- fix man page formatting [Jakub Wilk]
- support the time namespace [Adrian Reber]
- use '-T' for time namespace instead of '-t' [Adrian Reber]
unshare --fork:
- Ignore SIGINT and SIGTERM in parent [Daan De Meyer]
various:
- fix more lgtm scan warnings [Sami Kerola]
- use threadsafe versions of time functions [lgtm scan] [Sami Kerola]
wipefs:
- add --lock and LOCK_BLOCK_DEVICE [Karel Zak]
- fix man page --no-headings short option [Karel Zak]
write:
- fix potential string overflow [Sami Kerola]

File diff suppressed because it is too large Load diff

File diff suppressed because it is too large Load diff

File diff suppressed because it is too large Load diff

View file

@ -5,33 +5,19 @@ AM_CPPFLAGS = \
-D_PATH_RUNSTATEDIR=\"${runstatedir}\" \
-D_PATH_SYSCONFSTATICDIR=\"${sysconfstaticdir}\"
if USE_VENDORDIR
AM_CPPFLAGS += \
-D_PATH_VENDORDIR=\"${vendordir}\"
endif
if FUZZING_ENGINE
if !OSS_FUZZ
AM_CPPFLAGS += \
-DFUZZING_BUILD_MODE_UNSAFE_FOR_PRODUCTION
endif
endif
if WITH_COVERAGE
AM_CPPFLAGS += \
-include $(top_srcdir)/include/coverage.h
endif
AM_CFLAGS = -fsigned-char $(WARN_CFLAGS)
AM_CXXFLAGS = $(AM_CFLAGS)
AM_LDFLAGS = $(ASAN_LDFLAGS) $(UBSAN_LDFLAGS) $(FUZZING_ENGINE_LDFLAGS) $(COVERAGE_LDFLAGS)
AM_LDFLAGS = $(ASAN_LDFLAGS)
# Add gettext stuff to the global LDADD for systems with separate libintl
# library. The LTLIBINTL is generated by AM_GNU_GETTEXT macro.
#
LDADD = $(LTLIBINTL)
LIB_FUZZING_ENGINE ?= -fsanitize=fuzzer
# Automake (at least up to 1.10) mishandles dist_man_MANS inside conditionals.
# Unlike with other dist primaries, the files are not distributed if the
# conditional is false.
# Work the bug around until it is fixed:
dist_noinst_DATA = $(dist_man_MANS)
# Paths to in-tree libraries (use ul_ prefix to avoid possible collisions) Note
# that blkid.h, libmount.h, libfdisk.h and libsmartcols.h are generated and
@ -47,11 +33,11 @@ ul_libuuid_incdir = $(top_srcdir)/libuuid/src
bashcompletiondir = @bashcompletiondir@
dist_noinst_HEADERS =
dist_noinst_DATA =
noinst_PROGRAMS =
EXTRA_LTLIBRARIES =
noinst_LTLIBRARIES =
usrbin_exec_PROGRAMS =
usrsbin_exec_PROGRAMS =
dist_man_MANS =
man_MANS =
pkgconfig_DATA =
usrlib_exec_LTLIBRARIES =
@ -64,9 +50,6 @@ check_PROGRAMS =
dist_check_SCRIPTS =
PATHFILES =
ADOCFILES_COMMON =
MANPAGES =
MANLINKS =
INSTALL_EXEC_HOOKS =
UNINSTALL_HOOKS =
@ -79,12 +62,6 @@ CLEANFILES =
SUBDIRS = po
if ENABLE_ASCIIDOC
if ENABLE_POMAN
SUBDIRS += po-man
endif
endif
RCS_FIND_IGNORE = \( -name SCCS -o -name BitKeeper -o -name .svn -o \
-name CVS -o -name .pc -o -name .hg -o -name .git \) -prune -o
@ -115,33 +92,9 @@ include misc-utils/Makemodule.am
include disk-utils/Makemodule.am
include bash-completion/Makemodule.am
include man-common/Makemodule.am
include tests/Makemodule.am
# Meson files
EXTRA_DIST += \
meson.build \
meson_options.txt \
tools/meson-make-manpage-stub.sh \
tools/meson-make-symlink.sh \
\
include/meson.build \
libblkid/meson.build \
libmount/meson.build \
libmount/python/meson.build \
misc-utils/meson.build \
libsmartcols/meson.build \
text-utils/meson.build \
po/meson.build \
lib/meson.build \
libuuid/meson.build \
sys-utils/meson.build \
libfdisk/meson.build \
term-utils/meson.build \
disk-utils/meson.build \
login-utils/meson.build
# pylibmountexec module must be installed after usrlib_exec libraries,
# otherwise the libtool relink step will fail to find libmount.la and
# will try -lmount which is possibly not available.
@ -165,7 +118,6 @@ edit_cmd = sed \
-e 's|@datadir[@]|$(datadir)|g' \
-e 's|@sbindir[@]|$(sbindir)|g' \
-e 's|@bindir[@]|$(bindir)|g' \
-e 's|@docdir[@]|$(docdir)|g' \
-e 's|@includedir[@]|$(includedir)|g' \
-e 's|@runstatedir[@]|$(runstatedir)|g' \
-e 's|@usrlib_execdir[@]|$(usrlib_execdir)|g' \
@ -192,26 +144,7 @@ else
edit_cmd += -e 's|@LIBSELINUX[@]||g'
endif
if HAVE_CRYPTSETUP
if CRYPTSETUP_VIA_DLOPEN
edit_cmd += -e 's|@LIBCRYPTSETUP[@]||g'
edit_cmd += -e 's|@LIBDL[@]|-ldl|g'
else
edit_cmd += -e 's|@LIBCRYPTSETUP[@]|libcryptsetup|g'
edit_cmd += -e 's|@LIBDL[@]||g'
endif
else
edit_cmd += -e 's|@LIBCRYPTSETUP[@]||g'
edit_cmd += -e 's|@LIBDL[@]||g'
endif
if USE_VENDORDIR
edit_cmd += -e 's|@vendordir[@]|$(vendordir)|g'
else
edit_cmd += -e 's|@vendordir[@]||g'
endif
CLEANFILES += $(PATHFILES) $(EXTRA_LTLIBRARIES)
CLEANFILES += $(PATHFILES)
EXTRA_DIST += $(PATHFILES:=.in)
$(PATHFILES): Makefile
@ -222,72 +155,12 @@ $(PATHFILES): Makefile
$(edit_cmd) $${srcdir}$@.in >$@.tmp
@ mv $@.tmp $@
if ENABLE_ASCIIDOC
EXTRA_DIST += $(ADOCFILES_COMMON) $(MANPAGES) $(MANLINKS)
man_MANS += $(MANPAGES) $(MANLINKS)
$(MANPAGES): $(ADOCFILES_COMMON)
asciidoc_man_cmd = $(ASCIIDOCTOR) \
-b manpage \
-a 'release-version=$(VERSION)' \
-a 'package-docdir=$(docdir)' \
-a 'VERSION=$(VERSION)' \
-a 'ADJTIME_PATH=$(ADJTIME_PATH)' \
--load-path '$(abs_srcdir)/tools' \
--require asciidoctor-includetracker
if HAVE_ASCIIDOCTOR_FAILURE_LEVEL
asciidoc_man_cmd += --failure-level ERROR
endif
SUFFIXES = .1.adoc .3.adoc .5.adoc .8.adoc .1 .3 .5 .8
.1.adoc.1 .3.adoc.3 .5.adoc.5 .8.adoc.8:
$(AM_V_GEN) test -f ./$@ || \
$(MKDIR_P) $$(dirname $@) && \
$(asciidoc_man_cmd) --base-dir=$(abs_srcdir) \
--destination-dir $(abs_builddir)/$$(dirname $@) $<
-include \
$(abs_builddir)/**.1.deps \
$(abs_builddir)/**.3.deps \
$(abs_builddir)/**.5.deps \
$(abs_builddir)/**.8.deps
$(MANLINKS): $(MANPAGES)
gen-man: $(man_MANS)
# Standard "make" follows BUILD_* macros from ./configure, and in this case, it
# ignores man pages for disabled tools, but for distribution tarball, we need
# to generate all man-pages (to avoid dependence on asciidoc). [kzak Jan-2022]
gen-man-dist:
@list=`find -name *.adoc -not -path "*/man-common/*" -not -path "*/po-man/*" | sed -e 's/\.adoc//g'`; \
missing=`for p in $$list; do test -f $$p || echo $$p; done`; \
if test -n "$$missing"; then \
$(MAKE) $(AM_MAKEFLAGS) $$missing; \
fi;
# !ENABLE_ASCIIDOC
else
if HAVE_MANPAGES
EXTRA_DIST += $(ADOCFILES_COMMON) $(MANPAGES) $(MANLINKS)
man_MANS += $(MANPAGES) $(MANLINKS)
endif
gen-man:
gen-man-dist:
endif
# Arrange so that .tarball-version appears only in the distribution
# tarball, and never in a checked-out repository.
dist-hook: gen-man-dist
dist-hook:
echo $(VERSION) > $(distdir)/.tarball-version
# Set ChangeLog tag reference.
sed -i "s!log!log?h=v$(VERSION)!" $(distdir)/ChangeLog
sed -i "s/log/log;h=$(VERSION)/" $(distdir)/ChangeLog
distclean-local:
-find . -name \*~ -o -name \*.orig -o -name \*.rej | xargs rm -f
@ -305,8 +178,7 @@ checkconfig:
| xargs $(top_srcdir)/tools/checkconfig.sh $(top_srcdir)
checkmans:
@$(top_srcdir)/tools/checkadoc-missing.sh
@$(top_srcdir)/tools/checkadoc-repeat.sh
@$(top_srcdir)/tools/checkmans.sh
checkxalloc:
@ $(top_srcdir)/tools/checkxalloc.sh
@ -336,17 +208,16 @@ checklibdoc:
$(top_srcdir)/libblkid/docs/libblkid-sections.txt
DISTCHECK_CONFIGURE_FLAGS = \
--disable-makeinstall-chown \
--disable-use-tty-group \
--disable-silent-rules \
--disable-rpath \
--enable-all-programs \
--disable-makeinstall-chown \
--enable-static-programs \
--enable-gtk-doc \
--with-python \
--with-bashcompletiondir=$$dc_install_base/$(bashcompletiondir) \
--with-systemdsystemunitdir=$$dc_install_base/$(systemdsystemunitdir)
BUILT_SOURCES = .version
.version:
echo $(VERSION) > $@-t && mv $@-t $@

74
NEWS
View file

@ -1,75 +1,3 @@
util-linux 2.39: May 17 2023
* see Documentation/releases/v2.39-ReleaseNotes or the complete changelog at
https://www.kernel.org/pub/linux/utils/util-linux/v2.39/v2.39-ChangeLog
util-linux 2.39-rc2: Apr 19 2023
* see Documentation/releases/v2.39-ReleaseNotes or the complete changelog at
https://www.kernel.org/pub/linux/utils/util-linux/v2.39/v2.39-rc3-ChangeLog
util-linux 2.39-rc2: Apr 04 2023
* see Documentation/releases/v2.39-ReleaseNotes or the complete changelog at
https://www.kernel.org/pub/linux/utils/util-linux/v2.39/v2.39-rc2-ChangeLog
util-linux 2.39-rc1: Mar 10 2023
* see Documentation/releases/v2.39-ReleaseNotes or the complete changelog at
https://www.kernel.org/pub/linux/utils/util-linux/v2.39/v2.39-rc1-ChangeLog
util-linux 2.38: Mar 28 2022
* see Documentation/releases/v2.38-ReleaseNotes or the complete changelog at
https://www.kernel.org/pub/linux/utils/util-linux/v2.38/v2.38-ChangeLog
util-linux 2.38-rc4: Mar 16 2022
* see Documentation/releases/v2.38-ReleaseNotes or the complete changelog at
https://www.kernel.org/pub/linux/utils/util-linux/v2.38/v2.38-rc4-ChangeLog
util-linux 2.38-rc3: Mar 15 2022
* see Documentation/releases/v2.38-ReleaseNotes or the complete changelog at
https://www.kernel.org/pub/linux/utils/util-linux/v2.38/v2.38-rc3-ChangeLog
util-linux 2.38-rc2: Mar 04 2022
* see Documentation/releases/v2.38-ReleaseNotes or the complete changelog at
https://www.kernel.org/pub/linux/utils/util-linux/v2.38/v2.38-rc2-ChangeLog
util-linux 2.38-rc1: Jan 31 2022
* see Documentation/releases/v2.38-ReleaseNotes or the complete changelog at
https://www.kernel.org/pub/linux/utils/util-linux/v2.38/v2.38-rc1-ChangeLog
util-linux 2.37: Jun 1 2021
* see Documentation/releases/v2.37-ReleaseNotes or the complete changelog at
https://www.kernel.org/pub/linux/utils/util-linux/v2.37/v2.37-ChangeLog
util-linux 2.37-rc2: May 10 2021
* see Documentation/releases/v2.37-ReleaseNotes or the complete changelog at
https://www.kernel.org/pub/linux/utils/util-linux/v2.37/v2.37-rc2-ChangeLog
util-linux 2.37-rc1: Apr 12 2021
* see Documentation/releases/v2.37-ReleaseNotes or the complete changelog at
https://www.kernel.org/pub/linux/utils/util-linux/v2.37/v2.37-rc1-ChangeLog
util-linux 2.36: Jul 23 2020
* see Documentation/releases/v2.36-ReleaseNotes or the complete changelog at
https://www.kernel.org/pub/linux/utils/util-linux/v2.36/v2.36-ChangeLog
util-linux 2.36-rc2: Jul 09 2020
* see Documentation/releases/v2.36-ReleaseNotes or the complete changelog at
https://www.kernel.org/pub/linux/utils/util-linux/v2.36/v2.36-rc2-ChangeLog
util-linux 2.36-rc1: Jun 09 2020
* see Documentation/releases/v2.36-ReleaseNotes or the complete changelog at
https://www.kernel.org/pub/linux/utils/util-linux/v2.36/v2.36-rc1-ChangeLog
util-linux 2.35: Jan 21 2020
* see Documentation/releases/v2.35-ReleaseNotes or the complete changelog at
https://www.kernel.org/pub/linux/utils/util-linux/v2.35/v2.35-ChangeLog
util-linux 2.35-rc2: Jan 8 2020
* see Documentation/releases/v2.35-ReleaseNotes or the complete changelog at
https://www.kernel.org/pub/linux/utils/util-linux/v2.35/v2.35-rc2-ChangeLog
util-linux 2.35-rc1: Dec 11 2019
* see Documentation/releases/v2.35-ReleaseNotes or the complete changelog at
https://www.kernel.org/pub/linux/utils/util-linux/v2.35/v2.35-rc1-ChangeLog
util-linux 2.34: Jun 14 2019
* see Documentation/releases/v2.34-ReleaseNotes or the complete changelog at
https://www.kernel.org/pub/linux/utils/util-linux/v2.34/v2.34-ChangeLog
@ -381,7 +309,7 @@ util-linux 2.13-pre4
util-linux 2.13-pre3
* misc build system fixes
* misc buld system fixes
* cfdisk: fix a segfault with ReiserFS partitions
* umount: disallow -r option for non-root users
* updated translations: da, fr, it, nl, ru, sl, tr

25
README
View file

@ -5,10 +5,6 @@
Note: for the years 2006-2010 this project was named "util-linux-ng".
COMPILE & INSTALL:
See Documentation/howto-compilation.txt.
MAILING LIST:
E-MAIL: util-linux@vger.kernel.org
@ -23,9 +19,9 @@ MAILING LIST:
IRC CHANNEL:
#util-linux at libera.chat:
#util-linux at freenode.net:
irc://irc.libera.chat/util-linux
irc://chat.freenode.net/util-linux
The IRC channel and Mailing list are for developers and project
maintainers. For end users it is recommended to utilize the
@ -34,9 +30,7 @@ IRC CHANNEL:
BUG REPORTING:
E-MAIL: util-linux@vger.kernel.org
Web: https://github.com/util-linux/util-linux/issues
Bug reports with sensitive or private information: Karel Zak <kzak@redhat.com>
Web: https://github.com/karelzak/util-linux/issues
This project has no resources to provide support for distribution specific
issues. For end users it is recommended to utilize the distribution's
@ -45,7 +39,7 @@ BUG REPORTING:
NLS (PO TRANSLATIONS):
PO files are maintained by:
https://translationproject.org/domain/util-linux.html
http://translationproject.org/domain/util-linux.html
VERSION SCHEMA:
@ -63,22 +57,17 @@ SOURCE CODE:
Download archive:
https://www.kernel.org/pub/linux/utils/util-linux/
See also:
Documentation/howto-contribute.txt
Documentation/howto-build-sys.txt
Documentation/howto-pull-request.txt
SCM (Source Code Management) Repository:
Primary repository:
git clone git://git.kernel.org/pub/scm/utils/util-linux/util-linux.git
Backup repository:
git clone git://github.com/util-linux/util-linux.git
git clone git://github.com/karelzak/util-linux.git
Web interfaces:
https://git.kernel.org/cgit/utils/util-linux/util-linux.git
https://github.com/util-linux/util-linux
http://git.kernel.org/cgit/utils/util-linux/util-linux.git
https://github.com/karelzak/util-linux
Note: the GitHub repository may contain temporary development branches too.

View file

@ -10,8 +10,6 @@ There is code under:
* LGPL-2.1-or-later - GNU Lesser General Public License 2.1 or any later version
* BSD-2-Clause - Simplified BSD License
* BSD-3-Clause - BSD 3-Clause "New" or "Revised" License
* BSD-4-Clause-UC - BSD 4-Clause University of California-Specific

View file

@ -13,25 +13,6 @@ THEDIR=`pwd`
cd $srcdir
DIE=0
warn_mesg ()
{
echo
echo "WARNING: $1"
test -z "$2" ||
echo " $2"
echo
}
error_mesg ()
{
echo
echo "ERROR: $1"
test -z "$2" ||
echo " $2"
echo
DIE=1
}
# provide simple gettext backward compatibility
autopoint_fun ()
{
@ -43,7 +24,7 @@ autopoint_fun ()
sed -n -e 's/.* \(0\.17\|0\.18\|0\.18\.[1-2]\)$/\1/p'`
if [ -n "$gt_ver" ]; then
warn_mesg "warning: forcing autopoint to use old gettext $gt_ver"
echo "warning: forcing autopoint to use old gettext $gt_ver"
rm -f configure.ac.autogenbak
sed -i.autogenbak configure.ac \
-e "s/\(AM_GNU_GETTEXT_VERSION\).*/\1([$gt_ver])/"
@ -58,30 +39,49 @@ autopoint_fun ()
return $ret
}
test -f sys-utils/mount.c ||
error_mesg "You must run this script in the top-level util-linux directory."
test -f sys-utils/mount.c || {
echo
echo "You must run this script in the top-level util-linux directory."
echo
DIE=1
}
(autopoint --version) < /dev/null > /dev/null 2>&1 ||
error_mesg "You must have autopoint installed to generate the util-linux build system." "The autopoint command is part of the GNU gettext package."
(autoconf --version) < /dev/null > /dev/null 2>&1 ||
error_mesg "You must have autoconf installed to generate the util-linux build system."
(autoheader --version) < /dev/null > /dev/null 2>&1 ||
error_mesg "You must have autoheader installed to generate the util-linux build system." "The autoheader command is part of the GNU autoconf package."
[ -x "$(command -v gettext)" -o -x "$(command -v xgettext)" ] ||
warn_mesg "You need have [x]gettext binary installed to update po/ stuff."
(autopoint --version) < /dev/null > /dev/null 2>&1 || {
echo
echo "You must have autopoint installed to generate the util-linux build system."
echo "The autopoint command is part of the GNU gettext package."
echo
DIE=1
}
(autoconf --version) < /dev/null > /dev/null 2>&1 || {
echo
echo "You must have autoconf installed to generate the util-linux build system."
echo
DIE=1
}
(autoheader --version) < /dev/null > /dev/null 2>&1 || {
echo
echo "You must have autoheader installed to generate the util-linux build system."
echo "The autoheader command is part of the GNU autoconf package."
echo
DIE=1
}
if ! (bison --version) < /dev/null > /dev/null 2>&1; then
error_mesg "You must have bison installed to build the util-linux."
echo
echo "You must have bison installed to build the util-linux."
echo
DIE=1
else
lexver=$(bison --version | awk '/^bison \(GNU [Bb]ison\)/ { print $4 }')
case "$lexver" in
[2-9].*)
;;
*)
error_mesg "You must have bison version >= 2.x, but you have $lexver."
echo
echo "You must have bison version >= 2.x, but you have $lexver."
echo
DIE=1
;;
esac
fi
@ -89,16 +89,27 @@ fi
LIBTOOLIZE=libtoolize
case `uname` in Darwin*) LIBTOOLIZE=glibtoolize ;; esac
if ! ($LIBTOOLIZE --version) < /dev/null > /dev/null 2>&1; then
error_mesg "You must have libtool-2 installed to generate the util-linux build system."
echo
echo "You must have libtool-2 installed to generate the util-linux build system."
echo
DIE=1
else
ltver=$($LIBTOOLIZE --version | awk '/^[g]*libtoolize/ { print $4 }')
ltver=${ltver:-"none"}
test ${ltver##2.} = "$ltver" &&
error_mesg "You must have libtool version >= 2.x.x, but you have $ltver."
test ${ltver##2.} = "$ltver" && {
echo
echo "You must have libtool version >= 2.x.x, but you have $ltver."
echo
DIE=1
}
fi
(automake --version) < /dev/null > /dev/null 2>&1 ||
error_mesg "You must have automake installed to generate the util-linux build system."
(automake --version) < /dev/null > /dev/null 2>&1 || {
echo
echo "You must have automake installed to generate the util-linux build system."
echo
DIE=1
}
if test "$DIE" -eq 1; then
exit 1
@ -113,7 +124,6 @@ echo " autoheader: $(autoheader --version | head -1)"
echo " automake: $(automake --version | head -1)"
echo " libtoolize: $($LIBTOOLIZE --version | head -1)"
echo " bison: $(bison --version | head -1)"
echo
rm -rf autom4te.cache
@ -121,34 +131,17 @@ set -e
po/update-potfiles
autopoint_fun --force $AP_OPTS
if ! grep -q datarootdir po/Makefile.in.in; then
echo "INFO: autopoint does not honor dataroot variable, patching."
echo autopoint does not honor dataroot variable, patching.
sed -i -e 's/^datadir *=\(.*\)/datarootdir = @datarootdir@\
datadir = @datadir@/g' po/Makefile.in.in
fi
$LIBTOOLIZE --force $LT_OPTS
# patch libtool
if test -f tools/libtool.m4.patch; then
if test -L m4/libtool.m4; then
cp m4/libtool.m4 m4/libtool.m4.org
rm m4/libtool.m4
mv m4/libtool.m4.org m4/libtool.m4
fi
set +e
patch --batch --dry -p1 < tools/libtool.m4.patch > /dev/null 2>&1
if [ "$?" -eq 0 ]; then
patch -p1 --batch < tools/libtool.m4.patch
fi
set -e
fi
aclocal -I m4 $AL_OPTS
autoconf $AC_OPTS
autoheader $AH_OPTS
automake --add-missing $AM_OPTS
cd "$THEDIR"
echo

View file

@ -45,9 +45,6 @@ endif
if BUILD_IPCS
dist_bashcompletion_DATA += bash-completion/ipcs
endif
if BUILD_IRQTOP
dist_bashcompletion_DATA += bash-completion/irqtop
endif
if BUILD_ISOSIZE
dist_bashcompletion_DATA += bash-completion/isosize
endif
@ -60,9 +57,6 @@ endif
if BUILD_LSIPC
dist_bashcompletion_DATA += bash-completion/lsipc
endif
if BUILD_LSIRQ
dist_bashcompletion_DATA += bash-completion/lsirq
endif
if BUILD_LSNS
dist_bashcompletion_DATA += bash-completion/lsns
endif
@ -164,9 +158,6 @@ dist_bashcompletion_DATA += \
endif
if BUILD_LAST
dist_bashcompletion_DATA += bash-completion/last
install-data-hook-bashcomp-lastb::
ln -sf last $(DESTDIR)$(bashcompletiondir)/lastb
INSTALL_DATA_HOOKS += install-data-hook-bashcomp-lastb
endif
if BUILD_LSLOGINS
dist_bashcompletion_DATA += bash-completion/lslogins
@ -192,7 +183,7 @@ endif
if BUILD_UTMPDUMP
dist_bashcompletion_DATA += bash-completion/utmpdump
endif
if BUILD_UUIDGEN
if BUILD_LIBUUID
dist_bashcompletion_DATA += bash-completion/uuidgen
endif
if BUILD_UUIDPARSE
@ -213,9 +204,6 @@ endif
if BUILD_CHRT
dist_bashcompletion_DATA += bash-completion/chrt
endif
if BUILD_UCLAMPSET
dist_bashcompletion_DATA += bash-completion/uclampset
endif
if BUILD_IONICE
dist_bashcompletion_DATA += bash-completion/ionice
endif
@ -332,23 +320,5 @@ endif
if BUILD_UL
dist_bashcompletion_DATA += bash-completion/ul
endif
if BUILD_HARDLINK
dist_bashcompletion_DATA += bash-completion/hardlink
endif
if BUILD_PIPESZ
dist_bashcompletion_DATA += bash-completion/pipesz
endif
if BUILD_FADVISE
dist_bashcompletion_DATA += bash-completion/fadvise
endif
if BUILD_WAITPID
dist_bashcompletion_DATA += bash-completion/waitpid
endif
if BUILD_ENOSYS
dist_bashcompletion_DATA += bash-completion/enosys
endif
if BUILD_LSCLOCKS
dist_bashcompletion_DATA += bash-completion/lsclocks
endif
endif # BUILD_BASH_COMPLETION

View file

@ -16,10 +16,8 @@ _blkdiscard_module()
case $cur in
-*)
OPTS="
--force
--offset
--length
--quiet
--step
--secure
--zeroout

2
bash-completion/blkzone Normal file → Executable file
View file

@ -25,7 +25,7 @@ _blkzone_module()
-*)
case $prev in
'report'|'reset')
OPTS="--verbose --offset --length --count --force"
OPTS="--verbose --offset --length --count"
;;
*)
OPTS="--help --version"

View file

@ -12,8 +12,6 @@ _blockdev_module()
--setrw
--getro
--getdiscardzeroes
--getdiskseq
--getzonesz
--getss
--getpbsz
--getiomin

View file

@ -18,7 +18,6 @@ _cal_module()
--color=auto
--color=always
--color=never
--vertical
--version
--help"
COMPREPLY=( $(compgen -W "${OPTS[*]}" -- $cur) )

View file

@ -17,9 +17,7 @@ _cfdisk_module()
-*)
OPTS=" --color
--zero
--lock
--help
--read-only
--version"
COMPREPLY=( $(compgen -W "${OPTS[*]}" -- $cur) )
return 0

View file

@ -5,7 +5,7 @@ _column_module()
cur="${COMP_WORDS[COMP_CWORD]}"
prev="${COMP_WORDS[COMP_CWORD-1]}"
case $prev in
'-c'|'--output-width'|'-l'|'--table-columns-limit')
'-c'|'--output-width')
COMPREPLY=( $(compgen -W "number" -- $cur) )
return 0
;;
@ -32,16 +32,14 @@ _column_module()
--table-name
--table-order
--table-columns
--table-columns-limit
--table-noextreme
--table-noheadings
--table-maxout
--table-header-repeat
--table-hide
--table-right
--table-truncate
--table-wrap
--keep-empty-lines
--table-empty-lines
--json
--tree
--tree-id

View file

@ -41,7 +41,6 @@ _dmesg_module()
--file
--facility
--human
--json
--kernel
--color
--level
@ -56,10 +55,7 @@ _dmesg_module()
--time-format
--userspace
--follow
--follow-new
--decode
--since
--until
--help
--version"
COMPREPLY=( $(compgen -W "${OPTS[*]}" -- $cur) )

View file

@ -1,37 +0,0 @@
_waitpid_module()
{
local cur prev OPTS
COMPREPLY=()
cur="${COMP_WORDS[COMP_CWORD]}"
prev="${COMP_WORDS[COMP_CWORD-1]}"
case $prev in
'-s'|'--syscall')
return 0
;;
'-l'|'--list')
return 0
;;
'-h'|'--help'|'-V'|'--version')
return 0
;;
esac
case $cur in
-*)
OPTS="--syscall
--list
--help
--version"
COMPREPLY=( $(compgen -W "${OPTS[*]}" -- $cur) )
return 0
;;
*)
_pids
return 0
;;
esac
local IFS=$'\n'
compopt -o filenames
COMPREPLY=( $(compgen -u -- $cur) )
return 0
}
complete -F _enosys_module enosys

View file

@ -1,42 +0,0 @@
_fadvise_module()
{
local cur prev ADVS OPTS
COMPREPLY=()
cur="${COMP_WORDS[COMP_CWORD]}"
prev="${COMP_WORDS[COMP_CWORD-1]}"
case $prev in
'-a'|'--advise')
ADVS='normal
sequential
random
noreuse
willneeded
dontneed'
COMPREPLY=( $(compgen -W "${ADVS[*]}" -- $cur) )
return 0
;;
'-o'|'--offset'|'-l'|'--length')
COMPREPLY=( $(compgen -W "bytes" -- $cur) )
return 0
;;
'-h'|'--help'|'-V'|'--version')
return 0
;;
esac
case $cur in
-*)
OPTS='--advise
--length
--offset
--help
--versione'
COMPREPLY=( $(compgen -W "${OPTS[*]}" -- $cur) )
return 0
;;
esac
local IFS=$'\n'
compopt -o filenames
COMPREPLY=( $(compgen -f -- $cur) )
return 0
}
complete -F _fadvise_module fadvise

View file

@ -75,9 +75,6 @@ _fdisk_module()
--compatibility
--color
--list
--list-details
--noauto-pt
--lock
--output
--type
--units

View file

@ -17,12 +17,10 @@ _fstrim_module()
-*)
OPTS="--all
--fstab
--listed-in
--quiet-unsupported
--quiet
--offset
--length
--minimum
--types
--verbose
--dry-run
--help

View file

@ -9,34 +9,6 @@ _hardlink_module()
COMPREPLY=( $(compgen -W "regex" -- $cur) )
return 0
;;
'-i'|'--include')
COMPREPLY=( $(compgen -W "regex" -- $cur) )
return 0
;;
'-s'|'--minimum-size')
COMPREPLY=( $(compgen -W "number" -- $cur) )
return 0
;;
'-S'|'--maximum-size')
COMPREPLY=( $(compgen -W "number" -- $cur) )
return 0
;;
'-b'|'--io-size')
COMPREPLY=( $(compgen -W "number" -- $cur) )
return 0
;;
'-r'|'--cache-size')
COMPREPLY=( $(compgen -W "number" -- $cur) )
return 0
;;
'-y'|'--method')
COMPREPLY=( $(compgen -W "sha256 sha1 crc32c memcmp" -- $cur) )
return 0
;;
'--reflink')
COMPREPLY=( $(compgen -W "never always auto" -- $cur) )
return 0
;;
'-H'|'--help'|'-V'|'--version')
return 0
;;
@ -45,19 +17,10 @@ _hardlink_module()
-*)
OPTS="
--content
--respect-dir
--respect-name
--maximize
--minimize
--dry-run
--ignore-owner
--keep-oldest
--ignore-mode
--quiet
--ignore-time
--verbose
--respect-xattrs
--skip-reflinks
--force
--exclude
--version
--help
"

View file

@ -28,7 +28,6 @@ _hexdump_module()
case $cur in
-*)
OPTS=" --one-byte-octal
--one-byte-hex
--one-byte-char
--canonical
--two-bytes-decimal

View file

@ -19,14 +19,6 @@ _hwclock_module()
COMPREPLY=( $(compgen -W "year" -- $cur) )
return 0
;;
'--param-get')
COMPREPLY=( $(compgen -W "param" -- $cur) )
return 0
;;
'--param-set')
COMPREPLY=( $(compgen -W "param=value" -- $cur) )
return 0
;;
'-h'|'-?'|'--help'|'-v'|'-V'|'--version')
return 0
;;
@ -52,10 +44,6 @@ _hwclock_module()
--date
--delay
--epoch
--param-get
--param-set
--vl-read
--vl-clear
--update-drift
--noadjfile
--adjfile

View file

@ -1,51 +0,0 @@
_irqtop_module()
{
local cur prev OPTS
COMPREPLY=()
cur="${COMP_WORDS[COMP_CWORD]}"
prev="${COMP_WORDS[COMP_CWORD-1]}"
case $prev in
'-c'|'--cpu-stat')
COMPREPLY=( $(compgen -W "auto enable disable" -- $cur) )
return 0
;;
'-C'|'--cpu-list')
return 0
;;
'-d'|'--delay')
COMPREPLY=( $(compgen -W "secs" -- $cur) )
return 0
;;
'-s'|'--sort')
COMPREPLY=( $(compgen -W "irq total delta name" -- $cur) )
return 0
;;
'-o'|'--output')
local prefix realcur OUTPUT
realcur="${cur##*,}"
prefix="${cur%$realcur}"
for WORD in "IRQ TOTAL DELTA NAME"; do
if ! [[ $prefix == *"$WORD"* ]]; then
OUTPUT="$WORD ${OUTPUT:-""}"
fi
done
compopt -o nospace
COMPREPLY=( $(compgen -P "$prefix" -W "$OUTPUT" -S ',' -- $realcur) )
return 0
;;
'-h'|'--help'|'-V'|'--version')
return 0
;;
esac
OPTS=" --cpu-stat
--cpu-list
--delay
--sort
--output
--softirq
--help
--version"
COMPREPLY=( $(compgen -W "${OPTS[*]}" -- $cur) )
return 0
}
complete -F _irqtop_module irqtop

View file

@ -6,12 +6,11 @@ _lsblk_module()
prev="${COMP_WORDS[COMP_CWORD-1]}"
LSBLK_COLS_ALL="
NAME KNAME PATH MAJ:MIN FSAVAIL FSSIZE FSTYPE FSUSED FSUSE% FSVER MOUNTPOINT
LABEL UUID PTUUID PTTYPE PARTTYPE PARTTYPENAME PARTLABEL PARTUUID PARTFLAGS RA
RO RM HOTPLUG MODEL SERIAL SIZE STATE OWNER GROUP MODE ALIGNMENT MIN-IO OPT-IO
PHY-SEC LOG-SEC ROTA SCHED RQ-SIZE TYPE DISC-ALN DISC-GRAN DISC-MAX DISC-ZERO
WSAME WWN RAND PKNAME HCTL TRAN SUBSYSTEMS REV VENDOR ZONED ZONE-SZ ZONE-WGRAN
ZONE-APP ZONE-NR ZONE-OMAX ZONE-AMAX DAX MQ
NAME KNAME MAJ:MIN FSTYPE MOUNTPOINT LABEL UUID PARTTYPE
PARTLABEL PARTUUID PARTFLAGS RA RO RM HOTPLUG MODEL SERIAL SIZE
STATE OWNER GROUP MODE ALIGNMENT MIN-IO OPT-IO PHY-SEC LOG-SEC
ROTA SCHED RQ-SIZE TYPE DISC-ALN DISC-GRAN DISC-MAX DISC-ZERO
WSAME WWN RAND PKNAME HCTL TRAN SUBSYSTEMS REV VENDOR
"
case $prev in
@ -32,7 +31,7 @@ _lsblk_module()
COMPREPLY=( $(compgen -P "$prefix" -W "${MAJOR:-""}" -S ',' -- $realcur) )
return 0
;;
'-o'|'--output'|'-E'|'--dedup')
'-o'|'--output'|'-M'|'--dedup')
local prefix realcur LSBLK_COLS
realcur="${cur##*,}"
prefix="${cur%$realcur}"
@ -79,10 +78,7 @@ _lsblk_module()
--inverse
--topology
--scsi
--nvme
--virtio
--sort
--width
--help
--version"
COMPREPLY=( $(compgen -W "${OPTS[*]}" -- $cur) )

View file

@ -1,48 +0,0 @@
_lsclocks_module()
{
local cur prev OPTS
COMPREPLY=()
cur="${COMP_WORDS[COMP_CWORD]}"
prev="${COMP_WORDS[COMP_CWORD-1]}"
case $prev in
'-J'|'--json')
return 0
;;
'-n'|'--noheadings')
return 0
;;
'-o'|'--output')
return 0
;;
'-r'|'--raw')
return 0
;;
'-t'|'--time')
clocks="$(command "$1" --noheadings --raw --output NAME)"
COMPREPLY=( $(compgen -W "$clocks" -- "$cur") )
return 0
;;
'-h'|'--help'|'-V'|'--version')
return 0
;;
esac
case $cur in
-*)
OPTS="--json
--noheadings
--output
--raw
--time
--help
--version"
COMPREPLY=( $(compgen -W "${OPTS[*]}" -- $cur) )
return 0
;;
*)
return 0
;;
esac
return 0
}
complete -F _lsclocks_module lsclocks

View file

@ -1,40 +0,0 @@
_lsirq_module()
{
local cur prev OPTS
COMPREPLY=()
cur="${COMP_WORDS[COMP_CWORD]}"
prev="${COMP_WORDS[COMP_CWORD-1]}"
case $prev in
'-o'|'--output')
local prefix realcur OUTPUT
realcur="${cur##*,}"
prefix="${cur%$realcur}"
for WORD in "IRQ TOTAL NAME"; do
if ! [[ $prefix == *"$WORD"* ]]; then
OUTPUT="$WORD ${OUTPUT:-""}"
fi
done
compopt -o nospace
COMPREPLY=( $(compgen -P "$prefix" -W "$OUTPUT" -S ',' -- $realcur) )
return 0
;;
'-s'|'--sort')
COMPREPLY=( $(compgen -W "irq total name" -- $cur) )
return 0
;;
'-h'|'--help'|'-V'|'--version')
return 0
;;
esac
OPTS=" --json
--pairs
--noheadings
--output
--softirq
--sort
--help
--version"
COMPREPLY=( $(compgen -W "${OPTS[*]}" -- $cur) )
return 0
}
complete -F _lsirq_module lsirq

3
bash-completion/lslogins Normal file → Executable file
View file

@ -23,7 +23,7 @@ _lslogins_module()
COMPREPLY=( $(compgen -W "short full iso" -- $cur) )
return 0
;;
'--wtmp-file'|'--btmp-file'|'--lastlog')
'--wtmp-file'|'--btmp-file')
local IFS=$'\n'
compopt -o filenames
COMPREPLY=( $(compgen -f -- $cur) )
@ -69,7 +69,6 @@ _lslogins_module()
--print0
--wtmp-file
--btmp-file
--lastlog
--help
--version
" -- $cur) )

View file

@ -41,7 +41,6 @@ _lsns_module()
--noheadings
--output
--output-all
--persistent
--task
--raw
--notruncate

View file

@ -21,17 +21,13 @@ _mkswap_module()
COMPREPLY=( $(compgen -W "$(uuidgen -r)" -- $cur) )
return 0
;;
'-o'|'--offset')
COMPREPLY=( $(compgen -W "bytes" -- $cur) )
return 0
;;
'-h'|'--help'|'-V'|'--version')
return 0
;;
esac
case $cur in
-*)
OPTS="--check --force --pagesize --lock --label --swapversion --uuid --offset --verbose --version --help"
OPTS="--check --force --pagesize --label --swapversion --uuid --version --help"
COMPREPLY=( $(compgen -W "${OPTS[*]}" -- $cur) )
return 0
;;

View file

@ -5,33 +5,18 @@ _more_module()
cur="${COMP_WORDS[COMP_CWORD]}"
prev="${COMP_WORDS[COMP_CWORD-1]}"
case $prev in
'-n'|'--lines')
COMPREPLY=( $(compgen -W "number" -- $cur) )
return 0
;;
'-h'|'--help'|'-V'|'--version')
'-V')
return 0
;;
esac
case $cur in
-*)
OPTS="
--silent
--logical
--no-pause
--print-over
--clean-print
--squeeze
--plain
--lines
--help
--version
"
OPTS="-d -f -l -p -c -u -s -number -V"
COMPREPLY=( $(compgen -W "${OPTS[*]}" -- $cur) )
return 0
;;
+*)
OPTS="+number +/pattern"
OPTS="+number +/string"
COMPREPLY=( $(compgen -W "${OPTS[*]}" -- $cur) )
return 0
;;

View file

@ -88,8 +88,7 @@ _mount_module()
--make-rshared
--make-rslave
--make-rprivate
--make-runbindable
--mkdir"
--make-runbindable"
COMPREPLY=( $(compgen -W "${OPTS[*]}" -- $cur) )
return 0
;;

View file

@ -6,11 +6,11 @@ _nsenter_module()
prev="${COMP_WORDS[COMP_CWORD-1]}"
case $prev in
'-S'|'--uid')
COMPREPLY=( follow $(compgen -W "uid" -- $cur) )
COMPREPLY=( $(compgen -W "uid" -- $cur) )
return 0
;;
'-G'|'--gid')
COMPREPLY=( follow $(compgen -W "gid" -- $cur) )
COMPREPLY=( $(compgen -W "gid" -- $cur) )
return 0
;;
'-t'|'--target')
@ -42,16 +42,11 @@ _nsenter_module()
--pid=
--cgroup=
--user=
--user-parent
--time=
--setuid
--setgid
--keep-caps
--preserve-credentials
--root=
--wd=
--wdns=
--env
--no-fork
--help
--version

View file

@ -1,102 +0,0 @@
_pipesz_module()
{
local WORD OPTS OPTARG OPTEND SOPT LOPT TARG
local SOPTS=(g s f n i o e c q v h V)
local LOPTS=(get set file fd stdin stdout stderr check quiet verbose help version)
local AOPTS=(0 1 1 1 0 0 0 0 0 0 0 0) # takes argument
local TOPTS=(1 0 1 1 1 1 1 0 0 0 0 0) # specifies target
local XOPTS=(0 0 0 0 0 0 0 0 0 0 1 1) # exits immediately
local MOPTS=(0 0 1 1 0 0 0 0 0 0 0 0) # repeatable
local NOPTS=(0 0 0 0 0 0 0 0 0 0 0 0) # number of repeats
local IDXG=0 IDXS=1 # index of --get and --set
for ((i=1; i<COMP_CWORD; i++)); do
WORD=${COMP_WORDS[i]}
if [[ ${NOPTS[$IDXG]} -eq 0 ]]; then
case $WORD in
--)
_command_offset $((i+1))
return 0;;
[^-]*)
_command_offset $i
return 0;;
esac
fi
for ((j=0; j<${#NOPTS[@]}; j++)); do
SOPT=${SOPTS[$j]}
LOPT=${LOPTS[$j]}
case $WORD in
--$LOPT) OPTEND=l;;
--*) continue;;
-*$SOPT) OPTEND=s;;
-*$SOPT*) OPTEND=n;;
*) continue;;
esac
if [[ ${XOPTS[$j]} -ne 0 ]]; then
COMPREPLY=()
return 0
fi
((NOPTS[j]++))
[[ ${TOPTS[$j]} -ne 0 ]] && TARG=y
[[ $OPTEND != n ]] && ((i+=AOPTS[j]))
[[ $OPTEND == l ]] && break
done
done
case $3 in
--fd) OPTARG=n;;
--file) OPTARG=f;;
--size) OPTARG=s;;
--*) ;;
-*n) OPTARG=n;;
-*f) OPTARG=f;;
-*s) OPTARG=s;;
esac
case $OPTARG in
f)
compopt -o filenames
COMPREPLY=( $(compgen -f -- "$2") )
return 0;;
n)
COMPREPLY=( $(compgen -W "0 1 2" -- "$2") )
return 0;;
s)
WORD=$2
if [[ ! $WORD =~ ^[0-9]+[a-zA-Z]*$ ]]; then
COMPREPLY=()
return 0
fi
while [[ $WORD =~ [a-zA-Z]$ ]]; do WORD=${WORD:0:-1}; done
compopt -o nosort
COMPREPLY=( $(compgen -W "$WORD $WORD{K,M,G}{B,iB}" -- "$2") )
return 0;;
esac
for ((j=0; j<${#NOPTS[@]}; j++)); do
[[ $j -eq $IDXG && ${NOPTS[$IDXS]} -ne 0 ]] && continue
[[ $j -eq $IDXS && ${NOPTS[$IDXG]} -ne 0 ]] && continue
[[ $COMP_CWORD -ne 1 && ${XOPTS[$j]} -ne 0 ]] && continue
[[ ${NOPTS[$j]} -gt 0 && ${MOPTS[$j]} -eq 0 ]] && continue
[[ $2 != --* && $2 == -* ]] && OPTS+=" -${SOPTS[$j]}"
OPTS+=" --${LOPTS[$j]}"
done
if [[ ! $TARG || ${NOPTS[$IDXG]} -ne 0 ]]; then
COMPREPLY=( $(compgen -W "$OPTS" -- "$2") )
else
compopt -o filenames
COMPREPLY=( $(compgen -c -W "$OPTS --" -- "$2") )
fi
}
complete -F _pipesz_module pipesz

View file

@ -11,7 +11,7 @@ _rename_module()
esac
case $cur in
-*)
OPTS="--verbose --symlink --help --version --no-act --all --last --no-overwrite --interactive"
OPTS="--verbose --symlink --help --version --no-act --no-override --interactive"
COMPREPLY=( $(compgen -W "${OPTS[*]}" -- $cur) )
return 0
;;

View file

@ -11,7 +11,7 @@ _rev_module()
esac
case $cur in
-*)
OPTS="--version --help --zero"
OPTS="--version --help"
COMPREPLY=( $(compgen -W "${OPTS[*]}" -- $cur) )
return 0
;;

View file

@ -5,7 +5,7 @@ _rfkill_module()
cur="${COMP_WORDS[COMP_CWORD]}"
prev="${COMP_WORDS[COMP_CWORD-1]}"
case $prev in
'list'|'block'|'unblock'|'toggle')
'list'|'block'|'unblock')
local targets
targets="$(rfkill --output=id,type --noheadings list)"
COMPREPLY=( $(compgen -W "all $targets" -- $cur) )
@ -33,7 +33,6 @@ _rfkill_module()
list
block
unblock
toggle
--json
--noheadings
--output

View file

@ -10,18 +10,10 @@ _script_module()
COMPREPLY=( $(compgen -c -- $cur) )
return 0
;;
'-E'|'--echo')
COMPREPLY=( $(compgen -W "auto always never" -- $cur) )
return 0
;;
'-o'|'--output-limit')
COMPREPLY=( $(compgen -W "size" -- $cur) )
return 0
;;
'-m'|'--logging-format')
COMPREPLY=( $(compgen -W "classic advanced" -- $cur) )
return 0
;;
'-h'|'--help'|'-V'|'--version')
return 0
;;

View file

@ -5,11 +5,6 @@ _scriptlive_module()
cur="${COMP_WORDS[COMP_CWORD]}"
prev="${COMP_WORDS[COMP_CWORD-1]}"
case $prev in
'-c'|'--command')
compopt -o bashdefault
COMPREPLY=( $(compgen -c -- $cur) )
return 0
;;
'-d'|'--divisor'|'-m'|'--maxdelay')
COMPREPLY=( $(compgen -W "digit" -- $cur) )
return 0

View file

@ -5,18 +5,10 @@ _scriptreplay_module()
cur="${COMP_WORDS[COMP_CWORD]}"
prev="${COMP_WORDS[COMP_CWORD-1]}"
case $prev in
'-c'|'--cr-mode')
COMPREPLY=( $(compgen -W "auto never always" -- $cur) )
return 0
;;
'-d'|'--divisor'|'-m'|'--maxdelay')
COMPREPLY=( $(compgen -W "digit" -- $cur) )
return 0
;;
'-x'|'--stream')
COMPREPLY=( $(compgen -W "out in signal info" -- $cur) )
return 0
;;
'-h'|'--help'|'-V'|'--version')
return 0
;;

View file

@ -58,12 +58,10 @@ _sfdisk_module()
--show-geometry
--list
--list-free
--disk-id
--reorder
--show-size
--list-types
--verify
--relocate
--delete
--part-label
--part-type
@ -71,12 +69,10 @@ _sfdisk_module()
--part-attrs
--append
--backup
--backup-pt-sectors
--bytes
--move-data
--force
--color
--lock
--partno
--no-act
--no-reread

View file

@ -41,7 +41,7 @@ _su_module()
esac
local IFS=$'\n'
compopt -o filenames
COMPREPLY=( $(compgen -u -- $cur) )
COMPREPLY=( $(compgen -f -- $cur) )
return 0
}
complete -F _su_module su

View file

@ -59,7 +59,6 @@ _swapon_module()
--discard
--ifexists
--fixpgsz
--fstab
--priority
--summary
--show

View file

@ -1,39 +0,0 @@
_uclampset_module()
{
local cur prev OPTS
COMPREPLY=()
cur="${COMP_WORDS[COMP_CWORD]}"
prev="${COMP_WORDS[COMP_CWORD-1]}"
case $prev in
'-h'|'--help'|'-V'|'--version')
return 0
;;
esac
case $cur in
-*)
OPTS="
--all-tasks
--help
--pid
--system
--reset-on-fork
--verbose
--version
"
COMPREPLY=( $(compgen -W "${OPTS[*]}" -- $cur) )
return 0
;;
esac
local i
for i in ${COMP_WORDS[*]}; do
case $i in
'-p'|'--pid')
COMPREPLY=( $(compgen -W "$(cd /proc && echo [0-9]*)" -- $cur) )
return 0
;;
esac
done
COMPREPLY=( $(compgen -c -- $cur) )
return 0
}
complete -F _uclampset_module uclampset

View file

@ -1,37 +1,3 @@
_umount_points_list()
{
# List of characters to escape shamelessly stolen from "scp" completion
local escape_chars='[][(){}<>\",:;^&!$=?`|\\'\'' \t\f\n\r\v]'
findmnt -lno TARGET | awk '
function literal_ere(s) {
gsub(/[][^$.*?+{}\\()|]/, "\\\\&", s)
return s
}
{
home_ere = literal_ere(ENVIRON["HOME"])
print home_ere
if ($0 ~ "^"home_ere) {
homeless = $0
sub("^"home_ere, "~", homeless)
gsub("'"$escape_chars"'", "\\\\&", homeless)
print homeless " "
}
pwd_ere = literal_ere(ENVIRON["PWD"])
if ($0 ~ "^"pwd_ere) {
reldir = $0
sub("^"pwd_ere"/?", "", reldir)
gsub("'"$escape_chars"'", "\\\\&", reldir)
print "./" reldir " "
print reldir " "
}
gsub("'"$escape_chars"'", "\\\\&")
print $0 " "
}'
}
_umount_module()
{
local cur prev OPTS
@ -83,7 +49,27 @@ _umount_module()
;;
esac
local IFS=$'\n'
COMPREPLY=( $( compgen -W '$( _umount_points_list )' -- "$cur" ) )
local oldifs=$IFS
IFS=$'\n'
COMPREPLY=( $( compgen -W "$(findmnt -lno TARGET | awk \
'{
if ($0 ~ ENVIRON["HOME"]) {
homeless = $0
homeless = gensub(ENVIRON["HOME"], "\\\\~", "g", homeless)
homeless = gensub(/(\s)/, "\\\\\\1", "g", homeless)
print homeless
}
if ($0 ~ ENVIRON["PWD"]) {
reldir = $0
reldir = gensub(ENVIRON["PWD"]"/", "", "g", reldir)
reldir = gensub(/(\s)/, "\\\\\\1", "g", reldir)
print "./" reldir
print reldir
}
gsub(/\s/, "\\\\&")
print $0
}'
)" -- "$cur" ) )
IFS=$oldifs
}
complete -F _umount_module -o nospace umount
complete -F _umount_module umount

View file

@ -26,7 +26,6 @@ _unshare_module()
--pid
--user
--cgroup
--time
--fork
--kill-child
--keep-caps
@ -39,8 +38,6 @@ _unshare_module()
--version
--root
--wd
--monotonic
--boottime
--setuid
--setgid"
COMPREPLY=( $(compgen -W "${OPTS[*]}" -- $cur) )

View file

@ -1,37 +0,0 @@
_waitpid_module()
{
local cur prev OPTS
COMPREPLY=()
cur="${COMP_WORDS[COMP_CWORD]}"
prev="${COMP_WORDS[COMP_CWORD-1]}"
case $prev in
'-t'|'--timeout')
COMPREPLY=( $(compgen -W "seconds" -- $cur) )
return 0
;;
'-c'|'--count')
return 0
;;
'-h'|'--help'|'-V'|'--version')
return 0
;;
esac
case $cur in
-*)
OPTS="--verbose
--timeout
--exited
--count
--help
--version"
COMPREPLY=( $(compgen -W "${OPTS[*]}" -- $cur) )
return 0
;;
*)
_pids
return 0
;;
esac
return 0
}
complete -F _waitpid_module waitpid

View file

@ -17,12 +17,12 @@ _whereis_module()
esac
case $cur in
-*)
OPTS="-b -B -m -M -s -S -f -u -l -g"
OPTS="-b -B -m -M -s -S -f -u -l"
COMPREPLY=( $(compgen -W "${OPTS[*]}" -- $cur) )
return 0
;;
esac
COMPREPLY=( $(compgen -c -- $cur) )
COMPREPLY=( $(compgen -W "file" -- $cur) )
return 0
}
complete -F _whereis_module whereis

View file

@ -41,7 +41,6 @@ _wipefs_module()
--force
--noheadings
--json
--lock
--no-act
--offset
--output

File diff suppressed because it is too large Load diff

View file

@ -1,21 +1,17 @@
if BUILD_MINIX
sbin_PROGRAMS += fsck.minix
MANPAGES += disk-utils/fsck.minix.8
dist_noinst_DATA += disk-utils/fsck.minix.8.adoc
dist_man_MANS += disk-utils/fsck.minix.8
fsck_minix_SOURCES = \
disk-utils/fsck.minix.c \
disk-utils/minix_programs.h \
lib/ismounted.c
disk-utils/minix_programs.h
fsck_minix_LDADD = $(LDADD) libcommon.la
sbin_PROGRAMS += mkfs.minix
MANPAGES += disk-utils/mkfs.minix.8
dist_noinst_DATA += disk-utils/mkfs.minix.8.adoc
dist_man_MANS += disk-utils/mkfs.minix.8
mkfs_minix_SOURCES = \
disk-utils/minix_programs.h \
disk-utils/mkfs.minix.c \
lib/ismounted.c
disk-utils/mkfs.minix.c
mkfs_minix_LDADD = $(LDADD) libcommon.la
check_PROGRAMS += test_mkfs_minix
@ -27,16 +23,14 @@ endif
if BUILD_MKFS
sbin_PROGRAMS += mkfs
MANPAGES += disk-utils/mkfs.8
dist_noinst_DATA += disk-utils/mkfs.8.adoc
dist_man_MANS += disk-utils/mkfs.8
mkfs_SOURCES = disk-utils/mkfs.c
endif
if BUILD_ISOSIZE
usrbin_exec_PROGRAMS += isosize
MANPAGES += disk-utils/isosize.8
dist_noinst_DATA += disk-utils/isosize.8.adoc
dist_man_MANS += disk-utils/isosize.8
isosize_SOURCES = disk-utils/isosize.c
isosize_LDADD = $(LDADD) libcommon.la
endif
@ -44,8 +38,7 @@ endif
if BUILD_BFS
sbin_PROGRAMS += mkfs.bfs
MANPAGES += disk-utils/mkfs.bfs.8
dist_noinst_DATA += disk-utils/mkfs.bfs.8.adoc
dist_man_MANS += disk-utils/mkfs.bfs.8
mkfs_bfs_SOURCES = \
disk-utils/mkfs.bfs.c
mkfs_bfs_LDADD = $(LDADD) libcommon.la
@ -54,11 +47,9 @@ endif
if BUILD_MKSWAP
sbin_PROGRAMS += mkswap
MANPAGES += disk-utils/mkswap.8
dist_noinst_DATA += disk-utils/mkswap.8.adoc
dist_man_MANS += disk-utils/mkswap.8
mkswap_SOURCES = \
disk-utils/mkswap.c \
lib/ismounted.c
disk-utils/mkswap.c
mkswap_LDADD = $(LDADD) libcommon.la
mkswap_CFLAGS = $(AM_CFLAGS)
@ -72,17 +63,13 @@ mkswap_LDADD += libblkid.la
endif
if HAVE_SELINUX
mkswap_LDADD += -lselinux
mkswap_SOURCES += \
lib/selinux-utils.c \
include/selinux-utils.h
endif
endif # BUILD_MKSWAP
if BUILD_SWAPLABEL
sbin_PROGRAMS += swaplabel
MANPAGES += disk-utils/swaplabel.8
dist_noinst_DATA += disk-utils/swaplabel.8.adoc
dist_man_MANS += disk-utils/swaplabel.8
swaplabel_SOURCES = \
disk-utils/swaplabel.c \
lib/swapprober.c \
@ -100,8 +87,7 @@ endif #BUILD_SWAPLABEL
if BUILD_FSCK
sbin_PROGRAMS += fsck
MANPAGES += disk-utils/fsck.8
dist_noinst_DATA += disk-utils/fsck.8.adoc
dist_man_MANS += disk-utils/fsck.8
fsck_SOURCES = disk-utils/fsck.c lib/monotonic.c
fsck_LDADD = $(LDADD) libmount.la libblkid.la libcommon.la $(REALTIME_LIBS)
fsck_CFLAGS = $(AM_CFLAGS) -I$(ul_libmount_incdir) -I$(ul_libblkid_incdir)
@ -110,8 +96,7 @@ endif
if BUILD_RAW
sbin_PROGRAMS += raw
MANPAGES += disk-utils/raw.8
dist_noinst_DATA += disk-utils/raw.8.adoc
dist_man_MANS += disk-utils/raw.8
raw_SOURCES = disk-utils/raw.c
endif
@ -119,30 +104,26 @@ endif
if BUILD_CRAMFS
cramfs_common_sources = disk-utils/cramfs.h disk-utils/cramfs_common.c
sbin_PROGRAMS += fsck.cramfs
MANPAGES += disk-utils/fsck.cramfs.8
dist_noinst_DATA += disk-utils/fsck.cramfs.8.adoc
fsck_cramfs_SOURCES = disk-utils/fsck.cramfs.c $(cramfs_common_sources)
fsck_cramfs_LDADD = $(LDADD) -lz libcommon.la
dist_man_MANS += disk-utils/fsck.cramfs.8
sbin_PROGRAMS += mkfs.cramfs
MANPAGES += disk-utils/mkfs.cramfs.8
dist_noinst_DATA += disk-utils/mkfs.cramfs.8.adoc
mkfs_cramfs_SOURCES = disk-utils/mkfs.cramfs.c $(cramfs_common_sources)
mkfs_cramfs_LDADD = $(LDADD) -lz libcommon.la
dist_man_MANS += disk-utils/mkfs.cramfs.8
endif
if BUILD_FDFORMAT
usrsbin_exec_PROGRAMS += fdformat
MANPAGES += disk-utils/fdformat.8
dist_noinst_DATA += disk-utils/fdformat.8.adoc
dist_man_MANS += disk-utils/fdformat.8
fdformat_SOURCES = disk-utils/fdformat.c
fdformat_LDADD = $(LDADD) libcommon.la
endif
if BUILD_BLOCKDEV
sbin_PROGRAMS += blockdev
MANPAGES += disk-utils/blockdev.8
dist_noinst_DATA += disk-utils/blockdev.8.adoc
dist_man_MANS += disk-utils/blockdev.8
blockdev_SOURCES = disk-utils/blockdev.c
blockdev_LDADD = $(LDADD) libcommon.la
endif
@ -150,16 +131,13 @@ endif
if BUILD_FDISK
sbin_PROGRAMS += fdisk
MANPAGES += disk-utils/fdisk.8
dist_noinst_DATA += disk-utils/fdisk.8.adoc
dist_man_MANS += disk-utils/fdisk.8
fdisk_SOURCES = \
disk-utils/fdisk.c \
disk-utils/fdisk.h \
disk-utils/fdisk-menu.c \
disk-utils/fdisk-list.c \
disk-utils/fdisk-list.h \
include/pager.h \
lib/pager.c
disk-utils/fdisk-list.h
fdisk_LDADD = $(LDADD) libcommon.la libfdisk.la \
libsmartcols.la libtcolors.la $(READLINE_LIBS)
@ -177,8 +155,7 @@ endif # BUILD_FDISK
if BUILD_SFDISK
sbin_PROGRAMS += sfdisk
MANPAGES += disk-utils/sfdisk.8
dist_noinst_DATA += disk-utils/sfdisk.8.adoc
dist_man_MANS += disk-utils/sfdisk.8
sfdisk_SOURCES = \
disk-utils/sfdisk.c \
disk-utils/fdisk-list.c \
@ -200,8 +177,7 @@ endif # BUILD_SFDISK
if BUILD_CFDISK
sbin_PROGRAMS += cfdisk
MANPAGES += disk-utils/cfdisk.8
dist_noinst_DATA += disk-utils/cfdisk.8.adoc
dist_man_MANS += disk-utils/cfdisk.8
cfdisk_SOURCES = disk-utils/cfdisk.c
cfdisk_LDADD = \
$(LDADD) \
@ -230,16 +206,12 @@ endif # BUILD_CFDISK
if BUILD_PARTX
usrsbin_exec_PROGRAMS += partx addpart delpart resizepart
MANPAGES += \
dist_man_MANS += \
disk-utils/addpart.8 \
disk-utils/delpart.8 \
disk-utils/resizepart.8 \
disk-utils/partx.8
dist_noinst_DATA += \
disk-utils/addpart.8.adoc \
disk-utils/delpart.8.adoc \
disk-utils/resizepart.8.adoc \
disk-utils/partx.8.adoc
addpart_SOURCES = disk-utils/addpart.c
addpart_LDADD = $(LDADD) libcommon.la

40
disk-utils/addpart.8 Normal file
View file

@ -0,0 +1,40 @@
.\" addpart.8 -- man page for addpart
.\" Copyright 2007 Karel Zak <kzak@redhat.com>
.\" Copyright 2007 Red Hat, Inc.
.\" May be distributed under the GNU General Public License
.TH ADDPART 8 "January 2015" "util-linux" "System Administration"
.SH NAME
addpart \- tell the kernel about the existence of a partition
.SH SYNOPSIS
.B addpart
.I device partition start length
.SH DESCRIPTION
.B addpart
tells the Linux kernel about the existence of the specified partition.
The command is a simple wrapper around the "add partition" ioctl.
This command doesn't manipulate partitions on a block device.
.SH PARAMETERS
.TP
.I device
The disk device.
.TP
.I partition
The partition number.
.TP
.I start
The beginning of the partition (in 512-byte sectors).
.TP
.I length
The length of the partition (in 512-byte sectors).
.SH SEE ALSO
.BR delpart (8),
.BR fdisk (8),
.BR parted (8),
.BR partprobe (8),
.BR partx (8)
.SH AVAILABILITY
The addpart command is part of the util-linux package and is available from
https://www.kernel.org/pub/linux/utils/util-linux/.

View file

@ -1,59 +0,0 @@
//po4a: entry man manual
////
addpart.8 -- man page for addpart
Copyright 2007 Karel Zak <kzak@redhat.com>
Copyright 2007 Red Hat, Inc.
May be distributed under the GNU General Public License
////
= addpart(8)
:doctype: manpage
:man manual: System Administration
:man source: util-linux {release-version}
:page-layout: base
:command: addpart
== NAME
addpart - tell the kernel about the existence of a partition
== SYNOPSIS
*addpart* _device partition start length_
== DESCRIPTION
*addpart* tells the Linux kernel about the existence of the specified partition. The command is a simple wrapper around the "add partition" ioctl.
This command doesn't manipulate partitions on a block device.
== PARAMETERS
_device_::
The disk device.
_partition_::
The partition number.
_start_::
The beginning of the partition (in 512-byte sectors).
_length_::
The length of the partition (in 512-byte sectors).
include::man-common/help-version.adoc[]
== SEE ALSO
*delpart*(8),
*fdisk*(8),
*parted*(8),
*partprobe*(8),
*partx*(8)
include::man-common/bugreports.adoc[]
include::man-common/footer.adoc[]
ifdef::translation[]
include::man-common/translation.adoc[]
endif::[]

93
disk-utils/blockdev.8 Normal file
View file

@ -0,0 +1,93 @@
.\" Copyright 1998 Andries E. Brouwer (aeb@cwi.nl)
.\" Copyright 2007 Karel Zak <kzak@redhat.com>
.\"
.\" May be distributed under the GNU General Public License
.TH BLOCKDEV 8 "August 2010" "util-linux" "System Administration"
.SH NAME
blockdev \- call block device ioctls from the command line
.SH SYNOPSIS
.B blockdev
.RB [ \-q ]
.RB [ \-v ]
.I command
.RI [ command \&...\&]
.I device
.RI [ device \&...\&]
.br
.B blockdev
.B \-\-report
.RI [ device \&...\&]
.br
.B blockdev
.RB \-h | \-V
.SH DESCRIPTION
The utility
.B blockdev
allows one to call block device ioctls from the command line.
.SH OPTIONS
.IP "\fB\-q\fP"
Be quiet.
.IP "\fB\-v\fP"
Be verbose.
.IP "\fB\-\-report\fP"
Print a report for the specified device. It is possible to give multiple
devices. If none is given, all devices which appear in /proc/partitions are
shown. Note that the partition StartSec is in 512-byte sectors.
.IP "\fB\-h\fR, \fB\-\-help\fR"
Display help text and exit.
.IP "\fB\-V\fR, \fB\-\-version\fR"
Print version and exit.
.SH COMMANDS
It is possible to give multiple devices and multiple commands.
.IP "\fB\-\-flushbufs\fP"
Flush buffers.
.IP "\fB\-\-getalignoff\fP"
Get alignment offset.
.IP "\fB\-\-getbsz\fP"
Print blocksize in bytes. This size does not describe device topology. It's
size used internally by kernel and it maybe modified (for example) by
filesystem driver on mount.
.IP "\fB\-\-getdiscardzeroes\fP"
Get discard zeroes support status.
.IP "\fB\-\-getfra\fP"
Get filesystem readahead in 512-byte sectors.
.IP "\fB\-\-getiomin\fP"
Get minimum I/O size.
.IP "\fB\-\-getioopt\fP"
Get optimal I/O size.
.IP "\fB\-\-getmaxsect\fP"
Get max sectors per request
.IP "\fB\-\-getpbsz\fP"
Get physical block (sector) size.
.IP "\fB\-\-getra\fP"
Print readahead (in 512-byte sectors).
.IP "\fB\-\-getro\fP"
Get read-only. Print 1 if the device is read-only, 0 otherwise.
.IP "\fB\-\-getsize64\fP"
Print device size in bytes.
.IP "\fB\-\-getsize\fP"
Print device size (32-bit!) in sectors. Deprecated in favor of the \-\-getsz option.
.IP "\fB\-\-getss\fP"
Print logical sector size in bytes \(en usually 512.
.IP "\fB\-\-getsz\fP"
Get size in 512-byte sectors.
.IP "\fB\-\-rereadpt\fP"
Reread partition table
.IP "\fB\-\-setbsz\fP \fIbytes\fP"
Set blocksize. Note that the block size is specific to the current file
descriptor opening the block device, so the change of block size only persists
for as long as blockdev has the device open, and is lost once blockdev exits.
.IP "\fB\-\-setfra\fP \fIsectors\fP"
Set filesystem readahead (same like \-\-setra on 2.6 kernels).
.IP "\fB\-\-setra\fP \fIsectors\fP"
Set readahead (in 512-byte sectors).
.IP "\fB\-\-setro\fP"
Set read-only. The currently active access to the device may not be affected by the change. For example
filesystem already mounted in read-write mode will not be affected. The change applies after remount.
.IP "\fB\-\-setrw\fP"
Set read-write.
.SH AUTHOR
blockdev was written by Andries E.\& Brouwer and rewritten by Karel Zak.
.SH AVAILABILITY
The blockdev command is part of the util-linux package and is available from
https://www.kernel.org/pub/linux/utils/util-linux/.

View file

@ -1,127 +0,0 @@
//po4a: entry man manual
////
Copyright 1998 Andries E. Brouwer (aeb@cwi.nl)
Copyright 2007 Karel Zak <kzak@redhat.com>
May be distributed under the GNU General Public License
////
= blockdev(8)
:doctype: manpage
:man manual: System Administration
:man source: util-linux {release-version}
:page-layout: base
:command: blockdev
== NAME
blockdev - call block device ioctls from the command line
== SYNOPSIS
*blockdev* [*-q*] [*-v*] _command_ [_command_...] _device_ [_device_...]
*blockdev* *--report* [_device_...]
*blockdev* *-h*|*-V*
== DESCRIPTION
The utility *blockdev* allows one to call block device ioctls from the command line.
== OPTIONS
*-q*::
Be quiet.
*-v*::
Be verbose.
*--report*::
Print a report for the specified device. It is possible to give multiple devices. If none is given, all devices which appear in _/proc/partitions_ are shown. Note that the partition StartSec is in 512-byte sectors.
include::man-common/help-version.adoc[]
== COMMANDS
It is possible to give multiple devices and multiple commands.
*--flushbufs*::
Flush buffers.
*--getalignoff*::
Get alignment offset.
*--getbsz*::
Print the blocksize in bytes. This size does not describe device topology. It's the size used internally by the kernel and it may be modified (for example) by filesystem driver on mount.
*--getdiscardzeroes*::
Get discard zeroes support status.
*--getdiskseq*::
Get disk sequence number.
*--getzonesz*::
Get zone size in 512-byte sectors.
*--getfra*::
Get filesystem readahead in 512-byte sectors.
*--getiomin*::
Get minimum I/O size.
*--getioopt*::
Get optimal I/O size.
*--getmaxsect*::
Get max sectors per request.
*--getpbsz*::
Get physical block (sector) size.
*--getra*::
Print readahead (in 512-byte sectors).
*--getro*::
Get read-only. Print 1 if the device is read-only, 0 otherwise.
*--getsize64*::
Print device size in bytes.
*--getsize*::
Print device size (32-bit!) in sectors. Deprecated in favor of the *--getsz* option.
*--getss*::
Print logical sector size in bytes - usually 512.
*--getsz*::
Get size in 512-byte sectors.
*--rereadpt*::
Reread partition table
*--setbsz* _bytes_::
Set blocksize. Note that the block size is specific to the current file descriptor opening the block device, so the change of block size only persists for as long as *blockdev* has the device open, and is lost once *blockdev* exits.
*--setfra* _sectors_::
Set filesystem readahead (same as *--setra* on 2.6 kernels).
*--setra* _sectors_::
Set readahead (in 512-byte sectors).
*--setro*::
Set read-only. The currently active access to the device may not be affected by the change. For example, a filesystem already mounted in read-write mode will not be affected. The change applies after remount.
*--setrw*::
Set read-write.
== AUTHORS
*blockdev* was written by Andries E. Brouwer and rewritten by Karel Zak.
include::man-common/bugreports.adoc[]
include::man-common/footer.adoc[]
ifdef::translation[]
include::man-common/translation.adoc[]
endif::[]

View file

@ -10,16 +10,12 @@
#include <unistd.h>
#include <sys/ioctl.h>
#include <errno.h>
#ifdef HAVE_LINUX_BLKZONED_H
#include <linux/blkzoned.h>
#endif
#include "c.h"
#include "nls.h"
#include "blkdev.h"
#include "pathnames.h"
#include "closestream.h"
#include "strutils.h"
#include "sysfs.h"
struct bdc {
@ -172,20 +168,6 @@ static const struct bdc bdcms[] =
.argval = -1,
.help = N_("get filesystem readahead")
},{
IOCTL_ENTRY(BLKGETDISKSEQ),
.name = "--getdiskseq",
.argtype = ARG_ULLONG,
.argval = -1,
.help = N_("get disk sequence number")
},{
#ifdef BLKGETZONESZ
IOCTL_ENTRY(BLKGETZONESZ),
.name = "--getzonesz",
.argtype = ARG_UINT,
.argval = -1,
.help = N_("get zone size")
},{
#endif
IOCTL_ENTRY(BLKFLSBUF),
.name = "--flushbufs",
.help = N_("flush buffers")
@ -369,7 +351,7 @@ static void do_commands(int fd, char **argv, int d)
bdcms[j].name);
errtryhelp(EXIT_FAILURE);
}
iarg = strtos32_or_err(argv[++i], _("failed to parse command argument"));
iarg = atoi(argv[++i]);
} else
iarg = bdcms[j].argval;
@ -459,7 +441,7 @@ static void report_all_devices(void)
&ma, &mi, &sz, ptname) != 4)
continue;
snprintf(device, sizeof(device), "/dev/%s", ptname);
sprintf(device, "/dev/%s", ptname);
report_device(device, 1);
}
@ -473,7 +455,6 @@ static void report_device(char *device, int quiet)
long ra;
unsigned long long bytes;
uint64_t start = 0;
char start_str[16] = { "\0" };
struct stat st;
fd = open(device, O_RDONLY | O_NONBLOCK);
@ -495,21 +476,19 @@ static void report_device(char *device, int quiet)
disk != st.st_rdev) {
if (ul_path_read_u64(pc, &start, "start") != 0)
/* TRANSLATORS: Start sector not available. Max. 15 letters. */
snprintf(start_str, sizeof(start_str), "%15s", _("N/A"));
err(EXIT_FAILURE,
_("%s: failed to read partition start from sysfs"),
device);
}
ul_unref_path(pc);
}
if (!*start_str)
snprintf(start_str, sizeof(start_str), "%15ju", start);
if (ioctl(fd, BLKROGET, &ro) == 0 &&
ioctl(fd, BLKRAGET, &ra) == 0 &&
ioctl(fd, BLKSSZGET, &ssz) == 0 &&
ioctl(fd, BLKBSZGET, &bsz) == 0 &&
blkdev_get_size(fd, &bytes) == 0) {
printf("%s %5ld %5d %5d %s %15lld %s\n",
ro ? "ro" : "rw", ra, ssz, bsz, start_str, bytes, device);
printf("%s %5ld %5d %5d %10ju %15lld %s\n",
ro ? "ro" : "rw", ra, ssz, bsz, start, bytes, device);
} else {
if (!quiet)
warnx(_("ioctl error on %s"), device);
@ -520,5 +499,5 @@ static void report_device(char *device, int quiet)
static void report_header(void)
{
printf(_("RO RA SSZ BSZ StartSec Size Device\n"));
printf(_("RO RA SSZ BSZ StartSec Size Device\n"));
}

204
disk-utils/cfdisk.8 Normal file
View file

@ -0,0 +1,204 @@
.\" cfdisk.8 -- man page for cfdisk
.\" Copyright 1994 Kevin E. Martin (martin@cs.unc.edu)
.\" Copyright (C) 2014 Karel Zak <kzak@redhat.com>
.\"
.\" Permission is granted to make and distribute verbatim copies of this
.\" manual provided the copyright notice and this permission notice are
.\" preserved on all copies.
.\"
.\" Permission is granted to copy and distribute modified versions of this
.\" manual under the conditions for verbatim copying, provided that the
.\" entire resulting derived work is distributed under the terms of a
.\" permission notice identical to this one.
.\"
.TH CFDISK 8 "March 2014" "util-linux" "System Administration"
.SH NAME
cfdisk \- display or manipulate a disk partition table
.SH SYNOPSIS
.B cfdisk
[options]
.RI [ device ]
.SH DESCRIPTION
.B cfdisk
is a curses-based program for partitioning any block device.
The default device is
.IR /dev/sda .
Note that
.B cfdisk
provides basic partitioning functionality with a user-friendly interface.
If you need advanced features, use
.BR fdisk (8)
instead.
Since version 2.25
.B cfdisk
supports MBR (DOS), GPT, SUN and SGI disk labels, but no longer provides any
functionality for CHS (Cylinder-Head-Sector) addressing. CHS has
never been important for Linux, and this addressing concept does not make any
sense for new devices.
Since version 2.25
.B cfdisk
also does not provide a 'print' command any more.
This functionality is provided by the utilities
.BR partx (8)
and
.BR lsblk (8)
in a very comfortable and rich way.
If you want to remove an old partition table from a device, use
.BR wipefs (8).
.SH OPTIONS
.TP
.BR \-h , " \-\-help"
Display help text and exit.
.TP
.BR \-L , " \-\-color" [ = \fIwhen\fR]
Colorize the output. The optional argument \fIwhen\fP
can be \fBauto\fR, \fBnever\fR or \fBalways\fR. If the \fIwhen\fR argument is omitted,
it defaults to \fBauto\fR. The colors can be disabled, for the current built-in default
see \fB\-\-help\fR output. See also the COLORS section.
.TP
.BR \-V , " \-\-version"
Display version information and exit.
.TP
.BR \-z , " \-\-zero"
Start with an in-memory zeroed partition table. This option does not zero the
partition table on the disk; rather, it simply starts the program without
reading the existing partition table. This option allows you to create a new
partition table from scratch or from an sfdisk-compatible script.
.SH COMMANDS
The commands for
.B cfdisk
can be entered by pressing the corresponding key (pressing
.I Enter
after the command is not necessary). Here is a list of the available
commands:
.TP
.B b
Toggle the bootable flag of the current partition. This allows you to
select which primary partition is bootable on the drive. This command may not
be available for all partition label types.
.TP
.B d
Delete the current partition. This will convert the current partition
into free space and merge it with any free space immediately
surrounding the current partition. A partition already marked as free
space or marked as unusable cannot be deleted.
.TP
.B h
Show the help screen.
.TP
.B n
Create a new partition from free space.
.B cfdisk
then prompts you for the size of the partition you want to create.
The default size is equal to the entire available free space at the current
position.
The size may be followed by a multiplicative suffix: KiB (=1024),
MiB (=1024*1024), and so on for GiB, TiB, PiB, EiB, ZiB and YiB
(the "iB" is optional, e.g. "K" has the same meaning as "KiB").
.TP
.B q
Quit the program. This will exit the program without writing any data to
the disk.
.TP
.B s
Sort the partitions in ascending start-sector order. When deleting and
adding partitions, it is likely that the numbering of the partitions will
no longer match their order on the disk. This command restores that match.
.TP
.B t
Change the partition type. By default, new partitions are created as
.I Linux
partitions.
.TP
.B u
Dump the current in-memory partition table to an sfdisk-compatible script file.
.sp
The script files are compatible between \fBcfdisk\fR, \fBfdisk\fR, \fBsfdisk\fR
and other libfdisk applications. For more details see
.BR sfdisk (8).
.sp
It is also possible to load an sfdisk-script into \fBcfdisk\fR if there is
no partition table on the device or when you start \fBcfdisk\fR with the
\fB--zero\fR command-line option.
.TP
.B W
Write the partition table to disk (you must enter an uppercase W). Since
this might destroy data on the disk, you must either confirm or deny
the write by entering `yes' or `no'. If you enter `yes',
.B cfdisk
will write the partition table to disk and then tell the kernel to re-read the
partition table from the disk.
The re-reading of the partition table does not always work. In such a
case you need to inform the kernel about any new partitions by using
.BR partprobe (8)
or
.BR partx (8),
or by rebooting the system.
.TP
.B x
Toggle extra information about a partition.
.TP
.IR "Up Arrow" , " Down Arrow"
Move the cursor to the previous or next partition. If there are more
partitions than can be displayed on a screen, you can display the next
(previous) set of partitions by moving down (up) at the last (first)
partition displayed on the screen.
.TP
.IR "Left Arrow" , " Right Arrow"
Select the preceding or the next menu item. Hitting \fIEnter\fR will
execute the currently selected item.
.PP
All commands can be entered with either uppercase or lowercase
letters (except for
.BR W rite).
When in a submenu or at a prompt, you can hit the
.I Esc
key to return to the main menu.
.SH COLORS
Implicit coloring can be disabled by creating the empty file
.IR /etc/terminal-colors.d/cfdisk.disable .
See
.BR terminal-colors.d (5)
for more details about colorization configuration.
.B cfdisk
does not support color customization with a color-scheme file.
.SH ENVIRONMENT
.IP CFDISK_DEBUG=all
enables cfdisk debug output.
.IP LIBFDISK_DEBUG=all
enables libfdisk debug output.
.IP LIBBLKID_DEBUG=all
enables libblkid debug output.
.IP LIBSMARTCOLS_DEBUG=all
enables libsmartcols debug output.
.IP LIBSMARTCOLS_DEBUG_PADDING=on
use visible padding characters. Requires enabled LIBSMARTCOLS_DEBUG.
.SH "SEE ALSO"
.BR fdisk (8),
.BR parted (8),
.BR partprobe (8),
.BR partx (8),
.BR sfdisk (8)
.SH AUTHOR
Karel Zak <kzak@redhat.com>
.PP
The current cfdisk implementation is based on the original cfdisk
from Kevin E. Martin (martin@cs.unc.edu).
.SH AVAILABILITY
The cfdisk command is part of the util-linux package and is available from
https://www.kernel.org/pub/linux/utils/util-linux/.

View file

@ -1,159 +0,0 @@
//po4a: entry man manual
////
cfdisk.8 -- man page for cfdisk
Copyright 1994 Kevin E. Martin (martin@cs.unc.edu)
Copyright (C) 2014 Karel Zak <kzak@redhat.com>
Permission is granted to make and distribute verbatim copies of this
manual provided the copyright notice and this permission notice are
preserved on all copies.
Permission is granted to copy and distribute modified versions of this
manual under the conditions for verbatim copying, provided that the
entire resulting derived work is distributed under the terms of a
permission notice identical to this one.
////
= cfdisk(8)
:doctype: manpage
:man manual: System Administration
:man source: util-linux {release-version}
:page-layout: base
:command: cfdisk
== NAME
cfdisk - display or manipulate a disk partition table
== SYNOPSIS
*cfdisk* [options] [_device_]
== DESCRIPTION
*cfdisk* is a curses-based program for partitioning any block device. The default device is _/dev/sda_.
Note that *cfdisk* provides basic partitioning functionality with a user-friendly interface. If you need advanced features, use *fdisk*(8) instead.
All disk label changes will remain in memory only, and the disk will be unmodified until you decide to write your changes. Be careful before using the write command.
Since version 2.25 *cfdisk* supports MBR (DOS), GPT, SUN and SGI disk labels, but no longer provides any functionality for CHS (Cylinder-Head-Sector) addressing. CHS has never been important for Linux, and this addressing concept does not make any sense for new devices.
Since version 2.25 *cfdisk* also does not provide a 'print' command any more. This functionality is provided by the utilities *partx*(8) and *lsblk*(8) in a very comfortable and rich way.
If you want to remove an old partition table from a device, use *wipefs*(8).
== OPTIONS
include::man-common/help-version.adoc[]
*-L*, *--color*[**=**__when__]::
Colorize the output. The optional argument _when_ can be *auto*, *never* or *always*. If the _when_ argument is omitted, it defaults to *auto*. The colors can be disabled, for the current built-in default see *--help* output. See also the *COLORS* section.
*--lock*[=_mode_]::
Use exclusive BSD lock for device or file it operates. The optional argument _mode_ can be *yes*, *no* (or 1 and 0) or *nonblock*. If the _mode_ argument is omitted, it defaults to *yes*. This option overwrites environment variable *$LOCK_BLOCK_DEVICE*. The default is not to use any lock at all, but it's recommended to avoid collisions with *systemd-udevd*(8) or other tools.
*-r*, *--read-only*::
Forced open in read-only mode.
*-z*, *--zero*::
Start with an in-memory zeroed partition table. This option does not zero the partition table on the disk; rather, it simply starts the program without reading the existing partition table. This option allows you to create a new partition table from scratch or from an *sfdisk*(8)-compatible script.
== COMMANDS
The commands for *cfdisk* can be entered by pressing the corresponding key (pressing _Enter_ after the command is not necessary). Here is a list of the available commands:
*b*::
Toggle the bootable flag of the current partition. This allows you to select which primary partition is bootable on the drive. This command may not be available for all partition label types.
*d*::
Delete the current partition. This will convert the current partition into free space and merge it with any free space immediately surrounding the current partition. A partition already marked as free space or marked as unusable cannot be deleted.
*h*::
Show the help screen.
*n*::
Create a new partition from free space. *cfdisk* then prompts you for the size of the partition you want to create. The default size is equal to the entire available free space at the current position.
+
The size may be followed by a multiplicative suffix: KiB (=1024), MiB (=1024*1024), and so on for GiB, TiB, PiB, EiB, ZiB and YiB (the "iB" is optional, e.g., "K" has the same meaning as "KiB").
*q*::
Quit the program. This will exit the program without writing any data to the disk.
*r*::
Reduce or enlarge the current partition. *cfdisk* then prompts you for the new size of the partition. The default size is the current size. A partition marked as free space or marked as unusable cannot be resized.
+
*Note that reducing the size of a partition might destroy data on that partition.*
*s*::
Sort the partitions in ascending start-sector order. When deleting and adding partitions, it is likely that the numbering of the partitions will no longer match their order on the disk. This command restores that match.
*t*::
Change the partition type. By default, new partitions are created as _Linux_ partitions.
*u*::
Dump the current in-memory partition table to an **sfdisk**(8)-compatible script file.
+
The script files are compatible between *cfdisk*, *fdisk*(8) *sfdisk*(8) and other libfdisk applications. For more details see *sfdisk*(8).
+
It is also possible to load an sfdisk-script into *cfdisk* if there is no partition table on the device or when you start *cfdisk* with the *--zero* command-line option.
*W*::
Write the partition table to disk (you must enter an uppercase W). Since this might destroy data on the disk, you must either confirm or deny the write by entering `yes' or `no'. If you enter `yes', *cfdisk* will write the partition table to disk and then tell the kernel to re-read the partition table from the disk.
+
The re-reading of the partition table does not always work. In such a case you need to inform the kernel about any new partitions by using *partprobe*(8) or *partx*(8), or by rebooting the system.
*x*::
Toggle extra information about a partition.
_Up Arrow_, _Down Arrow_::
Move the cursor to the previous or next partition. If there are more partitions than can be displayed on a screen, you can display the next (previous) set of partitions by moving down (up) at the last (first) partition displayed on the screen.
_Left Arrow_, _Right Arrow_::
Select the preceding or the next menu item. Hitting _Enter_ will execute the currently selected item.
All commands can be entered with either uppercase or lowercase letters (except for **W**rite). When in a submenu or at a prompt, you can hit the _Esc_ key to return to the main menu.
include::man-common/colors.adoc[]
*cfdisk* does not support color customization with a color-scheme file.
== ENVIRONMENT
*CFDISK_DEBUG*=all::
enables cfdisk debug output.
*LIBFDISK_DEBUG*=all::
enables libfdisk debug output.
*LIBBLKID_DEBUG*=all::
enables libblkid debug output.
*LIBSMARTCOLS_DEBUG*=all::
enables libsmartcols debug output.
*LIBSMARTCOLS_DEBUG_PADDING*=on::
use visible padding characters. Requires enabled *LIBSMARTCOLS_DEBUG*.
*LOCK_BLOCK_DEVICE*=<mode>::
use exclusive BSD lock. The mode is "1" or "0". See *--lock* for more details.
== AUTHORS
mailto:kzak@redhat.com[Karel Zak]
The current *cfdisk* implementation is based on the original *cfdisk* from mailto:martin@cs.unc.edu[Kevin E. Martin].
== SEE ALSO
*fdisk*(8),
*parted*(8),
*partprobe*(8),
*partx*(8),
*sfdisk*(8)
include::man-common/bugreports.adoc[]
include::man-common/footer.adoc[]
ifdef::translation[]
include::man-common/translation.adoc[]
endif::[]

View file

@ -1,7 +1,7 @@
/*
* cfdisk.c - Display or manipulate a disk partition table.
*
* Copyright (C) 2014-2023 Karel Zak <kzak@redhat.com>
* Copyright (C) 2014-2015 Karel Zak <kzak@redhat.com>
* Copyright (C) 1994 Kevin E. Martin (martin@cs.unc.edu)
*
* The original cfdisk was inspired by the fdisk program
@ -21,7 +21,6 @@
#include <assert.h>
#include <libsmartcols.h>
#include <sys/ioctl.h>
#include <rpmatch.h>
#include <libfdisk.h>
#ifdef HAVE_LIBMOUNT
@ -65,7 +64,6 @@
#include "colors.h"
#include "debug.h"
#include "list.h"
#include "blkdev.h"
static const char *default_disks[] = {
#ifdef __GNU__
@ -125,14 +123,12 @@ enum {
CFDISK_CL_FREESPACE,
CFDISK_CL_INFO
};
#ifdef HAVE_USE_DEFAULT_COLORS
static const int color_pairs[][2] = {
/* color foreground, background */
[CFDISK_CL_WARNING] = { COLOR_RED, -1 },
[CFDISK_CL_FREESPACE] = { COLOR_GREEN, -1 },
[CFDISK_CL_INFO] = { COLOR_BLUE, -1 }
};
#endif
struct cfdisk;
@ -144,14 +140,9 @@ static void menu_refresh_size(struct cfdisk *cf);
static int ui_end(void);
static int ui_refresh(struct cfdisk *cf);
static void ui_warnx(const char *fmt, ...)
__attribute__((__format__ (__printf__, 1, 2)));
static void ui_warn(const char *fmt, ...)
__attribute__((__format__ (__printf__, 1, 2)));
static void ui_info(const char *fmt, ...)
__attribute__((__format__ (__printf__, 1, 2)));
static void ui_warnx(const char *fmt, ...);
static void ui_warn(const char *fmt, ...);
static void ui_info(const char *fmt, ...);
static void ui_draw_menu(struct cfdisk *cf);
static int ui_menu_move(struct cfdisk *cf, int key);
static void ui_menu_resize(struct cfdisk *cf);
@ -638,13 +629,13 @@ static int ask_callback(struct fdisk_context *cxt __attribute__((__unused__)),
switch(fdisk_ask_get_type(ask)) {
case FDISK_ASKTYPE_INFO:
ui_info("%s", fdisk_ask_print_get_mesg(ask));
ui_info(fdisk_ask_print_get_mesg(ask));
break;
case FDISK_ASKTYPE_WARNX:
ui_warnx("%s", fdisk_ask_print_get_mesg(ask));
ui_warnx(fdisk_ask_print_get_mesg(ask));
break;
case FDISK_ASKTYPE_WARN:
ui_warn("%s", fdisk_ask_print_get_mesg(ask));
ui_warn(fdisk_ask_print_get_mesg(ask));
break;
case FDISK_ASKTYPE_MENU:
ask_menu(ask, (struct cfdisk *) data);
@ -676,8 +667,7 @@ static int ui_end(void)
return 0;
}
static void __attribute__((__format__ (__printf__, 3, 0)))
ui_vprint_center(size_t line, int attrs, const char *fmt, va_list ap)
static void ui_vprint_center(size_t line, int attrs, const char *fmt, va_list ap)
{
size_t width;
char *buf = NULL;
@ -707,8 +697,7 @@ static void __attribute__((__format__ (__printf__, 3, 0)))
free(buf);
}
static void __attribute__((__format__ (__printf__, 2, 3)))
ui_center(size_t line, const char *fmt, ...)
static void ui_center(size_t line, const char *fmt, ...)
{
va_list ap;
va_start(ap, fmt);
@ -716,8 +705,7 @@ static void __attribute__((__format__ (__printf__, 2, 3)))
va_end(ap);
}
static void __attribute__((__format__ (__printf__, 1, 2)))
ui_warnx(const char *fmt, ...)
static void ui_warnx(const char *fmt, ...)
{
va_list ap;
va_start(ap, fmt);
@ -732,8 +720,7 @@ static void __attribute__((__format__ (__printf__, 1, 2)))
va_end(ap);
}
static void __attribute__((__format__ (__printf__, 1, 2)))
ui_warn(const char *fmt, ...)
static void ui_warn(const char *fmt, ...)
{
char *fmt_m;
va_list ap;
@ -759,25 +746,7 @@ static void ui_clean_warn(void)
clrtoeol();
}
static int __attribute__((__noreturn__))
__attribute__((__format__ (__printf__, 2, 3)))
ui_err(int rc, const char *fmt, ...)
{
va_list ap;
ui_end();
va_start(ap, fmt);
fprintf(stderr, "%s: ", program_invocation_short_name);
vfprintf(stderr, fmt, ap);
fprintf(stderr, ": %s\n", strerror(errno));
va_end(ap);
exit(rc);
}
static int __attribute__((__noreturn__))
__attribute__((__format__ (__printf__, 2, 3)))
ui_errx(int rc, const char *fmt, ...)
static int __attribute__((__noreturn__)) ui_errx(int rc, const char *fmt, ...)
{
va_list ap;
ui_end();
@ -791,8 +760,7 @@ static int __attribute__((__noreturn__))
exit(rc);
}
static void __attribute__((__format__ (__printf__, 1, 2)))
ui_info(const char *fmt, ...)
static void ui_info(const char *fmt, ...)
{
va_list ap;
va_start(ap, fmt);
@ -813,8 +781,7 @@ static void ui_clean_info(void)
clrtoeol();
}
static void __attribute__((__format__ (__printf__, 1, 2)))
ui_hint(const char *fmt, ...)
static void ui_hint(const char *fmt, ...)
{
va_list ap;
va_start(ap, fmt);
@ -1019,9 +986,7 @@ static size_t menuitem_get_line(struct cfdisk *cf, size_t idx)
if (!m->page_sz) /* small menu */
return (ui_lines - (cf->menu->nitems + 1)) / 2 + idx;
return (idx % m->page_sz) + 1;
}
{
} else {
size_t len = MENU_H_ITEMWIDTH(m) + MENU_H_BETWEEN; /** item width */
size_t items = ui_cols / len; /* items per line */
@ -1038,9 +1003,7 @@ static int menuitem_get_column(struct cfdisk *cf, size_t idx)
if ((size_t) ui_cols <= nc)
return 0;
return (ui_cols - nc) / 2;
}
{
} else {
size_t len = MENU_H_ITEMWIDTH(cf->menu) + MENU_H_BETWEEN; /* item width */
size_t items = ui_cols / len; /* items per line */
size_t extra = items < cf->menu->nitems ? /* extra space on line */
@ -1148,7 +1111,7 @@ static void ui_draw_menuitem(struct cfdisk *cf,
if (cf->menu->idx == idx) {
standend();
if (d->desc)
ui_hint("%s", _(d->desc));
ui_hint(_(d->desc));
}
}
@ -1303,10 +1266,7 @@ static char *get_mountpoint(struct cfdisk *cf, const char *tagname, const char *
cf->fstab = mnt_new_table();
if (cf->fstab) {
mnt_table_set_cache(cf->fstab, cf->mntcache);
if (mnt_table_parse_fstab(cf->fstab, NULL) != 0) {
mnt_unref_table(cf->fstab);
cf->fstab = NULL;
}
mnt_table_parse_fstab(cf->fstab, NULL);
}
}
if (cf->fstab)
@ -1325,34 +1285,6 @@ static char *get_mountpoint(struct cfdisk *cf, const char *tagname, const char *
}
#endif /* HAVE_LIBMOUNT */
static inline int iszero(const char *str)
{
const char *p;
for (p = str; p && *p == '0'; p++);
return !p || *p == '\0';
}
static int has_uuid(struct fdisk_table *tb, const char *uuid)
{
struct fdisk_partition *pa;
struct fdisk_iter *itr;
int rc = 0;
if (!tb || !uuid || fdisk_table_is_empty(tb))
return 0;
itr = fdisk_new_iter(FDISK_ITER_FORWARD);
while (rc == 0 && fdisk_table_next_partition(tb, itr, &pa) == 0) {
const char *x = fdisk_partition_get_uuid(pa);
if (x)
rc = strcmp(x, uuid) == 0;
}
fdisk_free_iter(itr);
return rc;
}
static void extra_prepare_data(struct cfdisk *cf)
{
struct fdisk_partition *pa = get_current_partition(cf);
@ -1372,14 +1304,7 @@ static void extra_prepare_data(struct cfdisk *cf)
if (!fdisk_partition_to_string(pa, cf->cxt, FDISK_FIELD_UUID, &data) && data) {
extra_insert_pair(l, _("Partition UUID:"), data);
/* Search for mountpoint by PARTUUID= means that we need to
* check fstab and convert PARTUUID to the device name. This is
* unnecessary and overkill for newly created partitions. Let's
* check if the UUID already exist in the old layout, otherwise
* ignore it.
*/
if (!mountpoint && has_uuid(cf->original_layout, data))
if (!mountpoint)
mountpoint = get_mountpoint(cf, "PARTUUID", data);
free(data);
}
@ -1403,19 +1328,19 @@ static void extra_prepare_data(struct cfdisk *cf)
/* for numeric data, only show non-zero rows */
if (!fdisk_partition_to_string(pa, cf->cxt, FDISK_FIELD_BSIZE, &data) && data) {
if (!iszero(data))
if (atoi(data))
extra_insert_pair(l, "BSIZE:", data);
free(data);
}
if (!fdisk_partition_to_string(pa, cf->cxt, FDISK_FIELD_CPG, &data) && data) {
if (!iszero(data))
if (atoi(data))
extra_insert_pair(l, "CPG:", data);
free(data);
}
if (!fdisk_partition_to_string(pa, cf->cxt, FDISK_FIELD_FSIZE, &data) && data) {
if (!iszero(data))
if (atoi(data))
extra_insert_pair(l, "FSIZE:", data);
free(data);
}
@ -1793,7 +1718,6 @@ static int ui_refresh(struct cfdisk *cf)
else
ui_center(2, _("Label: %s"), fdisk_label_get_name(lb));
free(strsz);
free(id);
ui_draw_table(cf);
ui_draw_menu(cf);
@ -1831,7 +1755,7 @@ static ssize_t ui_get_string(const char *prompt,
mbs_edit_goto(edit, MBS_EDIT_END);
if (hint)
ui_hint("%s", hint);
ui_hint(hint);
else
ui_clean_hint();
@ -1950,7 +1874,7 @@ static int ui_get_size(struct cfdisk *cf, /* context */
if (rc == 0) {
ui_warnx(_("Please, specify size."));
continue; /* nothing specified */
} if (rc == -CFDISK_ERR_ESC)
} else if (rc == -CFDISK_ERR_ESC)
break; /* cancel dialog */
if (strcmp(buf, dflt) == 0)
@ -2083,7 +2007,7 @@ done:
}
free(cm);
DBG(UI, ul_debug("get parrtype done [type=%s] ", t ?
fdisk_parttype_get_name(t) : ""));
fdisk_parttype_get_name(t) : NULL));
return t;
}
@ -2203,7 +2127,7 @@ static int ui_create_label(struct cfdisk *cf)
if (refresh_menu) {
ui_draw_menu(cf);
ui_hint(_("Select a type to create a new label, press 'L' to load script file, 'Q' quits."));
ui_hint(_("Select a type to create a new label or press 'L' to load script file."));
refresh();
refresh_menu = 0;
}
@ -2257,13 +2181,11 @@ static int ui_help(void)
" ",
N_("Command Meaning"),
N_("------- -------"),
N_(" b Toggle bootable flag of the current partition;"),
N_(" implemented for DOS (MBR) and SGI labels only"),
N_(" b Toggle bootable flag of the current partition"),
N_(" d Delete the current partition"),
N_(" h Print this screen"),
N_(" n Create new partition from free space"),
N_(" q Quit program without writing partition table"),
N_(" r Reduce or enlarge the current partition"),
N_(" s Fix partitions order (only when in disarray)"),
N_(" t Change the partition type"),
N_(" u Dump disk layout to sfdisk compatible script file"),
@ -2282,7 +2204,7 @@ static int ui_help(void)
N_("Use lsblk(8) or partx(8) to see more details about the device."),
" ",
" ",
"Copyright (C) 2014-2023 Karel Zak <kzak@redhat.com>"
"Copyright (C) 2014-2017 Karel Zak <kzak@redhat.com>"
};
erase();
@ -2525,15 +2447,11 @@ static int main_menu_action(struct cfdisk *cf, int key)
if (rc)
warn = _("Failed to write disklabel.");
else {
size_t q_idx = 0;
if (cf->device_is_used)
fdisk_reread_changes(cf->cxt, cf->original_layout);
else
fdisk_reread_partition_table(cf->cxt);
info = _("The partition table has been altered.");
if (menu_get_menuitem_by_key(cf, 'q', &q_idx))
ui_menu_goto(cf, q_idx);
}
cf->nwrites++;
break;
@ -2593,26 +2511,18 @@ static int ui_run(struct cfdisk *cf)
DBG(UI, ul_debug("start cols=%zu, lines=%zu", ui_cols, ui_lines));
if (fdisk_get_collision(cf->cxt)) {
ui_warnx(_("Device already contains a %s signature."), fdisk_get_collision(cf->cxt));
if (fdisk_is_readonly(cf->cxt)) {
ui_hint(_("Press a key to continue."));
getch();
} else {
char buf[64] = { 0 };
rc = ui_get_string(_("Do you want to remove it? [Y]es/[N]o: "), NULL,
buf, sizeof(buf));
fdisk_enable_wipe(cf->cxt,
rc > 0 && rpmatch(buf) == RPMATCH_YES ? 1 : 0);
}
ui_warnx(_("Device already contains a %s signature; it will be removed by a write command."),
fdisk_get_collision(cf->cxt));
fdisk_enable_wipe(cf->cxt, 1);
ui_hint(_("Press a key to continue."));
getch();
}
if (!fdisk_has_label(cf->cxt) || cf->zero_start) {
rc = ui_create_label(cf);
if (rc < 0) {
errno = -rc;
ui_err(EXIT_FAILURE,
if (rc < 0)
ui_errx(EXIT_FAILURE,
_("failed to create a new disklabel"));
}
if (rc)
return rc;
}
@ -2633,9 +2543,7 @@ static int ui_run(struct cfdisk *cf)
ui_draw_extra(cf);
if (fdisk_is_readonly(cf->cxt))
ui_warnx(_("Device is open in read-only mode. Changes will remain in memory only."));
else if (cf->device_is_used)
ui_warnx(_("Device is currently in use, repartitioning is probably a bad idea."));
ui_warnx(_("Device is open in read-only mode."));
else if (cf->wrong_order)
ui_info(_("Note that partition table entries are not in disk order now."));
@ -2732,9 +2640,6 @@ static void __attribute__((__noreturn__)) usage(void)
fprintf(out,
" %s\n", USAGE_COLORS_DEFAULT);
fputs(_(" -z, --zero start with zeroed partition table\n"), out);
fprintf(out,
_(" --lock[=<mode>] use exclusive device lock (%s, %s or %s)\n"), "yes", "no", "nonblock");
fputs(_(" -r, --read-only forced open cfdisk in read-only mode\n"), out);
fputs(USAGE_SEPARATOR, out);
printf(USAGE_HELP_OPTIONS(26));
@ -2745,21 +2650,16 @@ static void __attribute__((__noreturn__)) usage(void)
int main(int argc, char *argv[])
{
const char *diskpath = NULL, *lockmode = NULL;
const char *diskpath = NULL;
int rc, c, colormode = UL_COLORMODE_UNDEF;
int read_only = 0;
struct cfdisk _cf = { .lines_idx = 0 },
*cf = &_cf;
enum {
OPT_LOCK = CHAR_MAX + 1
};
static const struct option longopts[] = {
{ "color", optional_argument, NULL, 'L' },
{ "lock", optional_argument, NULL, OPT_LOCK },
{ "help", no_argument, NULL, 'h' },
{ "version", no_argument, NULL, 'V' },
{ "zero", no_argument, NULL, 'z' },
{ "read-only", no_argument, NULL, 'r' },
{ NULL, 0, NULL, 0 },
};
@ -2768,7 +2668,7 @@ int main(int argc, char *argv[])
textdomain(PACKAGE);
close_stdout_atexit();
while((c = getopt_long(argc, argv, "L::hVzr", longopts, NULL)) != -1) {
while((c = getopt_long(argc, argv, "L::hVz", longopts, NULL)) != -1) {
switch(c) {
case 'h':
usage();
@ -2779,22 +2679,11 @@ int main(int argc, char *argv[])
colormode = colormode_or_err(optarg,
_("unsupported color mode"));
break;
case 'r':
read_only = 1;
break;
case 'V':
print_version(EXIT_SUCCESS);
case 'z':
cf->zero_start = 1;
break;
case OPT_LOCK:
lockmode = "1";
if (optarg) {
if (*optarg == '=')
optarg++;
lockmode = optarg;
}
break;
default:
errtryhelp(EXIT_FAILURE);
}
@ -2825,16 +2714,13 @@ int main(int argc, char *argv[])
} else
diskpath = argv[optind];
rc = fdisk_assign_device(cf->cxt, diskpath, read_only);
if (rc == -EACCES && read_only == 0)
rc = fdisk_assign_device(cf->cxt, diskpath, 0);
if (rc == -EACCES)
rc = fdisk_assign_device(cf->cxt, diskpath, 1);
if (rc != 0)
err(EXIT_FAILURE, _("cannot open %s"), diskpath);
if (!fdisk_is_readonly(cf->cxt)) {
if (blkdev_lock(fdisk_get_devfd(cf->cxt), diskpath, lockmode) != 0)
return EXIT_FAILURE;
cf->device_is_used = fdisk_device_is_used(cf->cxt);
fdisk_get_partitions(cf->cxt, &cf->original_layout);
}

View file

@ -36,7 +36,11 @@
#define CRAMFS_OFFSET_WIDTH 26
#ifndef HOST_IS_BIG_ENDIAN
#define HOST_IS_BIG_ENDIAN (__BYTE_ORDER__ == __ORDER_BIG_ENDIAN__)
#ifdef WORDS_BIGENDIAN
#define HOST_IS_BIG_ENDIAN 1
#else
#define HOST_IS_BIG_ENDIAN 0
#endif
#endif
/*

27
disk-utils/delpart.8 Normal file
View file

@ -0,0 +1,27 @@
.\" delpart.8 -- man page for delpart
.\" Copyright 2007 Karel Zak <kzak@redhat.com>
.\" Copyright 2007 Red Hat, Inc.
.\" May be distributed under the GNU General Public License
.TH DELPART 8 "January 2015" "util-linux" "System Administration"
.SH NAME
delpart \- tell the kernel to forget about a partition
.SH SYNOPSIS
.B delpart
.I device partition
.SH DESCRIPTION
.B delpart
asks the Linux kernel to forget about the specified \fIpartition\fR
(a number) on the specified \fIdevice\fR.
The command is a simple wrapper around the "del partition" ioctl.
This command doesn't manipulate partitions on a block device.
.SH SEE ALSO
.BR addpart (8),
.BR fdisk (8),
.BR parted (8),
.BR partprobe (8),
.BR partx (8)
.SH AVAILABILITY
The delpart command is part of the util-linux package and is available from
https://www.kernel.org/pub/linux/utils/util-linux/.

View file

@ -1,47 +0,0 @@
//po4a: entry man manual
////
delpart.8 -- man page for delpart
Copyright 2007 Karel Zak <kzak@redhat.com>
Copyright 2007 Red Hat, Inc.
May be distributed under the GNU General Public License
////
= delpart(8)
:doctype: manpage
:man manual: System Administration
:man source: util-linux {release-version}
:page-layout: base
:command: delpart
== NAME
delpart - tell the kernel to forget about a partition
== SYNOPSIS
*delpart* _device partition_
== DESCRIPTION
*delpart* asks the Linux kernel to forget about the specified _partition_ (a number) on the specified _device_. The command is a simple wrapper around the "del partition" ioctl.
This command doesn't manipulate partitions on a block device.
== OPTIONS
include::man-common/help-version.adoc[]
== SEE ALSO
*addpart*(8),
*fdisk*(8),
*parted*(8),
*partprobe*(8),
*partx*(8)
include::man-common/bugreports.adoc[]
include::man-common/footer.adoc[]
ifdef::translation[]
include::man-common/translation.adoc[]
endif::[]

74
disk-utils/fdformat.8 Normal file
View file

@ -0,0 +1,74 @@
.\" Copyright 1992, 1993 Rickard E. Faith (faith@cs.unc.edu)
.\" May be distributed under the GNU General Public License
.TH FDFORMAT 8 "July 2014" "util-linux" "System Administration"
.SH NAME
fdformat \- low-level format a floppy disk
.SH SYNOPSIS
.B fdformat
.RI [options] " device"
.SH DESCRIPTION
.B fdformat
does a low-level format on a floppy disk.
.I device
is usually one of the following (for floppy devices the major = 2, and the
minor is shown for informational purposes only):
.sp
.nf
.RS
/dev/fd0d360 (minor = 4)
/dev/fd0h1200 (minor = 8)
/dev/fd0D360 (minor = 12)
/dev/fd0H360 (minor = 12)
/dev/fd0D720 (minor = 16)
/dev/fd0H720 (minor = 16)
/dev/fd0h360 (minor = 20)
/dev/fd0h720 (minor = 24)
/dev/fd0H1440 (minor = 28)
.PP
/dev/fd1d360 (minor = 5)
/dev/fd1h1200 (minor = 9)
/dev/fd1D360 (minor = 13)
/dev/fd1H360 (minor = 13)
/dev/fd1D720 (minor = 17)
/dev/fd1H720 (minor = 17)
/dev/fd1h360 (minor = 21)
/dev/fd1h720 (minor = 25)
/dev/fd1H1440 (minor = 29)
.RE
.fi
.PP
The generic floppy devices, /dev/fd0 and /dev/fd1, will fail to work with
.B fdformat
when a non-standard format is being used, or if the format has not been
autodetected earlier. In this case, use
.BR setfdprm (8)
to load the disk parameters.
.SH OPTIONS
.TP
\fB\-f\fR, \fB\-\-from\fR \fIN\fR
Start at the track \fIN\fR (default is 0).
.TP
\fB\-t\fR, \fB\-\-to\fR \fIN\fR
Stop at the track \fIN\fR.
.TP
\fB\-r\fR, \fB\-\-repair\fR \fIN\fR
Try to repair tracks failed during the verification (max \fIN\fR retries).
.TP
\fB\-n\fR, \fB\-\-no\-verify\fR
Skip the verification that is normally performed after the formatting.
.TP
\fB\-V\fR, \fB\-\-version\fR
Display version information and exit.
.TP
\fB\-h\fR, \fB\-\-help\fR
Display help text and exit.
.SH "SEE ALSO"
.BR fd (4),
.BR emkfs (8),
.BR mkfs (8),
.BR setfdprm (8)
.SH AUTHOR
Werner Almesberger (almesber@nessie.cs.id.ethz.ch)
.SH AVAILABILITY
The fdformat command is part of the util-linux package and is available from
https://www.kernel.org/pub/linux/utils/util-linux/.

View file

@ -1,88 +0,0 @@
//po4a: entry man manual
////
Copyright 1992, 1993 Rickard E. Faith (faith@cs.unc.edu)
May be distributed under the GNU General Public License
////
= fdformat(8)
:doctype: manpage
:man manual: System Administration
:man source: util-linux {release-version}
:page-layout: base
:command: fdformat
== NAME
fdformat - low-level format a floppy disk
== SYNOPSIS
*fdformat* [options] _device_
== DESCRIPTION
*fdformat* does a low-level format on a floppy disk. _device_ is usually one of the following (for floppy devices the major = 2, and the minor is shown for informational purposes only):
....
/dev/fd0d360 (minor = 4)
/dev/fd0h1200 (minor = 8)
/dev/fd0D360 (minor = 12)
/dev/fd0H360 (minor = 12)
/dev/fd0D720 (minor = 16)
/dev/fd0H720 (minor = 16)
/dev/fd0h360 (minor = 20)
/dev/fd0h720 (minor = 24)
/dev/fd0H1440 (minor = 28)
....
....
/dev/fd1d360 (minor = 5)
/dev/fd1h1200 (minor = 9)
/dev/fd1D360 (minor = 13)
/dev/fd1H360 (minor = 13)
/dev/fd1D720 (minor = 17)
/dev/fd1H720 (minor = 17)
/dev/fd1h360 (minor = 21)
/dev/fd1h720 (minor = 25)
/dev/fd1H1440 (minor = 29)
....
The generic floppy devices, _/dev/fd0_ and _/dev/fd1_, will fail to work with *fdformat* when a non-standard format is being used, or if the format has not been autodetected earlier. In this case, use *setfdprm*(8) to load the disk parameters.
== OPTIONS
*-f*, *--from* _N_::
Start at the track _N_ (default is 0).
*-t*, *--to* _N_::
Stop at the track _N_.
*-r*, *--repair* _N_::
Try to repair tracks failed during the verification (max _N_ retries).
*-n*, *--no-verify*::
Skip the verification that is normally performed after the formatting.
include::man-common/help-version.adoc[]
== NOTES
This utility does not handle USB floppy disk drives. Use *ufiformat*(8) instead.
== AUTHORS
mailto:almesber@nessie.cs.id.ethz.ch[Werner Almesberger]
== SEE ALSO
*fd*(4),
*emkfs*(8),
*mkfs*(8),
*setfdprm*(8),
*ufiformat*(8)
include::man-common/bugreports.adoc[]
include::man-common/footer.adoc[]
ifdef::translation[]
include::man-common/translation.adoc[]
endif::[]

View file

@ -222,7 +222,7 @@ int main(int argc, char **argv)
if (stat(argv[0], &st) < 0)
err(EXIT_FAILURE, _("stat of %s failed"), argv[0]);
if (!S_ISBLK(st.st_mode))
/* do not test major - perhaps this was a USB floppy */
/* do not test major - perhaps this was an USB floppy */
errx(EXIT_FAILURE, _("%s: not a block device"), argv[0]);
ctrl = open_blkdev_or_file(&st, argv[0], O_RDWR);
if (ctrl < 0)

View file

@ -26,7 +26,7 @@ static int is_ide_cdrom_or_tape(char *device)
{
int fd, ret;
if ((fd = open(device, O_RDONLY|O_NONBLOCK)) < 0)
if ((fd = open(device, O_RDONLY)) < 0)
return 0;
ret = blkdev_is_cdrom(fd);
@ -68,10 +68,10 @@ void list_disk_geometry(struct fdisk_context *cxt)
fdisk_info(cxt, _("Disk model: %s"), fdisk_get_devmodel(cxt));
if (lb && (fdisk_label_require_geometry(lb) || fdisk_use_cylinders(cxt)))
fdisk_info(cxt, _("Geometry: %d heads, %ju sectors/track, %ju cylinders"),
fdisk_info(cxt, _("Geometry: %d heads, %llu sectors/track, %llu cylinders"),
fdisk_get_geom_heads(cxt),
(uintmax_t) fdisk_get_geom_sectors(cxt),
(uintmax_t) fdisk_get_geom_cylinders(cxt));
fdisk_get_geom_sectors(cxt),
fdisk_get_geom_cylinders(cxt));
fdisk_info(cxt, _("Units: %s of %d * %ld = %ld bytes"),
fdisk_get_unit(cxt, FDISK_PLURAL),
@ -182,7 +182,7 @@ void list_disklabel(struct fdisk_context *cxt)
/* print */
if (!scols_table_is_empty(out)) {
fdisk_info(cxt, "%s", ""); /* just line break */
fdisk_info(cxt, ""); /* just line break */
scols_print_table(out);
}
@ -193,24 +193,23 @@ void list_disklabel(struct fdisk_context *cxt)
continue;
if (!fdisk_lba_is_phy_aligned(cxt, fdisk_partition_get_start(pa))) {
if (!post)
fdisk_info(cxt, "%s", ""); /* line break */
fdisk_info(cxt, ""); /* line break */
fdisk_warnx(cxt, _("Partition %zu does not start on physical sector boundary."),
fdisk_partition_get_partno(pa) + 1);
post++;
}
if (fdisk_partition_has_wipe(cxt, pa)) {
if (!post)
fdisk_info(cxt, "%s", ""); /* line break */
fdisk_info(cxt, _("Filesystem/RAID signature on partition %zu will be wiped."),
fdisk_partition_get_partno(pa) + 1);
post++;
fdisk_info(cxt, ""); /* line break */
fdisk_info(cxt, _("Filesystem/RAID signature on partition %zu will be wiped."),
fdisk_partition_get_partno(pa) + 1);
post++;
}
}
if (fdisk_table_wrong_order(tb)) {
if (!post)
fdisk_info(cxt, "%s", ""); /* line break */
fdisk_info(cxt, ""); /* line break */
fdisk_info(cxt, _("Partition table entries are not in disk order."));
}
done:
@ -308,7 +307,7 @@ void list_freespace(struct fdisk_context *cxt)
/* print */
if (!scols_table_is_empty(out)) {
fdisk_info(cxt, "%s", ""); /* line break */
fdisk_info(cxt, ""); /* line break */
scols_print_table(out);
}
done:
@ -360,8 +359,7 @@ char *next_proc_partition(FILE **f)
return NULL;
}
int print_device_pt(struct fdisk_context *cxt, char *device, int warnme,
int verify, int separator)
int print_device_pt(struct fdisk_context *cxt, char *device, int warnme, int verify)
{
if (fdisk_assign_device(cxt, device, 1) != 0) { /* read-only */
if (warnme || errno == EACCES)
@ -369,9 +367,6 @@ int print_device_pt(struct fdisk_context *cxt, char *device, int warnme,
return -1;
}
if (separator)
fputs("\n\n", stdout);
list_disk_geometry(cxt);
if (fdisk_has_label(cxt)) {
@ -383,8 +378,7 @@ int print_device_pt(struct fdisk_context *cxt, char *device, int warnme,
return 0;
}
int print_device_freespace(struct fdisk_context *cxt, char *device, int warnme,
int separator)
int print_device_freespace(struct fdisk_context *cxt, char *device, int warnme)
{
if (fdisk_assign_device(cxt, device, 1) != 0) { /* read-only */
if (warnme || errno == EACCES)
@ -392,9 +386,6 @@ int print_device_freespace(struct fdisk_context *cxt, char *device, int warnme,
return -1;
}
if (separator)
fputs("\n\n", stdout);
list_freespace(cxt);
fdisk_deassign_device(cxt, 1);
return 0;
@ -403,26 +394,30 @@ int print_device_freespace(struct fdisk_context *cxt, char *device, int warnme,
void print_all_devices_pt(struct fdisk_context *cxt, int verify)
{
FILE *f = NULL;
int sep = 0;
int ct = 0;
char *dev;
while ((dev = next_proc_partition(&f))) {
print_device_pt(cxt, dev, 0, verify, sep);
if (ct)
fputs("\n\n", stdout);
if (print_device_pt(cxt, dev, 0, verify) == 0)
ct++;
free(dev);
sep = 1;
}
}
void print_all_devices_freespace(struct fdisk_context *cxt)
{
FILE *f = NULL;
int sep = 0;
int ct = 0;
char *dev;
while ((dev = next_proc_partition(&f))) {
print_device_freespace(cxt, dev, 0, sep);
if (ct)
fputs("\n\n", stdout);
if (print_device_freespace(cxt, dev, 0) == 0)
ct++;
free(dev);
sep = 1;
}
}

View file

@ -7,8 +7,8 @@ extern void list_disk_geometry(struct fdisk_context *cxt);
extern void list_freespace(struct fdisk_context *cxt);
extern char *next_proc_partition(FILE **f);
extern int print_device_pt(struct fdisk_context *cxt, char *device, int warnme, int verify, int separator);
extern int print_device_freespace(struct fdisk_context *cxt, char *device, int warnme, int separator);
extern int print_device_pt(struct fdisk_context *cxt, char *device, int warnme, int verify);
extern int print_device_freespace(struct fdisk_context *cxt, char *device, int warnme);
extern void print_all_devices_pt(struct fdisk_context *cxt, int verify);
extern void print_all_devices_freespace(struct fdisk_context *cxt);

View file

@ -122,7 +122,7 @@ static const struct menu menu_generic = {
MENU_BENT ('q', N_("quit without saving changes")),
MENU_XENT ('r', N_("return to main menu")),
MENU_ENT_NEST('r', N_("return from BSD to DOS (MBR)"), FDISK_DISKLABEL_BSD, FDISK_DISKLABEL_DOS),
MENU_ENT_NEST('r', N_("return from BSD to DOS"), FDISK_DISKLABEL_BSD, FDISK_DISKLABEL_DOS),
MENU_ENT_NEST('r', N_("return from protective/hybrid MBR to GPT"), FDISK_DISKLABEL_DOS, FDISK_DISKLABEL_GPT),
@ -138,7 +138,7 @@ static const struct menu menu_createlabel = {
MENU_SEP(N_("Create a new label")),
MENU_ENT('g', N_("create a new empty GPT partition table")),
MENU_ENT('G', N_("create a new empty SGI (IRIX) partition table")),
MENU_ENT('o', N_("create a new empty MBR (DOS) partition table")),
MENU_ENT('o', N_("create a new empty DOS partition table")),
MENU_ENT('s', N_("create a new empty Sun partition table")),
/* backward compatibility -- be sensitive to 'g', but don't
@ -221,7 +221,6 @@ static const struct menu menu_dos = {
MENU_ENT('c', N_("toggle the dos compatibility flag")),
MENU_XENT('b', N_("move beginning of data in a partition")),
MENU_XENT('F', N_("fix partitions C/H/S values")),
MENU_XENT('i', N_("change the disk identifier")),
MENU_BENT_NEST_H('M', N_("return from protective/hybrid MBR to GPT"), FDISK_DISKLABEL_DOS, FDISK_DISKLABEL_GPT),
@ -280,7 +279,7 @@ static const struct menu_entry *next_menu_entry(
/* no more entries */
if (e->title == NULL ||
/* menu wanted for specified labels only */
(m->label && (!lb || !(m->label & type))) ||
(m->label && lb && !(m->label & type)) ||
/* unwanted for nested PT */
(m->nonested && parent) ||
/* menu excluded for specified labels */
@ -297,7 +296,7 @@ static const struct menu_entry *next_menu_entry(
/* excluded for the current label */
if ((e->exclude && lb && e->exclude & type) ||
/* entry wanted for specified labels only */
(e->label && (!lb || !(e->label & type))) ||
(e->label && lb && !(e->label & type)) ||
/* exclude non-expert entries in expect mode */
(e->expert == 0 && fdisk_is_details(cxt)) ||
/* nested only */
@ -433,10 +432,8 @@ int process_fdisk_menu(struct fdisk_context **cxt0)
/* Map ^C and ^D in main menu to 'q' */
if (is_interactive
&& fdisk_label_is_changed(fdisk_get_label(cxt, NULL))) {
/* TRANSLATORS: these yes no questions use rpmatch(),
* and should be translated. */
rc = get_user_reply(
_("\nAll unwritten changes will be lost, do you really want to quit? (y/n)"),
_("\nAll unwritten changes will be lost, do you really want to quit? "),
buf, sizeof(buf));
if (rc || !rpmatch(buf))
return 0;
@ -490,7 +487,7 @@ static int script_read(struct fdisk_context *cxt)
rc = fdisk_reassign_device(cxt);
if (rc == 0 && !fdisk_has_label(cxt)) {
fdisk_info(cxt, _("Device does not contain a recognized partition table."));
rc = fdisk_create_disklabel(cxt, NULL);
fdisk_create_disklabel(cxt, NULL);
}
} else
fdisk_info(cxt, _("Script successfully applied."));
@ -639,6 +636,10 @@ static int generic_menu_cb(struct fdisk_context **cxt0,
break;
case 'f':
rc = fdisk_reorder_partitions(cxt);
if (rc)
fdisk_warnx(cxt, _("Failed to fix partitions order."));
else
fdisk_info(cxt, _("Partitions order fixed."));
break;
case 'r':
rc = fdisk_enable_details(cxt, 0);
@ -872,13 +873,6 @@ static int dos_menu_cb(struct fdisk_context **cxt0,
fdisk_unref_context(cxt);
}
break;
case 'F':
rc = fdisk_dos_fix_chs(cxt);
if (rc)
fdisk_info(cxt, _("C/H/S values fixed."));
else
fdisk_info(cxt, _("Nothing to do. C/H/S values are correct already."));
break;
}
return rc;
}
@ -1071,7 +1065,6 @@ static int createlabel_menu_cb(struct fdisk_context **cxt0,
const struct menu_entry *ent)
{
struct fdisk_context *cxt = *cxt0;
const char *wanted = NULL;
int rc = -EINVAL;
DBG(MENU, ul_debug("enter Create label menu"));
@ -1084,33 +1077,26 @@ static int createlabel_menu_cb(struct fdisk_context **cxt0,
case 'g':
/* Deprecated, use 'G' in main menu, just for backward
* compatibility only. */
wanted = "sgi";
rc = fdisk_create_disklabel(cxt, "sgi");
break;
}
} else {
switch (ent->key) {
case 'g':
wanted = "gpt";
rc = fdisk_create_disklabel(cxt, "gpt");
break;
case 'G':
wanted = "sgi";
rc = fdisk_create_disklabel(cxt, "sgi");
break;
case 'o':
wanted = "dos";
rc = fdisk_create_disklabel(cxt, "dos");
break;
case 's':
wanted = "sun";
rc = fdisk_create_disklabel(cxt, "sun");
break;
}
}
if (wanted) {
rc = fdisk_create_disklabel(cxt, wanted);
if (rc) {
errno = -rc;
fdisk_warn(cxt, _("Failed to create '%s' disk label"), wanted);
}
}
if (rc == 0 && fdisk_get_collision(cxt))
follow_wipe_mode(cxt);

375
disk-utils/fdisk.8 Normal file
View file

@ -0,0 +1,375 @@
.\" Copyright 1992, 1993 Rickard E. Faith (faith@cs.unc.edu)
.\" Copyright 1998 Andries E. Brouwer (aeb@cwi.nl)
.\" Copyright 2012 Davidlohr Bueso <dave@gnu.org>
.\" Copyright (C) 2013 Karel Zak <kzak@redhat.com>
.\" May be distributed under the GNU General Public License
.TH FDISK 8 "February 2016" "util-linux" "System Administration"
.SH NAME
fdisk \- manipulate disk partition table
.SH SYNOPSIS
.B fdisk
[options]
.I device
.sp
.B fdisk \-l
.RI [ device ...]
.SH DESCRIPTION
.B fdisk
is a dialog-driven program for creation and manipulation of partition tables.
It understands GPT, MBR, Sun, SGI and BSD partition tables.
Block devices can be divided into one or more logical disks called
.IR partitions .
This division is recorded in the
.IR "partition table" ,
usually found in sector 0 of the disk.
(In the BSD world one talks about `disk slices' and a `disklabel'.)
All partitioning is driven by device I/O limits (the topology) by default.
.B fdisk
is able to optimize the disk layout for a 4K-sector size and use an alignment offset on
modern devices for MBR and GPT. It is always a good idea to follow \fBfdisk\fR's defaults
as the default values (e.g. first and last partition sectors) and partition
sizes specified by the +/-<size>{M,G,...} notation are always aligned according
to the device properties.
CHS (Cylinder-Head-Sector) addressing is deprecated and not used by default.
Please, do not follow old articles and recommendations with "fdisk -S <n> -H
<n>" advices for SSD or 4K-sector devices.
Note that
.BR partx (8)
provides a rich interface for scripts to print disk layouts,
.B fdisk
is mostly designed for humans. Backward compatibility in the output of
.B fdisk
is not guaranteed. The input (the commands) should always be backward compatible.
.SH OPTIONS
.TP
\fB\-b\fR, \fB\-\-sector\-size\fR \fIsectorsize\fP
Specify the sector size of the disk. Valid values are 512, 1024, 2048, and 4096.
(Recent kernels know the sector size. Use this option only on old kernels or
to override the kernel's ideas.) Since util-linux-2.17, \fBfdisk\fR differentiates
between logical and physical sector size. This option changes both sector sizes to
.IB sectorsize .
.TP
\fB\-B\fR, \fB\-\-protect\-boot\fP
Don't erase the begin of the first disk sector when create a new disk label. This
feature is supported for GPT and MBR.
.TP
\fB\-c\fR, \fB\-\-compatibility\fR[=\fImode\fR]
Specify the compatibility mode, 'dos' or 'nondos'. The default is non-DOS
mode. For backward compatibility, it is possible to use the option without
the \fImode\fR argument -- then the default is used. Note that the optional
\fImode\fR argument cannot be separated from the \fB-c\fR option by a space,
the correct form is for example '-c=dos'.
.TP
\fB\-h\fR, \fB\-\-help\fR
Display a help text and exit.
.TP
\fB\-L\fR, \fB\-\-color\fR[=\fIwhen\fR]
Colorize the output. The optional argument \fIwhen\fP
can be \fBauto\fR, \fBnever\fR or \fBalways\fR. If the \fIwhen\fR argument is omitted,
it defaults to \fBauto\fR. The colors can be disabled; for the current built-in default
see the \fB\-\-help\fR output. See also the \fBCOLORS\fR section.
.TP
\fB\-l\fR, \fB\-\-list\fR
List the partition tables for the specified devices and then exit.
If no devices are given, those mentioned in
.I /proc/partitions
(if that file exists) are used.
.TP
.BR \-o , " \-\-output " \fIlist\fP
Specify which output columns to print. Use
.B \-\-help
to get a list of all supported columns.
The default list of columns may be extended if \fIlist\fP is
specified in the format \fI+list\fP (e.g. \fB-o +UUID\fP).
.TP
\fB\-s\fR, \fB\-\-getsz\fR
Print the size in 512-byte sectors of each given block device. This option is DEPRECATED
in favour of
.BR blockdev (8).
.TP
\fB\-t\fR, \fB\-\-type\fR \fItype\fR
Enable support only for disklabels of the specified \fItype\fP, and disable
support for all other types.
.TP
\fB\-u\fR, \fB\-\-units\fR[=\fIunit\fR]
When listing partition tables, show sizes in 'sectors' or in 'cylinders'. The
default is to show sizes in sectors. For backward compatibility, it is possible
to use the option without the \fIunit\fR argument -- then the default is used.
Note that the optional \fIunit\fR argument cannot be separated from the \fB-u\fR
option by a space, the correct form is for example '-u=cylinders'.
.TP
\fB\-C\fR, \fB\-\-cylinders\fR \fInumber\fR
Specify the number of cylinders of the disk.
I have no idea why anybody would want to do so.
.TP
\fB\-H\fR, \fB\-\-heads\fR \fInumber\fR
Specify the number of heads of the disk. (Not the physical number,
of course, but the number used for partition tables.)
Reasonable values are 255 and 16.
.TP
\fB\-S\fR, \fB\-\-sectors\fR \fInumber\fR
Specify the number of sectors per track of the disk.
(Not the physical number, of course, but the number used for
partition tables.) A reasonable value is 63.
.TP
\fB\-w\fR, \fB\-\-wipe\fR \fIwhen\fR
Wipe filesystem, RAID and partition-table signatures from the device, in order
to avoid possible collisions. The argument \fIwhen\fR can be \fBauto\fR,
\fBnever\fR or \fBalways\fR. When this option is not given, the default is
\fBauto\fR, in which case signatures are wiped only when in interactive mode.
In all cases detected signatures are reported by warning messages
before a new partition table is created. See also
.BR wipefs (8)
command.
.TP
\fB\-W\fR, \fB\-\-wipe-partition\fR \fIwhen\fR
Wipe filesystem, RAID and partition-table signatures from a newly created
partitions, in order to avoid possible collisions. The argument \fIwhen\fR can
be \fBauto\fR, \fBnever\fR or \fBalways\fR. When this option is not given, the
default is \fBauto\fR, in which case signatures are wiped only when in
interactive mode and after confirmation by user. In all cases detected
signatures are reported by warning messages before a new partition is
created. See also
.BR wipefs (8)
command.
.TP
\fB\-V\fR, \fB\-\-version\fR
Display version information and exit.
.SH DEVICES
The
.I device
is usually /dev/sda, /dev/sdb or so. A device name refers to the entire disk.
Old systems without libata (a library used inside the Linux kernel to support
ATA host controllers and devices) make a difference between IDE and SCSI disks.
In such cases the device name will be /dev/hd* (IDE) or /dev/sd* (SCSI).
The
.I partition
is a device name followed by a partition number. For example, /dev/sda1 is the
first partition on the first hard disk in the system. See also Linux kernel
documentation (the Documentation/devices.txt file).
.SH SIZES
The "last sector" dialog accepts partition size specified by number of sectors
or by +/-<size>{K,B,M,G,...} notation.
If the size is prefixed by '+' then it is interpreted as relative to the
partition first sector. If the size is prefixed by '-' then it is interpreted
as relative to the high limit (last available sector for the partition).
In the case the size is specified in bytes than the number may be followed by
the multiplicative suffixes KiB=1024, MiB=1024*1024, and so on for GiB, TiB,
PiB, EiB, ZiB and YiB. The "iB" is optional, e.g. "K" has the same meaning as
"KiB".
The relative sizes are always aligned according to device I/O limits. The
+/-<size>{K,B,M,G,...} notation is recommended.
For backward compatibility fdisk also accepts the suffixes KB=1000,
MB=1000*1000, and so on for GB, TB, PB, EB, ZB and YB. These 10^N suffixes
are deprecated.
.SH SCRIPT FILES
.B fdisk
allows to read (by 'I' command) sfdisk compatible script files. The script is
applied to in-memory partition table, and then it is possible to modify the
partition table before you write it to the device.
.PP
And vice-versa it is possible to write the current in-memory disk layout
to the script file by command 'O'.
.PP
The script files are compatible between cfdisk, sfdisk, fdisk and another
libfdisk applications. For more details see
.BR sfdisk (8).
.SH DISK LABELS
.B GPT (GUID Partition Table)
.RS
GPT is modern standard for the layout of the partition table. GPT uses 64-bit
logical block addresses, checksums, UUIDs and names for partitions and an
unlimited number of partitions (although the number of partitions is
usually restricted to 128 in many partitioning tools).
Note that the first sector is still reserved for a
.B protective MBR
in the GPT specification. It prevents MBR-only partitioning tools
from mis-recognizing and overwriting GPT disks.
GPT is always a better choice than MBR, especially on modern hardware with a UEFI
boot loader.
.RE
.B DOS-type (MBR)
.RS
A DOS-type partition table can describe an unlimited number of partitions. In sector 0
there is room for the description of 4 partitions (called `primary'). One of
these may be an extended partition; this is a box holding logical partitions,
with descriptors found in a linked list of sectors, each preceding the
corresponding logical partitions. The four primary partitions, present or not,
get numbers 1-4. Logical partitions are numbered starting from 5.
In a DOS-type partition table the starting offset and the size of each
partition is stored in two ways: as an absolute number of sectors (given in 32
bits), and as a
.B Cylinders/Heads/Sectors
triple (given in 10+8+6 bits). The former is OK -- with 512-byte sectors this
will work up to 2 TB. The latter has two problems. First, these C/H/S fields
can be filled only when the number of heads and the number of sectors per track
are known. And second, even if we know what these numbers should be, the 24
bits that are available do not suffice. DOS uses C/H/S only, Windows uses
both, Linux never uses C/H/S. The
.B C/H/S addressing is deprecated
and may be unsupported in some later fdisk version.
.B Please, read the DOS-mode section if you want DOS-compatible partitions.
.B fdisk
does not care about cylinder boundaries by default.
.RE
.B BSD/Sun-type
.RS
A BSD/Sun disklabel can describe 8 partitions, the third of which should be a `whole
disk' partition. Do not start a partition that actually uses its first sector
(like a swap partition) at cylinder 0, since that will destroy the disklabel.
Note that a
.B BSD label
is usually nested within a DOS partition.
.RE
.B IRIX/SGI-type
.RS
An IRIX/SGI disklabel can describe 16 partitions, the eleventh of which should be an entire
`volume' partition, while the ninth should be labeled `volume header'. The
volume header will also cover the partition table, i.e., it starts at block
zero and extends by default over five cylinders. The remaining space in the
volume header may be used by header directory entries. No partitions may
overlap with the volume header. Also do not change its type or make some
filesystem on it, since you will lose the partition table. Use this type of
label only when working with Linux on IRIX/SGI machines or IRIX/SGI disks under
Linux.
.RE
A sync() and an ioctl(BLKRRPART) (rereading the partition table from disk)
are performed before exiting when the partition table has been updated.
.SH "DOS mode and DOS 6.x WARNING"
.B Note that all this is deprecated. You don't have to care about things like
.B geometry and cylinders on modern operating systems. If you really want
.B DOS-compatible partitioning then you have to enable DOS mode and cylinder
.B units by using the '-c=dos -u=cylinders' fdisk command-line options.
The DOS 6.x FORMAT command looks for some information in the first sector of
the data area of the partition, and treats this information as more reliable
than the information in the partition table. DOS FORMAT expects DOS FDISK to
clear the first 512 bytes of the data area of a partition whenever a size
change occurs. DOS FORMAT will look at this extra information even if the /U
flag is given -- we consider this a bug in DOS FORMAT and DOS FDISK.
The bottom line is that if you use \fBfdisk\fR or \fBcfdisk\fR to change the
size of a DOS partition table entry, then you must also use
.BR dd "(1) to " "zero the first 512 bytes"
of that partition before using DOS FORMAT to format the partition. For
example, if you were using \fBfdisk\fR to make a DOS partition table entry for
/dev/sda1, then (after exiting \fBfdisk\fR and rebooting Linux so that the
partition table information is valid) you would use the command "dd
if=/dev/zero of=/dev/sda1 bs=512 count=1" to zero the first 512 bytes of the
partition.
.B fdisk
usually obtains the disk geometry automatically. This is not necessarily the
physical disk geometry (indeed, modern disks do not really have anything like a
physical geometry, certainly not something that can be described in the simplistic
Cylinders/Heads/Sectors form), but it is the disk geometry that MS-DOS uses for
the partition table.
Usually all goes well by default, and there are no problems if Linux is the
only system on the disk. However, if the disk has to be shared with other
operating systems, it is often a good idea to let an fdisk from another
operating system make at least one partition. When Linux boots it looks at the
partition table, and tries to deduce what (fake) geometry is required for good
cooperation with other systems.
Whenever a partition table is printed out in DOS mode, a consistency check is
performed on the partition table entries. This check verifies that the
physical and logical start and end points are identical, and that each
partition starts and ends on a cylinder boundary (except for the first
partition).
Some versions of MS-DOS create a first partition which does not begin
on a cylinder boundary, but on sector 2 of the first cylinder.
Partitions beginning in cylinder 1 cannot begin on a cylinder boundary, but
this is unlikely to cause difficulty unless you have OS/2 on your machine.
For best results, you should always use an OS-specific partition table
program. For example, you should make DOS partitions with the DOS FDISK
program and Linux partitions with the Linux fdisk or Linux cfdisk programs.
.SH COLORS
Implicit coloring can be disabled by an empty file \fI/etc/terminal-colors.d/fdisk.disable\fR.
See
.BR terminal-colors.d (5)
for more details about colorization configuration. The logical color names
supported by
.B fdisk
are:
.TP
.B header
The header of the output tables.
.TP
.B help-title
The help section titles.
.TP
.B warn
The warning messages.
.TP
.B welcome
The welcome message.
.SH AUTHORS
.MT kzak@redhat.com
Karel Zak
.ME
.br
.MT dave@gnu.org
Davidlohr Bueso
.ME
.br
.PP
The original version was written by
Andries E. Brouwer, A. V. Le Blanc and others.
.SH ENVIRONMENT
.IP FDISK_DEBUG=all
enables fdisk debug output.
.IP LIBFDISK_DEBUG=all
enables libfdisk debug output.
.IP LIBBLKID_DEBUG=all
enables libblkid debug output.
.IP LIBSMARTCOLS_DEBUG=all
enables libsmartcols debug output.
.IP LIBSMARTCOLS_DEBUG_PADDING=on
use visible padding characters. Requires enabled LIBSMARTCOLS_DEBUG.
.SH "SEE ALSO"
.BR cfdisk (8),
.BR mkfs (8),
.BR partx (8),
.BR sfdisk (8)
.SH AVAILABILITY
The fdisk command is part of the util-linux package and is available from
https://www.kernel.org/pub/linux/utils/util-linux/.

View file

@ -1,233 +0,0 @@
//po4a: entry man manual
////
Copyright 1992, 1993 Rickard E. Faith (faith@cs.unc.edu)
Copyright 1998 Andries E. Brouwer (aeb@cwi.nl)
Copyright 2012 Davidlohr Bueso <dave@gnu.org>
Copyright (C) 2013 Karel Zak <kzak@redhat.com>
May be distributed under the GNU General Public License
////
= fdisk(8)
:doctype: manpage
:man manual: System Administration
:man source: util-linux {release-version}
:page-layout: base
:command: fdisk
:plus: +
== NAME
fdisk - manipulate disk partition table
== SYNOPSIS
*fdisk* [options] _device_
*fdisk* *-l* [_device_...]
== DESCRIPTION
*fdisk* is a dialog-driven program for creation and manipulation of partition tables. It understands GPT, MBR, Sun, SGI and BSD partition tables.
Block devices can be divided into one or more logical disks called _partitions_. This division is recorded in the _partition table_, usually found in sector 0 of the disk. (In the BSD world one talks about `disk slices' and a `disklabel'.)
//TRANSLATORS: Keep {plus} untranslated.
All partitioning is driven by device I/O limits (the topology) by default. *fdisk* is able to optimize the disk layout for a 4K-sector size and use an alignment offset on modern devices for MBR and GPT. It is always a good idea to follow *fdisk*'s defaults as the default values (e.g., first and last partition sectors) and partition sizes specified by the {plus}/-<size>{M,G,...} notation are always aligned according to the device properties.
CHS (Cylinder-Head-Sector) addressing is deprecated and not used by default. Please, do not follow old articles and recommendations with *fdisk -S <n> -H <n>* advices for SSD or 4K-sector devices.
Note that *partx*(8) provides a rich interface for scripts to print disk layouts, *fdisk* is mostly designed for humans. Backward compatibility in the output of *fdisk* is not guaranteed. The input (the commands) should always be backward compatible.
== OPTIONS
*-b*, *--sector-size* _sectorsize_::
Specify the sector size of the disk. Valid values are 512, 1024, 2048, and 4096. (Recent kernels know the sector size. Use this option only on old kernels or to override the kernel's ideas.) Since util-linux-2.17, *fdisk* differentiates between logical and physical sector size. This option changes both sector sizes to _sectorsize_.
*-B*, *--protect-boot*::
Don't erase the beginning of the first disk sector when creating a new disk label. This feature is supported for GPT and MBR.
*-c*, *--compatibility*[=_mode_]::
Specify the compatibility mode, 'dos' or 'nondos'. The default is non-DOS mode. For backward compatibility, it is possible to use the option without the _mode_ argument -- then the default is used. Note that the optional _mode_ argument cannot be separated from the *-c* option by a space, the correct form is for example *-c*=_dos_.
include::man-common/help-version.adoc[]
*-L*, *--color*[=_when_]::
Colorize the output. The optional argument _when_ can be *auto*, *never* or *always*. If the _when_ argument is omitted, it defaults to *auto*. The colors can be disabled; for the current built-in default see the *--help* output. See also the *COLORS* section.
*-l*, *--list*::
List the partition tables for the specified devices and then exit.
+
If no devices are given, the devices mentioned in _/proc/partitions_ (if this file exists) are used. Devices are always listed in the order in which they are specified on the command-line, or by the kernel listed in _/proc/partitions_.
*-x*, *--list-details*::
Like *--list*, but provides more details.
*--lock*[=_mode_]::
Use exclusive BSD lock for device or file it operates. The optional argument _mode_ can be *yes*, *no* (or 1 and 0) or *nonblock*. If the _mode_ argument is omitted, it defaults to *yes*. This option overwrites environment variable *$LOCK_BLOCK_DEVICE*. The default is not to use any lock at all, but it's recommended to avoid collisions with *systemd-udevd*(8) or other tools.
*-n*, *--noauto-pt*::
Don't automatically create a default partition table on empty device. The partition table has to be explicitly created by user (by command like 'o', 'g', etc.).
*-o*, *--output* _list_::
Specify which output columns to print. Use *--help* to get a list of all supported columns.
+
The default list of columns may be extended if _list_ is specified in the format _{plus}list_ (e.g., *-o {plus}UUID*).
//TRANSLATORS: Keep {plus} untranslated.
*-s*, *--getsz*::
Print the size in 512-byte sectors of each given block device. This option is DEPRECATED in favour of *blockdev*(8).
*-t*, *--type* _type_::
Enable support only for disklabels of the specified _type_, and disable support for all other types.
*-u*, *--units*[=_unit_]::
When listing partition tables, show sizes in 'sectors' or in 'cylinders'. The default is to show sizes in sectors. For backward compatibility, it is possible to use the option without the _unit_ argument -- then the default is used. Note that the optional _unit_ argument cannot be separated from the *-u* option by a space, the correct form is for example '**-u=**__cylinders__'.
*-C*, *--cylinders* _number_::
Specify the _number_ of cylinders of the disk. I have no idea why anybody would want to do so.
*-H*, *--heads* _number_::
Specify the number of heads of the disk. (Not the physical number, of course, but the number used for partition tables.) Reasonable values are 255 and 16.
*-S*, *--sectors* _number_::
Specify the number of sectors per track of the disk. (Not the physical number, of course, but the number used for partition tables.) A reasonable value is 63.
*-w*, *--wipe* _when_::
Wipe filesystem, RAID and partition-table signatures from the device, in order to avoid possible collisions. The argument _when_ can be *auto*, *never* or *always*. When this option is not given, the default is *auto*, in which case signatures are wiped only when in interactive mode. In all cases detected signatures are reported by warning messages before a new partition table is created. See also *wipefs*(8) command.
*-W*, *--wipe-partitions* _when_::
Wipe filesystem, RAID and partition-table signatures from a newly created partitions, in order to avoid possible collisions. The argument _when_ can be *auto*, *never* or *always*. When this option is not given, the default is *auto*, in which case signatures are wiped only when in interactive mode and after confirmation by user. In all cases detected signatures are reported by warning messages before a new partition is created. See also *wipefs*(8) command.
*-V*, *--version*::
Display version information and exit.
== DEVICES
The _device_ is usually _/dev/sda_, _/dev/sdb_ or so. A device name refers to the entire disk. Old systems without libata (a library used inside the Linux kernel to support ATA host controllers and devices) make a difference between IDE and SCSI disks. In such cases the device name will be _/dev/hd*_ (IDE) or _/dev/sd*_ (SCSI).
The _partition_ is a device name followed by a partition number. For example, _/dev/sda1_ is the first partition on the first hard disk in the system. See also Linux kernel documentation (the _Documentation/admin-guide/devices.txt_ file).
== SIZES
//TRANSLATORS: Keep {plus} untranslated.
The "last sector" dialog accepts partition size specified by number of sectors or by {plus}/-<size>{K,B,M,G,...} notation.
//TRANSLATORS: Keep {plus} untranslated.
If the size is prefixed by '{plus}' then it is interpreted as relative to the partition first sector. If the size is prefixed by '-' then it is interpreted as relative to the high limit (last available sector for the partition).
In the case the size is specified in bytes than the number may be followed by the multiplicative suffixes KiB=1024, MiB=1024*1024, and so on for GiB, TiB, PiB, EiB, ZiB and YiB. The "iB" is optional, e.g., "K" has the same meaning as "KiB".
//TRANSLATORS: Keep {plus} untranslated.
The relative sizes are always aligned according to device I/O limits. The {plus}/-<size>{K,B,M,G,...} notation is recommended.
For backward compatibility *fdisk* also accepts the suffixes KB=1000, MB=1000*1000, and so on for GB, TB, PB, EB, ZB and YB. These 10^N suffixes are deprecated.
== SCRIPT FILES
*fdisk* allows reading (by 'I' command) *sfdisk*(8) compatible script files. The script is applied to in-memory partition table, and then it is possible to modify the partition table before you write it to the device.
And vice-versa it is possible to write the current in-memory disk layout to the script file by command 'O'.
The script files are compatible between *cfdisk*(8), *sfdisk*(8), *fdisk* and other libfdisk applications. For more details see *sfdisk*(8).
== DISK LABELS
*GPT (GUID Partition Table)*::
GPT is modern standard for the layout of the partition table. GPT uses 64-bit logical block addresses, checksums, UUIDs and names for partitions and an unlimited number of partitions (although the number of partitions is usually restricted to 128 in many partitioning tools).
+
Note that the first sector is still reserved for a *protective MBR* in the GPT specification. It prevents MBR-only partitioning tools from mis-recognizing and overwriting GPT disks.
+
GPT is always a better choice than MBR, especially on modern hardware with a UEFI boot loader.
*DOS-type (MBR)*::
A DOS-type partition table can describe an unlimited number of partitions. In sector 0 there is room for the description of 4 partitions (called `primary'). One of these may be an extended partition; this is a box holding logical partitions, with descriptors found in a linked list of sectors, each preceding the corresponding logical partitions. The four primary partitions, present or not, get numbers 1-4. Logical partitions are numbered starting from 5.
+
In a DOS-type partition table the starting offset and the size of each partition is stored in two ways: as an absolute number of sectors (given in 32 bits), and as a *Cylinders/Heads/Sectors* triple (given in 10{plus}8{plus}6 bits). The former is OK -- with 512-byte sectors this will work up to 2 TB. The latter has two problems. First, these C/H/S fields can be filled only when the number of heads and the number of sectors per track are known. And second, even if we know what these numbers should be, the 24 bits that are available do not suffice. DOS uses C/H/S only, Windows uses both, Linux never uses C/H/S. The *C/H/S addressing is deprecated* and may be unsupported in some later *fdisk* version.
//TRANSLATORS: Keep {plus} untranslated.
+
*Please, read the DOS-mode section if you want DOS-compatible partitions.* *fdisk* does not care about cylinder boundaries by default.
*BSD/Sun-type*::
A BSD/Sun disklabel can describe 8 partitions, the third of which should be a `whole disk' partition. Do not start a partition that actually uses its first sector (like a swap partition) at cylinder 0, since that will destroy the disklabel. Note that a *BSD label* is usually nested within a DOS partition.
*IRIX/SGI-type*::
An IRIX/SGI disklabel can describe 16 partitions, the eleventh of which should be an entire `volume' partition, while the ninth should be labeled `volume header'. The volume header will also cover the partition table, i.e., it starts at block zero and extends by default over five cylinders. The remaining space in the volume header may be used by header directory entries. No partitions may overlap with the volume header. Also do not change its type or make some filesystem on it, since you will lose the partition table. Use this type of label only when working with Linux on IRIX/SGI machines or IRIX/SGI disks under Linux.
+
A *sync*(2) and an ioctl(BLKRRPART) (rereading the partition table from disk) are performed before exiting when the partition table has been updated.
== DOS mode and DOS 6.x WARNING
*Note that all this is deprecated. You don't have to care about things like* *geometry and cylinders on modern operating systems. If you really want* *DOS-compatible partitioning then you have to enable DOS mode and cylinder* *units by using the '-c=dos -u=cylinders' fdisk command-line options.*
The DOS 6.x FORMAT command looks for some information in the first sector of the data area of the partition, and treats this information as more reliable than the information in the partition table. DOS FORMAT expects DOS FDISK to clear the first 512 bytes of the data area of a partition whenever a size change occurs. DOS FORMAT will look at this extra information even if the /U flag is given -- we consider this a bug in DOS FORMAT and DOS FDISK.
The bottom line is that if you use *fdisk* or *cfdisk*(8) to change the size of a DOS partition table entry, then you must also use *dd*(1) to *zero the first 512 bytes* of that partition before using DOS FORMAT to format the partition. For example, if you were using *fdisk* to make a DOS partition table entry for _/dev/sda1_, then (after exiting *fdisk* and rebooting Linux so that the partition table information is valid) you would use the command *dd if=/dev/zero of=/dev/sda1 bs=512 count=1* to zero the first 512 bytes of the partition.
*fdisk* usually obtains the disk geometry automatically. This is not necessarily the physical disk geometry (indeed, modern disks do not really have anything like a physical geometry, certainly not something that can be described in the simplistic Cylinders/Heads/Sectors form), but it is the disk geometry that MS-DOS uses for the partition table.
Usually all goes well by default, and there are no problems if Linux is the only system on the disk. However, if the disk has to be shared with other operating systems, it is often a good idea to let an *fdisk* from another operating system make at least one partition. When Linux boots it looks at the partition table, and tries to deduce what (fake) geometry is required for good cooperation with other systems.
Whenever a partition table is printed out in DOS mode, a consistency check is performed on the partition table entries. This check verifies that the physical and logical start and end points are identical, and that each partition starts and ends on a cylinder boundary (except for the first partition).
Some versions of MS-DOS create a first partition which does not begin on a cylinder boundary, but on sector 2 of the first cylinder. Partitions beginning in cylinder 1 cannot begin on a cylinder boundary, but this is unlikely to cause difficulty unless you have OS/2 on your machine.
For best results, you should always use an OS-specific partition table program. For example, you should make DOS partitions with the DOS FDISK program and Linux partitions with the Linux *fdisk* or Linux *cfdisk*(8) programs.
include::man-common/colors.adoc[]
The logical color names supported by *fdisk* are:
*header*::
The header of the output tables.
*help-title*::
The help section titles.
*warn*::
The warning messages.
*welcome*::
The welcome message.
== ENVIRONMENT
*FDISK_DEBUG*=all::
enables fdisk debug output.
*LIBFDISK_DEBUG*=all::
enables libfdisk debug output.
*LIBBLKID_DEBUG*=all::
enables libblkid debug output.
*LIBSMARTCOLS_DEBUG*=all::
enables libsmartcols debug output.
*LIBSMARTCOLS_DEBUG_PADDING*=on::
use visible padding characters.
*LOCK_BLOCK_DEVICE*=<mode>::
use exclusive BSD lock. The mode is "1" or "0". See *--lock* for more details.
== AUTHORS
mailto:kzak@redhat.com[Karel Zak],
mailto:dave@gnu.org[Davidlohr Bueso]
The original version was written by Andries E. Brouwer, A. V. Le Blanc and others.
== SEE ALSO
*cfdisk*(8),
*mkfs*(8),
*partx*(8),
*sfdisk*(8)
include::man-common/bugreports.adoc[]
include::man-common/footer.adoc[]
ifdef::translation[]
include::man-common/translation.adoc[]
endif::[]

View file

@ -480,15 +480,9 @@ static struct fdisk_parttype *ask_partition_type(struct fdisk_context *cxt, int
return NULL;
*canceled = 0;
if (fdisk_label_has_parttypes_shortcuts(lb))
q = fdisk_label_has_code_parttypes(lb) ?
_("Hex code or alias (type L to list all): ") :
_("Partition type or alias (type L to list all): ");
else
q = fdisk_label_has_code_parttypes(lb) ?
_("Hex code (type L to list all codes): ") :
_("Partition type (type L to list all types): ");
q = fdisk_label_has_code_parttypes(lb) ?
_("Hex code (type L to list all codes): ") :
_("Partition type (type L to list all types): ");
do {
char buf[256] = { '\0' };
int rc = get_user_reply(q, buf, sizeof(buf));
@ -502,11 +496,8 @@ static struct fdisk_parttype *ask_partition_type(struct fdisk_context *cxt, int
if (buf[1] == '\0' && toupper(*buf) == 'L')
list_partition_types(cxt);
else if (*buf) {
struct fdisk_parttype *t = fdisk_label_advparse_parttype(lb, buf,
FDISK_PARTTYPE_PARSE_DATA
| FDISK_PARTTYPE_PARSE_ALIAS
| FDISK_PARTTYPE_PARSE_NAME
| FDISK_PARTTYPE_PARSE_SEQNUM);
struct fdisk_parttype *t = fdisk_label_parse_parttype(lb, buf);
if (!t)
fdisk_info(cxt, _("Failed to parse '%s' partition type."), buf);
return t;
@ -519,9 +510,8 @@ static struct fdisk_parttype *ask_partition_type(struct fdisk_context *cxt, int
void list_partition_types(struct fdisk_context *cxt)
{
size_t ntypes = 0, next = 0;
size_t ntypes = 0;
struct fdisk_label *lb;
int pager = 0;
assert(cxt);
lb = fdisk_get_label(cxt, NULL);
@ -535,7 +525,7 @@ void list_partition_types(struct fdisk_context *cxt)
/*
* Prints in 4 columns in format <hex> <name>
*/
size_t last[4], done = 0, size;
size_t last[4], done = 0, next = 0, size;
int i;
size = ntypes;
@ -552,7 +542,7 @@ void list_partition_types(struct fdisk_context *cxt)
size_t ret;
if (fdisk_parttype_get_name(t)) {
printf("%s%02x ", i ? " " : "\n",
printf("%c%2x ", i ? ' ' : '\n',
fdisk_parttype_get_code(t));
ret = mbsalign(_(fdisk_parttype_get_name(t)),
name, sizeof(name),
@ -572,7 +562,6 @@ void list_partition_types(struct fdisk_context *cxt)
}
} while (done < last[0]);
putchar('\n');
} else {
/*
* Prints 1 column in format <idx> <name> <typestr>
@ -580,7 +569,6 @@ void list_partition_types(struct fdisk_context *cxt)
size_t i;
pager_open();
pager = 1;
for (i = 0; i < ntypes; i++) {
const struct fdisk_parttype *t = fdisk_label_get_parttype(lb, i);
@ -589,30 +577,9 @@ void list_partition_types(struct fdisk_context *cxt)
fdisk_parttype_get_string(t));
}
}
/*
* Aliases
*/
if (fdisk_label_has_parttypes_shortcuts(lb)) {
const char *alias = NULL, *typestr = NULL;
int rc = 0;
fputs(_("\nAliases:\n"), stdout);
for (next = 0; rc == 0 || rc == 2; next++) {
/* rc: <0 error, 0 success, 1 end, 2 deprecated */
rc = fdisk_label_get_parttype_shortcut(lb,
next, &typestr, NULL, &alias);
if (rc == 0)
printf(" %-14s - %s\n", alias, typestr);
}
}
if (pager)
pager_close();
}
putchar('\n');
}
void toggle_dos_compatibility_flag(struct fdisk_context *cxt)
@ -729,7 +696,7 @@ static size_t skip_empty(const unsigned char *buf, size_t i, size_t sz)
return next == i + 16 ? i : next;
}
static void dump_buffer(off_t base, unsigned char *buf, size_t sz)
static void dump_buffer(off_t base, unsigned char *buf, size_t sz, int all)
{
size_t i, l, next = 0;
@ -737,7 +704,7 @@ static void dump_buffer(off_t base, unsigned char *buf, size_t sz)
return;
for (i = 0, l = 0; i < sz; i++, l++) {
if (l == 0) {
if (!next)
if (all == 0 && !next)
next = skip_empty(buf, i, sz);
printf("%08jx ", (intmax_t)base + i);
}
@ -759,7 +726,7 @@ static void dump_buffer(off_t base, unsigned char *buf, size_t sz)
}
static void dump_blkdev(struct fdisk_context *cxt, const char *name,
uint64_t offset, size_t size)
uint64_t offset, size_t size, int all)
{
int fd = fdisk_get_devfd(cxt);
@ -776,20 +743,23 @@ static void dump_blkdev(struct fdisk_context *cxt, const char *name,
if (read_all(fd, (char *) buf, size) != (ssize_t) size)
fdisk_warn(cxt, _("cannot read"));
else
dump_buffer(offset, buf, size);
dump_buffer(offset, buf, size, all);
free(buf);
}
}
void dump_firstsector(struct fdisk_context *cxt)
{
int all = !isatty(STDOUT_FILENO);
assert(cxt);
dump_blkdev(cxt, _("First sector"), 0, fdisk_get_sector_size(cxt));
dump_blkdev(cxt, _("First sector"), 0, fdisk_get_sector_size(cxt), all);
}
void dump_disklabel(struct fdisk_context *cxt)
{
int all = !isatty(STDOUT_FILENO);
int i = 0;
const char *name = NULL;
uint64_t offset = 0;
@ -798,7 +768,7 @@ void dump_disklabel(struct fdisk_context *cxt)
assert(cxt);
while (fdisk_locate_disklabel(cxt, i++, &name, &offset, &size) == 0 && size)
dump_blkdev(cxt, name, offset, size);
dump_blkdev(cxt, name, offset, size, all);
}
static fdisk_sector_t get_dev_blocks(char *dev)
@ -806,7 +776,7 @@ static fdisk_sector_t get_dev_blocks(char *dev)
int fd, ret;
fdisk_sector_t size;
if ((fd = open(dev, O_RDONLY|O_NONBLOCK)) < 0)
if ((fd = open(dev, O_RDONLY)) < 0)
err(EXIT_FAILURE, _("cannot open %s"), dev);
ret = blkdev_get_sectors(fd, (unsigned long long *) &size);
close(fd);
@ -847,8 +817,8 @@ static void __attribute__((__noreturn__)) usage(void)
fputs(USAGE_HEADER, out);
fprintf(out,
_(" %1$s [options] <disk> change partition table\n"
" %1$s [options] -l [<disk>...] list partition table(s)\n"),
_(" %1$s [options] <disk> change partition table\n"
" %1$s [options] -l [<disk>] list partition table(s)\n"),
program_invocation_short_name);
fputs(USAGE_SEPARATOR, out);
@ -863,16 +833,11 @@ static void __attribute__((__noreturn__)) usage(void)
fprintf(out,
" %s\n", USAGE_COLORS_DEFAULT);
fputs(_(" -l, --list display partitions and exit\n"), out);
fputs(_(" -x, --list-details like --list but with more details\n"), out);
fputs(_(" -n, --noauto-pt don't create default partition table on empty devices\n"), out);
fputs(_(" -o, --output <list> output columns\n"), out);
fputs(_(" -t, --type <type> recognize specified partition table type only\n"), out);
fputs(_(" -u, --units[=<unit>] display units: 'cylinders' or 'sectors' (default)\n"), out);
fputs(_(" -s, --getsz display device size in 512-byte sectors [DEPRECATED]\n"), out);
fputs(_(" --bytes print SIZE in bytes rather than in human readable format\n"), out);
fprintf(out,
_(" --lock[=<mode>] use exclusive device lock (%s, %s or %s)\n"), "yes", "no", "nonblock");
fprintf(out,
_(" -w, --wipe <mode> wipe signatures (%s, %s or %s)\n"), "auto", "always", "never");
fprintf(out,
@ -896,39 +861,33 @@ static void __attribute__((__noreturn__)) usage(void)
enum {
ACT_FDISK = 0, /* default */
ACT_LIST,
ACT_LIST_DETAILS,
ACT_SHOWSIZE
};
int main(int argc, char **argv)
{
int rc, i, c, act = ACT_FDISK, noauto_pt = 0;
int rc, i, c, act = ACT_FDISK;
int colormode = UL_COLORMODE_UNDEF;
struct fdisk_context *cxt;
char *outarg = NULL;
const char *devname, *lockmode = NULL;
enum {
OPT_BYTES = CHAR_MAX + 1,
OPT_LOCK
OPT_BYTES = CHAR_MAX + 1
};
static const struct option longopts[] = {
{ "bytes", no_argument, NULL, OPT_BYTES },
{ "color", optional_argument, NULL, 'L' },
{ "compatibility", optional_argument, NULL, 'c' },
{ "cylinders", required_argument, NULL, 'C' },
{ "heads", required_argument, NULL, 'H' },
{ "heads", required_argument, NULL, 'H' },
{ "sectors", required_argument, NULL, 'S' },
{ "getsz", no_argument, NULL, 's' },
{ "help", no_argument, NULL, 'h' },
{ "list", no_argument, NULL, 'l' },
{ "list-details", no_argument, NULL, 'x' },
{ "lock", optional_argument, NULL, OPT_LOCK },
{ "noauto-pt", no_argument, NULL, 'n' },
{ "sector-size", required_argument, NULL, 'b' },
{ "type", required_argument, NULL, 't' },
{ "units", optional_argument, NULL, 'u' },
{ "version", no_argument, NULL, 'V' },
{ "output", required_argument, NULL, 'o' },
{ "output", no_argument, NULL, 'o' },
{ "protect-boot", no_argument, NULL, 'B' },
{ "wipe", required_argument, NULL, 'w' },
{ "wipe-partitions",required_argument, NULL, 'W' },
@ -950,7 +909,7 @@ int main(int argc, char **argv)
fdisk_set_ask(cxt, ask_callback, NULL);
while ((c = getopt_long(argc, argv, "b:Bc::C:hH:lL::no:sS:t:u::vVw:W:x",
while ((c = getopt_long(argc, argv, "b:Bc::C:hH:lL::o:sS:t:u::vVw:W:",
longopts, NULL)) != -1) {
switch (c) {
case 'b':
@ -1004,18 +963,12 @@ int main(int argc, char **argv)
case 'l':
act = ACT_LIST;
break;
case 'x':
act = ACT_LIST_DETAILS;
break;
case 'L':
colormode = UL_COLORMODE_AUTO;
if (optarg)
colormode = colormode_or_err(optarg,
_("unsupported color mode"));
break;
case 'n':
noauto_pt = 1;
break;
case 'o':
outarg = optarg;
break;
@ -1059,14 +1012,6 @@ int main(int argc, char **argv)
case OPT_BYTES:
fdisk_set_size_unit(cxt, FDISK_SIZEUNIT_BYTES);
break;
case OPT_LOCK:
lockmode = "1";
if (optarg) {
if (*optarg == '=')
optarg++;
lockmode = optarg;
}
break;
default:
errtryhelp(EXIT_FAILURE);
}
@ -1081,20 +1026,20 @@ int main(int argc, char **argv)
switch (act) {
case ACT_LIST:
case ACT_LIST_DETAILS:
fdisk_enable_listonly(cxt, 1);
if (act == ACT_LIST_DETAILS)
fdisk_enable_details(cxt, 1);
init_fields(cxt, outarg, NULL);
if (argc > optind) {
int k;
int ct = 0;
for (rc = 0, k = optind; k < argc; k++)
rc += print_device_pt(cxt, argv[k], 1, 0, k != optind);
for (rc = 0, k = optind; k < argc; k++) {
if (ct)
fputs("\n\n", stdout);
rc += print_device_pt(cxt, argv[k], 1, 0);
ct++;
}
if (rc)
return EXIT_FAILURE;
} else
@ -1130,38 +1075,23 @@ int main(int argc, char **argv)
fdisk_info(cxt, _("Changes will remain in memory only, until you decide to write them.\n"
"Be careful before using the write command.\n"));
devname = argv[optind];
rc = fdisk_assign_device(cxt, devname, 0);
rc = fdisk_assign_device(cxt, argv[optind], 0);
if (rc == -EACCES) {
rc = fdisk_assign_device(cxt, devname, 1);
rc = fdisk_assign_device(cxt, argv[optind], 1);
if (rc == 0)
fdisk_warnx(cxt, _("Device is open in read-only mode."));
}
if (rc)
err(EXIT_FAILURE, _("cannot open %s"), devname);
if (fdisk_device_is_used(cxt))
fdisk_warnx(cxt, _(
"This disk is currently in use - repartitioning is probably a bad idea.\n"
"It's recommended to umount all file systems, and swapoff all swap\n"
"partitions on this disk.\n"));
err(EXIT_FAILURE, _("cannot open %s"), argv[optind]);
fflush(stdout);
if (!fdisk_is_readonly(cxt)
&& blkdev_lock(fdisk_get_devfd(cxt), devname, lockmode) != 0) {
fdisk_deassign_device(cxt, 1);
fdisk_unref_context(cxt);
return EXIT_FAILURE;
}
if (fdisk_get_collision(cxt))
follow_wipe_mode(cxt);
if (!fdisk_has_label(cxt)) {
fdisk_info(cxt, _("Device does not contain a recognized partition table."));
if (!noauto_pt)
fdisk_create_disklabel(cxt, NULL);
fdisk_create_disklabel(cxt, NULL);
} else if (fdisk_is_label(cxt, GPT) && fdisk_gpt_is_hybrid(cxt))
fdisk_warnx(cxt, _(

418
disk-utils/fsck.8 Normal file
View file

@ -0,0 +1,418 @@
.\" Copyright 1993, 1994, 1995 by Theodore Ts'o. All Rights Reserved.
.\" This file may be copied under the terms of the GNU Public License.
.\"
.TH FSCK 8 "February 2009" "util-linux" "System Administration"
.SH NAME
fsck \- check and repair a Linux filesystem
.SH SYNOPSIS
.B fsck
.RB [ \-lsAVRTMNP ]
.RB [ \-r
.RI [ fd ]]
.RB [ \-C
.RI [ fd ]]
.RB [ \-t
.IR fstype ]
.RI [ filesystem \&...\&]
.RB [ \-\- ]
.RI [ fs-specific-options ]
.SH DESCRIPTION
.B fsck
is used to check and optionally repair one or more Linux filesystems.
.I filesys
can be a device name (e.g.
.IR /dev/hdc1 ", " /dev/sdb2 ),
a mount point (e.g.
.IR / ", " /usr ", " /home ),
or an filesystem label or UUID specifier (e.g.
UUID=8868abf6-88c5-4a83-98b8-bfc24057f7bd or LABEL=root).
Normally, the
.B fsck
program will try to handle filesystems on different physical disk drives
in parallel to reduce the total amount of time needed to check all of them.
.PP
If no filesystems are specified on the command line, and the
.B \-A
option is not specified,
.B fsck
will default to checking filesystems in
.I /etc/fstab
serially. This is equivalent to the
.B \-As
options.
.PP
The exit code returned by
.B fsck
is the sum of the following conditions:
.PP
.RS
.PD 0
.TP
.B 0
No errors
.TP
.B 1
Filesystem errors corrected
.TP
.B 2
System should be rebooted
.TP
.B 4
Filesystem errors left uncorrected
.TP
.B 8
Operational error
.TP
.B 16
Usage or syntax error
.TP
.B 32
Checking canceled by user request
.TP
.B 128
Shared-library error
.PD
.RE
.PP
The exit code returned when multiple filesystems are checked
is the bit-wise OR of the exit codes for each
filesystem that is checked.
.PP
In actuality,
.B fsck
is simply a front-end for the various filesystem checkers
(\fBfsck\fR.\fIfstype\fR) available under Linux. The
filesystem-specific checker is searched for in the
PATH environment variable. If the PATH is undefined then
fallback to "/sbin".
.PP
Please see the filesystem-specific checker manual pages for
further details.
.SH OPTIONS
.TP
.B \-l
Create an exclusive
.BR flock (2)
lock file (/run/fsck/<diskname>.lock) for whole-disk device.
This option can be used with one device only (this means that \fB\-A\fR and
\fB\-l\fR are mutually exclusive). This option is recommended when more
.BR fsck (8)
instances are executed in the same time. The option is ignored when used for
multiple devices or for non-rotating disks. \fBfsck\fR does not lock underlying
devices when executed to check stacked devices (e.g.\& MD or DM) \(en this feature is
not implemented yet.
.TP
.BR \-r \ [ \fIfd\fR ]
Report certain statistics for each fsck when it completes. These statistics
include the exit status, the maximum run set size (in kilobytes), the elapsed
all-clock time and the user and system CPU time used by the fsck run. For
example:
/dev/sda1: status 0, rss 92828, real 4.002804, user 2.677592, sys 0.86186
GUI front-ends may specify a file descriptor
.IR fd ,
in which case the progress bar information will be sent to that file descriptor
in a machine parsable format. For example:
/dev/sda1 0 92828 4.002804 2.677592 0.86186
.TP
.B \-s
Serialize
.B fsck
operations. This is a good idea if you are checking multiple
filesystems and the checkers are in an interactive mode. (Note:
.BR e2fsck (8)
runs in an interactive mode by default. To make
.BR e2fsck (8)
run in a non-interactive mode, you must either specify the
.B \-p
or
.B \-a
option, if you wish for errors to be corrected automatically, or the
.B \-n
option if you do not.)
.TP
.BI \-t " fslist"
Specifies the type(s) of filesystem to be checked. When the
.B \-A
flag is specified, only filesystems that match
.I fslist
are checked. The
.I fslist
parameter is a comma-separated list of filesystems and options
specifiers. All of the filesystems in this comma-separated list may be
prefixed by a negation operator
.RB ' no '
or
.RB ' ! ',
which requests that only those filesystems not listed in
.I fslist
will be checked. If none of the filesystems in
.I fslist
is prefixed by a negation operator, then only those listed filesystems
will be checked.
.sp
Options specifiers may be included in the comma-separated
.IR fslist .
They must have the format
.BI opts= fs-option\fR.
If an options specifier is present, then only filesystems which contain
.I fs-option
in their mount options field of
.I /etc/fstab
will be checked. If the options specifier is prefixed by a negation
operator, then only
those filesystems that do not have
.I fs-option
in their mount options field of
.I /etc/fstab
will be checked.
.sp
For example, if
.B opts=ro
appears in
.IR fslist ,
then only filesystems listed in
.I /etc/fstab
with the
.B ro
option will be checked.
.sp
For compatibility with Mandrake distributions whose boot scripts
depend upon an unauthorized UI change to the
.B fsck
program, if a filesystem type of
.B loop
is found in
.IR fslist ,
it is treated as if
.B opts=loop
were specified as an argument to the
.B \-t
option.
.sp
Normally, the filesystem type is deduced by searching for
.I filesys
in the
.I /etc/fstab
file and using the corresponding entry.
If the type cannot be deduced, and there is only a single filesystem
given as an argument to the
.B \-t
option,
.B fsck
will use the specified filesystem type. If this type is not
available, then the default filesystem type (currently ext2) is used.
.TP
.B \-A
Walk through the
.I /etc/fstab
file and try to check all filesystems in one run. This option is
typically used from the
.I /etc/rc
system initialization file, instead of multiple commands for checking
a single filesystem.
.sp
The root filesystem will be checked first unless the
.B \-P
option is specified (see below). After that,
filesystems will be checked in the order specified by the
.I fs_passno
(the sixth) field in the
.I /etc/fstab
file.
Filesystems with a
.I fs_passno
value of 0 are skipped and are not checked at all. Filesystems with a
.I fs_passno
value of greater than zero will be checked in order,
with filesystems with the lowest
.I fs_passno
number being checked first.
If there are multiple filesystems with the same pass number,
.B fsck
will attempt to check them in parallel, although it will avoid running
multiple filesystem checks on the same physical disk.
.sp
.B fsck
does not check stacked devices (RAIDs, dm-crypt, \&...\&) in parallel with any other
device. See below for FSCK_FORCE_ALL_PARALLEL setting. The /sys filesystem is
used to determine dependencies between devices.
.sp
Hence, a very common configuration in
.I /etc/fstab
files is to set the root filesystem to have a
.I fs_passno
value of 1
and to set all other filesystems to have a
.I fs_passno
value of 2. This will allow
.B fsck
to automatically run filesystem checkers in parallel if it is advantageous
to do so. System administrators might choose
not to use this configuration if they need to avoid multiple filesystem
checks running in parallel for some reason \(en for example, if the
machine in question is short on memory so that
excessive paging is a concern.
.sp
.B fsck
normally does not check whether the device actually exists before
calling a filesystem specific checker. Therefore non-existing
devices may cause the system to enter filesystem repair mode during
boot if the filesystem specific checker returns a fatal error. The
.I /etc/fstab
mount option
.B nofail
may be used to have
.B fsck
skip non-existing devices.
.B fsck
also skips non-existing devices that have the special filesystem type
.BR auto .
.TP
.BR \-C \ [ \fIfd\fR ]
Display completion/progress bars for those filesystem checkers (currently
only for ext[234]) which support them. \fBfsck\fR will manage the
filesystem checkers so that only one of them will display
a progress bar at a time. GUI front-ends may specify a file descriptor
.IR fd ,
in which case the progress bar information will be sent to that file descriptor.
.TP
.B \-M
Do not check mounted filesystems and return an exit code of 0
for mounted filesystems.
.TP
.B \-N
Don't execute, just show what would be done.
.TP
.B \-P
When the
.B \-A
flag is set, check the root filesystem in parallel with the other filesystems.
This is not the safest thing in the world to do,
since if the root filesystem is in doubt things like the
.BR e2fsck (8)
executable might be corrupted! This option is mainly provided
for those sysadmins who don't want to repartition the root
filesystem to be small and compact (which is really the right solution).
.TP
.B \-R
When checking all filesystems with the
.B \-A
flag, skip the root filesystem. (This is useful in case the root
filesystem has already been mounted read-write.)
.TP
.B \-T
Don't show the title on startup.
.TP
.B \-V
Produce verbose output, including all filesystem-specific commands
that are executed.
.TP
\fB\-?\fR, \fB\-\-help\fR
Display help text and exit.
.TP
\fB\-\-version\fR
Display version information and exit.
.SH FILESYSTEM SPECIFIC OPTIONS
.B Options which are not understood by fsck are passed to the filesystem-specific checker!
.PP
These options
.B must
not take arguments, as there is no
way for
.B fsck
to be able to properly guess which options take arguments and which
don't.
.PP
Options and arguments which follow the
.B \-\-
are treated as filesystem-specific options to be passed to the
filesystem-specific checker.
.PP
Please note that \fBfsck\fR is not
designed to pass arbitrarily complicated options to filesystem-specific
checkers. If you're doing something complicated, please just
execute the filesystem-specific checker directly. If you pass
.B fsck
some horribly complicated options and arguments, and it doesn't do
what you expect,
.B don't bother reporting it as a bug.
You're almost certainly doing something that you shouldn't be doing
with
.BR fsck .
Options to different filesystem-specific fsck's are not standardized.
.SH FILES
.I /etc/fstab
.SH ENVIRONMENT VARIABLES
The
.B fsck
program's behavior is affected by the following environment variables:
.TP
.B FSCK_FORCE_ALL_PARALLEL
If this environment variable is set,
.B fsck
will attempt to check all of the specified filesystems in parallel, regardless of
whether the filesystems appear to be on the same device. (This is useful for
RAID systems or high-end storage systems such as those sold by companies such
as IBM or EMC.) Note that the fs_passno value is still used.
.TP
.B FSCK_MAX_INST
This environment variable will limit the maximum number of filesystem
checkers that can be running at one time. This allows configurations
which have a large number of disks to avoid
.B fsck
starting too many filesystem checkers at once, which might overload
CPU and memory resources available on the system. If this value is
zero, then an unlimited number of processes can be spawned. This is
currently the default, but future versions of
.B fsck
may attempt to automatically determine how many filesystem checks can
be run based on gathering accounting data from the operating system.
.TP
.B PATH
The
.B PATH
environment variable is used to find filesystem checkers.
.TP
.B FSTAB_FILE
This environment variable allows the system administrator
to override the standard location of the
.I /etc/fstab
file. It is also useful for developers who are testing
.BR fsck .
.TP
.B LIBBLKID_DEBUG=all
enables libblkid debug output.
.TP
.B LIBMOUNT_DEBUG=all
enables libmount debug output.
.SH SEE ALSO
.na
.BR fstab (5),
.BR mkfs (8),
.BR fsck.ext2 (8)
or
.BR fsck.ext3 (8)
or
.BR e2fsck (8),
.BR fsck.cramfs (8),
.BR fsck.jfs (8),
.BR fsck.nfs (8),
.BR fsck.minix (8),
.BR fsck.msdos (8),
.BR fsck.vfat (8),
.BR fsck.xfs (8),
.BR reiserfsck (8)
.ad
.SH AUTHORS
.nf
Theodore Ts'o <tytso@mit.edu>
Karel Zak <kzak@redhat.com>
.fi
.SH AVAILABILITY
The fsck command is part of the util-linux package and is available from
.UR https://\:www.kernel.org\:/pub\:/linux\:/utils\:/util-linux/
Linux Kernel Archive
.UE .

View file

@ -1,179 +0,0 @@
//po4a: entry man manual
////
Copyright 1993, 1994, 1995 by Theodore Ts'o. All Rights Reserved.
This file may be copied under the terms of the GNU Public License.
////
= fsck(8)
:doctype: manpage
:man manual: System Administration
:man source: util-linux {release-version}
:page-layout: base
:command: fsck
== NAME
fsck - check and repair a Linux filesystem
== SYNOPSIS
*fsck* [*-lsAVRTMNP*] [*-r* [_fd_]] [*-C* [_fd_]] [*-t* _fstype_] [_filesystem_...] [*--*] [_fs-specific-options_]
== DESCRIPTION
*fsck* is used to check and optionally repair one or more Linux filesystems. _filesystem_ can be a device name (e.g., _/dev/hdc1_, _/dev/sdb2_), a mount point (e.g., _/_, _/usr_, _/home_), or a filesystem label or UUID specifier (e.g., UUID=8868abf6-88c5-4a83-98b8-bfc24057f7bd or LABEL=root). Normally, the *fsck* program will try to handle filesystems on different physical disk drives in parallel to reduce the total amount of time needed to check all of them.
If no filesystems are specified on the command line, and the *-A* option is not specified, *fsck* will default to checking filesystems in _/etc/fstab_ serially. This is equivalent to the *-As* options.
The exit status returned by *fsck* is the sum of the following conditions:
*0*::
No errors
*1*::
Filesystem errors corrected
*2*::
System should be rebooted
*4*::
Filesystem errors left uncorrected
*8*::
Operational error
*16*::
Usage or syntax error
*32*::
Checking canceled by user request
*128*::
Shared-library error
The exit status returned when multiple filesystems are checked is the bit-wise OR of the exit statuses for each filesystem that is checked.
In actuality, *fsck* is simply a front-end for the various filesystem checkers (*fsck*._fstype_) available under Linux. The filesystem-specific checker is searched for in the *PATH* environment variable. If the *PATH* is undefined then fallback to _/sbin_.
Please see the filesystem-specific checker manual pages for further details.
== OPTIONS
*-l*::
Create an exclusive *flock*(2) lock file (_/run/fsck/<diskname>.lock_) for whole-disk device. This option can be used with one device only (this means that *-A* and *-l* are mutually exclusive). This option is recommended when more *fsck* instances are executed in the same time. The option is ignored when used for multiple devices or for non-rotating disks. *fsck* does not lock underlying devices when executed to check stacked devices (e.g. MD or DM) - this feature is not implemented yet.
*-r* [_fd_]::
Report certain statistics for each fsck when it completes. These statistics include the exit status, the maximum run set size (in kilobytes), the elapsed all-clock time and the user and system CPU time used by the fsck run. For example:
+
*/dev/sda1: status 0, rss 92828, real 4.002804, user 2.677592, sys 0.86186*
+
GUI front-ends may specify a file descriptor _fd_, in which case the progress bar information will be sent to that file descriptor in a machine parsable format. For example:
+
*/dev/sda1 0 92828 4.002804 2.677592 0.86186*
*-s*::
Serialize *fsck* operations. This is a good idea if you are checking multiple filesystems and the checkers are in an interactive mode. (Note: *e2fsck*(8) runs in an interactive mode by default. To make *e2fsck*(8) run in a non-interactive mode, you must either specify the *-p* or *-a* option, if you wish for errors to be corrected automatically, or the *-n* option if you do not.)
*-t* _fslist_::
Specifies the type(s) of filesystem to be checked. When the *-A* flag is specified, only filesystems that match _fslist_ are checked. The _fslist_ parameter is a comma-separated list of filesystems and options specifiers. All of the filesystems in this comma-separated list may be prefixed by a negation operator '*no*' or '*!*', which requests that only those filesystems not listed in _fslist_ will be checked. If none of the filesystems in _fslist_ is prefixed by a negation operator, then only those listed filesystems will be checked.
+
Options specifiers may be included in the comma-separated _fslist_. They must have the format **opts=**__fs-option__. If an options specifier is present, then only filesystems which contain _fs-option_ in their mount options field of _/etc/fstab_ will be checked. If the options specifier is prefixed by a negation operator, then only those filesystems that do not have _fs-option_ in their mount options field of _/etc/fstab_ will be checked.
+
For example, if *opts=ro* appears in _fslist_, then only filesystems listed in _/etc/fstab_ with the *ro* option will be checked.
+
For compatibility with Mandrake distributions whose boot scripts depend upon an unauthorized UI change to the *fsck* program, if a filesystem type of *loop* is found in _fslist_, it is treated as if *opts=loop* were specified as an argument to the *-t* option.
+
Normally, the filesystem type is deduced by searching for _filesys_ in the _/etc/fstab_ file and using the corresponding entry. If the type cannot be deduced, and there is only a single filesystem given as an argument to the *-t* option, *fsck* will use the specified filesystem type. If this type is not available, then the default filesystem type (currently ext2) is used.
*-A*::
Walk through the _/etc/fstab_ file and try to check all filesystems in one run. This option is typically used from the _/etc/rc_ system initialization file, instead of multiple commands for checking a single filesystem.
+
The root filesystem will be checked first unless the *-P* option is specified (see below). After that, filesystems will be checked in the order specified by the _fs_passno_ (the sixth) field in the _/etc/fstab_ file. Filesystems with a _fs_passno_ value of 0 are skipped and are not checked at all. Filesystems with a _fs_passno_ value of greater than zero will be checked in order, with filesystems with the lowest _fs_passno_ number being checked first. If there are multiple filesystems with the same pass number, *fsck* will attempt to check them in parallel, although it will avoid running multiple filesystem checks on the same physical disk.
+
*fsck* does not check stacked devices (RAIDs, dm-crypt, ...) in parallel with any other device. See below for *FSCK_FORCE_ALL_PARALLEL* setting. The _/sys_ filesystem is used to determine dependencies between devices.
+
Hence, a very common configuration in _/etc/fstab_ files is to set the root filesystem to have a _fs_passno_ value of 1 and to set all other filesystems to have a _fs_passno_ value of 2. This will allow *fsck* to automatically run filesystem checkers in parallel if it is advantageous to do so. System administrators might choose not to use this configuration if they need to avoid multiple filesystem checks running in parallel for some reason - for example, if the machine in question is short on memory so that excessive paging is a concern.
+
*fsck* normally does not check whether the device actually exists before calling a filesystem specific checker. Therefore non-existing devices may cause the system to enter filesystem repair mode during boot if the filesystem specific checker returns a fatal error. The _/etc/fstab_ mount option *nofail* may be used to have *fsck* skip non-existing devices. *fsck* also skips non-existing devices that have the special filesystem type *auto*.
*-C* [_fd_]::
Display completion/progress bars for those filesystem checkers (currently only for ext[234]) which support them. *fsck* will manage the filesystem checkers so that only one of them will display a progress bar at a time. GUI front-ends may specify a file descriptor _fd_, in which case the progress bar information will be sent to that file descriptor.
*-M*::
Do not check mounted filesystems and return an exit status of 0 for mounted filesystems.
*-N*::
Don't execute, just show what would be done.
*-P*::
When the *-A* flag is set, check the root filesystem in parallel with the other filesystems. This is not the safest thing in the world to do, since if the root filesystem is in doubt things like the *e2fsck*(8) executable might be corrupted! This option is mainly provided for those sysadmins who don't want to repartition the root filesystem to be small and compact (which is really the right solution).
*-R*::
When checking all filesystems with the *-A* flag, skip the root filesystem. (This is useful in case the root filesystem has already been mounted read-write.)
*-T*::
Don't show the title on startup.
*-V*::
Produce verbose output, including all filesystem-specific commands that are executed.
*-?*, *--help*::
Display help text and exit.
*--version*::
Display version information and exit.
== FILESYSTEM SPECIFIC OPTIONS
*Options which are not understood by fsck are passed to the filesystem-specific checker!*
These options *must* not take arguments, as there is no way for *fsck* to be able to properly guess which options take arguments and which don't.
Options and arguments which follow the *--* are treated as filesystem-specific options to be passed to the filesystem-specific checker.
Please note that *fsck* is not designed to pass arbitrarily complicated options to filesystem-specific checkers. If you're doing something complicated, please just execute the filesystem-specific checker directly. If you pass *fsck* some horribly complicated options and arguments, and it doesn't do what you expect, *don't bother reporting it as a bug.* You're almost certainly doing something that you shouldn't be doing with *fsck*. Options to different filesystem-specific fsck's are not standardized.
== ENVIRONMENT
The *fsck* program's behavior is affected by the following environment variables:
*FSCK_FORCE_ALL_PARALLEL*::
If this environment variable is set, *fsck* will attempt to check all of the specified filesystems in parallel, regardless of whether the filesystems appear to be on the same device. (This is useful for RAID systems or high-end storage systems such as those sold by companies such as IBM or EMC.) Note that the _fs_passno_ value is still used.
*FSCK_MAX_INST*::
This environment variable will limit the maximum number of filesystem checkers that can be running at one time. This allows configurations which have a large number of disks to avoid *fsck* starting too many filesystem checkers at once, which might overload CPU and memory resources available on the system. If this value is zero, then an unlimited number of processes can be spawned. This is currently the default, but future versions of *fsck* may attempt to automatically determine how many filesystem checks can be run based on gathering accounting data from the operating system.
*PATH*::
The *PATH* environment variable is used to find filesystem checkers.
*FSTAB_FILE*::
This environment variable allows the system administrator to override the standard location of the _/etc/fstab_ file. It is also useful for developers who are testing *fsck*.
*LIBBLKID_DEBUG=all*::
enables libblkid debug output.
*LIBMOUNT_DEBUG=all*::
enables libmount debug output.
== FILES
_/etc/fstab_
== AUTHORS
mailto:tytso@mit.edu>[Theodore Ts'o],
mailto:kzak@redhat.com[Karel Zak]
== SEE ALSO
*fstab*(5),
*mkfs*(8),
*fsck.ext2*(8) or *fsck.ext3*(8) or *e2fsck*(8),
*fsck.cramfs*(8),
*fsck.jfs*(8),
*fsck.nfs*(8),
*fsck.minix*(8),
*fsck.msdos*(8),
*fsck.vfat*(8),
*fsck.xfs*(8),
*reiserfsck*(8)
include::man-common/bugreports.adoc[]
include::man-common/footer.adoc[]
ifdef::translation[]
include::man-common/translation.adoc[]
endif::[]

View file

@ -149,7 +149,7 @@ static FILE *report_stats_file;
static int num_running;
static int max_running;
static volatile sig_atomic_t cancel_requested;
static volatile int cancel_requested;
static int kill_sent;
static char *fstype;
static struct fsck_instance *instance_list;
@ -169,12 +169,11 @@ static int string_to_int(const char *s)
long l;
char *p;
errno = 0;
l = strtol(s, &p, 0);
if (errno || *p || l == LONG_MIN || l == LONG_MAX || l < 0 || l > INT_MAX)
if (*p || l == LONG_MIN || l == LONG_MAX || l < 0 || l > INT_MAX)
return -1;
return (int) l;
else
return (int) l;
}
/* Do we really really want to check this fs? */
@ -399,6 +398,7 @@ done:
inst->lockpath = NULL;
}
free(diskpath);
return;
}
static void unlock_disk(struct fsck_instance *inst)
@ -425,6 +425,7 @@ static void free_instance(struct fsck_instance *i)
free(i->lockpath);
mnt_unref_fs(i->fs);
free(i);
return;
}
static struct libmnt_fs *add_dummy_fs(const char *device)
@ -598,31 +599,27 @@ static void print_stats(struct fsck_instance *inst)
timersub(&inst->end_time, &inst->start_time, &delta);
if (report_stats_file)
fprintf(report_stats_file, "%s %d %ld"
" %"PRId64".%06"PRId64
" %"PRId64".%06"PRId64
" %"PRId64".%06"PRId64"\n",
fprintf(report_stats_file, "%s %d %ld "
"%ld.%06ld %ld.%06ld %ld.%06ld\n",
fs_get_device(inst->fs),
inst->exit_status,
inst->rusage.ru_maxrss,
(int64_t)delta.tv_sec, (int64_t)delta.tv_usec,
(int64_t)inst->rusage.ru_utime.tv_sec,
(int64_t)inst->rusage.ru_utime.tv_usec,
(int64_t)inst->rusage.ru_stime.tv_sec,
(int64_t)inst->rusage.ru_stime.tv_usec);
(long)delta.tv_sec, (long)delta.tv_usec,
(long)inst->rusage.ru_utime.tv_sec,
(long)inst->rusage.ru_utime.tv_usec,
(long)inst->rusage.ru_stime.tv_sec,
(long)inst->rusage.ru_stime.tv_usec);
else
fprintf(stdout, "%s: status %d, rss %ld, "
"real %"PRId64".%06"PRId64", "
"user %"PRId64".%06"PRId64", "
"sys %"PRId64".%06"PRId64"\n",
"real %ld.%06ld, user %ld.%06ld, sys %ld.%06ld\n",
fs_get_device(inst->fs),
inst->exit_status,
inst->rusage.ru_maxrss,
(int64_t)delta.tv_sec, (int64_t)delta.tv_usec,
(int64_t)inst->rusage.ru_utime.tv_sec,
(int64_t)inst->rusage.ru_utime.tv_usec,
(int64_t)inst->rusage.ru_stime.tv_sec,
(int64_t)inst->rusage.ru_stime.tv_usec);
(long)delta.tv_sec, (long)delta.tv_usec,
(long)inst->rusage.ru_utime.tv_sec,
(long)inst->rusage.ru_utime.tv_usec,
(long)inst->rusage.ru_stime.tv_sec,
(long)inst->rusage.ru_stime.tv_usec);
}
/*
@ -730,8 +727,6 @@ static int kill_all(int signum)
for (inst = instance_list; inst; inst = inst->next) {
if (inst->flags & FLAG_DONE)
continue;
if (inst->pid <= 0)
continue;
kill(inst->pid, signum);
n++;
}
@ -826,10 +821,10 @@ static struct fsck_instance *wait_one(int flags)
for (inst2 = instance_list; inst2; inst2 = inst2->next) {
if (inst2->flags & FLAG_DONE)
continue;
if (strcmp(inst2->type, "ext2") != 0 &&
if (strcmp(inst2->type, "ext2") &&
strcmp(inst2->type, "ext3") &&
strcmp(inst2->type, "ext4") != 0 &&
strcmp(inst2->type, "ext4dev") != 0)
strcmp(inst2->type, "ext4") &&
strcmp(inst2->type, "ext4dev"))
continue;
/*
* If we've just started the fsck, wait a tiny
@ -910,8 +905,8 @@ static int fsck_device(struct libmnt_fs *fs, int interactive)
if (type && strcmp(type, "auto") != 0)
;
else if (fstype && strncmp(fstype, "no", 2) != 0 &&
strncmp(fstype, "opts=", 5) != 0 && strncmp(fstype, "loop", 4) != 0 &&
else if (fstype && strncmp(fstype, "no", 2) &&
strncmp(fstype, "opts=", 5) && strncmp(fstype, "loop", 4) &&
!strchr(fstype, ','))
type = fstype;
else
@ -938,8 +933,8 @@ static int fsck_device(struct libmnt_fs *fs, int interactive)
}
return 0;
err:
warnx(_("error %d (%s) while executing fsck.%s for %s"),
retval, strerror(errno), type, fs_get_device(fs));
warnx(_("error %d (%m) while executing fsck.%s for %s"),
retval, type, fs_get_device(fs));
return FSCK_EX_ERROR;
}
@ -1092,7 +1087,7 @@ static int fs_ignored_type(struct libmnt_fs *fs)
{
const char **ip, *type;
if (!mnt_fs_is_regularfs(fs))
if (mnt_fs_is_netfs(fs) || mnt_fs_is_pseudofs(fs) || mnt_fs_is_swaparea(fs))
return 1;
type = mnt_fs_get_fstype(fs);
@ -1422,7 +1417,7 @@ static void __attribute__((__noreturn__)) usage(void)
static void signal_cancel(int sig __attribute__((__unused__)))
{
cancel_requested = 1;
cancel_requested++;
}
static void parse_argv(int argc, char *argv[])
@ -1606,8 +1601,8 @@ static void parse_argv(int argc, char *argv[])
if (getenv("FSCK_FORCE_ALL_PARALLEL"))
force_all_parallel++;
if (ul_strtos32(getenv("FSCK_MAX_INST"), &max_running, 10) != 0)
max_running = 0;
if ((tmp = getenv("FSCK_MAX_INST")))
max_running = atoi(tmp);
}
int main(int argc, char *argv[])
@ -1630,23 +1625,11 @@ int main(int argc, char *argv[])
mnt_init_debug(0); /* init libmount debug mask */
mntcache = mnt_new_cache(); /* no fatal error if failed */
if (mntcache)
/* Force libblkid to accept also filesystems with bad
* checksums. This feature is helpful for "fsck /dev/foo," but
* if it evaluates LABEL/UUIDs from fstab, then libmount may
* use cached data from udevd and udev accepts only properly
* detected filesystems.
*/
mnt_cache_set_sbprobe(mntcache, BLKID_SUBLKS_BADCSUM);
parse_argv(argc, argv);
if (!notitle)
printf(UTIL_LINUX_VERSION);
signal(SIGCHLD, SIG_DFL); /* clear any inherited settings */
load_fs_info();
fsck_path = xstrdup(path && *path ? path : FSCK_DEFAULT_PATH);

61
disk-utils/fsck.cramfs.8 Normal file
View file

@ -0,0 +1,61 @@
.TH FSCK.CRAMFS 8 "April 2013" "util-linux" "System Administration"
.SH NAME
fsck.cramfs \- fsck compressed ROM file system
.SH SYNOPSIS
.B fsck.cramfs
[options]
.I file
.SH DESCRIPTION
.I fsck.cramfs
is used to check the cramfs file system.
.SH OPTIONS
.TP
\fB\-v\fR, \fB\-\-verbose\fR
Enable verbose messaging.
.TP
\fB\-b\fR, \fB\-\-blocksize\fR \fIblocksize\fR
Use this blocksize, defaults to page size. Must be equal to what was set at
creation time. Only used for \-\-extract.
.TP
\fB\-\-extract\fR[=\fIdirectory\fR]
Test to uncompress the whole file system. Optionally extract contents of the
.I file
to
.IR directory .
.TP
\fB\-a\fR
This option is silently ignored.
.TP
\fB\-y\fR
This option is silently ignored.
.TP
\fB\-V\fR, \fB\-\-version\fR
Display version information and exit.
.TP
\fB\-h\fR, \fB\-\-help\fR
Display help text and exit.
.SH "EXIT STATUS"
.RS
.PD 0
.TP
.B 0
success
.TP
.B 4
file system was left uncorrected
.TP
.B 8
operation error, such as unable to allocate memory
.TP
.B 16
usage information was printed
.PD
.RE
.SH "SEE ALSO"
.BR mount (8),
.BR mkfs.cramfs (8)
.SH AVAILABILITY
The example command is part of the util-linux package and is available from
.UR https://\:www.kernel.org\:/pub\:/linux\:/utils\:/util-linux/
Linux Kernel Archive
.UE .

Some files were not shown because too many files have changed in this diff Show more