Commit Graph
25 Commits
Author SHA1 Message Date
Abdurrahman Kaan DikeçandClaude Opus 5.5 209c2bfadd Imported Android files: readable by the vendor daemons whoever unpacked them, root's, nothing world-writable (#127, #170)
install.sh run from a folder on FAT or exFAT under macOS stored every imported file and directory as 0700
root:root (the file system keeps no modes, macOS reports 0700, tools/vendor-overlay.py took what it was told).
modem_control and refnotify run as uid 1000 or mu300vnd and keep no capability that reads past a mode: the
property area unreadable ends at "can't get modem type!", vendor/etc unreadable at "can't get modem img!" - the
CP is never loaded, the AT ttys answer ENODEV. Reproduced on the F50-B on 7.2.10 and on 5.4.254 (the kernel makes
no difference), on Ubuntu and on openwrt-luci.

- android-vendor-start: before anything is started, the five imported trees are checked with one find and set
  right where they are not: root's, directories 0755 (0711 left), programs 0755, the property files 0444, other
  files 0644. One line says what was found, in the service's log and in the kernel's; marks in the boot
  timeline. An update carries these files over as they are, so this is what repairs an installed system.
- tools/vendor-overlay.py: the mode of an entry comes from where it goes, never from the host's file system.
- The Magisk installer and android-install.sh run under umask 022 (magisk --install-module gives 000: sixteen
  directories 0777 and ld.config.txt 0666 in a system the v2026.10.22 zip installed), and the overlay is packed
  as root's (bionic was stored as Android's system, uid 1000: the first login account of the installed system).
- android-vendor-start makes /var/log before it starts logdw: on OpenWrt it can run before the boot script that
  creates it, and then there was no vendor log at all - on three of four boots of the F50-B.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01VVN2zDgf76kMDVSuWhHPUE
2026-10-12 18:13:40 +03:00
Abdurrahman Kaan DikeçandClaude Fable 5.1 2f2c8e3bc3 Merge origin/main into installer-io-guards (FINDINGS: this section becomes 50)
Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01VVN2zDgf76kMDVSuWhHPUE
2026-10-12 15:55:02 +03:00
Abdurrahman Kaan DikeçandClaude Fable 5.1 1e129cd9f9 installers: boot image read back from the medium, bounded SD-card stages, no re-run in the same boot (FINDINGS 48)
Three guards taken from kanoqwq's TF installer, in our shape (one android-install.sh,
no slot layout):

1. Every install reads the written boot image back from the partition with the page
   cache dropped - exactly its length in whole 4096-byte blocks, one dd into a file
   whose status counts - and compares the sha256; a difference never arms Linux. The
   Magisk installer's boot_readback (after write_boot's own check, the AVB footer
   too) says which step failed; install.sh/install.ps1 keep their message.
2. In SD mode android-install.sh runs the format, each unpack, the removal of the old
   system and a final flush through stage_run: the command in a session of its own
   (setsid), polled, never waited for; ended at its limit or after 120 s without
   movement of the card's completion counters (/sys/class/block/DISK/stat). On a
   timeout the group gets TERM/KILL, nothing more is written (no sync, no unmount),
   the user is told to reboot Android, and the OK line never comes.
3. The timeout leaves mu300-install.stalled (boot_id, stage, reason) in the lock dir
   (/data/local/tmp; /data/adb for the zip). Both the device script and the Magisk
   installer refuse a run in the same Android boot, remove a stale lock, and a clean
   run leaves none. The zip keeps the device log in /data/adb on failure;
   install.ps1 now writes work/device-install.log like install.sh.

Tests: test_android_install.Stages, test_magisk_installer.Install (a dd stub whose
read-back differs or fails; the lock; the lock dir; the kept log); fakedevice gets a
boot id. tr/zh lines for the three new messages. FINDINGS 48 with the device checks.

Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01VVN2zDgf76kMDVSuWhHPUE
2026-10-12 14:46:32 +03:00
Abdurrahman Kaan DikeçandClaude Fable 5.1 43a09bb9e2 magisk installer: fixed default passwords - ubuntu/ubuntu, OpenWrt root without one (#167)
A system the Magisk zip installed next to one already on the disk got a random
12-character password (build_password, KEEP_PW=0 without MU300_PASSWORD) that was
written only to /data/adb/mu300-linux-password.txt, root-only and replaced by every
later zip, so the user never saw it and the device offered a system nobody could log
in to (F50-B: Ubuntu first, openwrt-luci and openwrt added later). The one-boot
image's root::: was never the cause: the installer always replaced it.

Decision: a system the zip installs gets the images' well-known password - Ubuntu's
user ubuntu has the password ubuntu, OpenWrt's root has none (the empty field stock
OpenWrt ships with; dropbear and LuCI let root in until one is set with passwd or in
LuCI). No random password any more, for a first install or an added system. A trusted
MU300_PASSWORD still wins, hashed as before and never shown or written down. An update
of a system with accounts of its own keeps carrying them over (KEEP_PW).

