Pakfire: call "sync" in function.sh after having extracted archives

After upgrading to Core Update 157, a few number of users reported their
systems to be unworkable after a reboot. Most of them (the systems, not
the users) were apparently missing the new Linux kernel in their Grub
configuration, causing a non-functional bootloader written to disk.

While we seem to be able to rule out issues related to poor storage
(SDDs, flash cards, etc.) or very high I/O load, it occurred to me we
are not calling "sync" after having extracted a Core Update's .tar.gz
file.

This patch therefore proposes to do so. It is a somewhat homeopathic
approach, though, but might ensure all parts of the system to have
properly processed the contents of an extracted archive. While we cannot
even reasonably guess it will solve the problem(s) mentioned initially,
doing so cannot hurt either.

See also:
https://community.ipfire.org/t/after-update-ipfire-to-157-no-boot/5641/45

Signed-off-by: Peter Müller <peter.mueller@ipfire.org>
Signed-off-by: Michael Tremer <michael.tremer@ipfire.org>
This commit is contained in:
Peter Müller
2021-07-07 19:27:14 +02:00
committed by Michael Tremer
parent a26986a3b0
commit d0ba077ed3

View File

@@ -2,7 +2,7 @@
###############################################################################
# #
# IPFire.org - A linux based firewall #
# Copyright (C) 2007-2012 IPFire Team <info@ipfire.org> #
# Copyright (C) 2007-2021 IPFire Team <info@ipfire.org> #
# #
# This program is free software: you can redistribute it and/or modify #
# it under the terms of the GNU General Public License as published by #
@@ -35,6 +35,7 @@ TAR_OPTIONS=(
extract_files() {
echo "Extracting files..."
tar -xavf /opt/pakfire/tmp/files* "${TAR_OPTIONS[@]}" -C /
sync
echo "...Finished."
}
@@ -42,6 +43,7 @@ extract_backup_includes() {
echo "Extracting backup includes..."
tar xavf /opt/pakfire/tmp/files* "${TAR_OPTIONS[@]}" -C / \
var/ipfire/backup/addons/includes
sync
echo "...Finished."
}