consmirror.c: the BSD notice is replaced (Makronix's own file). Files with changes of other sessions pending are left for their commit. Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
17 lines
887 B
Bash
17 lines
887 B
Bash
# License: CNCL 1.0 (Could Not Care Less), see LICENSE at the top of the tree.
|
|
# One line about the root layout (base/initramfs/init, docs/NEXT.md task B):
|
|
# which layout the initramfs set up, where / comes from, whether /data and the
|
|
# /etc overlay are in place, the version of /system/current
|
|
# (/etc/makronix-release) and how many files
|
|
# the overlay's upper directory holds. Plain sh, one line, meant for
|
|
# tools/boot-loop.sh.
|
|
|
|
lay=$(dmesg | sed -n 's/.*makronix-rd: layout: //p' | head -n 1)
|
|
src=$(awk '$2 == "/" { print $1 }' /proc/mounts)
|
|
[ -d /data/home ] && data=1 || data=0
|
|
awk '$2 == "/etc" && $3 == "overlay" { found = 1 } END { exit !found }' /proc/mounts &&
|
|
ovl=1 || ovl=0
|
|
ver=$(tr ' ' '_' < /etc/makronix-release 2>/dev/null)
|
|
up=$(ls -A /data/etc/upper 2>/dev/null | wc -l)
|
|
echo "layout=${lay:-none} root=$src data=$data etc_overlay=$ovl version=${ver:-none} upper=$up"
|