mirror of
https://github.com/systemd/systemd
synced 2026-03-13 16:44:48 +01:00
Compare commits
5 Commits
5f815d6fa1
...
a53e369786
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
a53e369786 | ||
|
|
43ef7c944c | ||
|
|
0c9de6daee | ||
|
|
ab89fad427 | ||
|
|
dd2676c1ab |
@ -1033,3 +1033,38 @@ SPDX-License-Identifier: LGPL-2.1-or-later
|
|||||||
- Never use `grep -q` in a pipeline, use `grep >/dev/null` instead. The former
|
- Never use `grep -q` in a pipeline, use `grep >/dev/null` instead. The former
|
||||||
will generate `SIGPIPE` for the previous command in the pipeline when it finds
|
will generate `SIGPIPE` for the previous command in the pipeline when it finds
|
||||||
a match which will cause the test to fail unexpectedly.
|
a match which will cause the test to fail unexpectedly.
|
||||||
|
|
||||||
|
## Kernel Version Dependencies
|
||||||
|
|
||||||
|
- For entirely new functionality it's fine to rely on features of very recent
|
||||||
|
(released!) kernel versions. If a feature is added to the upstream kernel,
|
||||||
|
and a stable release is made, then it's immediately OK to merge *new*
|
||||||
|
functionality into systemd relying on it, as long as that functionality is
|
||||||
|
optional. (In some cases, it might be OK to merge a feature into systemd
|
||||||
|
slightly before the final kernel release that it is based on, as long as the
|
||||||
|
kernel development cycle has already progressed far enough that the feature
|
||||||
|
is unlikely to be still reverted – for example once RC2 of the kernel release
|
||||||
|
has been released.)
|
||||||
|
|
||||||
|
- For components that already have been released in a stable version
|
||||||
|
compatibility with older kernels must be retained, down to the "minimum
|
||||||
|
baseline" version as listed in the README, or the version current when the
|
||||||
|
component was added to our tree, whichever is newer.
|
||||||
|
|
||||||
|
- When adding a fallback path, please avoid checking for kernel versions, as
|
||||||
|
downstream distributions tend to backport features, and version checks are
|
||||||
|
not great replacements for feature checks hence.
|
||||||
|
|
||||||
|
- When adding a compatibility code path for an older kernel version, please add
|
||||||
|
a comment in the following style to the relevant codepath:
|
||||||
|
|
||||||
|
```c
|
||||||
|
// FIXME: This compatibility code path shall be removed once kernel X.Y
|
||||||
|
// becomes the new minimal baseline
|
||||||
|
```
|
||||||
|
|
||||||
|
When this syntax is followed we'll have an easier time tracking down these
|
||||||
|
codepaths and removing them when bumping baselines.
|
||||||
|
|
||||||
|
- Whenever support for a new kernel API feature is added, please update the
|
||||||
|
kernel feature/version list in README as well (as part of the same PR).
|
||||||
|
|||||||
@ -153,8 +153,6 @@ static int print_inhibitors(sd_bus *bus) {
|
|||||||
if (r < 0)
|
if (r < 0)
|
||||||
return table_log_sort_error(r);
|
return table_log_sort_error(r);
|
||||||
|
|
||||||
table_set_header(table, arg_legend);
|
|
||||||
|
|
||||||
r = table_print_with_pager(table, arg_json_format_flags, arg_pager_flags, arg_legend);
|
r = table_print_with_pager(table, arg_json_format_flags, arg_pager_flags, arg_legend);
|
||||||
if (r < 0)
|
if (r < 0)
|
||||||
return r;
|
return r;
|
||||||
|
|||||||
@ -190,7 +190,7 @@ test ! -d /var/lib/machines/.hidden1
|
|||||||
|
|
||||||
# Prepare a simple raw container
|
# Prepare a simple raw container
|
||||||
mkdir -p /tmp/mnt
|
mkdir -p /tmp/mnt
|
||||||
dd if=/dev/zero of=/var/tmp/container.raw bs=1M count=256
|
truncate -s 384M /var/tmp/container.raw
|
||||||
mkfs.ext4 /var/tmp/container.raw
|
mkfs.ext4 /var/tmp/container.raw
|
||||||
mount -o loop /var/tmp/container.raw /tmp/mnt
|
mount -o loop /var/tmp/container.raw /tmp/mnt
|
||||||
cp -r /var/lib/machines/container1/* /tmp/mnt
|
cp -r /var/lib/machines/container1/* /tmp/mnt
|
||||||
|
|||||||
@ -77,7 +77,7 @@ testcase_sanity() {
|
|||||||
create_dummy_container "$template"
|
create_dummy_container "$template"
|
||||||
# Create a simple image from the just created container template
|
# Create a simple image from the just created container template
|
||||||
image="$(mktemp /var/lib/machines/TEST-13-NSPAWN.image-XXX.img)"
|
image="$(mktemp /var/lib/machines/TEST-13-NSPAWN.image-XXX.img)"
|
||||||
dd if=/dev/zero of="$image" bs=1M count=256
|
truncate -s 384M "$image"
|
||||||
mkfs.ext4 "$image"
|
mkfs.ext4 "$image"
|
||||||
mkdir -p /mnt
|
mkdir -p /mnt
|
||||||
mount -o loop "$image" /mnt
|
mount -o loop "$image" /mnt
|
||||||
@ -810,7 +810,7 @@ testcase_rootidmap() {
|
|||||||
root="$(mktemp -d /var/lib/machines/TEST-13-NSPAWN.rootidmap-path.XXX)"
|
root="$(mktemp -d /var/lib/machines/TEST-13-NSPAWN.rootidmap-path.XXX)"
|
||||||
# Create ext4 image, as ext4 supports idmapped-mounts.
|
# Create ext4 image, as ext4 supports idmapped-mounts.
|
||||||
mkdir -p /tmp/rootidmap/bind
|
mkdir -p /tmp/rootidmap/bind
|
||||||
dd if=/dev/zero of=/tmp/rootidmap/ext4.img bs=4k count=2048
|
truncate -s $((4096*2048)) /tmp/rootidmap/ext4.img
|
||||||
mkfs.ext4 /tmp/rootidmap/ext4.img
|
mkfs.ext4 /tmp/rootidmap/ext4.img
|
||||||
mount /tmp/rootidmap/ext4.img /tmp/rootidmap/bind
|
mount /tmp/rootidmap/ext4.img /tmp/rootidmap/bind
|
||||||
trap "rootidmap_cleanup /tmp/rootidmap/" RETURN
|
trap "rootidmap_cleanup /tmp/rootidmap/" RETURN
|
||||||
@ -854,7 +854,7 @@ testcase_owneridmap() {
|
|||||||
root="$(mktemp -d /var/lib/machines/TEST-13-NSPAWN.owneridmap-path.XXX)"
|
root="$(mktemp -d /var/lib/machines/TEST-13-NSPAWN.owneridmap-path.XXX)"
|
||||||
# Create ext4 image, as ext4 supports idmapped-mounts.
|
# Create ext4 image, as ext4 supports idmapped-mounts.
|
||||||
mkdir -p /tmp/owneridmap/bind
|
mkdir -p /tmp/owneridmap/bind
|
||||||
dd if=/dev/zero of=/tmp/owneridmap/ext4.img bs=4k count=2048
|
truncate -s $((4096*2048)) /tmp/owneridmap/ext4.img
|
||||||
mkfs.ext4 /tmp/owneridmap/ext4.img
|
mkfs.ext4 /tmp/owneridmap/ext4.img
|
||||||
mount /tmp/owneridmap/ext4.img /tmp/owneridmap/bind
|
mount /tmp/owneridmap/ext4.img /tmp/owneridmap/bind
|
||||||
trap "owneridmap_cleanup /tmp/owneridmap/" RETURN
|
trap "owneridmap_cleanup /tmp/owneridmap/" RETURN
|
||||||
|
|||||||
@ -25,7 +25,7 @@ netdev=hoge
|
|||||||
ip link add $netdev type dummy
|
ip link add $netdev type dummy
|
||||||
|
|
||||||
blk="$(mktemp)"
|
blk="$(mktemp)"
|
||||||
dd if=/dev/zero of="$blk" bs=1M count=1
|
truncate -s 1M "$blk"
|
||||||
loopdev="$(losetup --show -f "$blk")"
|
loopdev="$(losetup --show -f "$blk")"
|
||||||
|
|
||||||
# Wait for devices created in the above being processed.
|
# Wait for devices created in the above being processed.
|
||||||
|
|||||||
@ -153,7 +153,7 @@ root_size="$(du --apparent-size -k "$MINIMAL_IMAGE.raw" | cut -f1)"
|
|||||||
verity_size="$(du --apparent-size -k "$MINIMAL_IMAGE.verity" | cut -f1)"
|
verity_size="$(du --apparent-size -k "$MINIMAL_IMAGE.verity" | cut -f1)"
|
||||||
signature_size=4
|
signature_size=4
|
||||||
# 4MB seems to be the minimum size blkid will accept, below that probing fails
|
# 4MB seems to be the minimum size blkid will accept, below that probing fails
|
||||||
dd if=/dev/zero of="$MINIMAL_IMAGE.gpt" bs=512 count=$((8192+root_size*2+verity_size*2+signature_size*2))
|
truncate -s $(((8192+root_size*2+verity_size*2+signature_size*2)*512)) "$MINIMAL_IMAGE.gpt"
|
||||||
# sfdisk seems unhappy if the size overflows into the next unit, eg: 1580KiB will be interpreted as 1MiB
|
# sfdisk seems unhappy if the size overflows into the next unit, eg: 1580KiB will be interpreted as 1MiB
|
||||||
# so do some basic rounding up if the minimal image is more than 1 MB
|
# so do some basic rounding up if the minimal image is more than 1 MB
|
||||||
if [[ "$root_size" -ge 1024 ]]; then
|
if [[ "$root_size" -ge 1024 ]]; then
|
||||||
|
|||||||
@ -26,7 +26,7 @@ if systemd-detect-virt --vm --quiet; then
|
|||||||
if [[ "$(findmnt -n -o FSTYPE /)" == btrfs ]]; then
|
if [[ "$(findmnt -n -o FSTYPE /)" == btrfs ]]; then
|
||||||
btrfs filesystem mkswapfile -s 64M /swapfile
|
btrfs filesystem mkswapfile -s 64M /swapfile
|
||||||
else
|
else
|
||||||
dd if=/dev/zero of=/swapfile bs=1M count=64
|
fallocate -l 64M /swapfile
|
||||||
chmod 0600 /swapfile
|
chmod 0600 /swapfile
|
||||||
mkswap /swapfile
|
mkswap /swapfile
|
||||||
fi
|
fi
|
||||||
|
|||||||
@ -1708,7 +1708,7 @@ testcase_btrfs_compression() {
|
|||||||
# Must not be in tmpfs due to exclusions. It also must be large and
|
# Must not be in tmpfs due to exclusions. It also must be large and
|
||||||
# compressible so that the compression check succeeds later.
|
# compressible so that the compression check succeeds later.
|
||||||
src=/etc/test-source-file
|
src=/etc/test-source-file
|
||||||
dd if=/dev/zero of="$src" bs=1M count=1 2>/dev/null
|
fallocate -l 1M "$src"
|
||||||
|
|
||||||
tee "$defs/btrfs-compressed.conf" <<EOF
|
tee "$defs/btrfs-compressed.conf" <<EOF
|
||||||
[Partition]
|
[Partition]
|
||||||
|
|||||||
@ -1013,7 +1013,7 @@ testcase_iscsi_lvm() {
|
|||||||
udevadm wait --settle --timeout=30 "${devices[0]}"
|
udevadm wait --settle --timeout=30 "${devices[0]}"
|
||||||
mount "${devices[0]}" "$mpoint"
|
mount "${devices[0]}" "$mpoint"
|
||||||
for i in {1..4}; do
|
for i in {1..4}; do
|
||||||
dd if=/dev/zero of="$mpoint/lun$i.img" bs=1M count=32
|
truncate -s 32M "$mpoint/lun$i.img"
|
||||||
done
|
done
|
||||||
# Initialize a new iSCSI target <$target_name> consisting of 4 LUNs, each
|
# Initialize a new iSCSI target <$target_name> consisting of 4 LUNs, each
|
||||||
# backed by a file
|
# backed by a file
|
||||||
|
|||||||
@ -48,8 +48,8 @@ EOF
|
|||||||
udevadm control --reload
|
udevadm control --reload
|
||||||
|
|
||||||
TMP_DIR="$(mktemp -d -t -p / integrity.tmp.XXXXXX)"
|
TMP_DIR="$(mktemp -d -t -p / integrity.tmp.XXXXXX)"
|
||||||
dd if=/dev/zero of="${TMP_DIR}/image" bs=1048576 count=64
|
truncate -s 64M "${TMP_DIR}/image"
|
||||||
dd if=/dev/zero of="${TMP_DIR}/data" bs=1048576 count=64
|
truncate -s 64M "${TMP_DIR}/data"
|
||||||
LOOP="$(losetup --show -f "${TMP_DIR}/image")"
|
LOOP="$(losetup --show -f "${TMP_DIR}/image")"
|
||||||
udevadm wait --timeout=30 --settle "${LOOP}"
|
udevadm wait --timeout=30 --settle "${LOOP}"
|
||||||
|
|
||||||
|
|||||||
@ -43,7 +43,7 @@ test -e "$WORK_DIR/upper/foo"
|
|||||||
systemd-umount "$WORK_DIR/overlay"
|
systemd-umount "$WORK_DIR/overlay"
|
||||||
|
|
||||||
# Set up a simple block device for further tests
|
# Set up a simple block device for further tests
|
||||||
dd if=/dev/zero of="$WORK_DIR/simple.img" bs=1M count=16
|
truncate -s 16M "$WORK_DIR/simple.img"
|
||||||
mkfs.ext4 -L sd-mount-test "$WORK_DIR/simple.img"
|
mkfs.ext4 -L sd-mount-test "$WORK_DIR/simple.img"
|
||||||
LOOP="$(losetup --show --find "$WORK_DIR/simple.img")"
|
LOOP="$(losetup --show --find "$WORK_DIR/simple.img")"
|
||||||
udevadm wait --timeout=60 --settle "$LOOP"
|
udevadm wait --timeout=60 --settle "$LOOP"
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user