2022-02-18 14:52:14 +03:00
|
|
|
# Copyright 1999-2022 Gentoo Authors
|
2021-06-07 11:14:50 +03:00
|
|
|
# Distributed under the terms of the GNU General Public License v2
|
|
|
|
|
|
|
|
EAPI=7
|
|
|
|
|
|
|
|
CRATES="
|
|
|
|
aho-corasick-0.7.18
|
2022-02-18 14:52:14 +03:00
|
|
|
ansi_term-0.12.1
|
|
|
|
async-trait-0.1.52
|
2021-06-07 11:14:50 +03:00
|
|
|
atty-0.2.14
|
2022-02-18 14:52:14 +03:00
|
|
|
autocfg-1.1.0
|
|
|
|
bindgen-0.58.1
|
|
|
|
bindgen-0.59.2
|
2021-06-07 11:14:50 +03:00
|
|
|
bit-set-0.5.2
|
|
|
|
bit-vec-0.6.3
|
2022-02-18 14:52:14 +03:00
|
|
|
bitflags-1.3.2
|
2021-06-07 11:14:50 +03:00
|
|
|
block-buffer-0.9.0
|
|
|
|
byteorder-1.4.3
|
2022-02-18 14:52:14 +03:00
|
|
|
cc-1.0.72
|
2021-06-07 11:14:50 +03:00
|
|
|
cexpr-0.4.0
|
2022-02-18 14:52:14 +03:00
|
|
|
cexpr-0.6.0
|
2021-06-07 11:14:50 +03:00
|
|
|
cfg-if-0.1.10
|
|
|
|
cfg-if-1.0.0
|
|
|
|
chrono-0.4.19
|
2022-02-18 14:52:14 +03:00
|
|
|
clang-sys-1.3.1
|
|
|
|
clap-2.34.0
|
|
|
|
cpufeatures-0.2.1
|
|
|
|
crc-2.1.0
|
|
|
|
crc-catalog-1.1.1
|
2021-06-07 11:14:50 +03:00
|
|
|
data-encoding-2.3.2
|
2022-02-18 14:52:14 +03:00
|
|
|
dbus-0.9.5
|
|
|
|
dbus-tree-0.9.2
|
|
|
|
devicemapper-sys-0.1.2
|
2021-06-07 11:14:50 +03:00
|
|
|
digest-0.9.0
|
|
|
|
either-1.6.1
|
2022-02-18 14:52:14 +03:00
|
|
|
env_logger-0.8.4
|
|
|
|
env_logger-0.9.0
|
|
|
|
errno-0.2.8
|
|
|
|
errno-dragonfly-0.1.2
|
|
|
|
fastrand-1.7.0
|
2021-06-07 11:14:50 +03:00
|
|
|
fnv-1.0.7
|
2022-02-18 14:52:14 +03:00
|
|
|
futures-0.3.21
|
|
|
|
futures-channel-0.3.21
|
|
|
|
futures-core-0.3.21
|
|
|
|
futures-executor-0.3.21
|
|
|
|
futures-io-0.3.21
|
|
|
|
futures-macro-0.3.21
|
|
|
|
futures-sink-0.3.21
|
|
|
|
futures-task-0.3.21
|
|
|
|
futures-util-0.3.21
|
|
|
|
generic-array-0.14.5
|
|
|
|
getrandom-0.2.4
|
2021-06-07 11:14:50 +03:00
|
|
|
glob-0.3.0
|
2022-02-18 14:52:14 +03:00
|
|
|
hermit-abi-0.1.19
|
2021-06-07 11:14:50 +03:00
|
|
|
humantime-2.1.0
|
2022-02-18 14:52:14 +03:00
|
|
|
instant-0.1.12
|
|
|
|
itertools-0.10.3
|
|
|
|
itoa-1.0.1
|
2021-06-07 11:14:50 +03:00
|
|
|
lazy_static-1.4.0
|
|
|
|
lazycell-1.3.0
|
2022-02-18 14:52:14 +03:00
|
|
|
libblkid-rs-0.1.1
|
|
|
|
libblkid-rs-sys-0.1.3
|
|
|
|
libc-0.2.117
|
|
|
|
libcryptsetup-rs-0.5.0
|
|
|
|
libcryptsetup-rs-sys-0.1.6
|
|
|
|
libdbus-sys-0.2.2
|
|
|
|
libloading-0.7.3
|
2021-06-07 11:14:50 +03:00
|
|
|
libmount-0.1.15
|
|
|
|
libudev-0.2.0
|
|
|
|
libudev-sys-0.1.4
|
|
|
|
log-0.4.14
|
2022-02-18 14:52:14 +03:00
|
|
|
loopdev-0.2.2
|
|
|
|
matches-0.1.9
|
|
|
|
memchr-2.4.1
|
|
|
|
memoffset-0.6.5
|
|
|
|
minimal-lexical-0.2.1
|
|
|
|
mio-0.7.14
|
2021-06-07 11:14:50 +03:00
|
|
|
miow-0.3.7
|
|
|
|
nix-0.14.1
|
2022-02-18 14:52:14 +03:00
|
|
|
nix-0.22.3
|
|
|
|
nix-0.23.1
|
2021-06-07 11:14:50 +03:00
|
|
|
nom-5.1.2
|
2022-02-18 14:52:14 +03:00
|
|
|
nom-7.1.0
|
|
|
|
ntapi-0.3.7
|
2021-06-07 11:14:50 +03:00
|
|
|
num-integer-0.1.44
|
|
|
|
num-traits-0.2.14
|
2022-02-18 14:52:14 +03:00
|
|
|
num_cpus-1.13.1
|
|
|
|
once_cell-1.9.0
|
2021-06-07 11:14:50 +03:00
|
|
|
opaque-debug-0.3.0
|
|
|
|
peeking_take_while-0.1.2
|
2022-02-18 14:52:14 +03:00
|
|
|
pin-project-lite-0.2.8
|
2021-06-07 11:14:50 +03:00
|
|
|
pin-utils-0.1.0
|
2022-02-18 14:52:14 +03:00
|
|
|
pkg-config-0.3.24
|
|
|
|
ppv-lite86-0.2.16
|
2021-06-07 11:14:50 +03:00
|
|
|
pretty-hex-0.2.1
|
2022-02-18 14:52:14 +03:00
|
|
|
proc-macro2-1.0.36
|
2021-06-07 11:14:50 +03:00
|
|
|
proptest-1.0.0
|
|
|
|
quick-error-1.2.3
|
|
|
|
quick-error-2.0.1
|
2022-02-18 14:52:14 +03:00
|
|
|
quote-1.0.15
|
|
|
|
rand-0.8.4
|
|
|
|
rand_chacha-0.3.1
|
|
|
|
rand_core-0.6.3
|
|
|
|
rand_hc-0.3.1
|
2021-06-07 11:14:50 +03:00
|
|
|
rand_xorshift-0.3.0
|
2022-02-18 14:52:14 +03:00
|
|
|
redox_syscall-0.2.10
|
2021-06-07 11:14:50 +03:00
|
|
|
regex-1.5.4
|
|
|
|
regex-syntax-0.6.25
|
|
|
|
remove_dir_all-0.5.3
|
|
|
|
rpassword-5.0.1
|
|
|
|
rustc-hash-1.1.0
|
|
|
|
rusty-fork-0.3.0
|
2022-02-18 14:52:14 +03:00
|
|
|
ryu-1.0.9
|
|
|
|
semver-1.0.5
|
|
|
|
serde-1.0.136
|
|
|
|
serde_derive-1.0.136
|
|
|
|
serde_json-1.0.78
|
|
|
|
sha2-0.9.9
|
|
|
|
shlex-1.1.0
|
2021-06-07 11:14:50 +03:00
|
|
|
signal-hook-registry-1.4.0
|
2022-02-18 14:52:14 +03:00
|
|
|
slab-0.4.5
|
2021-06-07 11:14:50 +03:00
|
|
|
strsim-0.8.0
|
2022-02-18 14:52:14 +03:00
|
|
|
syn-1.0.86
|
|
|
|
tempfile-3.3.0
|
2021-06-07 11:14:50 +03:00
|
|
|
termcolor-1.1.2
|
|
|
|
textwrap-0.11.0
|
2022-02-18 14:52:14 +03:00
|
|
|
tokio-1.16.1
|
|
|
|
tokio-macros-1.7.0
|
|
|
|
typenum-1.15.0
|
|
|
|
unicode-width-0.1.9
|
2021-06-07 11:14:50 +03:00
|
|
|
unicode-xid-0.2.2
|
|
|
|
uuid-0.8.2
|
|
|
|
vec_map-0.8.2
|
2022-02-18 14:52:14 +03:00
|
|
|
version_check-0.9.4
|
2021-06-07 11:14:50 +03:00
|
|
|
void-1.0.2
|
|
|
|
wait-timeout-0.2.0
|
|
|
|
wasi-0.10.2+wasi-snapshot-preview1
|
|
|
|
which-3.1.1
|
2022-02-18 14:52:14 +03:00
|
|
|
which-4.2.4
|
2021-06-07 11:14:50 +03:00
|
|
|
winapi-0.3.9
|
|
|
|
winapi-i686-pc-windows-gnu-0.4.0
|
|
|
|
winapi-util-0.1.5
|
|
|
|
winapi-x86_64-pc-windows-gnu-0.4.0
|
|
|
|
"
|
|
|
|
|
2021-06-12 12:17:17 +03:00
|
|
|
inherit cargo systemd udev
|
2021-06-07 11:14:50 +03:00
|
|
|
|
|
|
|
DESCRIPTION="Daemon that manages block devices to create filesystems"
|
|
|
|
HOMEPAGE="https://stratis-storage.github.io/"
|
|
|
|
SRC_URI="https://github.com/stratis-storage/${PN}/archive/v${PV}.tar.gz -> ${P}.tar.gz
|
|
|
|
$(cargo_crate_uris ${CRATES})"
|
|
|
|
|
|
|
|
LICENSE="MPL-2.0 BSD MIT"
|
|
|
|
SLOT="0"
|
|
|
|
KEYWORDS="~amd64 ~x86"
|
2021-06-19 14:46:53 +03:00
|
|
|
IUSE="elibc_musl extra dracut systemd"
|
2021-06-07 11:14:50 +03:00
|
|
|
|
|
|
|
BDEPEND="
|
|
|
|
>=virtual/rust-1.49.0
|
|
|
|
sys-devel/clang
|
|
|
|
"
|
|
|
|
DEPEND="
|
2021-06-19 12:51:33 +03:00
|
|
|
dracut? (
|
|
|
|
>=sys-kernel/dracut-051
|
|
|
|
sys-boot/plymouth
|
|
|
|
)
|
2021-06-19 14:45:44 +03:00
|
|
|
systemd? ( sys-apps/systemd )
|
2021-06-07 11:14:50 +03:00
|
|
|
app-crypt/clevis
|
|
|
|
sys-apps/dbus
|
|
|
|
virtual/udev
|
|
|
|
dev-libs/libpcre
|
|
|
|
>=sys-fs/cryptsetup-2.3
|
|
|
|
>=sys-apps/util-linux-2.32
|
|
|
|
"
|
|
|
|
RDEPEND="
|
|
|
|
${DEPEND}
|
|
|
|
sys-fs/xfsprogs
|
|
|
|
sys-block/thin-provisioning-tools
|
|
|
|
"
|
|
|
|
|
|
|
|
#QA_FLAGS_IGNORED="/usr/libexec/stratisd "
|
|
|
|
|
2022-02-18 14:52:14 +03:00
|
|
|
RESTRICT="network-sandbox"
|
|
|
|
|
2021-06-12 12:17:17 +03:00
|
|
|
REQUIRED_USE="dracut? ( systemd )"
|
|
|
|
|
2021-06-07 11:14:50 +03:00
|
|
|
PATCHES=(
|
|
|
|
# Until feature will be released. https://github.com/stratis-storage/project/issues/161
|
|
|
|
${FILESDIR}/0001-disable-xfs-uuid-change-after-snapshot-create.patch
|
|
|
|
)
|
|
|
|
|
2021-06-17 17:57:48 +03:00
|
|
|
src_prepare() {
|
|
|
|
sed -i "s@/usr/lib/udev@$(get_udevdir)@g" "${S}"/dracut/90stratis/module-setup.sh
|
2021-06-19 20:00:02 +03:00
|
|
|
sed -i "s@/usr/lib/systemd@$(systemd_get_utildir)@g" "${S}"/src/bin/generators/stratis_clevis_setup_generator.rs
|
|
|
|
sed -i "s@/usr/lib/systemd@$(systemd_get_utildir)@g" "${S}"/src/bin/generators/stratis_setup_generator.rs
|
|
|
|
sed -i "s@/usr/lib/systemd@$(systemd_get_utildir)@g" "${S}"/systemd/stratis-fstab-setup@.service
|
2021-06-17 19:22:02 +03:00
|
|
|
|
2021-06-17 17:57:48 +03:00
|
|
|
default
|
|
|
|
}
|
|
|
|
|
2021-06-07 11:14:50 +03:00
|
|
|
src_compile() {
|
2022-02-18 14:52:14 +03:00
|
|
|
# Disable offline mode for device-mapper library
|
|
|
|
sed -i 's/^offline.*/offline = false/g' ${WORKDIR}/cargo_home/config
|
|
|
|
|
2021-06-07 11:14:50 +03:00
|
|
|
# allow building on musl with dynamic linking support
|
|
|
|
# https://github.com/BurntSushi/rust-pcre2/issues/7
|
|
|
|
use elibc_musl && export PCRE2_SYS_STATIC=0
|
2021-06-19 14:45:44 +03:00
|
|
|
#export RUSTFLAGS="-D warnings -D future-incompatible -D unused -D bare-trait-objects -D ellipsis-inclusive-range-patterns"
|
|
|
|
|
|
|
|
# Compile main daemon
|
|
|
|
cargo_src_compile --bin=stratisd --no-default-features --features dbus_enabled,min
|
|
|
|
|
|
|
|
if use dracut;then
|
|
|
|
# Compile min binaries
|
|
|
|
cargo_src_compile --bin=stratis-min --bin=stratisd-min --bin=stratis-utils --no-default-features --features min,systemd_compat
|
|
|
|
fi
|
|
|
|
|
|
|
|
if use extra;then
|
|
|
|
cargo_src_compile --bin=stratis_dumpmetadata --no-default-features --features extras,min
|
|
|
|
fi
|
2021-06-07 11:14:50 +03:00
|
|
|
}
|
|
|
|
|
|
|
|
src_install() {
|
|
|
|
einstalldocs
|
|
|
|
dodoc -r docs/.
|
|
|
|
|
|
|
|
insinto /etc/dbus-1/system.d
|
|
|
|
doins ${S}/stratisd.conf
|
|
|
|
|
2021-06-12 12:17:17 +03:00
|
|
|
udev_dorules ${S}/udev/61-stratisd.rules
|
|
|
|
|
|
|
|
dosym "$(get_udevdir)"/stratis-str-cmp "$(get_udevdir)"/stratis-base32-decode
|
|
|
|
dosym "$(get_udevdir)"/stratis-str-cmp "${EPREFIX}"/bin/stratis-predict-usage
|
2021-06-07 11:14:50 +03:00
|
|
|
|
2021-08-11 15:05:09 +03:00
|
|
|
exeinto /usr/libexec
|
|
|
|
doexe ${S}/target/release/stratisd
|
2021-06-07 11:14:50 +03:00
|
|
|
|
|
|
|
if use dracut; then
|
2021-08-11 15:05:09 +03:00
|
|
|
doexe ${S}/target/release/stratisd-min
|
|
|
|
|
2021-06-19 14:45:44 +03:00
|
|
|
dobin ${S}/target/release/stratis-min
|
|
|
|
|
2021-08-01 10:58:50 +03:00
|
|
|
exeinto "$(get_udevdir)"
|
|
|
|
newexe ${S}/target/release/stratis-utils stratis-str-cmp
|
|
|
|
|
2021-06-07 11:14:50 +03:00
|
|
|
insinto /usr/lib/dracut/modules.d/
|
|
|
|
doins -r ${S}/dracut/90stratis
|
2021-06-17 17:57:48 +03:00
|
|
|
doins -r ${S}/dracut/90stratis-clevis
|
2021-07-17 10:06:45 +03:00
|
|
|
chmod +x /usr/lib/dracut/modules.d/90stratis/stratis-rootfs-setup
|
2021-06-07 11:14:50 +03:00
|
|
|
|
2021-06-12 12:17:17 +03:00
|
|
|
insinto /usr/lib/dracut/dracut.conf.d
|
2021-06-07 11:14:50 +03:00
|
|
|
doins ${S}/dracut/90-stratis.conf
|
2021-06-12 12:17:17 +03:00
|
|
|
|
|
|
|
dosym "$(get_udevdir)"/stratis-str-cmp "$(systemd_get_systemgeneratordir)"/stratis-clevis-setup-generator
|
|
|
|
dosym "$(get_udevdir)"/stratis-str-cmp "$(systemd_get_systemgeneratordir)"/stratis-setup-generator
|
2021-06-07 11:14:50 +03:00
|
|
|
fi
|
2021-06-12 12:17:17 +03:00
|
|
|
|
2021-06-07 11:14:50 +03:00
|
|
|
if use systemd; then
|
|
|
|
systemd_dounit "${S}/systemd/stratisd.service"
|
|
|
|
systemd_dounit "${S}/systemd/stratis-fstab-setup@.service"
|
2021-06-12 12:17:17 +03:00
|
|
|
|
|
|
|
exeinto "$(systemd_get_utildir)"
|
|
|
|
doexe "${S}/systemd/stratis-fstab-setup"
|
|
|
|
else
|
|
|
|
newinitd "${FILESDIR}/init.d.stratisd-r3" stratisd
|
2021-06-07 11:14:50 +03:00
|
|
|
fi
|
2021-08-11 15:05:09 +03:00
|
|
|
|
|
|
|
if use extra; then
|
|
|
|
dobin ${S}/target/release/stratis_dumpmetadata
|
|
|
|
fi
|
2021-06-12 12:17:17 +03:00
|
|
|
}
|
2021-06-07 11:14:50 +03:00
|
|
|
|
2021-06-12 12:17:17 +03:00
|
|
|
pkg_postinst() {
|
|
|
|
udev_reload
|
2021-06-07 11:14:50 +03:00
|
|
|
}
|