Skip to content

Commit

Permalink
Merge pull request #322 from aafeijoo-suse/059-upstream-fixes-12
Browse files Browse the repository at this point in the history
Backport upstream fixes to 059
  • Loading branch information
aafeijoo-suse authored Apr 26, 2024
2 parents 4900899 + 0037413 commit 19b7c06
Show file tree
Hide file tree
Showing 16 changed files with 508 additions and 219 deletions.
461 changes: 356 additions & 105 deletions .github/labeler.yml

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion dracut-init.sh
Original file line number Diff line number Diff line change
Expand Up @@ -637,7 +637,7 @@ inst_hook() {
dfatal "No such hook type $1. Aborting initrd creation."
exit 1
fi
hook="/lib/dracut/hooks/${1}/${2}-${3##*/}"
hook="/var/lib/dracut/hooks/${1}/${2}-${3##*/}"
inst_simple "$3" "$hook"
chmod u+x "$initdir/$hook"
}
Expand Down
6 changes: 5 additions & 1 deletion dracut.sh
Original file line number Diff line number Diff line change
Expand Up @@ -1881,7 +1881,11 @@ mkdir -p "${initdir}"/lib/dracut
if [[ $kernel_only != yes ]]; then
mkdir -p "${initdir}/etc/cmdline.d"
mkdir -m 0755 "${initdir}"/lib/dracut/hooks
mkdir -m 0755 -p "${initdir}"/var/lib/dracut/hooks
# symlink to old hooks location for compatibility
ln_r /var/lib/dracut/hooks /lib/dracut/hooks
# shellcheck disable=SC2154
for _d in $hookdirs; do
# shellcheck disable=SC2174
Expand Down
2 changes: 2 additions & 0 deletions modules.d/00systemd/module-setup.sh
Original file line number Diff line number Diff line change
Expand Up @@ -262,6 +262,8 @@ EOF
# Install library file(s)
_arch=${DRACUT_ARCH:-$(uname -m)}
inst_libdir_file \
{"tls/$_arch/",tls/,"$_arch/",}"libgcrypt.so*" \
{"tls/$_arch/",tls/,"$_arch/",}"libkmod.so*" \
{"tls/$_arch/",tls/,"$_arch/",}"libnss_*"

}
7 changes: 7 additions & 0 deletions modules.d/01systemd-coredump/module-setup.sh
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,13 @@ install() {
"$sysusers"/systemd-coredump.conf \
coredumpctl

# Install library file(s)
_arch=${DRACUT_ARCH:-$(uname -m)}
inst_libdir_file \
{"tls/$_arch/",tls/,"$_arch/",}"liblz4.so.*" \
{"tls/$_arch/",tls/,"$_arch/",}"liblzma.so.*" \
{"tls/$_arch/",tls/,"$_arch/",}"libzstd.so.*"

# Install the hosts local user configurations if enabled.
if [[ $hostonly ]]; then
inst_multiple -H -o \
Expand Down
5 changes: 3 additions & 2 deletions modules.d/01systemd-journald/module-setup.sh
Original file line number Diff line number Diff line change
Expand Up @@ -53,9 +53,10 @@ install() {
# Install library file(s)
_arch=${DRACUT_ARCH:-$(uname -m)}
inst_libdir_file \
{"tls/$_arch/",tls/,"$_arch/",}"libgcrypt.so*" \
{"tls/$_arch/",tls/,"$_arch/",}"liblz4.so.*" \
{"tls/$_arch/",tls/,"$_arch/",}"libzstd.so.*" \
{"tls/$_arch/",tls/,"$_arch/",}"liblzma.so.*"
{"tls/$_arch/",tls/,"$_arch/",}"liblzma.so.*" \
{"tls/$_arch/",tls/,"$_arch/",}"libzstd.so.*"

# Install the hosts local user configurations if enabled.
if [[ $hostonly ]]; then
Expand Down
1 change: 0 additions & 1 deletion modules.d/35connman/cm-lib.sh
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,6 @@ type getcmdline > /dev/null 2>&1 || . /lib/dracut-lib.sh

cm_generate_connections() {
if getargbool 0 rd.neednet; then
mkdir -p "$hookdir"/initqueue/finished
echo '[ -f /tmp/cm.done ]' > "$hookdir"/initqueue/finished/cm.sh
mkdir -p /run/connman/initrd
: > /run/connman/initrd/neednet # activate ConnMan services
Expand Down
1 change: 0 additions & 1 deletion modules.d/35network-manager/nm-lib.sh
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,6 @@ nm_generate_connections() {
/etc/NetworkManager/system-connections/* \
/etc/sysconfig/network-scripts/ifcfg-*; do
[ -f "$i" ] || continue
mkdir -p "$hookdir"/initqueue/finished
echo '[ -f /tmp/nm.done ]' > "$hookdir"/initqueue/finished/nm.sh
mkdir -p /run/NetworkManager/initrd
: > /run/NetworkManager/initrd/neednet # activate NM services
Expand Down
2 changes: 2 additions & 0 deletions modules.d/91tpm2-tss/module-setup.sh
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,8 @@ install() {
"$sysusers"/system-user-tss.conf \
"$tmpfilesdir"/tpm2-tss-fapi*.conf \
"$udevrulesdir"/90-tpm.rules \
"$systemdutildir"/system-generators/systemd-tpm2-generator \
"$systemdsystemunitdir/tpm2.target" \
tpm2_pcrread tpm2_pcrextend tpm2_createprimary tpm2_createpolicy \
tpm2_create tpm2_load tpm2_unseal tpm2

Expand Down
2 changes: 1 addition & 1 deletion modules.d/99base/dracut-lib.sh
Original file line number Diff line number Diff line change
Expand Up @@ -1131,7 +1131,7 @@ show_memstats() {
}

remove_hostonly_files() {
rm -fr /etc/cmdline /etc/cmdline.d/*.conf "$hookdir/initqueue/finished"
rm -fr /etc/cmdline /etc/cmdline.d/*.conf "$hookdir"/initqueue/finished/*.sh
if [ -f /lib/dracut/hostonly-files ]; then
while read -r line || [ -n "$line" ]; do
[ -e "$line" ] || [ -h "$line" ] || continue
Expand Down
5 changes: 4 additions & 1 deletion modules.d/99base/module-setup.sh
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,10 @@ install() {

[ -e "${initdir}/lib" ] || mkdir -m 0755 -p "${initdir}"/lib
mkdir -m 0755 -p "${initdir}"/lib/dracut
mkdir -m 0755 -p "${initdir}"/lib/dracut/hooks
mkdir -m 0755 -p "${initdir}"/var/lib/dracut/hooks

# symlink to old hooks location for compatibility
ln_r /var/lib/dracut/hooks /lib/dracut/hooks

mkdir -p "${initdir}"/tmp

Expand Down
8 changes: 5 additions & 3 deletions modules.d/99shutdown/module-setup.sh
Original file line number Diff line number Diff line change
Expand Up @@ -17,9 +17,11 @@ install() {
inst_multiple umount poweroff reboot halt losetup stat sleep timeout
inst_multiple -o kexec
inst "$moddir/shutdown.sh" "$prefix/shutdown"
[ -e "${initdir}/lib" ] || mkdir -m 0755 -p "${initdir}"/lib
mkdir -m 0755 -p "${initdir}"/lib/dracut
mkdir -m 0755 -p "${initdir}"/lib/dracut/hooks
mkdir -m 0755 -p "${initdir}"/var/lib/dracut/hooks

# symlink to old hooks location for compatibility
ln_r /var/lib/dracut/hooks /lib/dracut/hooks

for _d in $hookdirs shutdown shutdown-emergency; do
mkdir -m 0755 -p "${initdir}"/lib/dracut/hooks/"$_d"
done
Expand Down
Loading

0 comments on commit 19b7c06

Please sign in to comment.