274 lines
6.0 KiB
Bash
274 lines
6.0 KiB
Bash
# Copyright 1999-2021 Gentoo Authors
|
|
# Distributed under the terms of the GNU General Public License v2
|
|
|
|
EAPI=7
|
|
|
|
CRATES="
|
|
addr2line-0.15.1
|
|
adler-1.0.2
|
|
aho-corasick-0.7.18
|
|
ansi_term-0.11.0
|
|
atty-0.2.14
|
|
autocfg-1.0.1
|
|
backtrace-0.3.59
|
|
bindgen-0.57.0
|
|
bit-set-0.5.2
|
|
bit-vec-0.6.3
|
|
bitflags-1.2.1
|
|
block-buffer-0.9.0
|
|
build_const-0.2.2
|
|
byteorder-1.4.3
|
|
cc-1.0.68
|
|
cexpr-0.4.0
|
|
cfg-if-0.1.10
|
|
cfg-if-1.0.0
|
|
chrono-0.4.19
|
|
clang-sys-1.2.0
|
|
clap-2.33.3
|
|
cpufeatures-0.1.4
|
|
crc-1.8.1
|
|
data-encoding-2.3.2
|
|
dbus-0.9.2
|
|
dbus-tree-0.9.1
|
|
devicemapper-0.29.1
|
|
digest-0.9.0
|
|
either-1.6.1
|
|
env_logger-0.8.3
|
|
errno-0.2.7
|
|
errno-dragonfly-0.1.1
|
|
error-chain-0.12.4
|
|
fnv-1.0.7
|
|
futures-0.3.15
|
|
futures-channel-0.3.15
|
|
futures-core-0.3.15
|
|
futures-executor-0.3.15
|
|
futures-io-0.3.15
|
|
futures-macro-0.3.15
|
|
futures-sink-0.3.15
|
|
futures-task-0.3.15
|
|
futures-util-0.3.15
|
|
gcc-0.3.55
|
|
generic-array-0.14.4
|
|
getrandom-0.2.3
|
|
gimli-0.24.0
|
|
glob-0.3.0
|
|
hermit-abi-0.1.18
|
|
humantime-2.1.0
|
|
itertools-0.10.0
|
|
itoa-0.4.7
|
|
lazy_static-1.4.0
|
|
lazycell-1.3.0
|
|
libc-0.2.95
|
|
libcryptsetup-rs-0.4.4
|
|
libcryptsetup-rs-sys-0.1.5
|
|
libdbus-sys-0.2.1
|
|
libloading-0.7.0
|
|
libmount-0.1.15
|
|
libudev-0.2.0
|
|
libudev-sys-0.1.4
|
|
log-0.4.14
|
|
loopdev-0.2.1
|
|
matches-0.1.8
|
|
memchr-2.4.0
|
|
miniz_oxide-0.4.4
|
|
mio-0.7.11
|
|
miow-0.3.7
|
|
nix-0.14.1
|
|
nix-0.20.0
|
|
nom-5.1.2
|
|
ntapi-0.3.6
|
|
num-integer-0.1.44
|
|
num-traits-0.2.14
|
|
num_cpus-1.13.0
|
|
object-0.24.0
|
|
once_cell-1.7.2
|
|
opaque-debug-0.3.0
|
|
peeking_take_while-0.1.2
|
|
pest-2.1.3
|
|
pin-project-lite-0.2.6
|
|
pin-utils-0.1.0
|
|
pkg-config-0.3.19
|
|
ppv-lite86-0.2.10
|
|
pretty-hex-0.2.1
|
|
proc-macro-hack-0.5.19
|
|
proc-macro-nested-0.1.7
|
|
proc-macro2-1.0.27
|
|
proptest-1.0.0
|
|
quick-error-1.2.3
|
|
quick-error-2.0.1
|
|
quote-1.0.9
|
|
rand-0.8.3
|
|
rand_chacha-0.3.0
|
|
rand_core-0.6.2
|
|
rand_hc-0.3.0
|
|
rand_xorshift-0.3.0
|
|
redox_syscall-0.2.8
|
|
regex-1.5.4
|
|
regex-syntax-0.6.25
|
|
remove_dir_all-0.5.3
|
|
rpassword-5.0.1
|
|
rustc-demangle-0.1.19
|
|
rustc-hash-1.1.0
|
|
rusty-fork-0.3.0
|
|
ryu-1.0.5
|
|
semver-0.11.0
|
|
semver-parser-0.10.2
|
|
serde-1.0.126
|
|
serde_derive-1.0.126
|
|
serde_json-1.0.64
|
|
sha-1-0.9.6
|
|
shlex-0.1.1
|
|
signal-hook-registry-1.4.0
|
|
slab-0.4.3
|
|
strsim-0.8.0
|
|
syn-1.0.72
|
|
tempfile-3.2.0
|
|
termcolor-1.1.2
|
|
textwrap-0.11.0
|
|
time-0.1.43
|
|
tokio-1.6.1
|
|
tokio-macros-1.2.0
|
|
typenum-1.13.0
|
|
ucd-trie-0.1.3
|
|
unicode-width-0.1.8
|
|
unicode-xid-0.2.2
|
|
uuid-0.8.2
|
|
vec_map-0.8.2
|
|
version_check-0.9.3
|
|
void-1.0.2
|
|
wait-timeout-0.2.0
|
|
wasi-0.10.2+wasi-snapshot-preview1
|
|
which-3.1.1
|
|
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
|
|
"
|
|
|
|
inherit cargo systemd udev
|
|
|
|
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"
|
|
IUSE="elibc_musl extra dracut systemd"
|
|
|
|
BDEPEND="
|
|
>=virtual/rust-1.49.0
|
|
sys-devel/clang
|
|
"
|
|
DEPEND="
|
|
dracut? (
|
|
>=sys-kernel/dracut-051
|
|
sys-boot/plymouth
|
|
)
|
|
systemd? ( sys-apps/systemd )
|
|
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 "
|
|
|
|
REQUIRED_USE="dracut? ( systemd )"
|
|
|
|
PATCHES=(
|
|
# Until feature will be released. https://github.com/stratis-storage/project/issues/161
|
|
${FILESDIR}/0001-disable-xfs-uuid-change-after-snapshot-create.patch
|
|
# Until issue will be fixed. https://github.com/stratis-storage/stratisd/issues/1470 https://github.com/stratis-storage/stratisd/issues/1780
|
|
${FILESDIR}/0002-duplicate_check-disable.patch
|
|
)
|
|
|
|
src_prepare() {
|
|
sed -i "s@/usr/lib/udev@$(get_udevdir)@g" "${S}"/dracut/90stratis/module-setup.sh
|
|
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
|
|
|
|
default
|
|
}
|
|
|
|
src_compile() {
|
|
# allow building on musl with dynamic linking support
|
|
# https://github.com/BurntSushi/rust-pcre2/issues/7
|
|
use elibc_musl && export PCRE2_SYS_STATIC=0
|
|
#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
|
|
}
|
|
|
|
src_install() {
|
|
einstalldocs
|
|
dodoc -r docs/.
|
|
|
|
insinto /etc/dbus-1/system.d
|
|
doins ${S}/stratisd.conf
|
|
|
|
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
|
|
|
|
|
|
if use extra; then
|
|
dobin ${S}/target/release/stratis_dumpmetadata
|
|
fi
|
|
|
|
if use dracut; then
|
|
dobin ${S}/target/release/stratis-min
|
|
|
|
exeinto "$(get_udevdir)"
|
|
newexe ${S}/target/release/stratis-utils stratis-str-cmp
|
|
|
|
exeinto /usr/libexec
|
|
doexe ${S}/target/release/stratisd ${S}/target/release/stratisd-min
|
|
|
|
insinto /usr/lib/dracut/modules.d/
|
|
doins -r ${S}/dracut/90stratis
|
|
doins -r ${S}/dracut/90stratis-clevis
|
|
chmod +x /usr/lib/dracut/modules.d/90stratis/stratis-rootfs-setup
|
|
|
|
insinto /usr/lib/dracut/dracut.conf.d
|
|
doins ${S}/dracut/90-stratis.conf
|
|
|
|
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
|
|
fi
|
|
|
|
if use systemd; then
|
|
systemd_dounit "${S}/systemd/stratisd.service"
|
|
systemd_dounit "${S}/systemd/stratis-fstab-setup@.service"
|
|
|
|
exeinto "$(systemd_get_utildir)"
|
|
doexe "${S}/systemd/stratis-fstab-setup"
|
|
else
|
|
newinitd "${FILESDIR}/init.d.stratisd-r3" stratisd
|
|
fi
|
|
}
|
|
|
|
pkg_postinst() {
|
|
udev_reload
|
|
}
|