File systemd-repart-dracut-1+git20241008.deebae3.obscpio of Package systemd-repart-dracut
07070100000000000081A4000000000000000000000001670501D300000429000000000000000000000000000000000000003400000000systemd-repart-dracut-1+git20241008.deebae3/LICENSEMIT License
Copyright (c) 2024 SUSE LLC
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.
07070100000001000081A4000000000000000000000001670501D300000163000000000000000000000000000000000000003600000000systemd-repart-dracut-1+git20241008.deebae3/README.mdsystemd-repart-dracut is a dracut service module which reparts the disk while booting the system (initrd).
Despite of systemd-repart service systemd-repart-dracut service will be called before starting the encryption.
The format of the definition files are the same as systemd-repart:
https://www.freedesktop.org/software/systemd/man/latest/repart.d.html07070100000002000081ED000000000000000000000001670501D300000206000000000000000000000000000000000000003C00000000systemd-repart-dracut-1+git20241008.deebae3/module-setup.sh#!/bin/bash
# called by dracut
check() {
return 0
}
# called by dracut
depends() {
echo systemd-repart
return 0
}
# called by dracut
install() {
inst_multiple mountpoint findmnt readlink
inst_script "$moddir"/systemd-repart-dracut /usr/bin/systemd-repart-dracut
for service in "systemd-repart-dracut.service"; do
inst_simple "${moddir}/$service" "${systemdsystemunitdir}/$service"
$SYSTEMCTL -q --root "$initdir" enable "$service"
#$SYSTEMCTL -q --root "$initdir" enable "debug-shell.service"
done
}
07070100000003000081ED000000000000000000000001670501D300000394000000000000000000000000000000000000004200000000systemd-repart-dracut-1+git20241008.deebae3/systemd-repart-dracut#!/bin/bash
# SPDX-License-Identifier: MIT
# SPDX-FileCopyrightText: Copyright 2024 SUSE LLC
set -e
shopt -s nullglob
unset "${!LC_@}"
LANG="C.utf8"
export LANG
blkdev=
blkpart=
mp=
log_info()
{
echo "$@"
}
err()
{
echo "Error: $*" >&2
echo "Error: $*"
exit 1
}
####### main #######
[ -e /etc/initrd-release ] || err "No initrd environment"
mp="/sysroot"
mountpoint -q "${mp}" || err "${mp} is not a valid mountpoint"
blkpart="$(findmnt -nvo SOURCE "$mp")"
[ -L "/sys/class/block/${blkpart##*/}" ] || err "$blkpart is not a partition"
blkdev="$(readlink -f "/sys/class/block/${blkpart##*/}")"
blkdev="${blkdev%/*}"
blkdev="/dev/${blkdev##*/}"
if [ -d "/etc/repart.d" ]; then
log_info "Reparting with systemd-repart: ${blkdev}"
/usr/bin/systemd-repart --definitions="/etc/repart.d" --dry-run=no ${blkdev}
else
log_info "No systemd-repart configuration files found"
fi
log_info "Repartition completed"
07070100000004000081A4000000000000000000000001670501D300000245000000000000000000000000000000000000004A00000000systemd-repart-dracut-1+git20241008.deebae3/systemd-repart-dracut.service[Unit]
Description=Resize disks with systemd-repart
DefaultDependencies=false
After=combustion.service
# After ignition completed its stuff
After=ignition-complete.target
Before=disk-encryption-tool-dracut.service
Conflicts=initrd-switch-root.target umount.target
Conflicts=dracut-emergency.service emergency.service emergency.target
# Without this it goes into an endless loop on failure
OnFailure=emergency.target
OnFailureJobMode=isolate
[Service]
Type=oneshot
ExecStart=/usr/bin/systemd-repart-dracut
StandardOutput=journal+console
[Install]
RequiredBy=firstboot.target
07070100000005000081A4000000000000000000000001670501D300000859000000000000000000000000000000000000004700000000systemd-repart-dracut-1+git20241008.deebae3/systemd-repart-dracut.spec#
# spec file for package systemd-repart-dracut
#
# Copyright (c) 2024 SUSE LLC
#
# All modifications and additions to the file contributed by third parties
# remain the property of their copyright owners, unless otherwise agreed
# upon. The license for this file, and modifications and additions to the
# file, is the same license as for the pristine package itself (unless the
# license for the pristine package is not an Open Source License, in which
# case the license is the MIT License). An "Open Source License" is a
# license that conforms to the Open Source Definition (Version 1.9)
# published by the Open Source Initiative.
# Please submit bugfixes or comments via https://bugs.opensuse.org/
#
# icecream 0
%if 0%{?_build_in_place}
%define git_version %(git log '-n1' '--date=format:%Y%m%d' '--no-show-signature' "--pretty=format:+git%cd.%h")
BuildRequires: git-core
%else
# this is required for obs' source validator. It's
# 20-files-present-and-referenced ignores all conditionals. So the
# definition of git_version actually happens always.
%define git_version %{nil}
%endif
Name: systemd-repart-dracut
Version: 1+git20241007.a97aa3c%{git_version}
Release: 0
Summary: systemd-repart service dracut module
License: MIT
URL: https://github.com/schubi2/systemd-repart-dracut
Source: systemd-repart-dracut-%{version}.tar
BuildRequires: systemd-rpm-macros
ExclusiveArch: aarch64 ppc64le riscv64 x86_64
BuildArch: noarch
%{?systemd_requires}
%description
Dracut module which is calling systemd-repart before encryption.
%prep
%setup -q
%build
%install
mkdir -p %buildroot/usr/lib/dracut/modules.d/94systemd-repart-dracut
for i in systemd-repart-dracut{,.service} module-setup.sh; do
cp "$i" %buildroot/usr/lib/dracut/modules.d/94systemd-repart-dracut/"$i"
done
mkdir -p %buildroot/usr/bin
ln -s ../lib/dracut/modules.d/94systemd-repart-dracut/systemd-repart-dracut %buildroot/usr/bin
%files
%license LICENSE
/usr/bin/systemd-repart-dracut
%dir /usr/lib/dracut
%dir /usr/lib/dracut/modules.d
/usr/lib/dracut/modules.d/94systemd-repart-dracut
%changelog
07070100000000000000000000000000000000000000010000000000000000000000000000000000000000000000000000000B00000000TRAILER!!!14 blocks