mirror of
https://github.com/systemd/systemd
synced 2025-11-09 11:54:44 +01:00
Compare commits
No commits in common. "8049c79b654f9c00da883423813ec25b7b54f3d6" and "ddd6a22a0fb034c763495fa1f3b6ebdd6a669e27" have entirely different histories.
8049c79b65
...
ddd6a22a0f
@ -52,7 +52,6 @@ BuildPackages=
|
|||||||
python-lxml
|
python-lxml
|
||||||
qrencode
|
qrencode
|
||||||
xz
|
xz
|
||||||
zstd
|
|
||||||
|
|
||||||
Packages=
|
Packages=
|
||||||
libidn2
|
libidn2
|
||||||
|
|||||||
@ -50,7 +50,6 @@ BuildPackages=
|
|||||||
libsmartcols-dev
|
libsmartcols-dev
|
||||||
libtool
|
libtool
|
||||||
libxkbcommon-dev
|
libxkbcommon-dev
|
||||||
libzstd-dev
|
|
||||||
m4
|
m4
|
||||||
meson
|
meson
|
||||||
pkg-config
|
pkg-config
|
||||||
@ -60,7 +59,6 @@ BuildPackages=
|
|||||||
uuid-dev
|
uuid-dev
|
||||||
xsltproc
|
xsltproc
|
||||||
xz-utils
|
xz-utils
|
||||||
zstd
|
|
||||||
|
|
||||||
Packages=
|
Packages=
|
||||||
libqrencode4
|
libqrencode4
|
||||||
|
|||||||
@ -47,7 +47,6 @@ BuildPackages=
|
|||||||
libselinux-devel
|
libselinux-devel
|
||||||
libxkbcommon-devel
|
libxkbcommon-devel
|
||||||
libxslt
|
libxslt
|
||||||
libzstd-devel
|
|
||||||
lz4
|
lz4
|
||||||
lz4-devel
|
lz4-devel
|
||||||
m4
|
m4
|
||||||
@ -63,7 +62,6 @@ BuildPackages=
|
|||||||
tree
|
tree
|
||||||
valgrind-devel
|
valgrind-devel
|
||||||
xz-devel
|
xz-devel
|
||||||
zstd
|
|
||||||
|
|
||||||
Packages=
|
Packages=
|
||||||
coreutils
|
coreutils
|
||||||
|
|||||||
@ -51,7 +51,6 @@ BuildPackages=
|
|||||||
libsmartcols-dev
|
libsmartcols-dev
|
||||||
libtool
|
libtool
|
||||||
libxkbcommon-dev
|
libxkbcommon-dev
|
||||||
libzstd-dev
|
|
||||||
m4
|
m4
|
||||||
meson
|
meson
|
||||||
pkg-config
|
pkg-config
|
||||||
@ -62,7 +61,6 @@ BuildPackages=
|
|||||||
uuid-dev
|
uuid-dev
|
||||||
xsltproc
|
xsltproc
|
||||||
xz-utils
|
xz-utils
|
||||||
zstd
|
|
||||||
|
|
||||||
Packages=
|
Packages=
|
||||||
libqrencode3
|
libqrencode3
|
||||||
|
|||||||
1
README
1
README
@ -150,7 +150,6 @@ REQUIREMENTS:
|
|||||||
libselinux (optional)
|
libselinux (optional)
|
||||||
liblzma (optional)
|
liblzma (optional)
|
||||||
liblz4 >= 1.3.0 / 130 (optional)
|
liblz4 >= 1.3.0 / 130 (optional)
|
||||||
libzstd >= 1.4.0 (optional)
|
|
||||||
libgcrypt (optional)
|
libgcrypt (optional)
|
||||||
libqrencode (optional)
|
libqrencode (optional)
|
||||||
libmicrohttpd (optional)
|
libmicrohttpd (optional)
|
||||||
|
|||||||
@ -411,26 +411,3 @@ i jądro wymusiło zakończenie jego działania.
|
|||||||
|
|
||||||
Proszę zauważyć, że brak pamięci mógł nie zostać spowodowany
|
Proszę zauważyć, że brak pamięci mógł nie zostać spowodowany
|
||||||
przez jednostkę @UNIT@.
|
przez jednostkę @UNIT@.
|
||||||
|
|
||||||
-- b61fdac612e94b9182285b998843061f
|
|
||||||
Subject: Przyjmowanie nazwy użytkownika/grupy @USER_GROUP_NAME@, która nie zgadza się ze ścisłymi regułami nazw użytkowników/grup.
|
|
||||||
Defined-By: systemd
|
|
||||||
Support: %SUPPORT_URL%
|
|
||||||
|
|
||||||
Podano nazwę użytkownika/grupy @USER_GROUP_NAME@, co zostało przyjęte
|
|
||||||
zgodnie z rozluźnionymi regułami nazw użytkowników/grup, ale nie spełnia
|
|
||||||
ścisłych reguł.
|
|
||||||
|
|
||||||
Ścisłe reguły nazw użytkowników/grup zapisane jako wyrażenie regularne to:
|
|
||||||
|
|
||||||
^[a-zA-Z_][a-zA-Z0-9_-]{0,30}$
|
|
||||||
|
|
||||||
Rozluźnione reguły nazw użytkowników/grup przyjmują wszystkie nazwy,
|
|
||||||
oprócz pustego ciągu, nazw zawierających bajty NUL, znaki kontrolne,
|
|
||||||
dwukropki lub ukośniki, nazw niebędących prawidłowym tekstem UTF-8,
|
|
||||||
nazw z początkową lub końcową spacją, ciągów „.” lub „..”, ciągów
|
|
||||||
zawierających tylko cyfry lub ciągów zaczynających się myślnikiem
|
|
||||||
i zawierających oprócz niego tylko cyfry.
|
|
||||||
|
|
||||||
https://systemd.io/USER_NAMES zawiera więcej informacji o ścisłych
|
|
||||||
i rozluźnionych regułach nazw użytkowników/grup.
|
|
||||||
|
|||||||
@ -288,10 +288,6 @@ mouse:usb:v04b3p3107:name:*
|
|||||||
mouse:usb:v047dp1020:*Kensington Expert Mouse*
|
mouse:usb:v047dp1020:*Kensington Expert Mouse*
|
||||||
ID_INPUT_TRACKBALL=1
|
ID_INPUT_TRACKBALL=1
|
||||||
|
|
||||||
# Kensington SlimBlade Trackball
|
|
||||||
mouse:usb:v047dp2041:name:Kensington Slimblade Trackball:
|
|
||||||
ID_INPUT_TRACKBALL=1
|
|
||||||
|
|
||||||
##########################################
|
##########################################
|
||||||
# Lenovo
|
# Lenovo
|
||||||
##########################################
|
##########################################
|
||||||
|
|||||||
48
meson.build
48
meson.build
@ -1195,18 +1195,6 @@ else
|
|||||||
endif
|
endif
|
||||||
conf.set10('HAVE_LZ4', have)
|
conf.set10('HAVE_LZ4', have)
|
||||||
|
|
||||||
want_zstd = get_option('zstd')
|
|
||||||
if want_zstd != 'false' and not skip_deps
|
|
||||||
libzstd = dependency('libzstd',
|
|
||||||
required : want_zstd == 'true',
|
|
||||||
version : '>= 1.4.0')
|
|
||||||
have = libzstd.found()
|
|
||||||
else
|
|
||||||
have = false
|
|
||||||
libzstd = []
|
|
||||||
endif
|
|
||||||
conf.set10('HAVE_ZSTD', have)
|
|
||||||
|
|
||||||
want_xkbcommon = get_option('xkbcommon')
|
want_xkbcommon = get_option('xkbcommon')
|
||||||
if want_xkbcommon != 'false' and not skip_deps
|
if want_xkbcommon != 'false' and not skip_deps
|
||||||
libxkbcommon = dependency('xkbcommon',
|
libxkbcommon = dependency('xkbcommon',
|
||||||
@ -1555,7 +1543,6 @@ libsystemd = shared_library(
|
|||||||
dependencies : [threads,
|
dependencies : [threads,
|
||||||
librt,
|
librt,
|
||||||
libxz,
|
libxz,
|
||||||
libzstd,
|
|
||||||
liblz4],
|
liblz4],
|
||||||
link_depends : libsystemd_sym,
|
link_depends : libsystemd_sym,
|
||||||
install : true,
|
install : true,
|
||||||
@ -1579,7 +1566,6 @@ install_libsystemd_static = static_library(
|
|||||||
dependencies : [threads,
|
dependencies : [threads,
|
||||||
librt,
|
librt,
|
||||||
libxz,
|
libxz,
|
||||||
libzstd,
|
|
||||||
liblz4,
|
liblz4,
|
||||||
libcap,
|
libcap,
|
||||||
libblkid,
|
libblkid,
|
||||||
@ -1741,8 +1727,7 @@ executable(
|
|||||||
dependencies : [threads,
|
dependencies : [threads,
|
||||||
libxz,
|
libxz,
|
||||||
liblz4,
|
liblz4,
|
||||||
libselinux,
|
libselinux],
|
||||||
libzstd],
|
|
||||||
install_rpath : rootlibexecdir,
|
install_rpath : rootlibexecdir,
|
||||||
install : true,
|
install : true,
|
||||||
install_dir : rootlibexecdir)
|
install_dir : rootlibexecdir)
|
||||||
@ -1766,8 +1751,7 @@ public_programs += executable(
|
|||||||
libqrencode,
|
libqrencode,
|
||||||
libxz,
|
libxz,
|
||||||
liblz4,
|
liblz4,
|
||||||
libpcre2,
|
libpcre2],
|
||||||
libzstd],
|
|
||||||
install_rpath : rootlibexecdir,
|
install_rpath : rootlibexecdir,
|
||||||
install : true,
|
install : true,
|
||||||
install_dir : rootbindir)
|
install_dir : rootbindir)
|
||||||
@ -1922,8 +1906,7 @@ if conf.get('ENABLE_LOGIND') == 1
|
|||||||
link_with : [libshared],
|
link_with : [libshared],
|
||||||
dependencies : [threads,
|
dependencies : [threads,
|
||||||
liblz4,
|
liblz4,
|
||||||
libxz,
|
libxz],
|
||||||
libzstd],
|
|
||||||
install_rpath : rootlibexecdir,
|
install_rpath : rootlibexecdir,
|
||||||
install : true,
|
install : true,
|
||||||
install_dir : rootbindir)
|
install_dir : rootbindir)
|
||||||
@ -2053,8 +2036,7 @@ public_programs += executable(
|
|||||||
libcap,
|
libcap,
|
||||||
libselinux,
|
libselinux,
|
||||||
libxz,
|
libxz,
|
||||||
liblz4,
|
liblz4],
|
||||||
libzstd],
|
|
||||||
install_rpath : rootlibexecdir,
|
install_rpath : rootlibexecdir,
|
||||||
install : true,
|
install : true,
|
||||||
install_dir : rootbindir)
|
install_dir : rootbindir)
|
||||||
@ -2404,8 +2386,7 @@ if conf.get('ENABLE_MACHINED') == 1
|
|||||||
link_with : [libshared],
|
link_with : [libshared],
|
||||||
dependencies : [threads,
|
dependencies : [threads,
|
||||||
libxz,
|
libxz,
|
||||||
liblz4,
|
liblz4],
|
||||||
libzstd],
|
|
||||||
install_rpath : rootlibexecdir,
|
install_rpath : rootlibexecdir,
|
||||||
install : true,
|
install : true,
|
||||||
install_dir : rootbindir)
|
install_dir : rootbindir)
|
||||||
@ -2486,8 +2467,7 @@ if conf.get('ENABLE_REMOTE') == 1 and conf.get('HAVE_LIBCURL') == 1
|
|||||||
libcurl,
|
libcurl,
|
||||||
libgnutls,
|
libgnutls,
|
||||||
libxz,
|
libxz,
|
||||||
liblz4,
|
liblz4],
|
||||||
libzstd],
|
|
||||||
install_rpath : rootlibexecdir,
|
install_rpath : rootlibexecdir,
|
||||||
install : true,
|
install : true,
|
||||||
install_dir : rootlibexecdir)
|
install_dir : rootlibexecdir)
|
||||||
@ -2504,8 +2484,7 @@ if conf.get('ENABLE_REMOTE') == 1 and conf.get('HAVE_MICROHTTPD') == 1
|
|||||||
libmicrohttpd,
|
libmicrohttpd,
|
||||||
libgnutls,
|
libgnutls,
|
||||||
libxz,
|
libxz,
|
||||||
liblz4,
|
liblz4],
|
||||||
libzstd],
|
|
||||||
install_rpath : rootlibexecdir,
|
install_rpath : rootlibexecdir,
|
||||||
install : true,
|
install : true,
|
||||||
install_dir : rootlibexecdir)
|
install_dir : rootlibexecdir)
|
||||||
@ -2519,8 +2498,7 @@ if conf.get('ENABLE_REMOTE') == 1 and conf.get('HAVE_MICROHTTPD') == 1
|
|||||||
libmicrohttpd,
|
libmicrohttpd,
|
||||||
libgnutls,
|
libgnutls,
|
||||||
libxz,
|
libxz,
|
||||||
liblz4,
|
liblz4],
|
||||||
libzstd],
|
|
||||||
install_rpath : rootlibexecdir,
|
install_rpath : rootlibexecdir,
|
||||||
install : true,
|
install : true,
|
||||||
install_dir : rootlibexecdir)
|
install_dir : rootlibexecdir)
|
||||||
@ -2536,8 +2514,7 @@ if conf.get('ENABLE_COREDUMP') == 1
|
|||||||
libacl,
|
libacl,
|
||||||
libdw,
|
libdw,
|
||||||
libxz,
|
libxz,
|
||||||
liblz4,
|
liblz4],
|
||||||
libzstd],
|
|
||||||
install_rpath : rootlibexecdir,
|
install_rpath : rootlibexecdir,
|
||||||
install : true,
|
install : true,
|
||||||
install_dir : rootlibexecdir)
|
install_dir : rootlibexecdir)
|
||||||
@ -2549,8 +2526,7 @@ if conf.get('ENABLE_COREDUMP') == 1
|
|||||||
link_with : [libshared],
|
link_with : [libshared],
|
||||||
dependencies : [threads,
|
dependencies : [threads,
|
||||||
libxz,
|
libxz,
|
||||||
liblz4,
|
liblz4],
|
||||||
libzstd],
|
|
||||||
install_rpath : rootlibexecdir,
|
install_rpath : rootlibexecdir,
|
||||||
install : true)
|
install : true)
|
||||||
endif
|
endif
|
||||||
@ -2565,8 +2541,7 @@ if conf.get('ENABLE_PSTORE') == 1
|
|||||||
libacl,
|
libacl,
|
||||||
libdw,
|
libdw,
|
||||||
libxz,
|
libxz,
|
||||||
liblz4,
|
liblz4],
|
||||||
libzstd],
|
|
||||||
install_rpath : rootlibexecdir,
|
install_rpath : rootlibexecdir,
|
||||||
install : true,
|
install : true,
|
||||||
install_dir : rootlibexecdir)
|
install_dir : rootlibexecdir)
|
||||||
@ -3521,7 +3496,6 @@ foreach tuple : [
|
|||||||
['SMACK'],
|
['SMACK'],
|
||||||
['zlib'],
|
['zlib'],
|
||||||
['xz'],
|
['xz'],
|
||||||
['zstd'],
|
|
||||||
['lz4'],
|
['lz4'],
|
||||||
['bzip2'],
|
['bzip2'],
|
||||||
['ACL'],
|
['ACL'],
|
||||||
|
|||||||
@ -316,8 +316,6 @@ option('xz', type : 'combo', choices : ['auto', 'true', 'false'],
|
|||||||
description : 'xz compression support')
|
description : 'xz compression support')
|
||||||
option('lz4', type : 'combo', choices : ['auto', 'true', 'false'],
|
option('lz4', type : 'combo', choices : ['auto', 'true', 'false'],
|
||||||
description : 'lz4 compression support')
|
description : 'lz4 compression support')
|
||||||
option('zstd', type : 'combo', choices : ['auto', 'true', 'false'],
|
|
||||||
description : 'zstd compression support')
|
|
||||||
option('xkbcommon', type : 'combo', choices : ['auto', 'true', 'false'],
|
option('xkbcommon', type : 'combo', choices : ['auto', 'true', 'false'],
|
||||||
description : 'xkbcommon keymap support')
|
description : 'xkbcommon keymap support')
|
||||||
option('pcre2', type : 'combo', choices : ['auto', 'true', 'false'],
|
option('pcre2', type : 'combo', choices : ['auto', 'true', 'false'],
|
||||||
|
|||||||
27
po/pl.po
27
po/pl.po
@ -6,8 +6,8 @@ msgid ""
|
|||||||
msgstr ""
|
msgstr ""
|
||||||
"Project-Id-Version: systemd\n"
|
"Project-Id-Version: systemd\n"
|
||||||
"Report-Msgid-Bugs-To: https://github.com/systemd/systemd/issues\n"
|
"Report-Msgid-Bugs-To: https://github.com/systemd/systemd/issues\n"
|
||||||
"POT-Creation-Date: 2020-05-01 15:36+0000\n"
|
"POT-Creation-Date: 2020-03-07 03:28+0000\n"
|
||||||
"PO-Revision-Date: 2020-05-03 13:50+0200\n"
|
"PO-Revision-Date: 2020-03-15 13:13+0100\n"
|
||||||
"Last-Translator: Piotr Drąg <piotrdrag@gmail.com>\n"
|
"Last-Translator: Piotr Drąg <piotrdrag@gmail.com>\n"
|
||||||
"Language-Team: Polish <trans-pl@lists.fedoraproject.org>\n"
|
"Language-Team: Polish <trans-pl@lists.fedoraproject.org>\n"
|
||||||
"Language: pl\n"
|
"Language: pl\n"
|
||||||
@ -905,25 +905,25 @@ msgstr ""
|
|||||||
"Wymagane jest uwierzytelnienie, aby kontrolować, czy włączyć synchronizację "
|
"Wymagane jest uwierzytelnienie, aby kontrolować, czy włączyć synchronizację "
|
||||||
"czasu przez sieć."
|
"czasu przez sieć."
|
||||||
|
|
||||||
#: src/core/dbus-unit.c:358
|
#: src/core/dbus-unit.c:356
|
||||||
msgid "Authentication is required to start '$(unit)'."
|
msgid "Authentication is required to start '$(unit)'."
|
||||||
msgstr "Wymagane jest uwierzytelnienie, aby uruchomić jednostkę „$(unit)”."
|
msgstr "Wymagane jest uwierzytelnienie, aby uruchomić jednostkę „$(unit)”."
|
||||||
|
|
||||||
#: src/core/dbus-unit.c:359
|
#: src/core/dbus-unit.c:357
|
||||||
msgid "Authentication is required to stop '$(unit)'."
|
msgid "Authentication is required to stop '$(unit)'."
|
||||||
msgstr "Wymagane jest uwierzytelnienie, aby zatrzymać jednostkę „$(unit)”."
|
msgstr "Wymagane jest uwierzytelnienie, aby zatrzymać jednostkę „$(unit)”."
|
||||||
|
|
||||||
#: src/core/dbus-unit.c:360
|
#: src/core/dbus-unit.c:358
|
||||||
msgid "Authentication is required to reload '$(unit)'."
|
msgid "Authentication is required to reload '$(unit)'."
|
||||||
msgstr ""
|
msgstr ""
|
||||||
"Wymagane jest uwierzytelnienie, aby ponownie wczytać jednostkę „$(unit)”."
|
"Wymagane jest uwierzytelnienie, aby ponownie wczytać jednostkę „$(unit)”."
|
||||||
|
|
||||||
#: src/core/dbus-unit.c:361 src/core/dbus-unit.c:362
|
#: src/core/dbus-unit.c:359 src/core/dbus-unit.c:360
|
||||||
msgid "Authentication is required to restart '$(unit)'."
|
msgid "Authentication is required to restart '$(unit)'."
|
||||||
msgstr ""
|
msgstr ""
|
||||||
"Wymagane jest uwierzytelnienie, aby ponownie uruchomić jednostkę „$(unit)”."
|
"Wymagane jest uwierzytelnienie, aby ponownie uruchomić jednostkę „$(unit)”."
|
||||||
|
|
||||||
#: src/core/dbus-unit.c:534
|
#: src/core/dbus-unit.c:532
|
||||||
msgid ""
|
msgid ""
|
||||||
"Authentication is required to send a UNIX signal to the processes of "
|
"Authentication is required to send a UNIX signal to the processes of "
|
||||||
"'$(unit)'."
|
"'$(unit)'."
|
||||||
@ -931,18 +931,18 @@ msgstr ""
|
|||||||
"Wymagane jest uwierzytelnienie, aby wysłać sygnał uniksowy do procesów "
|
"Wymagane jest uwierzytelnienie, aby wysłać sygnał uniksowy do procesów "
|
||||||
"jednostki „$(unit)”."
|
"jednostki „$(unit)”."
|
||||||
|
|
||||||
#: src/core/dbus-unit.c:565
|
#: src/core/dbus-unit.c:563
|
||||||
msgid "Authentication is required to reset the \"failed\" state of '$(unit)'."
|
msgid "Authentication is required to reset the \"failed\" state of '$(unit)'."
|
||||||
msgstr ""
|
msgstr ""
|
||||||
"Wymagane jest uwierzytelnienie, aby przywrócić stan „failed” (niepowodzenia) "
|
"Wymagane jest uwierzytelnienie, aby przywrócić stan „failed” (niepowodzenia) "
|
||||||
"jednostki „$(unit)”."
|
"jednostki „$(unit)”."
|
||||||
|
|
||||||
#: src/core/dbus-unit.c:598
|
#: src/core/dbus-unit.c:596
|
||||||
msgid "Authentication is required to set properties on '$(unit)'."
|
msgid "Authentication is required to set properties on '$(unit)'."
|
||||||
msgstr ""
|
msgstr ""
|
||||||
"Wymagane jest uwierzytelnienie, aby ustawić właściwości jednostki „$(unit)”."
|
"Wymagane jest uwierzytelnienie, aby ustawić właściwości jednostki „$(unit)”."
|
||||||
|
|
||||||
#: src/core/dbus-unit.c:707
|
#: src/core/dbus-unit.c:705
|
||||||
msgid ""
|
msgid ""
|
||||||
"Authentication is required to delete files and directories associated with "
|
"Authentication is required to delete files and directories associated with "
|
||||||
"'$(unit)'."
|
"'$(unit)'."
|
||||||
@ -950,13 +950,6 @@ msgstr ""
|
|||||||
"Wymagane jest uwierzytelnienie, aby usunąć pliki i katalogi powiązane "
|
"Wymagane jest uwierzytelnienie, aby usunąć pliki i katalogi powiązane "
|
||||||
"z jednostką „$(unit)”."
|
"z jednostką „$(unit)”."
|
||||||
|
|
||||||
#: src/core/dbus-unit.c:756
|
|
||||||
msgid ""
|
|
||||||
"Authentication is required to freeze or thaw the processes of '$(unit)' unit."
|
|
||||||
msgstr ""
|
|
||||||
"Wymagane jest uwierzytelnienie, aby zamrozić lub odmrozić procesy jednostki "
|
|
||||||
"„$(unit)”."
|
|
||||||
|
|
||||||
#~ msgid "Press Ctrl+C to cancel all filesystem checks in progress"
|
#~ msgid "Press Ctrl+C to cancel all filesystem checks in progress"
|
||||||
#~ msgstr ""
|
#~ msgstr ""
|
||||||
#~ "Naciśnięcie klawiszy Ctrl+C anuluje wszystkie trwające procesy "
|
#~ "Naciśnięcie klawiszy Ctrl+C anuluje wszystkie trwające procesy "
|
||||||
|
|||||||
@ -87,12 +87,6 @@
|
|||||||
#define _LZ4_FEATURE_ "-LZ4"
|
#define _LZ4_FEATURE_ "-LZ4"
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#if HAVE_ZSTD
|
|
||||||
#define _ZSTD_FEATURE_ "+ZSTD"
|
|
||||||
#else
|
|
||||||
#define _ZSTD_FEATURE_ "-ZSTD"
|
|
||||||
#endif
|
|
||||||
|
|
||||||
#if HAVE_SECCOMP
|
#if HAVE_SECCOMP
|
||||||
#define _SECCOMP_FEATURE_ "+SECCOMP"
|
#define _SECCOMP_FEATURE_ "+SECCOMP"
|
||||||
#else
|
#else
|
||||||
@ -152,7 +146,6 @@
|
|||||||
_ACL_FEATURE_ " " \
|
_ACL_FEATURE_ " " \
|
||||||
_XZ_FEATURE_ " " \
|
_XZ_FEATURE_ " " \
|
||||||
_LZ4_FEATURE_ " " \
|
_LZ4_FEATURE_ " " \
|
||||||
_ZSTD_FEATURE_ " " \
|
|
||||||
_SECCOMP_FEATURE_ " " \
|
_SECCOMP_FEATURE_ " " \
|
||||||
_BLKID_FEATURE_ " " \
|
_BLKID_FEATURE_ " " \
|
||||||
_ELFUTILS_FEATURE_ " " \
|
_ELFUTILS_FEATURE_ " " \
|
||||||
|
|||||||
@ -420,7 +420,7 @@ static int save_external_coredump(
|
|||||||
goto fail;
|
goto fail;
|
||||||
}
|
}
|
||||||
|
|
||||||
#if HAVE_XZ || HAVE_LZ4 || HAVE_ZSTD
|
#if HAVE_XZ || HAVE_LZ4
|
||||||
/* If we will remove the coredump anyway, do not compress. */
|
/* If we will remove the coredump anyway, do not compress. */
|
||||||
if (arg_compress && !maybe_remove_external_coredump(NULL, st.st_size)) {
|
if (arg_compress && !maybe_remove_external_coredump(NULL, st.st_size)) {
|
||||||
|
|
||||||
|
|||||||
@ -765,7 +765,7 @@ static int save_core(sd_journal *j, FILE *file, char **path, bool *unlink_temp)
|
|||||||
if (access(filename, R_OK) < 0)
|
if (access(filename, R_OK) < 0)
|
||||||
return log_error_errno(errno, "File \"%s\" is not readable: %m", filename);
|
return log_error_errno(errno, "File \"%s\" is not readable: %m", filename);
|
||||||
|
|
||||||
if (path && !ENDSWITH_SET(filename, ".xz", ".lz4", ".zst")) {
|
if (path && !endswith(filename, ".xz") && !endswith(filename, ".lz4")) {
|
||||||
*path = TAKE_PTR(filename);
|
*path = TAKE_PTR(filename);
|
||||||
|
|
||||||
return 0;
|
return 0;
|
||||||
@ -824,7 +824,7 @@ static int save_core(sd_journal *j, FILE *file, char **path, bool *unlink_temp)
|
|||||||
}
|
}
|
||||||
|
|
||||||
if (filename) {
|
if (filename) {
|
||||||
#if HAVE_XZ || HAVE_LZ4 || HAVE_ZSTD
|
#if HAVE_XZ || HAVE_LZ4
|
||||||
_cleanup_close_ int fdf;
|
_cleanup_close_ int fdf;
|
||||||
|
|
||||||
fdf = open(filename, O_RDONLY | O_CLOEXEC);
|
fdf = open(filename, O_RDONLY | O_CLOEXEC);
|
||||||
|
|||||||
@ -16,11 +16,6 @@
|
|||||||
#include <lz4frame.h>
|
#include <lz4frame.h>
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#if HAVE_ZSTD
|
|
||||||
#include <zstd.h>
|
|
||||||
#include <zstd_errors.h>
|
|
||||||
#endif
|
|
||||||
|
|
||||||
#include "alloc-util.h"
|
#include "alloc-util.h"
|
||||||
#include "compress.h"
|
#include "compress.h"
|
||||||
#include "fd-util.h"
|
#include "fd-util.h"
|
||||||
@ -38,22 +33,6 @@ DEFINE_TRIVIAL_CLEANUP_FUNC(LZ4F_compressionContext_t, LZ4F_freeCompressionConte
|
|||||||
DEFINE_TRIVIAL_CLEANUP_FUNC(LZ4F_decompressionContext_t, LZ4F_freeDecompressionContext);
|
DEFINE_TRIVIAL_CLEANUP_FUNC(LZ4F_decompressionContext_t, LZ4F_freeDecompressionContext);
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#if HAVE_ZSTD
|
|
||||||
DEFINE_TRIVIAL_CLEANUP_FUNC(ZSTD_CCtx *, ZSTD_freeCCtx);
|
|
||||||
DEFINE_TRIVIAL_CLEANUP_FUNC(ZSTD_DCtx *, ZSTD_freeDCtx);
|
|
||||||
|
|
||||||
static int zstd_ret_to_errno(size_t ret) {
|
|
||||||
switch (ZSTD_getErrorCode(ret)) {
|
|
||||||
case ZSTD_error_dstSize_tooSmall:
|
|
||||||
return -ENOBUFS;
|
|
||||||
case ZSTD_error_memory_allocation:
|
|
||||||
return -ENOMEM;
|
|
||||||
default:
|
|
||||||
return -EBADMSG;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
#endif
|
|
||||||
|
|
||||||
#define ALIGN_8(l) ALIGN_TO(l, sizeof(size_t))
|
#define ALIGN_8(l) ALIGN_TO(l, sizeof(size_t))
|
||||||
|
|
||||||
static const char* const object_compressed_table[_OBJECT_COMPRESSED_MAX] = {
|
static const char* const object_compressed_table[_OBJECT_COMPRESSED_MAX] = {
|
||||||
@ -689,230 +668,12 @@ int decompress_stream_lz4(int in, int out, uint64_t max_bytes) {
|
|||||||
#endif
|
#endif
|
||||||
}
|
}
|
||||||
|
|
||||||
int compress_stream_zstd(int fdf, int fdt, uint64_t max_bytes) {
|
|
||||||
#if HAVE_ZSTD
|
|
||||||
_cleanup_(ZSTD_freeCCtxp) ZSTD_CCtx *cctx = NULL;
|
|
||||||
_cleanup_free_ void *in_buff = NULL, *out_buff = NULL;
|
|
||||||
size_t in_allocsize, out_allocsize;
|
|
||||||
size_t z;
|
|
||||||
uint64_t left = max_bytes, in_bytes = 0;
|
|
||||||
/* This can be used in the future to add uncompressed size to the header */
|
|
||||||
uint64_t in_totalsize = 0;
|
|
||||||
|
|
||||||
assert(fdf >= 0);
|
|
||||||
assert(fdt >= 0);
|
|
||||||
|
|
||||||
/* Create the context and buffers */
|
|
||||||
in_allocsize = ZSTD_CStreamInSize();
|
|
||||||
out_allocsize = ZSTD_CStreamOutSize();
|
|
||||||
in_buff = malloc(in_allocsize);
|
|
||||||
out_buff = malloc(out_allocsize);
|
|
||||||
cctx = ZSTD_createCCtx();
|
|
||||||
if (!cctx || !out_buff || !in_buff)
|
|
||||||
return -ENOMEM;
|
|
||||||
|
|
||||||
if (in_totalsize) {
|
|
||||||
z = ZSTD_CCtx_setPledgedSrcSize(cctx, in_totalsize);
|
|
||||||
if (z)
|
|
||||||
log_debug("Failed to enable ZSTD input size, ignoring: %s", ZSTD_getErrorName(z));
|
|
||||||
}
|
|
||||||
z = ZSTD_CCtx_setParameter(cctx, ZSTD_c_checksumFlag, 1);
|
|
||||||
if (ZSTD_isError(z))
|
|
||||||
log_debug("Failed to enable ZSTD checksum, ignoring: %s", ZSTD_getErrorName(z));
|
|
||||||
|
|
||||||
/* This loop read from the input file, compresses that entire chunk,
|
|
||||||
* and writes all output produced to the output file.
|
|
||||||
*/
|
|
||||||
for (;;) {
|
|
||||||
bool is_last_chunk;
|
|
||||||
ZSTD_inBuffer input = {
|
|
||||||
.src = in_buff,
|
|
||||||
.size = 0,
|
|
||||||
.pos = 0
|
|
||||||
};
|
|
||||||
ssize_t red;
|
|
||||||
|
|
||||||
red = loop_read(fdf, in_buff, in_allocsize, true);
|
|
||||||
if (red < 0)
|
|
||||||
return red;
|
|
||||||
is_last_chunk = red == 0;
|
|
||||||
|
|
||||||
in_bytes += (size_t) red;
|
|
||||||
input.size = (size_t) red;
|
|
||||||
|
|
||||||
for (bool finished = false; !finished;) {
|
|
||||||
ZSTD_outBuffer output = {
|
|
||||||
.dst = out_buff,
|
|
||||||
.size = out_allocsize,
|
|
||||||
.pos = 0
|
|
||||||
};
|
|
||||||
size_t remaining;
|
|
||||||
ssize_t wrote;
|
|
||||||
|
|
||||||
/* Compress into the output buffer and write all of the
|
|
||||||
* output to the file so we can reuse the buffer next
|
|
||||||
* iteration.
|
|
||||||
*/
|
|
||||||
remaining = ZSTD_compressStream2(
|
|
||||||
cctx, &output, &input,
|
|
||||||
is_last_chunk ? ZSTD_e_end : ZSTD_e_continue);
|
|
||||||
|
|
||||||
if (ZSTD_isError(remaining)) {
|
|
||||||
log_debug("ZSTD encoder failed: %s", ZSTD_getErrorName(remaining));
|
|
||||||
return zstd_ret_to_errno(remaining);
|
|
||||||
}
|
|
||||||
|
|
||||||
if (left < output.pos)
|
|
||||||
return -EFBIG;
|
|
||||||
|
|
||||||
wrote = loop_write(fdt, output.dst, output.pos, 1);
|
|
||||||
if (wrote < 0)
|
|
||||||
return wrote;
|
|
||||||
|
|
||||||
left -= output.pos;
|
|
||||||
|
|
||||||
/* If we're on the last chunk we're finished when zstd
|
|
||||||
* returns 0, which means its consumed all the input AND
|
|
||||||
* finished the frame. Otherwise, we're finished when
|
|
||||||
* we've consumed all the input.
|
|
||||||
*/
|
|
||||||
finished = is_last_chunk ? (remaining == 0) : (input.pos == input.size);
|
|
||||||
}
|
|
||||||
|
|
||||||
/* zstd only returns 0 when the input is completely consumed */
|
|
||||||
assert(input.pos == input.size);
|
|
||||||
if (is_last_chunk)
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
|
|
||||||
log_debug(
|
|
||||||
"ZSTD compression finished (%" PRIu64 " -> %" PRIu64 " bytes, %.1f%%)",
|
|
||||||
in_bytes,
|
|
||||||
max_bytes - left,
|
|
||||||
(double) (max_bytes - left) / in_bytes * 100);
|
|
||||||
|
|
||||||
return 0;
|
|
||||||
#else
|
|
||||||
return -EPROTONOSUPPORT;
|
|
||||||
#endif
|
|
||||||
}
|
|
||||||
|
|
||||||
int decompress_stream_zstd(int fdf, int fdt, uint64_t max_bytes) {
|
|
||||||
#if HAVE_ZSTD
|
|
||||||
_cleanup_(ZSTD_freeDCtxp) ZSTD_DCtx *dctx = NULL;
|
|
||||||
_cleanup_free_ void *in_buff = NULL, *out_buff = NULL;
|
|
||||||
size_t in_allocsize, out_allocsize;
|
|
||||||
size_t last_result = 0;
|
|
||||||
uint64_t left = max_bytes, in_bytes = 0;
|
|
||||||
|
|
||||||
assert(fdf >= 0);
|
|
||||||
assert(fdt >= 0);
|
|
||||||
|
|
||||||
/* Create the context and buffers */
|
|
||||||
in_allocsize = ZSTD_DStreamInSize();
|
|
||||||
out_allocsize = ZSTD_DStreamOutSize();
|
|
||||||
in_buff = malloc(in_allocsize);
|
|
||||||
out_buff = malloc(out_allocsize);
|
|
||||||
dctx = ZSTD_createDCtx();
|
|
||||||
if (!dctx || !out_buff || !in_buff)
|
|
||||||
return -ENOMEM;
|
|
||||||
|
|
||||||
/* This loop assumes that the input file is one or more concatenated
|
|
||||||
* zstd streams. This example won't work if there is trailing non-zstd
|
|
||||||
* data at the end, but streaming decompression in general handles this
|
|
||||||
* case. ZSTD_decompressStream() returns 0 exactly when the frame is
|
|
||||||
* completed, and doesn't consume input after the frame.
|
|
||||||
*/
|
|
||||||
for (;;) {
|
|
||||||
bool has_error = false;
|
|
||||||
ZSTD_inBuffer input = {
|
|
||||||
.src = in_buff,
|
|
||||||
.size = 0,
|
|
||||||
.pos = 0
|
|
||||||
};
|
|
||||||
ssize_t red;
|
|
||||||
|
|
||||||
red = loop_read(fdf, in_buff, in_allocsize, true);
|
|
||||||
if (red < 0)
|
|
||||||
return red;
|
|
||||||
if (red == 0)
|
|
||||||
break;
|
|
||||||
|
|
||||||
in_bytes += (size_t) red;
|
|
||||||
input.size = (size_t) red;
|
|
||||||
input.pos = 0;
|
|
||||||
|
|
||||||
/* Given a valid frame, zstd won't consume the last byte of the
|
|
||||||
* frame until it has flushed all of the decompressed data of
|
|
||||||
* the frame. So input.pos < input.size means frame is not done
|
|
||||||
* or there is still output available.
|
|
||||||
*/
|
|
||||||
while (input.pos < input.size) {
|
|
||||||
ZSTD_outBuffer output = {
|
|
||||||
.dst = out_buff,
|
|
||||||
.size = out_allocsize,
|
|
||||||
.pos = 0
|
|
||||||
};
|
|
||||||
ssize_t wrote;
|
|
||||||
/* The return code is zero if the frame is complete, but
|
|
||||||
* there may be multiple frames concatenated together.
|
|
||||||
* Zstd will automatically reset the context when a
|
|
||||||
* frame is complete. Still, calling ZSTD_DCtx_reset()
|
|
||||||
* can be useful to reset the context to a clean state,
|
|
||||||
* for instance if the last decompression call returned
|
|
||||||
* an error.
|
|
||||||
*/
|
|
||||||
last_result = ZSTD_decompressStream(dctx, &output, &input);
|
|
||||||
if (ZSTD_isError(last_result)) {
|
|
||||||
has_error = true;
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
|
|
||||||
if (left < output.pos)
|
|
||||||
return -EFBIG;
|
|
||||||
|
|
||||||
wrote = loop_write(fdt, output.dst, output.pos, 1);
|
|
||||||
if (wrote < 0)
|
|
||||||
return wrote;
|
|
||||||
|
|
||||||
left -= output.pos;
|
|
||||||
}
|
|
||||||
if (has_error)
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
|
|
||||||
if (in_bytes == 0)
|
|
||||||
return log_debug_errno(SYNTHETIC_ERRNO(EBADMSG), "ZSTD decoder failed: no data read");
|
|
||||||
|
|
||||||
if (last_result != 0) {
|
|
||||||
/* The last return value from ZSTD_decompressStream did not end
|
|
||||||
* on a frame, but we reached the end of the file! We assume
|
|
||||||
* this is an error, and the input was truncated.
|
|
||||||
*/
|
|
||||||
log_debug("ZSTD decoder failed: %s", ZSTD_getErrorName(last_result));
|
|
||||||
return zstd_ret_to_errno(last_result);
|
|
||||||
}
|
|
||||||
|
|
||||||
log_debug(
|
|
||||||
"ZSTD decompression finished (%" PRIu64 " -> %" PRIu64 " bytes, %.1f%%)",
|
|
||||||
in_bytes,
|
|
||||||
max_bytes - left,
|
|
||||||
(double) (max_bytes - left) / in_bytes * 100);
|
|
||||||
return 0;
|
|
||||||
#else
|
|
||||||
log_debug("Cannot decompress file. Compiled without ZSTD support.");
|
|
||||||
return -EPROTONOSUPPORT;
|
|
||||||
#endif
|
|
||||||
}
|
|
||||||
|
|
||||||
int decompress_stream(const char *filename, int fdf, int fdt, uint64_t max_bytes) {
|
int decompress_stream(const char *filename, int fdf, int fdt, uint64_t max_bytes) {
|
||||||
|
|
||||||
if (endswith(filename, ".lz4"))
|
if (endswith(filename, ".lz4"))
|
||||||
return decompress_stream_lz4(fdf, fdt, max_bytes);
|
return decompress_stream_lz4(fdf, fdt, max_bytes);
|
||||||
else if (endswith(filename, ".xz"))
|
else if (endswith(filename, ".xz"))
|
||||||
return decompress_stream_xz(fdf, fdt, max_bytes);
|
return decompress_stream_xz(fdf, fdt, max_bytes);
|
||||||
else if (endswith(filename, ".zst"))
|
|
||||||
return decompress_stream_zstd(fdf, fdt, max_bytes);
|
|
||||||
else
|
else
|
||||||
return -EPROTONOSUPPORT;
|
return -EPROTONOSUPPORT;
|
||||||
}
|
}
|
||||||
|
|||||||
@ -52,16 +52,11 @@ int decompress_startswith(int compression,
|
|||||||
|
|
||||||
int compress_stream_xz(int fdf, int fdt, uint64_t max_bytes);
|
int compress_stream_xz(int fdf, int fdt, uint64_t max_bytes);
|
||||||
int compress_stream_lz4(int fdf, int fdt, uint64_t max_bytes);
|
int compress_stream_lz4(int fdf, int fdt, uint64_t max_bytes);
|
||||||
int compress_stream_zstd(int fdf, int fdt, uint64_t max_bytes);
|
|
||||||
|
|
||||||
int decompress_stream_xz(int fdf, int fdt, uint64_t max_size);
|
int decompress_stream_xz(int fdf, int fdt, uint64_t max_size);
|
||||||
int decompress_stream_lz4(int fdf, int fdt, uint64_t max_size);
|
int decompress_stream_lz4(int fdf, int fdt, uint64_t max_size);
|
||||||
int decompress_stream_zstd(int fdf, int fdt, uint64_t max_size);
|
|
||||||
|
|
||||||
#if HAVE_ZSTD
|
#if HAVE_LZ4
|
||||||
# define compress_stream compress_stream_zstd
|
|
||||||
# define COMPRESSED_EXT ".zst"
|
|
||||||
#elif HAVE_LZ4
|
|
||||||
# define compress_stream compress_stream_lz4
|
# define compress_stream compress_stream_lz4
|
||||||
# define COMPRESSED_EXT ".lz4"
|
# define COMPRESSED_EXT ".lz4"
|
||||||
#else
|
#else
|
||||||
|
|||||||
@ -44,20 +44,20 @@ typedef int (decompress_sw_t)(const void *src, uint64_t src_size,
|
|||||||
typedef int (compress_stream_t)(int fdf, int fdt, uint64_t max_bytes);
|
typedef int (compress_stream_t)(int fdf, int fdt, uint64_t max_bytes);
|
||||||
typedef int (decompress_stream_t)(int fdf, int fdt, uint64_t max_size);
|
typedef int (decompress_stream_t)(int fdf, int fdt, uint64_t max_size);
|
||||||
|
|
||||||
#if HAVE_XZ || HAVE_LZ4 || HAVE_ZSTD
|
#if HAVE_XZ || HAVE_LZ4
|
||||||
_unused_ static void test_compress_decompress(const char *compression,
|
static void test_compress_decompress(int compression,
|
||||||
compress_blob_t compress,
|
compress_blob_t compress,
|
||||||
decompress_blob_t decompress,
|
decompress_blob_t decompress,
|
||||||
const char *data,
|
const char *data,
|
||||||
size_t data_len,
|
size_t data_len,
|
||||||
bool may_fail) {
|
bool may_fail) {
|
||||||
char compressed[512];
|
char compressed[512];
|
||||||
size_t csize, usize = 0;
|
size_t csize, usize = 0;
|
||||||
_cleanup_free_ char *decompressed = NULL;
|
_cleanup_free_ char *decompressed = NULL;
|
||||||
int r;
|
int r;
|
||||||
|
|
||||||
log_info("/* testing %s %s blob compression/decompression */",
|
log_info("/* testing %s %s blob compression/decompression */",
|
||||||
compression, data);
|
object_compressed_to_string(compression), data);
|
||||||
|
|
||||||
r = compress(data, data_len, compressed, sizeof(compressed), &csize);
|
r = compress(data, data_len, compressed, sizeof(compressed), &csize);
|
||||||
if (r == -ENOBUFS) {
|
if (r == -ENOBUFS) {
|
||||||
@ -88,12 +88,12 @@ _unused_ static void test_compress_decompress(const char *compression,
|
|||||||
memzero(decompressed, usize);
|
memzero(decompressed, usize);
|
||||||
}
|
}
|
||||||
|
|
||||||
_unused_ static void test_decompress_startswith(const char *compression,
|
static void test_decompress_startswith(int compression,
|
||||||
compress_blob_t compress,
|
compress_blob_t compress,
|
||||||
decompress_sw_t decompress_sw,
|
decompress_sw_t decompress_sw,
|
||||||
const char *data,
|
const char *data,
|
||||||
size_t data_len,
|
size_t data_len,
|
||||||
bool may_fail) {
|
bool may_fail) {
|
||||||
|
|
||||||
char *compressed;
|
char *compressed;
|
||||||
_cleanup_free_ char *compressed1 = NULL, *compressed2 = NULL, *decompressed = NULL;
|
_cleanup_free_ char *compressed1 = NULL, *compressed2 = NULL, *decompressed = NULL;
|
||||||
@ -101,7 +101,7 @@ _unused_ static void test_decompress_startswith(const char *compression,
|
|||||||
int r;
|
int r;
|
||||||
|
|
||||||
log_info("/* testing decompress_startswith with %s on %.20s text */",
|
log_info("/* testing decompress_startswith with %s on %.20s text */",
|
||||||
compression, data);
|
object_compressed_to_string(compression), data);
|
||||||
|
|
||||||
#define BUFSIZE_1 512
|
#define BUFSIZE_1 512
|
||||||
#define BUFSIZE_2 20000
|
#define BUFSIZE_2 20000
|
||||||
@ -136,9 +136,9 @@ _unused_ static void test_decompress_startswith(const char *compression,
|
|||||||
assert_se(r > 0);
|
assert_se(r > 0);
|
||||||
}
|
}
|
||||||
|
|
||||||
_unused_ static void test_decompress_startswith_short(const char *compression,
|
static void test_decompress_startswith_short(int compression,
|
||||||
compress_blob_t compress,
|
compress_blob_t compress,
|
||||||
decompress_sw_t decompress_sw) {
|
decompress_sw_t decompress_sw) {
|
||||||
|
|
||||||
#define TEXT "HUGE=xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx"
|
#define TEXT "HUGE=xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx"
|
||||||
|
|
||||||
@ -146,7 +146,7 @@ _unused_ static void test_decompress_startswith_short(const char *compression,
|
|||||||
size_t i, csize;
|
size_t i, csize;
|
||||||
int r;
|
int r;
|
||||||
|
|
||||||
log_info("/* %s with %s */", __func__, compression);
|
log_info("/* %s with %s */", __func__, object_compressed_to_string(compression));
|
||||||
|
|
||||||
r = compress(TEXT, sizeof TEXT, buf, sizeof buf, &csize);
|
r = compress(TEXT, sizeof TEXT, buf, sizeof buf, &csize);
|
||||||
assert_se(r == 0);
|
assert_se(r == 0);
|
||||||
@ -162,11 +162,11 @@ _unused_ static void test_decompress_startswith_short(const char *compression,
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
_unused_ static void test_compress_stream(const char *compression,
|
static void test_compress_stream(int compression,
|
||||||
const char *cat,
|
const char* cat,
|
||||||
compress_stream_t compress,
|
compress_stream_t compress,
|
||||||
decompress_stream_t decompress,
|
decompress_stream_t decompress,
|
||||||
const char *srcfile) {
|
const char *srcfile) {
|
||||||
|
|
||||||
_cleanup_close_ int src = -1, dst = -1, dst2 = -1;
|
_cleanup_close_ int src = -1, dst = -1, dst2 = -1;
|
||||||
_cleanup_(unlink_tempfilep) char
|
_cleanup_(unlink_tempfilep) char
|
||||||
@ -182,7 +182,8 @@ _unused_ static void test_compress_stream(const char *compression,
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
log_debug("/* testing %s compression */", compression);
|
log_debug("/* testing %s compression */",
|
||||||
|
object_compressed_to_string(compression));
|
||||||
|
|
||||||
log_debug("/* create source from %s */", srcfile);
|
log_debug("/* create source from %s */", srcfile);
|
||||||
|
|
||||||
@ -265,8 +266,8 @@ static void test_lz4_decompress_partial(void) {
|
|||||||
#endif
|
#endif
|
||||||
|
|
||||||
int main(int argc, char *argv[]) {
|
int main(int argc, char *argv[]) {
|
||||||
#if HAVE_XZ || HAVE_LZ4 || HAVE_ZSTD
|
#if HAVE_XZ || HAVE_LZ4
|
||||||
_unused_ const char text[] =
|
const char text[] =
|
||||||
"text\0foofoofoofoo AAAA aaaaaaaaa ghost busters barbarbar FFF"
|
"text\0foofoofoofoo AAAA aaaaaaaaa ghost busters barbarbar FFF"
|
||||||
"foofoofoofoo AAAA aaaaaaaaa ghost busters barbarbar FFF";
|
"foofoofoofoo AAAA aaaaaaaaa ghost busters barbarbar FFF";
|
||||||
|
|
||||||
@ -287,67 +288,60 @@ int main(int argc, char *argv[]) {
|
|||||||
random_bytes(data + 7, sizeof(data) - 7);
|
random_bytes(data + 7, sizeof(data) - 7);
|
||||||
|
|
||||||
#if HAVE_XZ
|
#if HAVE_XZ
|
||||||
test_compress_decompress("XZ", compress_blob_xz, decompress_blob_xz,
|
test_compress_decompress(OBJECT_COMPRESSED_XZ, compress_blob_xz, decompress_blob_xz,
|
||||||
text, sizeof(text), false);
|
text, sizeof(text), false);
|
||||||
test_compress_decompress("XZ", compress_blob_xz, decompress_blob_xz,
|
test_compress_decompress(OBJECT_COMPRESSED_XZ, compress_blob_xz, decompress_blob_xz,
|
||||||
data, sizeof(data), true);
|
data, sizeof(data), true);
|
||||||
|
|
||||||
test_decompress_startswith("XZ",
|
test_decompress_startswith(OBJECT_COMPRESSED_XZ,
|
||||||
compress_blob_xz, decompress_startswith_xz,
|
compress_blob_xz, decompress_startswith_xz,
|
||||||
text, sizeof(text), false);
|
text, sizeof(text), false);
|
||||||
test_decompress_startswith("XZ",
|
test_decompress_startswith(OBJECT_COMPRESSED_XZ,
|
||||||
compress_blob_xz, decompress_startswith_xz,
|
compress_blob_xz, decompress_startswith_xz,
|
||||||
data, sizeof(data), true);
|
data, sizeof(data), true);
|
||||||
test_decompress_startswith("XZ",
|
test_decompress_startswith(OBJECT_COMPRESSED_XZ,
|
||||||
compress_blob_xz, decompress_startswith_xz,
|
compress_blob_xz, decompress_startswith_xz,
|
||||||
huge, HUGE_SIZE, true);
|
huge, HUGE_SIZE, true);
|
||||||
|
|
||||||
test_compress_stream("XZ", "xzcat",
|
test_compress_stream(OBJECT_COMPRESSED_XZ, "xzcat",
|
||||||
compress_stream_xz, decompress_stream_xz, srcfile);
|
compress_stream_xz, decompress_stream_xz, srcfile);
|
||||||
|
|
||||||
test_decompress_startswith_short("XZ", compress_blob_xz, decompress_startswith_xz);
|
test_decompress_startswith_short(OBJECT_COMPRESSED_XZ, compress_blob_xz, decompress_startswith_xz);
|
||||||
|
|
||||||
#else
|
#else
|
||||||
log_info("/* XZ test skipped */");
|
log_info("/* XZ test skipped */");
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#if HAVE_LZ4
|
#if HAVE_LZ4
|
||||||
test_compress_decompress("LZ4", compress_blob_lz4, decompress_blob_lz4,
|
test_compress_decompress(OBJECT_COMPRESSED_LZ4, compress_blob_lz4, decompress_blob_lz4,
|
||||||
text, sizeof(text), false);
|
text, sizeof(text), false);
|
||||||
test_compress_decompress("LZ4", compress_blob_lz4, decompress_blob_lz4,
|
test_compress_decompress(OBJECT_COMPRESSED_LZ4, compress_blob_lz4, decompress_blob_lz4,
|
||||||
data, sizeof(data), true);
|
data, sizeof(data), true);
|
||||||
|
|
||||||
test_decompress_startswith("LZ4",
|
test_decompress_startswith(OBJECT_COMPRESSED_LZ4,
|
||||||
compress_blob_lz4, decompress_startswith_lz4,
|
compress_blob_lz4, decompress_startswith_lz4,
|
||||||
text, sizeof(text), false);
|
text, sizeof(text), false);
|
||||||
test_decompress_startswith("LZ4",
|
test_decompress_startswith(OBJECT_COMPRESSED_LZ4,
|
||||||
compress_blob_lz4, decompress_startswith_lz4,
|
compress_blob_lz4, decompress_startswith_lz4,
|
||||||
data, sizeof(data), true);
|
data, sizeof(data), true);
|
||||||
test_decompress_startswith("LZ4",
|
test_decompress_startswith(OBJECT_COMPRESSED_LZ4,
|
||||||
compress_blob_lz4, decompress_startswith_lz4,
|
compress_blob_lz4, decompress_startswith_lz4,
|
||||||
huge, HUGE_SIZE, true);
|
huge, HUGE_SIZE, true);
|
||||||
|
|
||||||
test_compress_stream("LZ4", "lz4cat",
|
test_compress_stream(OBJECT_COMPRESSED_LZ4, "lz4cat",
|
||||||
compress_stream_lz4, decompress_stream_lz4, srcfile);
|
compress_stream_lz4, decompress_stream_lz4, srcfile);
|
||||||
|
|
||||||
test_lz4_decompress_partial();
|
test_lz4_decompress_partial();
|
||||||
|
|
||||||
test_decompress_startswith_short("LZ4", compress_blob_lz4, decompress_startswith_lz4);
|
test_decompress_startswith_short(OBJECT_COMPRESSED_LZ4, compress_blob_lz4, decompress_startswith_lz4);
|
||||||
|
|
||||||
#else
|
#else
|
||||||
log_info("/* LZ4 test skipped */");
|
log_info("/* LZ4 test skipped */");
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#if HAVE_ZSTD
|
|
||||||
test_compress_stream("ZSTD", "zstdcat",
|
|
||||||
compress_stream_zstd, decompress_stream_zstd, srcfile);
|
|
||||||
#else
|
|
||||||
log_info("/* ZSTD test skipped */");
|
|
||||||
#endif
|
|
||||||
|
|
||||||
return 0;
|
return 0;
|
||||||
#else
|
#else
|
||||||
log_info("/* XZ, LZ4 and ZSTD tests skipped */");
|
log_info("/* XZ and LZ4 tests skipped */");
|
||||||
return EXIT_TEST_SKIP;
|
return EXIT_TEST_SKIP;
|
||||||
#endif
|
#endif
|
||||||
}
|
}
|
||||||
|
|||||||
@ -329,7 +329,6 @@ libshared_deps = [threads,
|
|||||||
librt,
|
librt,
|
||||||
libseccomp,
|
libseccomp,
|
||||||
libselinux,
|
libselinux,
|
||||||
libzstd,
|
|
||||||
libxz]
|
libxz]
|
||||||
|
|
||||||
libshared_sym_path = '@0@/libshared.sym'.format(meson.current_source_dir())
|
libshared_sym_path = '@0@/libshared.sym'.format(meson.current_source_dir())
|
||||||
|
|||||||
@ -893,14 +893,12 @@ tests += [
|
|||||||
[libjournal_core,
|
[libjournal_core,
|
||||||
libshared],
|
libshared],
|
||||||
[liblz4,
|
[liblz4,
|
||||||
libzstd,
|
|
||||||
libxz]],
|
libxz]],
|
||||||
|
|
||||||
[['src/journal/test-compress-benchmark.c'],
|
[['src/journal/test-compress-benchmark.c'],
|
||||||
[libjournal_core,
|
[libjournal_core,
|
||||||
libshared],
|
libshared],
|
||||||
[liblz4,
|
[liblz4,
|
||||||
libzstd,
|
|
||||||
libxz],
|
libxz],
|
||||||
'', 'timeout=90'],
|
'', 'timeout=90'],
|
||||||
|
|
||||||
|
|||||||
@ -388,7 +388,7 @@ static void test_cg_get_keyed_attribute(void) {
|
|||||||
assert_se(val == NULL);
|
assert_se(val == NULL);
|
||||||
|
|
||||||
assert_se(cg_get_keyed_attribute("cpu", "/init.scope", "cpu.stat", STRV_MAKE("usage_usec"), &val) == 0);
|
assert_se(cg_get_keyed_attribute("cpu", "/init.scope", "cpu.stat", STRV_MAKE("usage_usec"), &val) == 0);
|
||||||
val = mfree(val);
|
free(val);
|
||||||
|
|
||||||
assert_se(cg_get_keyed_attribute_graceful("cpu", "/init.scope", "cpu.stat", STRV_MAKE("usage_usec"), &val) == 1);
|
assert_se(cg_get_keyed_attribute_graceful("cpu", "/init.scope", "cpu.stat", STRV_MAKE("usage_usec"), &val) == 1);
|
||||||
log_info("cpu /init.scope cpu.stat [usage_usec] → \"%s\"", val);
|
log_info("cpu /init.scope cpu.stat [usage_usec] → \"%s\"", val);
|
||||||
|
|||||||
@ -22,9 +22,7 @@ ADDITIONAL_DEPS=(python3-libevdev
|
|||||||
libpwquality-dev
|
libpwquality-dev
|
||||||
libfdisk-dev
|
libfdisk-dev
|
||||||
libp11-kit-dev
|
libp11-kit-dev
|
||||||
libssl-dev
|
libssl-dev)
|
||||||
libzstd-dev
|
|
||||||
zstd)
|
|
||||||
|
|
||||||
function info() {
|
function info() {
|
||||||
echo -e "\033[33;1m$1\033[0m"
|
echo -e "\033[33;1m$1\033[0m"
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user