mirror of
https://github.com/systemd/systemd
synced 2026-03-17 02:24:48 +01:00
Compare commits
3 Commits
3da9b65b30
...
947ecb0812
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
947ecb0812 | ||
|
|
834a7dfc12 | ||
|
|
7d23749ddd |
@ -1031,7 +1031,8 @@ DEFINE_TRIVIAL_CLEANUP_FUNC_FULL(Socket*, socket_close_fds, NULL);
|
||||
int _e_ = (e); \
|
||||
log_unit_full_errno( \
|
||||
UNIT(s), \
|
||||
ERRNO_IS_NOT_SUPPORTED(_e_) ? LOG_DEBUG : LOG_WARNING, \
|
||||
ERRNO_IS_NOT_SUPPORTED(_e_) || \
|
||||
ERRNO_IS_PRIVILEGE(_e_) ? LOG_DEBUG : LOG_WARNING, \
|
||||
_e_, \
|
||||
"Failed to set %s socket option, ignoring: %m", \
|
||||
option); \
|
||||
|
||||
@ -83,11 +83,11 @@ static const char* chassis_string_to_glyph(const char *chassis) {
|
||||
if (streq_ptr(chassis, "watch"))
|
||||
return UTF8("⌚"); /* Watch */
|
||||
if (streq_ptr(chassis, "handset"))
|
||||
return UTF8("🕻"); /* Left Hand Telephone Receiver */
|
||||
return UTF8("📱"); /* Mobile Phone */
|
||||
if (streq_ptr(chassis, "vm"))
|
||||
return UTF8("🖴"); /* Hard disk */
|
||||
return UTF8("💽"); /* Computer disk */
|
||||
if (streq_ptr(chassis, "container"))
|
||||
return UTF8("☐"); /* Ballot Box */
|
||||
return UTF8("📦"); /* Package */
|
||||
return NULL;
|
||||
}
|
||||
|
||||
|
||||
@ -453,12 +453,24 @@ int make_filesystem(
|
||||
|
||||
if (sector_size > 0) {
|
||||
if (strv_extend(&env, "MKE2FS_DEVICE_SECTSIZE") < 0)
|
||||
return log_oom();
|
||||
return log_oom();
|
||||
|
||||
if (strv_extendf(&env, "%"PRIu64, sector_size) < 0)
|
||||
return log_oom();
|
||||
}
|
||||
|
||||
/* e2fsprogs supports $SOURCE_DATE_EPOCH since v1.47.1. For older versions, we need to set
|
||||
* $E2FSPROGS_FAKE_TIME. See the following:
|
||||
* https://github.com/tytso/e2fsprogs/commit/b6e2913061577ad981464e435026d71a48fd5caf
|
||||
* Note, $E2FSPROGS_FAKE_TIME and $SOURCE_DATE_EPOCH are mostly equivalent, except for the
|
||||
* 0 value handling, where $E2FSPROGS_FAKE_TIME=0 is ignored and the current time is used,
|
||||
* but $SOURCE_DATE_EPOCH=0 sets 1970-01-01 as the timestamp. */
|
||||
if (!secure_getenv("E2FSPROGS_FAKE_TIME")) { /* honor $E2FSPROGS_FAKE_TIME if already set */
|
||||
const char *e = secure_getenv("SOURCE_DATE_EPOCH");
|
||||
if (e && strv_extend_strv(&env, STRV_MAKE("E2FSPROGS_FAKE_TIME", e), /* filter_duplicates= */ false) < 0)
|
||||
return log_oom();
|
||||
}
|
||||
|
||||
} else if (streq(fstype, "btrfs")) {
|
||||
argv = strv_new(mkfs,
|
||||
"-L", label,
|
||||
|
||||
@ -1896,7 +1896,7 @@ testcase_luks2_integrity() {
|
||||
}
|
||||
|
||||
testcase_ext_reproducibility() {
|
||||
local defs imgs
|
||||
local defs imgs ts
|
||||
|
||||
# Online mode mounts the filesystem which updates inode timestamps non-deterministically
|
||||
if [[ "$OFFLINE" != "yes" ]]; then
|
||||
@ -1916,21 +1916,28 @@ Format=ext4
|
||||
EOF
|
||||
|
||||
# Build the image twice with the same seed and verify they are identical
|
||||
systemd-repart --offline="$OFFLINE" \
|
||||
--definitions="$defs" \
|
||||
--empty=create \
|
||||
--size=50M \
|
||||
--seed="$seed" \
|
||||
--dry-run=no \
|
||||
"$imgs/test1.img"
|
||||
ts=$(date +%s)
|
||||
env SOURCE_DATE_EPOCH="$ts" \
|
||||
systemd-repart \
|
||||
--offline="$OFFLINE" \
|
||||
--definitions="$defs" \
|
||||
--empty=create \
|
||||
--size=50M \
|
||||
--seed="$seed" \
|
||||
--dry-run=no \
|
||||
"$imgs/test1.img"
|
||||
|
||||
systemd-repart --offline="$OFFLINE" \
|
||||
--definitions="$defs" \
|
||||
--empty=create \
|
||||
--size=50M \
|
||||
--seed="$seed" \
|
||||
--dry-run=no \
|
||||
"$imgs/test2.img"
|
||||
sleep 2
|
||||
|
||||
env SOURCE_DATE_EPOCH="$ts" \
|
||||
systemd-repart \
|
||||
--offline="$OFFLINE" \
|
||||
--definitions="$defs" \
|
||||
--empty=create \
|
||||
--size=50M \
|
||||
--seed="$seed" \
|
||||
--dry-run=no \
|
||||
"$imgs/test2.img"
|
||||
|
||||
cmp "$imgs/test1.img" "$imgs/test2.img"
|
||||
}
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user