Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

ramlog: remove obsolete nocache; fixes #6890 #7378

Merged
merged 1 commit into from
Oct 15, 2024
Merged
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
Original file line number Diff line number Diff line change
@@ -1,3 +1,2 @@
gpiod
nocache
firmware-sof-signed
Original file line number Diff line number Diff line change
@@ -1,3 +1,2 @@
gpiod
mtd-utils
nocache
Original file line number Diff line number Diff line change
@@ -1,2 +1 @@
gpiod
nocache
Original file line number Diff line number Diff line change
@@ -1,3 +1,2 @@
gpiod
mtd-utils
nocache
9 changes: 4 additions & 5 deletions packages/bsp/common/usr/lib/armbian/armbian-ramlog
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,6 @@ LOG_OUTPUT="tee -a $LOG2RAM_LOG"

isSafe () {
[ -d $HDD_LOG ] || (echo "ERROR: $HDD_LOG doesn't exist! Can't sync." >&2 ; exit 1)
NoCache=$(command -v nocache 2>/dev/null)
}

RecreateLogs (){
Expand All @@ -48,15 +47,15 @@ syncToDisk () {
echo -e "\n\n$(date): Syncing logs to storage\n" | $LOG_OUTPUT

if [ "$USE_RSYNC" = true ]; then
${NoCache} rsync -aXWv \
rsync -aXWv \
--exclude "lost+found" --exclude armbian-ramlog.log \
--exclude 'journal*' --one-file-system \
--links \
${XTRA_RSYNC_TO[@]+"${XTRA_RSYNC_TO[@]}"} \
$RAM_LOG/ $HDD_LOG/ 2>&1 | $LOG_OUTPUT
else
rm -f $RAM_LOG/journal # linked journal cannot copied onto itself, it will be re-created below
${NoCache} cp -rfup $RAM_LOG -T $HDD_LOG 2>&1 | $LOG_OUTPUT
cp -rfup $RAM_LOG -T $HDD_LOG 2>&1 | $LOG_OUTPUT
fi
if [ ! -L $RAM_LOG/journal ] && [ -d $RAM_LOG/journal ]; then # move persistent journal to disk
systemctl stop systemd-journald # journal folder can be in use
Expand All @@ -83,15 +82,15 @@ syncFromDisk () {
echo -e "\n\n$(date): Loading logs from storage\n" | $LOG_OUTPUT

if [ "$USE_RSYNC" = true ]; then
${NoCache} rsync -aXWv --delete \
rsync -aXWv --delete \
--exclude "lost+found" --exclude armbian-ramlog.log \
--exclude '*.gz' --exclude '*.xz' --exclude='*.[0-9]' \
--links \
--exclude 'journal*' --one-file-system \
${XTRA_RSYNC_FROM[@]+"${XTRA_RSYNC_FROM[@]}"} \
$HDD_LOG/ $RAM_LOG/ 2>&1 | $LOG_OUTPUT
else
${NoCache} find $HDD_LOG/* -maxdepth 1 -type f -not \( -name '*.[0-9]' -or -name '*.xz*' -or -name '*.gz' -or -name 'journal*' \) | xargs cp -ut $RAM_LOG/
find $HDD_LOG/* -maxdepth 1 -type f -not \( -name '*.[0-9]' -or -name '*.xz*' -or -name '*.gz' -or -name 'journal*' \) | xargs cp -ut $RAM_LOG/
fi

if [ ! -L $RAM_LOG/journal ] && [ -d $HDD_LOG/journal ]; then # link persistent journal if applicable
Expand Down