Keeping EMMC Current

If you’re booting your MNT Reform from the NVMe drive, you might find it useful to keep the EMMC part up to date so you’ve got something to fall back on, just in case; the way I’m doing that is with mount and schroot. You can install schroot via apt in the usual way.

Once I have schroot installed, I’ve created "/srv"off the root of my drive, and have put a few other operating systems in there that I might want to try out. In my case, I’ve got a basic install of Alpine in /srv/alpine and an empty folder called /srv/emmc where I’m going to mount the EMMC drive.

Next, I have this file:

#!/bin/sh

if ! [ -e /srv/$1 ];
then
  echo No chroot by that name exists. && exit 1;
fi

if [ $1 = "emmc" ];
then
        cd ~ ;
        sudo mount /dev/mmcblk0p1 /srv/emmc ;
        schroot -c $1 ;
fi

if [ $1 = "alpine" ] ;
then
        cd ~ ;
        schroot -s /bin/sh -c $1;
fi

echo Exiting $1 schroot environment.

in my ~/bin/ -

and in /etc/schroot/schroot.conf

[emmc]
description=MNT Reform Internal EMMC
directory=/srv/emmc
users=mhoye
groups=mhoye

Between those two things (and having my name in the sudoers file,obvs) I can type in “become emmc” and the machine will mount the emmc on /srv/emmc, and then schroot - Securely CHange the ROOT directory I’m working on to be /srv/emmc - and I can apt-update, change user passwords, etc, whatever, and keep it up to date, so that in the event the NVMe fails or I need to pull it for whatever reason.

I’ve skipped over the part about Alpine but you can probably figure it out from this.

5 Likes

FWIW, the kernel you’re using also comes from the eMMC, as the reform-init script "chroot"s into the NVMe userspace instead of "kexec"ing into the kernel on the NVMe. So doing something like this (using mkkernel.sh instead of relying on the Debian kernel; at least, that’s what I’ve been doing) is also necessary to keep your kernel updated.

1 Like