Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -73,7 +73,7 @@ Driver support depends on the device you are using shimboot on. The `patch_rootf

<sup>1. The kernel is too old.</sup><br>
<sup>2. 5ghz wifi networks do not work, but 2.4ghz networks do.</sup><br>
<sup>3. You may need to compile the wifi driver from source. See issue #69.</sup><br>
<sup>3. You may need to compile the wifi driver from source. See [#69](https://github.com/ading2210/shimboot/issues/69) and [#317](https://github.com/ading2210/shimboot/issues/317).</sup><br>
<sup>4. X11 and LightDM might have some graphical issues.</sup><br>
<sup>5. You need to use Wayland instead of X11.</sup>

Expand Down
31 changes: 31 additions & 0 deletions rootfs/usr/local/bin/expand_rootfs
Original file line number Diff line number Diff line change
Expand Up @@ -47,6 +47,37 @@ if [ "$luks" ]; then
fi
resize2fs "$root_dev" || true

mountcount=$(dumpe2fs "$root_dev" 2>/dev/null | awk -F': *' '/Maximum mount count/ { print $2 }') || true

echo "Setting flags to run filesystem check on next boot..."
tune2fs -c 1 "$root_dev" || true

if [ ! "$(pidof systemd)" ]; then
echo -e "Please run sudo tune2fs -c ${mountcount} ${root_dev} on the next boot."
else
cat <<EOF > "/lib/systemd/system/filesystem-check.service"
[Unit]
Description=Disable filesystem check

[Service]
Type=simple
Restart=always
RestartSec=1
ExecStart=/usr/local/bin/fscheck

[Install]
WantedBy=multi-user.target
EOF
cat <<EOF > "/usr/local/bin/fscheck"
#!/bin/bash
tune2fs -c "$mountcount" "$root_dev"
systemctl disable filesystem-check
rm /usr/local/bin/fscheck
EOF
chmod +x /usr/local/bin/fscheck || true
systemctl enable filesystem-check || true
fi

echo
echo "After:"
df -h /
Expand Down