mirror of
https://github.com/systemd/systemd
synced 2026-03-13 16:44:48 +01:00
Compare commits
No commits in common. "a53e3697860695bc4db922f7e5b7b3c87454f39a" and "5f815d6fa1878a0f6c28039f5e2fb0df348dc405" have entirely different histories.
a53e369786
...
5f815d6fa1
@ -1033,38 +1033,3 @@ SPDX-License-Identifier: LGPL-2.1-or-later
|
||||
- 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
|
||||
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,6 +153,8 @@ static int print_inhibitors(sd_bus *bus) {
|
||||
if (r < 0)
|
||||
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);
|
||||
if (r < 0)
|
||||
return r;
|
||||
|
||||
@ -190,7 +190,7 @@ test ! -d /var/lib/machines/.hidden1
|
||||
|
||||
# Prepare a simple raw container
|
||||
mkdir -p /tmp/mnt
|
||||
truncate -s 384M /var/tmp/container.raw
|
||||
dd if=/dev/zero of=/var/tmp/container.raw bs=1M count=256
|
||||
mkfs.ext4 /var/tmp/container.raw
|
||||
mount -o loop /var/tmp/container.raw /tmp/mnt
|
||||
cp -r /var/lib/machines/container1/* /tmp/mnt
|
||||
|
||||
@ -77,7 +77,7 @@ testcase_sanity() {
|
||||
create_dummy_container "$template"
|
||||
# Create a simple image from the just created container template
|
||||
image="$(mktemp /var/lib/machines/TEST-13-NSPAWN.image-XXX.img)"
|
||||
truncate -s 384M "$image"
|
||||
dd if=/dev/zero of="$image" bs=1M count=256
|
||||
mkfs.ext4 "$image"
|
||||
mkdir -p /mnt
|
||||
mount -o loop "$image" /mnt
|
||||
@ -810,7 +810,7 @@ testcase_rootidmap() {
|
||||
root="$(mktemp -d /var/lib/machines/TEST-13-NSPAWN.rootidmap-path.XXX)"
|
||||
# Create ext4 image, as ext4 supports idmapped-mounts.
|
||||
mkdir -p /tmp/rootidmap/bind
|
||||
truncate -s $((4096*2048)) /tmp/rootidmap/ext4.img
|
||||
dd if=/dev/zero of=/tmp/rootidmap/ext4.img bs=4k count=2048
|
||||
mkfs.ext4 /tmp/rootidmap/ext4.img
|
||||
mount /tmp/rootidmap/ext4.img /tmp/rootidmap/bind
|
||||
trap "rootidmap_cleanup /tmp/rootidmap/" RETURN
|
||||
@ -854,7 +854,7 @@ testcase_owneridmap() {
|
||||
root="$(mktemp -d /var/lib/machines/TEST-13-NSPAWN.owneridmap-path.XXX)"
|
||||
# Create ext4 image, as ext4 supports idmapped-mounts.
|
||||
mkdir -p /tmp/owneridmap/bind
|
||||
truncate -s $((4096*2048)) /tmp/owneridmap/ext4.img
|
||||
dd if=/dev/zero of=/tmp/owneridmap/ext4.img bs=4k count=2048
|
||||
mkfs.ext4 /tmp/owneridmap/ext4.img
|
||||
mount /tmp/owneridmap/ext4.img /tmp/owneridmap/bind
|
||||
trap "owneridmap_cleanup /tmp/owneridmap/" RETURN
|
||||
|
||||
@ -25,7 +25,7 @@ netdev=hoge
|
||||
ip link add $netdev type dummy
|
||||
|
||||
blk="$(mktemp)"
|
||||
truncate -s 1M "$blk"
|
||||
dd if=/dev/zero of="$blk" bs=1M count=1
|
||||
loopdev="$(losetup --show -f "$blk")"
|
||||
|
||||
# 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)"
|
||||
signature_size=4
|
||||
# 4MB seems to be the minimum size blkid will accept, below that probing fails
|
||||
truncate -s $(((8192+root_size*2+verity_size*2+signature_size*2)*512)) "$MINIMAL_IMAGE.gpt"
|
||||
dd if=/dev/zero of="$MINIMAL_IMAGE.gpt" bs=512 count=$((8192+root_size*2+verity_size*2+signature_size*2))
|
||||
# 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
|
||||
if [[ "$root_size" -ge 1024 ]]; then
|
||||
|
||||
@ -26,7 +26,7 @@ if systemd-detect-virt --vm --quiet; then
|
||||
if [[ "$(findmnt -n -o FSTYPE /)" == btrfs ]]; then
|
||||
btrfs filesystem mkswapfile -s 64M /swapfile
|
||||
else
|
||||
fallocate -l 64M /swapfile
|
||||
dd if=/dev/zero of=/swapfile bs=1M count=64
|
||||
chmod 0600 /swapfile
|
||||
mkswap /swapfile
|
||||
fi
|
||||
|
||||
@ -1708,7 +1708,7 @@ testcase_btrfs_compression() {
|
||||
# Must not be in tmpfs due to exclusions. It also must be large and
|
||||
# compressible so that the compression check succeeds later.
|
||||
src=/etc/test-source-file
|
||||
fallocate -l 1M "$src"
|
||||
dd if=/dev/zero of="$src" bs=1M count=1 2>/dev/null
|
||||
|
||||
tee "$defs/btrfs-compressed.conf" <<EOF
|
||||
[Partition]
|
||||
|
||||
@ -1013,7 +1013,7 @@ testcase_iscsi_lvm() {
|
||||
udevadm wait --settle --timeout=30 "${devices[0]}"
|
||||
mount "${devices[0]}" "$mpoint"
|
||||
for i in {1..4}; do
|
||||
truncate -s 32M "$mpoint/lun$i.img"
|
||||
dd if=/dev/zero of="$mpoint/lun$i.img" bs=1M count=32
|
||||
done
|
||||
# Initialize a new iSCSI target <$target_name> consisting of 4 LUNs, each
|
||||
# backed by a file
|
||||
|
||||
@ -48,8 +48,8 @@ EOF
|
||||
udevadm control --reload
|
||||
|
||||
TMP_DIR="$(mktemp -d -t -p / integrity.tmp.XXXXXX)"
|
||||
truncate -s 64M "${TMP_DIR}/image"
|
||||
truncate -s 64M "${TMP_DIR}/data"
|
||||
dd if=/dev/zero of="${TMP_DIR}/image" bs=1048576 count=64
|
||||
dd if=/dev/zero of="${TMP_DIR}/data" bs=1048576 count=64
|
||||
LOOP="$(losetup --show -f "${TMP_DIR}/image")"
|
||||
udevadm wait --timeout=30 --settle "${LOOP}"
|
||||
|
||||
|
||||
@ -43,7 +43,7 @@ test -e "$WORK_DIR/upper/foo"
|
||||
systemd-umount "$WORK_DIR/overlay"
|
||||
|
||||
# Set up a simple block device for further tests
|
||||
truncate -s 16M "$WORK_DIR/simple.img"
|
||||
dd if=/dev/zero of="$WORK_DIR/simple.img" bs=1M count=16
|
||||
mkfs.ext4 -L sd-mount-test "$WORK_DIR/simple.img"
|
||||
LOOP="$(losetup --show --find "$WORK_DIR/simple.img")"
|
||||
udevadm wait --timeout=60 --settle "$LOOP"
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user