- mu300-install.sh: build_password hashes "ubuntu" for Ubuntu (fresh salt), leaves the
  hash empty for OpenWrt, and writes PW_SET=1 into mu300-install.env; the plan, the
  closing message and the note in the password file say which account and password
  work, in en/tr/zh; the file holds no secret any more
- android-install.sh: PW_SET=1 puts PWHASH in even when empty; the refusal of an
  "empty or default" password is gone (those are the intended accounts now) and the
  accounts-from-image mark is removed on every path
- tests: the images' password for a first install, a wipe and a system added beside
  another (Ubuntu and OpenWrt); MU300_PASSWORD used, hashed and not shown; an update
  kept; the device-side paths with and without PW_SET
- docs: FINDINGS 47, README, wiki/Installation.md, the site's install page (en/tr/zh)

Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01DqKKtBQZCfxYnHuBCuDqqn
2026-10-12 11:22:32 +03:00
Abdurrahman Kaan DikeçandClaude Opus 5.5 30c6dae6d3 Installers: the Linux slot gets the boot chain of Android's slot
Linux boots with its own slot's uboot, sml, teecfg, trustos and vbmeta but runs
Android's modem images (android-vendor-start swaps the slot suffix). After an OTA
the Linux slot still holds the factory chain (issue #86). Following kano's advice,
tools/android-bootchain.sh copies those five images from Android's slot to the
Linux slot where they differ: every check first (slot, model, Android's slot
marked successful in misc, no OTA pending on the other slot, never from Linux,
both links present, two devices, one size), both slots' images backed up to the
Linux filesystem (.mu300/bootchain/<date>, SHA256SUMS), each write read back, a
mismatch restored and the install stopped before Linux is armed. Nothing outside
the fixed list of five is ever written (NV names refused even if listed).

android-install.sh runs it (SYNC_BOOTCHAIN in mu300-install.env); install.sh,
install.ps1 and the Magisk installer show it in their plan, refuse before
anything is written, and the host installers pull the backup into
work/bootchain. MU300_SYNC_BOOTCHAIN=0 / -NoBootchainSync skip it. From Android
later: su -c 'mu300-linux bootchain [sync]' (the switch module's identical copy,
bootchain.sh). FINDINGS 40 records what LK and the SPL load per slot and why
the modem images and NV partitions are left alone.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01DqKKtBQZCfxYnHuBCuDqqn
2026-10-11 18:10:30 +03:00
Abdurrahman Kaan DikeçandClaude Opus 5.5 4ae528542e Magisk zips for OpenWrt with the control panel
Three more zips per release (openwrt-luci on 5.4, 6.18 and 7.2). The device
installer accepts the manifest of that system, sizes it like OpenWrt, puts
the device's firmware where OpenWrt keeps it, and keeps OpenWrt's password
block in the password file when Ubuntu is installed beside the panel system.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01DqKKtBQZCfxYnHuBCuDqqn
2026-10-10 21:36:35 +03:00
Abdurrahman Kaan DikeçandClaude Opus 5.5 9efff26a7f The installers take the VPN module from its own repository
When the release has no vpn extra of its own, install.sh and install.ps1 download mu300-linux-vpn.tar.gz from the
module's latest release (or MU300_VPN_MODULE, a copy on the computer), check it against SHA256SUMS and push it as the
vpn extra as before; android-install.sh accepts the module layout and the systems link it at their first boot. A
reinstall over a system that used the VPN without the module now warns that the VPN stays off, since engines alone
are no use without mu300-vpn. The question and the Magisk report name the module, in all three languages.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01DqKKtBQZCfxYnHuBCuDqqn
2026-10-09 22:04:51 +03:00
Abdurrahman Kaan DikeçandClaude Fable 5.1 3408e7c7fb Undecidable means a new password: an unreadable image shadow counts as the default, and android-install.sh keeps
a hash only when it carried the accounts over

image_hash fails when the zip's image shadow or the account's line cannot be read, and default_hash then says
"default" (a new password is generated). android-install.sh installs a system without PWHASH only when the merge
of the old accounts ran and left a real hash that is not the image's; its refusal names MU300_PASSWORD_RESET=yes.
Tests: the image's own hash carried over, an unreadable image shadow.

Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01DqKKtBQZCfxYnHuBCuDqqn
2026-10-06 00:17:51 +03:00
Abdurrahman Kaan DikeçandClaude Fable 5.1 3b7c0c1de2 Never keep a default or empty password: the update keeps only a real hash of the system's own, and fails closed
The Magisk installer keeps the password only when the system's account (ubuntu, OpenWrt's root) has a crypt hash
that is not empty or locked, not the image's hash and not a SHA-crypt hash of the images' "ubuntu" (checked with
the bundled mkpasswd); an unreadable shadow or accounts still marked as the image's get a generated password.
android-install.sh sets the password before the new system replaces the old one and refuses to install a system
whose account would end up with no hash, an empty one, the image's own or the image's accounts: the old system
stays, the install stops and the boot image is never armed. Review findings: comment width, the zip's own conf.

Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01DqKKtBQZCfxYnHuBCuDqqn
2026-10-06 00:04:05 +03:00
Abdurrahman Kaan DikeçandClaude Fable 5.1 0d83aacdf0 Magisk installer: an update keeps the accounts and passwords, a new one only for a new system or when asked
The Ubuntu zip installed over an existing Ubuntu on the U30 Air (keep mode) generated a new password and put it into
the system: the user's own password stopped working. Update now passes no PWHASH, writes no password file and says
"unchanged"; android-install.sh carries the accounts over with mu300-update's merge_accounts (a copy, kept identical
by a test), also when install.sh's update brings a hash. A password is generated for a new filesystem, a wipe, a
system added beside another, a system whose accounts are still the image's, or when /data/adb/mu300-install.conf
says MU300_PASSWORD=... or the new MU300_PASSWORD_RESET=yes (trusted only, used once).

Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01DqKKtBQZCfxYnHuBCuDqqn
2026-10-05 23:49:54 +03:00
Abdurrahman Kaan DikeçandClaude Opus 5.5 ab7cb2a929 Merge main: the F50 LEDs and the Magisk device fixes next to openwrt-luci
FINDINGS: main's 34 (LEDs, the second F50) before this branch's 35, under its own heading. The F50 lamp states that
K68/K38 point to are on main now. Host 650 OK, busybox OK, check-i18n and luci-i18n clean.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01DqKKtBQZCfxYnHuBCuDqqn
2026-10-05 20:11:57 +03:00
Abdurrahman Kaan DikeçandClaude Opus 5.5 4f2a3e1994 Merge main: the SD card, the driver fixes, the Magisk installer, mu300-extra and the eMMC by type next to openwrt-luci
Conflicts kept both sides: boot/init's region marker before the usb-net and pick-root blocks; android-vendor-start
links the partitions of the eMMC found by type, through the fork-free link_partitions; the OpenWrt build links the
shared path-commands list and keeps the panel's own services and mu300-sms; no VPN engine in either image (the vpn
extra) while the panel's docker mounts stay positional; assemble.sh enables mu300-atd2 next to the update notice;
android-install keeps openwrt-luci and the extras on a legacy wipe; make-release audits both the panel asset and the
vpn extra.

