-
Notifications
You must be signed in to change notification settings - Fork 8
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Signed-off-by: Eric Curtin <[email protected]>
- Loading branch information
1 parent
9fff900
commit 9667c68
Showing
9 changed files
with
211 additions
and
25 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -7,9 +7,9 @@ URL: https://github.com/containers/initoverlayfs | |
Source0: %{url}/archive/%{version}/%{name}-%{version}.tar.gz | ||
|
||
BuildRequires: gcc | ||
Recommends: erofs-utils | ||
Recommends: lz4 | ||
Recommends: gzip | ||
Requires: erofs-utils | ||
Requires: dracut | ||
|
||
%global debug_package %{nil} | ||
|
@@ -26,16 +26,24 @@ gcc ${RPM_OPT_FLAGS} storage-init.c -o storage-init | |
|
||
%install | ||
install -D -m755 bin/initoverlayfs-install ${RPM_BUILD_ROOT}/%{_bindir}/initoverlayfs-install | ||
install -D -m755 storage-init ${RPM_BUILD_ROOT}/%{_prefix}/sbin/storage-init | ||
install -D -m755 lib/dracut/modules.d/81initoverlayfs/module-setup.sh $RPM_BUILD_ROOT/%{_prefix}/lib/dracut/modules.d/81initoverlayfs/module-setup.sh | ||
install -D -m755 storage-init ${RPM_BUILD_ROOT}/%{_sbindir}/storage-init | ||
install -D -m755 lib/dracut/modules.d/81initoverlayfs/module-setup.sh ${RPM_BUILD_ROOT}/%{_prefix}/lib/dracut/modules.d/81initoverlayfs/module-setup.sh | ||
install -D -m644 lib/systemd/system/pre-initoverlayfs.target ${RPM_BUILD_ROOT}/%{_prefix}/lib/systemd/system/pre-initoverlayfs.target | ||
install -D -m644 lib/systemd/system/pre-initoverlayfs.service ${RPM_BUILD_ROOT}/%{_prefix}/lib/systemd/system/pre-initoverlayfs.service | ||
install -D -m644 lib/systemd/system/pre-initoverlayfs-switch-root.service ${RPM_BUILD_ROOT}/%{_prefix}/lib/systemd/system/pre-initoverlayfs-switch-root.service | ||
ln -s ../pre-initoverlayfs.service ${RPM_BUILD_ROOT}/%{_prefix}/lib/systemd/system/sysinit.target.wants/pre-initoverlayfs.service ../pre-initoverlayfs.service | ||
ln -s ../pre-initoverlayfs-switch-root.service ${RPM_BUILD_ROOT}/%{_prefix}/lib/systemd/system/sysinit.target.wants/pre-initoverlayfs-switch-root.service ../pre-initoverlayfs-switch-root.service | ||
|
||
%files | ||
%license LICENSE | ||
%doc README.md | ||
%attr(0755,root,root) | ||
%{_bindir}/initoverlayfs-install | ||
%{_prefix}/sbin/storage-init | ||
%{_sbindir}/storage-init | ||
%{_prefix}/lib/dracut/modules.d/81initoverlayfs/ | ||
%{_prefix}/lib/systemd/system/pre-initoverlayfs.target | ||
%{_prefix}/lib/systemd/system/pre-initoverlayfs.service | ||
%{_prefix}/lib/systemd/system/pre-initoverlayfs-switch-root.service | ||
|
||
%changelog | ||
* Thu Dec 14 2023 Stephen Smoogen <[email protected]> - 0.99-1 | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
[Unit] | ||
Description=Switch Root pre-initoverlayfs | ||
AssertPathExists=/etc/initrd-release | ||
DefaultDependencies=no | ||
ConditionPathExists=/etc/initrd-release | ||
AllowIsolate=yes | ||
OnFailure=emergency.target | ||
OnFailureJobMode=replace-irreversibly | ||
Before=sysinit.target pre-initoverlayfs.target | ||
After=systemd-journald.service pre-initoverlayfs.service | ||
|
||
[Service] | ||
Type=oneshot | ||
ExecStart=systemctl --no-block switch-root /initoverlayfs | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
[Unit] | ||
Description=Switch Root pre-initoverlayfs | ||
AssertPathExists=/etc/initrd-release | ||
DefaultDependencies=no | ||
Wants=pre-initoverlayfs-switch-root.service | ||
Before=pre-initoverlayfs-switch-root.service | ||
AllowIsolate=yes | ||
Wants=initrd-udevadm-cleanup-db.service initrd-root-fs.target initrd-fs.target systemd-journald.service initrd-cleanup.service | ||
After=initrd-udevadm-cleanup-db.service initrd-root-fs.target initrd-fs.target emergency.service emergency.target initrd-cleanup.service | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
[Unit] | ||
Description=Pre-Initoverlayfs initialization | ||
AssertPathExists=/etc/initrd-release | ||
DefaultDependencies=no | ||
ConditionPathExists=/etc/initrd-release | ||
OnFailure=emergency.target | ||
OnFailureJobMode=replace-irreversibly | ||
Before=sysinit.target pre-initoverlayfs.target | ||
After=systemd-journald.service | ||
|
||
[Service] | ||
Type=oneshot | ||
ExecStart=/usr/sbin/storage-init | ||
StandardInput=null | ||
StandardOutput=journal+console | ||
StandardError=journal+console | ||
RemainAfterExit=yes | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
[Unit] | ||
Description=Pre-Initoverlayfs Default Target | ||
OnFailure=emergency.target | ||
OnFailureJobMode=replace-irreversibly | ||
AssertPathExists=/etc/initrd-release | ||
Requires=basic.target | ||
#Wants=initrd-root-fs.target initrd-root-device.target initrd-fs.target initrd-usr-fs.target initrd-parse-etc.service | ||
After=pre-initoverlayfs.service rescue.target | ||
AllowIsolate=yes | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
#!/bin/bash | ||
|
||
set -ex | ||
|
||
REL="$(git tag | tail -1)" | ||
mkdir -p $HOME/rpmbuild/SOURCES/ | ||
git archive -o $HOME/rpmbuild/SOURCES/initoverlayfs-$REL.tar.gz --prefix initoverlayfs-$REL/ HEAD | ||
./build-scripts/create-spec.sh | ||
rpmbuild_output=$(rpmbuild -bb initoverlayfs.spec 2>&1) | ||
rpm_to_install=$(echo "$rpmbuild_output" | grep "Wrote:" | awk '{print $2}') | ||
if rpm -Uvh $rpm_to_install; then | ||
echo "$rpmbuild_output" | ||
fi | ||
|
||
initoverlayfs-install | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters