Skip to content

Commit

Permalink
Switch to custom script
Browse files Browse the repository at this point in the history
  • Loading branch information
nothingneko committed May 21, 2024
1 parent 715fa35 commit 408e0c8
Show file tree
Hide file tree
Showing 4 changed files with 29 additions and 10 deletions.
3 changes: 0 additions & 3 deletions ultramarine/ultramarine-raw-filesystem/50-root.conf

This file was deleted.

11 changes: 11 additions & 0 deletions ultramarine/ultramarine-raw-filesystem/grow-root.service
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
[Unit]
Description= Expand rootfs
After=multi-user.target

[Service]
Type=oneshot
ExecStart=/sbin/grow-root.sh
RemainAfterExit=true

[Install]
WantedBy=multi-user.target
8 changes: 8 additions & 0 deletions ultramarine/ultramarine-raw-filesystem/grow-root.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
#!/bin/bash

echo "Resize Root Partition"
root_device=$(lsblk -no UUID,MOUNTPOINT | grep " /$" | awk '{print $1}')
growpart $root_device
resize2fs $root_device
echo "Resized Root Partition"
fi
Original file line number Diff line number Diff line change
@@ -1,9 +1,10 @@
Name: ultramarine-raw-filesystem
Version: 1.0
Release: 1%{?dist}
Summary: systemd-repart config to automatically extend the root filesystem on raw images
Release: 2%{?dist}
Summary: Automatically extend the root filesystem on raw images
URL: ultramarine-linux.org
Source0: 50-root.conf
Source0: grow-root.service
Source1: grow-root.sh
License: MIT
BuildArch: noarch

Expand All @@ -15,13 +16,15 @@ BuildArch: noarch
%build

%install
mkdir -p %{buildroot}/usr/lib/repart.d
cp -v %{SOURCE0} %{buildroot}/usr/lib/repart.d

cp -v %{SOURCE0} %{buildroot}/etc/systemd/system
cp -v %{SOURCE1} %{buildroot}/sbin

%files
/usr/lib/repart.d/*
/etc/systemd/system/grow-root.service
/sbin/grow-root.sh

%changelog
* Tue May 21 2024 Jaiden Riordan <[email protected]>
- Switch to custom script
* Mon May 20 2024 Jaiden Riordan <[email protected]>
- Initial commit

0 comments on commit 408e0c8

Please sign in to comment.