The third system in main's new places: mu300-extra counts a disk with only openwrt-luci as mounted, the Magisk
installer sees an installed openwrt-luci (space, plan, MU300_BOOT_OS) and names the installed systems in its last
hint (the fixed "ubuntu|openwrt" text became the {1} form install.sh already uses). Tests that read what git tracks
skip where there is no checkout (a container with only the worktree mounted).

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01DqKKtBQZCfxYnHuBCuDqqn
2026-10-05 17:25:26 +03:00
Abdurrahman Kaan DikeçandClaude Opus 5.5 043bdf628e Magisk installer: the second zip's password file keeps the first system's password
Both systems are two zips, and the second one leaves the first system's password as it is. On the F50 the Ubuntu zip
replaced /data/adb/mu300-linux-password.txt with its own password, and the OpenWrt root password, still the one in
use, was then nowhere on the device. The file now keeps the other system's block when that system is on the
filesystem being kept (not after a wipe), newest first.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01DqKKtBQZCfxYnHuBCuDqqn
2026-10-05 17:20:03 +03:00
Abdurrahman Kaan DikeçandClaude Opus 5.5 b963e02fbe Merge main: the SD card, the driver fixes, the Magisk installer and the update notice next to mu300-extra
mu300-update keeps both: notice and the extras in its help and usage, the slot-aware boot next to the extras'
install and adopt. make-release.sh audits the vpn extra and the sdcard and linux-slot features of every kernel
bundle. The Magisk installer's report says that the VPN engines are the vpn extra and how to add them.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01DqKKtBQZCfxYnHuBCuDqqn
2026-10-05 12:31:37 +03:00
Abdurrahman Kaan DikeçandClaude Opus 5.5 fbc652e2b0 Magisk installer: a trusted MU300_MODE=wipe counts for one install also when the target had no filesystem yet
A wipe onto a blank region or a new card formatted the target but was not recorded as used, so it stayed in
/data/adb/mu300-install.conf and the next flash (the second zip, an update) wiped the system just installed.
The key is now used whenever it is set and the target is formatted. MU300_SD_ERASE and MU300_REGION_OVERWRITE
were already used in every path that formats or overwrites. Test: a first install with the wipe (blank region,
installed region, new card, mu300sd card), then the next flash with the conf it left is an update.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01DqKKtBQZCfxYnHuBCuDqqn
2026-10-05 11:56:26 +03:00
Abdurrahman Kaan DikeçandClaude Opus 5.5 07802048bc Magisk installer: the password is saved before anything is installed, misc gets its old block back when the armed one does not verify, an erasing setting counts for one install, the example's lines load once uncommented, the plan names every value's source, and the module's files come from the zip as it was checked
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01DqKKtBQZCfxYnHuBCuDqqn
2026-10-05 08:51:12 +03:00
Abdurrahman Kaan DikeçandClaude Opus 5.5 7bb4d1b9c6 README: installing from Android with a Magisk zip, which zip to take, and the settings file
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01DqKKtBQZCfxYnHuBCuDqqn
2026-10-05 08:07:15 +03:00
Abdurrahman Kaan DikeçandClaude Opus 5.5 d1758ac9ee magisk installer: customize.sh runs the installation as a child and becomes the switch module only after it succeeded
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01DqKKtBQZCfxYnHuBCuDqqn
2026-10-05 07:26:24 +03:00
Abdurrahman Kaan DikeçandClaude Opus 5.5 fc4cbba0ab magisk installer: builds the boot image and the vendor files on the device, installs, verifies boot_<slot> and arms misc last
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01DqKKtBQZCfxYnHuBCuDqqn
2026-10-05 07:12:33 +03:00
Abdurrahman Kaan DikeçandClaude Opus 5.5 7a7b57ffa2 magisk installer: every settings value and manifest field is checked before it is used or becomes part of a path, a standing erase counts only for storage a trusted file chose, and the example file is renamed into place
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01DqKKtBQZCfxYnHuBCuDqqn
2026-10-05 03:56:37 +03:00
Abdurrahman Kaan DikeçandClaude Opus 5.5 3e84e34304 magisk installer: root works only in a directory of its own, a settings file any app can write cannot erase or set the password, and no mounted filesystem is ever deleted
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01DqKKtBQZCfxYnHuBCuDqqn
2026-10-05 03:46:24 +03:00
Abdurrahman Kaan DikeçandClaude Opus 5.5 1ef019f69d magisk installer: finds the device, its slots and where Linux goes, from what is there and mu300-install.conf; a dry run writes nothing
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01DqKKtBQZCfxYnHuBCuDqqn
2026-10-05 03:26:59 +03:00
Abdurrahman Kaan DikeçandClaude Opus 5.5 2a4e479088 Linux on slot a: rollback-boot and old kernel bundles cannot put a slot-b init there, the slot falls back to the booted one, and the switch arms only a Linux image
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01DqKKtBQZCfxYnHuBCuDqqn
2026-10-05 02:28:46 +03:00
Abdurrahman Kaan DikeçandClaude Opus 5.5 9e20f444a5 next-boot, update, the recorder, the vendor chroot, collect-logs and the switch follow the slot Linux runs from
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01DqKKtBQZCfxYnHuBCuDqqn
2026-10-05 02:28:46 +03:00
Abdurrahman Kaan DikeçandClaude Opus 5 971f291e8f magisk: start Linux from Android without a computer
A small Magisk module: the Action button in the Magisk app, or "su -c
mu300-linux" from a terminal, arms the one-shot slot-b trial and reboots into
Linux. Until now that needed adb and a computer.

It writes the same 32 bytes as the installer - the bootloader_control block at
0x800 of misc - and nothing else, so an unbootable Linux still falls back to
Android on its own. The block is not a canned blob: the module reads the live
one, sets the slot suffix and the two metadata bytes, and recomputes the CRC32
in awk (no strtonum, no bitwise builtins, so busybox awk is enough). It refuses
to run when the magic is not BCAB, when Android is not on slot a, or when
boot_b is missing, is not a boot image or is a copy of boot_a.

Also: mu300-update now keeps lib/modules on OpenWrt. A release only ships
modules for the kernel it was built with, so updating threw away the hand-built
6.18 set and left the mainline system without a modem stack.

Checked on hardware (Magisk 30.7, Android 13): status and --dry-run produce
exactly the trial block that boot/flash-trial.sh computes on a computer, and
the switch rebooted the device into Linux.

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_017Z17MBkdHmZPvNPNSLxcHk
2026-09-18 22:11:17 +03:00