Benign linux Download

sysupgrade

Hidden path prefix in /tmpNested shell loops over value lists

Evidence

Temp or Tmp path segment lines 1–13
1#!/bin/sh
2# OpenIPC.org | 2025
3scr_version=1.0.85
4
5args="$@"
6LOCK_FILE=/tmp/sysupgrade.lock
7# Cross-repo contract with majestic. While this exists, majestic is in charge of
8# putting itself back after a failed upgrade and must not be restarted from
9# underneath -- see restore_resources. Written by its enter_upgrade_mode and
10# removed by leave_upgrade_mode; the other side is src/main.c in majestic.
11MAJESTIC_OWNER=/tmp/majestic-upgrade-owner
12# Where the flash phase is moved to before it starts writing. Deliberately not
13# under /tmp: /t …
References /proc/mounts path lines 13–18
13:64… cated under
14# itself. See enter_ramfs.
15RAM_ROOT=${RAM_ROOT:-/ram}
16# Absolute, always. Two things downstream assume it: /proc/mounts records mount
17# points absolutely, so the "is this tmpfs ours" check would never match a
18# relative path; and the second phase …
Shell stderr discard command text lines 30–33
30:59… s running there for a
31# few more commands. A shell redirection CREATES its target, so a plain
32# `2>/dev/null` in that window discards nothing — it writes a regular file named
33# `null` into the old root's now-empty /dev. That root is a …
Hidden /tmp entry path reference lines 53–61
53:58… ame one set_progress
54# smuggles its status through.
55WDOG_RELEASE=/tmp/.sysupgrade-wdog-release
56# Where UBI publishes its devices and volumes, and the inittab PID 1 parsed at
57# boot. Overridable so the test harness can point both at its sandbox.
58UBI_SYS=${UBI_SYS:-/sys/class/ubi}
59INITTAB=${INITTAB:-/etc/inittab}
60# Where MTD publishes its partitions, and the block devices the split NOR
61# layout …
Access raw flash memory (MTD) lines 64–70
64:55… de where the image goes.
65nor_split_layout=
66MTDBLOCK=${MTDBLOCK:-/dev/mtdblock}
67MTDCHR=${MTDCHR:-/dev/mtd}
68# Where a handed-off flash phase writes its log, and the port that serves it.
69# The hand-off kills dropbear and majestic with everything else, so this is the
70# only way to watch a NAND flash without a se …

Keyboard shortcuts on this page: j for the next sample, k for the previous one, x to go back to the feed, d to download the original bytes, r to re-queue the sample for analysis.