BBB device ids on init-beagle-flasher

I am getting ready to finalize SD card setup for testing new product running debian13.

uname -r gives 6.18.36-bone40

In the past I am pretty sure I didn’t need to worry about clearing ssh ids machine-info and machine-id as the on boot from SD card auto writes to emmc when uncommenting cmdline

#enable Generic eMMC Flasher:
#cmdline=init=/usr/sbin/init-beagle-flasher

Do I understand this correctly?

If not what is the correct process to ensure that every board that is flashed get’s unique id?

Here’s the script.. it doesn’t generate a fresh id repos-armhf/bb-beagle-flasher/suite/trixie/debian/init-beagle-flasher at master · beagleboard/repos-armhf · GitHub

Thanks. It looked like there had been a change. Thanks for confirming.

Maybe I am misunderstanding the change as this means in production we have to always be 100% certain that all identity files are non existent or else the micro-sd card’s identity will be cloned into new flashed eMMC so all devices will have the same identity.

To me the only safe way is to have the init flasher cmdline script clear out all files used to identify the device. Anything else is left to chance - some pretty open for failure and some less so, but Murphy often strikes and cost of failure could be pretty high,

I am fine with idea of a one shot service being used for setup on boot, but the one shot mechanism has to be controlled by the eMMC flasher.

Am I misunderstanding something?

When implementing UK/EU CRA law changes, the ‘flasher’ moved to pure storage rsyning..

All the User Settings are now in bbbio-set-sysconf scripts: Making sure you're not a bot!

touch /etc/bbb.io/ssh_regenerate

Will trigger for example

if( -f "/etc/bbb.io/ssh_regenerate") {
    system("systemctl stop ssh.service");
    logger('info', "SSH: Regenerate Host Keys");
    system("/usr/bin/bb-regenerate-ssh-host-keys");
    $call_reboot = 1;
}

if you want to erase and reset, lets add /etc/bbb.io/machine_id_regenerate

sudo truncate -s 0 /etc/machine-id

or something..

Regards,

There are so many moving parts to this!

Thanks for response, let me digest it.

Robert, thanks for the clear explanation on the CRA-driven change and the trigger mechanism.

Sadly I can’t view Making sure you're not a bot! as it is just sitting verifying I am not a bot and never returning.

The ssh_regenerate trigger is exactly what’s needed. Yes please, adding /etc/bbb.io/machine_id_regenerate would complete the picture — machine-id drives the DHCP client-id in systemd-networkd, so cloned images without unique machine-ids cause IP conflicts when multiple devices hit the same network.

One important consideration for the trigger approach: in volume production, the flow is hands-off — insert SD card, press boot button, power on. The serial console is connected only for monitoring. There’s no SSH, no manual steps.

So the trigger files need to be on the SD card master image and survive across multiple flash cycles — the same SD card flashes dozens of boards. The flasher rsyncs them to eMMC each time, bbbio-set-sysconf fires on first eMMC boot, regenerates identity, and deletes the triggers on eMMC. The SD card master still has them intact for the next board.

Does bbbio-set-sysconf run on the eMMC’s first-boot side (not the SD card side during flashing)? That’s the key — if it runs while still booted from SD, it would regenerate the master’s own identity instead of the target’s.

Thanks again — this mechanism is much cleaner than manually clearing identity pre-flash.

Testing this today: arm32: flasher: use generate_machine_id and generate_ssh_keys set as … · beagleboard/customizations@40466ac · GitHub

	if [ "x${generate_machine_id}" = "xenable" ] ; then
		echo "truncate -s 0 /etc/machine-id"
		truncate -s 0 /tmp/rootfs/etc/machine-id || true
	fi

	if [ "x${generate_ssh_keys}" = "xenable" ] ; then
		echo "touch /etc/bbb.io/ssh_regenerate"
		touch /tmp/rootfs/etc/bbb.io/ssh_regenerate || true
	fi

it would expect these two variables in the flashing file: /etc/default/beagle-flasher

generate_machine_id=enable
generate_ssh_keys=enable

First test:

voodoo@bbb-flasher:~$ cat /etc/default/beagle-flasher 
#debug_over_display=tty0
source=/dev/mmcblk0
destination=/dev/mmcblk1
rfs_partition=fat_swap
boot_fstype=fat32
boot_startmb=4
boot_endmb=36
swap_sizemb=512
rfs_rootfs_type=ext4
rfs_rootfs_startmb=4
bootloader=/opt/u-boot/bb-u-boot-am335x-evm/install-mmcblk1.sh
flash_back=beaglebone-black-emmc-to-microsd-fat-swap
generate_machine_id=enable
generate_ssh_keys=enable
voodoo@bbb-flasher:~$ sudo beagle-flasher

Robert that is awesome. I noticed that bone41 became available as well - you’ve all been busy.

Any idea where (version) this would expect to land?

I have just finished finalizing tests upgrading to bone40 :slight_smile:

I assume for both machine-id and host keys will be cleared and re-created.

Nice, thanks!

Full log:

voodoo@bbb-flasher:~$ sudo beagle-flasher 
[sudo] password for voodoo: 
--------------------------------------------------------------------------------
Version: [1.20250527.0, add new fat-swap-rootfs layout...]
--------------------------------------------------------------------------------
cat /etc/default/beagle-flasher:
--------------------------------------------------------------------------------
#debug_over_display=tty0
source=/dev/mmcblk0
destination=/dev/mmcblk1
rfs_partition=fat_swap
boot_fstype=fat32
boot_startmb=4
boot_endmb=36
swap_sizemb=512
rfs_rootfs_type=ext4
rfs_rootfs_startmb=4
bootloader=/opt/u-boot/bb-u-boot-am335x-evm/install-mmcblk1.sh
flash_back=beaglebone-black-emmc-to-microsd-fat-swap
generate_machine_id=enable
generate_ssh_keys=enable
--------------------------------------------------------------------------------
INFO: /proc/cmdline
INFO: [cat /proc/cmdline]
console=ttyS0,115200n8 root=/dev/mmcblk0p3 ro rootfstype=ext4 rootwait fsck.repair=yes earlycon coherent_pool=1M net.ifnames=0 lpj=1990656 rng_core.default_quality=100
--------------------------------------------------------------------------------
INFO: Preparing sysctl
INFO: [sysctl: vm.min_free_kbytes=[2769]
INFO: [sysctl: setting: [sysctl -w vm.min_free_kbytes=16384]
vm.min_free_kbytes = 16384
--------------------------------------------------------------------------------
INFO: [lsblk -i]
NAME         MAJ:MIN RM   SIZE RO TYPE MOUNTPOINTS
mmcblk1      179:0    0   3.6G  0 disk 
zram0        253:0    0 240.5M  0 disk [SWAP]
mmcblk1boot0 179:256  0     2M  1 disk 
mmcblk1boot1 179:512  0     2M  1 disk 
mmcblk0      179:768  0  29.7G  0 disk 
|-mmcblk0p1  179:769  0    36M  0 part /boot/firmware
|-mmcblk0p2  179:770  0   512M  0 part [SWAP]
`-mmcblk0p3  179:771  0  29.2G  0 part /
--------------------------------------------------------------------------------
INFO: copying [/dev/mmcblk0] -> [/dev/mmcblk1]
--------------------------------------------------------------------------------
INFO: [source=/dev/mmcblk0] is a valid block device
INFO: [destination=/dev/mmcblk1] is a valid block device
INFO: [/boot/config-6.18.37-bone41]
INFO: Generating: [/boot/initrd.img-6.18.37-bone41]
update-initramfs: Generating /boot/initrd.img-6.18.37-bone41
--------------------------------------------------------------------------------
INFO: flush_cache: [blockdev --flushbufs /dev/mmcblk1]
--------------------------------------------------------------------------------
INFO: Erasing: [/dev/mmcblk1]
INFO: flush_cache: [blockdev --flushbufs /dev/mmcblk1]
--------------------------------------------------------------------------------
INFO: [dd if=/dev/zero of=/dev/mmcblk1 bs=1M count=108 status=progress]
104857600 bytes (105 MB, 100 MiB) copied, 2 s, 51.9 MB/s
108+0 records in
108+0 records out
113246208 bytes (113 MB, 108 MiB) copied, 5.13183 s, 22.1 MB/s
--------------------------------------------------------------------------------
INFO: [dd if=/dev/mmcblk1 of=/dev/null bs=1M count=108 status=progress]
82837504 bytes (83 MB, 79 MiB) copied, 2 s, 41.4 MB/s
108+0 records in
108+0 records out
113246208 bytes (113 MB, 108 MiB) copied, 2.93534 s, 38.6 MB/s
--------------------------------------------------------------------------------
INFO: flush_cache: [blockdev --flushbufs /dev/mmcblk1]
--------------------------------------------------------------------------------
INFO: Erasing: [/dev/mmcblk1] complete
--------------------------------------------------------------------------------
INFO: [/bin/bash /opt/u-boot/bb-u-boot-am335x-evm/install-mmcblk1.sh]
dd if=/opt/u-boot/bb-u-boot-am335x-evm/MLO of=/dev/mmcblk1 count=2 seek=1 bs=128k
0+1 records in
0+1 records out
106452 bytes (106 kB, 104 KiB) copied, 0.0270106 s, 3.9 MB/s
dd if=/opt/u-boot/bb-u-boot-am335x-evm/u-boot-dtb.img of=/dev/mmcblk1 count=4 seek=1 bs=384k
2+1 records in
2+1 records out
1066760 bytes (1.1 MB, 1.0 MiB) copied, 0.0680821 s, 15.7 MB/s
--------------------------------------------------------------------------------
INFO: Partitioning: /dev/mmcblk1
INFO: sfdisk: [sfdisk from util-linux 2.41]
INFO: sfdisk: [sfdisk --force --wipe-partitions always /dev/mmcblk1]
INFO: sfdisk: [4M,36M,0xC,*]
INFO: sfdisk: [40M,512M,0x82,-]
INFO: sfdisk: [552M,,,-]
Checking that no-one is using this disk right now ... OK

Disk /dev/mmcblk1: 3.56 GiB, 3825205248 bytes, 7471104 sectors
Units: sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 512 bytes

>>> Created a new DOS (MBR) disklabel with disk identifier 0xe771f9dd.
/dev/mmcblk1p1: Created a new partition 1 of type 'W95 FAT32 (LBA)' and of size 36 MiB.
/dev/mmcblk1p2: Created a new partition 2 of type 'Linux swap / Solaris' and of size 512 MiB.
/dev/mmcblk1p3: Created a new partition 3 of type 'Linux' and of size 3 GiB.
/dev/mmcblk1p4: Done.

New situation:
Disklabel type: dos
Disk identifier: 0xe771f9dd

Device         Boot   Start     End Sectors  Size Id Type
/dev/mmcblk1p1 *       8192   81919   73728   36M  c W95 FAT32 (LBA)
/dev/mmcblk1p2        81920 1130495 1048576  512M 82 Linux swap / Solaris
/dev/mmcblk1p3      1130496 7471103 6340608    3G 83 Linux

The partition table has been altered.
Calling ioctl() to re-read partition table.
Syncing disks.
INFO: flush_cache: [blockdev --flushbufs /dev/mmcblk1]
--------------------------------------------------------------------------------
INFO: Formatting: /dev/mmcblk1
mkfs.vfat -F 32 /dev/mmcblk1p1 -n FIRMWARE
mkfs.fat 4.2 (2021-01-31)
--------------------------------------------------------------------------------
INFO: flush_cache: [blockdev --flushbufs /dev/mmcblk1]
--------------------------------------------------------------------------------
mkfs.ext4 -O ^metadata_csum,^64bit,^orphan_file /dev/mmcblk1p3 -L rootfs
mke2fs 1.47.2 (1-Jan-2025)
Discarding device blocks: done                            
Creating filesystem with 792576 4k blocks and 198400 inodes
Filesystem UUID: 86a72f3b-c4e8-4da1-862a-afec410445d5
Superblock backups stored on blocks: 
	32768, 98304, 163840, 229376, 294912

Allocating group tables: done                            
Writing inode tables: done                            
Creating journal (16384 blocks): done
Writing superblocks and filesystem accounting information: done 

--------------------------------------------------------------------------------
INFO: flush_cache: [blockdev --flushbufs /dev/mmcblk1]
--------------------------------------------------------------------------------
Setting up swapspace version 1, size = 512 MiB (536866816 bytes)
no label, UUID=1e789583-b945-4bb5-ae4a-11b37110ad1a
INFO: Formatting: /dev/mmcblk1 complete
--------------------------------------------------------------------------------
Copying: /dev/mmcblk0p1 -> /dev/mmcblk1p1
cp -rv: /boot/firmware/ -> /tmp/boot/
'/boot/firmware/ID.txt' -> '/tmp/boot/ID.txt'
'/boot/firmware/services' -> '/tmp/boot/services'
'/boot/firmware/START.HTM' -> '/tmp/boot/START.HTM'
'/boot/firmware/sysconf.txt' -> '/tmp/boot/sysconf.txt'
INFO: flush_cache: [blockdev --flushbufs /dev/mmcblk1]
--------------------------------------------------------------------------------
INFO: flush_cache: [blockdev --flushbufs /dev/mmcblk1]
--------------------------------------------------------------------------------
INFO: Copying: /dev/mmcblk0p3 -> /dev/mmcblk1p3
INFO: [mount /dev/mmcblk1p3 /tmp/rootfs/ -o async,noatime]
INFO: rsync: (-aAXHx) [/ -> /tmp/rootfs/]
          1.31G  99%    4.76MB/s    0:04:22 (xfr#38991, to-chk=0/48336)   
--------------------------------------------------------------------------------
INFO: flush_cache: [blockdev --flushbufs /dev/mmcblk1]
--------------------------------------------------------------------------------
INFO: rsync: (-aAXHx) [/ -> /tmp/rootfs/]
              0   0%    0.00kB/s    0:00:00 (xfr#1, to-chk=0/48336)   
--------------------------------------------------------------------------------
INFO: flush_cache: [blockdev --flushbufs /dev/mmcblk1]
--------------------------------------------------------------------------------
INFO: Copying: Kernel modules
INFO: rsync: (-aAXHx) /usr/lib/modules/6.18.37-bone41/ -> /tmp/rootfs/usr/lib/modules/6.18.37-bone41/
         33.31M 100%    2.14MB/s    0:00:14 (xfr#3018, to-chk=0/3463)   
--------------------------------------------------------------------------------
INFO: flush_cache: [blockdev --flushbufs /dev/mmcblk1]
--------------------------------------------------------------------------------
INFO: Generating: /etc/fstab
INFO: [cat /tmp/rootfs/etc/fstab]
# /etc/fstab: static file system information.
#
/dev/mmcblk1p3  /  ext4  noatime,errors=remount-ro  0  1
/dev/mmcblk1p1  /boot/firmware vfat user,uid=1000,gid=1000,defaults 0 2
/dev/mmcblk1p2       none    swap    sw      0       0
debugfs  /sys/kernel/debug  debugfs  mode=755,uid=root,gid=gpio,defaults  0  0
--------------------------------------------------------------------------------
INFO: flush_cache: [blockdev --flushbufs /dev/mmcblk1]
--------------------------------------------------------------------------------
INFO: [cat /tmp/rootfs/boot/uEnv.txt]
#Docs: http://elinux.org/Beagleboard:U-boot_partitioning_layout_2.0

uname_r=6.18.37-bone41
#uuid=
#dtb=

###U-Boot Overlays###
###Documentation: http://elinux.org/Beagleboard:BeagleBoneBlack_Debian#U-Boot_Overlays
###Master Enable
#enable_uboot_overlays=1
###
###Overide capes with eeprom
#uboot_overlay_addr0=<file0>.dtbo
#uboot_overlay_addr1=<file1>.dtbo
#uboot_overlay_addr2=<file2>.dtbo
#uboot_overlay_addr3=<file3>.dtbo
###
###Additional custom capes
#uboot_overlay_addr4=<file4>.dtbo
#uboot_overlay_addr5=<file5>.dtbo
#uboot_overlay_addr6=<file6>.dtbo
#uboot_overlay_addr7=<file7>.dtbo
###
###Custom Cape
#dtb_overlay=<file8>.dtbo
###
###Disable auto loading of virtual capes (emmc/video/wireless/adc)
#disable_uboot_overlay_emmc=1
#disable_uboot_overlay_video=1
#disable_uboot_overlay_audio=1
#disable_uboot_overlay_wireless=1
#disable_uboot_overlay_adc=1
###
###PRUSS OPTIONS
###pru_rproc (4.14.x-ti kernel)
#uboot_overlay_pru=AM335X-PRU-RPROC-4-14-TI-00A0.dtbo
###pru_rproc (4.19.x-ti kernel)
#uboot_overlay_pru=AM335X-PRU-RPROC-4-19-TI-00A0.dtbo
###pru_uio (4.14.x-ti, 4.19.x-ti & mainline/bone kernel)
uboot_overlay_pru=AM335X-PRU-UIO-00A0.dtbo
###
###Cape Universal Enable
#enable_uboot_cape_universal=1
###
###Debug: disable uboot autoload of Cape
#disable_uboot_overlay_addr0=1
#disable_uboot_overlay_addr1=1
#disable_uboot_overlay_addr2=1
#disable_uboot_overlay_addr3=1
###
###U-Boot fdt tweaks... (60000 = 384KB)
#uboot_fdt_buffer=0x60000
###U-Boot Overlays###

console=ttyS0,115200n8
cmdline=fsck.repair=yes earlycon coherent_pool=1M net.ifnames=0 lpj=1990656 rng_core.default_quality=100

#In the event of edid real failures, uncomment this next line:
#cmdline=fsck.repair=yes earlycon coherent_pool=1M net.ifnames=0 lpj=1990656 rng_core.default_quality=100 video=HDMI-A-1:1024x768@60e

#Use an overlayfs on top of a read-only root filesystem:
#cmdline=fsck.repair=yes earlycon coherent_pool=1M net.ifnames=0 lpj=1990656 rng_core.default_quality=100 overlayroot=tmpfs

##enable Generic eMMC Flasher:
#cmdline=init=/usr/sbin/init-beagle-flasher
--------------------------------------------------------------------------------
INFO: [cp -v /etc/beagle-flasher/beaglebone-black-emmc-to-microsd-fat-swap /tmp/rootfs/etc/default/beagle-flasher]
'/etc/beagle-flasher/beaglebone-black-emmc-to-microsd-fat-swap' -> '/tmp/rootfs/etc/default/beagle-flasher'
--------------------------------------------------------------------------------
INFO: [cat /tmp/rootfs/etc/default/generic-sys-mods]
#This file is sourced by /usb/bin/bb-growpart
ROOT_DRIVE=/dev/mmcblk1
ROOT_PARTITION=3
ARCH_SOC_MODULES=am335x
--------------------------------------------------------------------------------
INFO: flush_cache: [blockdev --flushbufs /dev/mmcblk1]
--------------------------------------------------------------------------------
truncate -s 0 /etc/machine-id
touch /etc/bbb.io/ssh_regenerate
Copying: /dev/mmcblk0p3 -> /dev/mmcblk1p3 complete
--------------------------------------------------------------------------------
INFO: flush_cache: [blockdev --flushbufs /dev/mmcblk1]
--------------------------------------------------------------------------------
INFO: [umount /tmp/rootfs/ || umount -l /tmp/rootfs/ || write_failure]
--------------------------------------------------------------------------------
INFO: Force writeback of eMMC buffers by Syncing: /dev/mmcblk1
INFO: [dd if=/dev/mmcblk1 of=/dev/null count=100000 status=progress]
51002880 bytes (51 MB, 49 MiB) copied, 2 s, 25.5 MB/s
100000+0 records in
100000+0 records out
51200000 bytes (51 MB, 49 MiB) copied, 2.04562 s, 25.0 MB/s
--------------------------------------------------------------------------------
INFO: flush_cache: [blockdev --flushbufs /dev/mmcblk1]
--------------------------------------------------------------------------------
voodoo@bbb-flasher:~$ 
voodoo@bbb-flasher:~$ cat /etc/machine-id 
a5044da808324399bffb0cfb07b64fbd
truncate -s 0 /etc/machine-id
touch /etc/bbb.io/ssh_regenerate

Okay lets’ reboot… and see if it’s updated…

[   14.523718] systemd[1]: Hostname set to <bbb-flasher>.
[   14.537006] systemd[1]: Initializing machine ID from D-Bus machine ID.
[   14.544271] systemd[1]: Installed transient /etc/machine-id file.
[   15.537239] zram: Added device: zram0
[   41.207795] bbbio-set-sysconf[457]: SSH: Regenerate Host Keys
[   41.363756] bbbio-set-sysconf[464]: removed '/etc/ssh/ssh_host_ecdsa_key'
[   41.397180] bbbio-set-sysconf[464]: removed '/etc/ssh/ssh_host_ed25519_key'
[   41.413043] bbbio-set-sysconf[464]: removed '/etc/ssh/ssh_host_rsa_key'
[   41.430901] bbbio-set-sysconf[468]: removed '/etc/ssh/ssh_host_ecdsa_key.pub'
[   41.449055] bbbio-set-sysconf[468]: removed '/etc/ssh/ssh_host_ed25519_key.pub'
[   41.461761] bbbio-set-sysconf[468]: removed '/etc/ssh/ssh_host_rsa_key.pub'

laughs!

voodoo@bbb-flasher:~$ cat /etc/machine-id 
a5044da808324399bffb0cfb07b64fbd

same id!!!

sorry only brought one board… bet it only used the mac address..

Regards,

So bone41 only adds: CONFIG_NETFILTER_NETLINK_HOOK=m and 6.18.36 → 6.18.37 stable

Regards,

Now trying the “microsd flasher enable”..

voodoo@bbb-flasher:~$ cat /etc/default/beagle-flasher 
#debug_over_display=tty0
source=/dev/mmcblk0
destination=/dev/mmcblk1
rfs_partition=fat_swap
boot_fstype=fat32
boot_startmb=4
boot_endmb=36
swap_sizemb=512
rfs_rootfs_type=ext4
rfs_rootfs_startmb=4
bootloader=/opt/u-boot/bb-u-boot-am335x-evm/install-mmcblk1.sh
flash_back=beaglebone-black-emmc-to-microsd-fat-swap
generate_machine_id=enable
generate_ssh_keys=enable
voodoo@bbb-flasher:~$ sudo enable-beagle-flasher 
[sudo] password for voodoo: 
Failed to disable unit: Unit grow_partition.service does not exist
INFO: [/bin/bash /opt/u-boot/bb-u-boot-am335x-evm/install-mmcblk1.sh]
dd if=/opt/u-boot/bb-u-boot-am335x-evm/MLO of=/dev/mmcblk1 count=2 seek=1 bs=128k
0+1 records in
0+1 records out
106452 bytes (106 kB, 104 KiB) copied, 0.329782 s, 323 kB/s
dd if=/opt/u-boot/bb-u-boot-am335x-evm/u-boot-dtb.img of=/dev/mmcblk1 count=4 seek=1 bs=384k
2+1 records in
2+1 records out
1066760 bytes (1.1 MB, 1.0 MiB) copied, 0.0607209 s, 17.6 MB/s
log: enable-beagle-flasher
log: media is now setup to flash other media
log: Shutdown system and this flasher will run on next startup

i need to fix this..

Failed to disable unit: Unit grow_partition.service does not exist
ootfs: recovering journal
rootfs: clean, 51838/1901952 files, 489742/7650427 blocks
done.
[   13.736174] EXT4-fs (mmcblk0p3): mounted filesystem 8da0903e-122f-4f29-8fd0-37484c5dd9e4 ro with ordered data mode. Quota mode: none.
done.
Begin: Running /scripts/local-bottom ... done.
Begin: Running /scripts/init-bottom ... done.
--------------------------------------------------------------------------------
Version: [1.20250527.0, add new fat-swap-rootfs layout...]
--------------------------------------------------------------------------------
cat /etc/default/beagle-flasher:
--------------------------------------------------------------------------------
#debug_over_display=tty0
source=/dev/mmcblk0
destination=/dev/mmcblk1
rfs_partition=fat_swap
boot_fstype=fat32
boot_startmb=4
boot_endmb=36
swap_sizemb=512
rfs_rootfs_type=ext4
rfs_rootfs_startmb=4
bootloader=/opt/u-boot/bb-u-boot-am335x-evm/install-mmcblk1.sh
flash_back=beaglebone-black-emmc-to-microsd-fat-swap
generate_machine_id=enable
generate_ssh_keys=enable
--------------------------------------------------------------------------------
INFO: Giving system time to stablize...
--------------------------------------------------------------------------------
5
4
3
2
1
--------------------------------------------------------------------------------
INFO: Preparing /tmp
INFO: [mount -t tmpfs tmpfs /tmp]
--------------------------------------------------------------------------------
INFO: /proc/cmdline
INFO: [cat /proc/cmdline]
console=ttyS0,115200n8 root=/dev/mmcblk0p3 ro rootfstype=ext4 rootwait init=/usr/sbin/init-beagle-flasher
--------------------------------------------------------------------------------
INFO: Preparing sysctl
INFO: [sysctl: vm.min_free_kbytes=[2769]
INFO: [sysctl: setting: [sysctl -w vm.min_free_kbytes=16384]
vm.min_free_kbytes = 16384
--------------------------------------------------------------------------------
INFO: [lsblk -i]
NAME         MAJ:MIN RM  SIZE RO TYPE MOUNTPOINTS
mmcblk1      179:0    0  3.6G  0 disk 
mmcblk1boot0 179:256  0    2M  1 disk 
mmcblk1boot1 179:512  0    2M  1 disk 
mmcblk0      179:768  0 29.7G  0 disk 
|-mmcblk0p1  179:769  0   36M  0 part 
|-mmcblk0p2  179:770  0  512M  0 part 
`-mmcblk0p3  179:771  0 29.2G  0 part /
--------------------------------------------------------------------------------
INFO: copying [/dev/mmcblk0] -> [/dev/mmcblk1]
--------------------------------------------------------------------------------
INFO: [source=/dev/mmcblk0] is a valid block device
INFO: [destination=/dev/mmcblk1] is a valid block device
INFO: flush_cache: [blockdev --flushbufs /dev/mmcblk1]
--------------------------------------------------------------------------------
INFO: Erasing: [/dev/mmcblk1]
INFO: flush_cache: [blockdev --flushbufs /dev/mmcblk1]
--------------------------------------------------------------------------------
INFO: [dd if=/dev/zero of=/dev/mmcblk1 bs=1M count=108 status=progress]
89128960 bytes (89 MB, 85 MiB) copied, 1 s, 85.8 MB/s
108+0 records in
108+0 records out
113246208 bytes (113 MB, 108 MiB) copied, 4.35156 s, 26.0 MB/s
--------------------------------------------------------------------------------
INFO: [dd if=/dev/mmcblk1 of=/dev/null bs=1M count=108 status=progress]
85983232 bytes (86 MB, 82 MiB) copied, 2 s, 42.8 MB/s
108+0 records in
108+0 records out
113246208 bytes (113 MB, 108 MiB) copied, 2.72102 s, 41.6 MB/s
--------------------------------------------------------------------------------
INFO: flush_cache: [blockdev --flushbufs /dev/mmcblk1]
--------------------------------------------------------------------------------
INFO: Erasing: [/dev/mmcblk1] complete
--------------------------------------------------------------------------------
INFO: [/bin/bash /opt/u-boot/bb-u-boot-am335x-evm/install-mmcblk1.sh]
dd if=/opt/u-boot/bb-u-boot-am335x-evm/MLO of=/dev/mmcblk1 count=2 seek=1 bs=128k
0+1 records in
0+1 records out
106452 bytes (106 kB, 104 KiB) copied, 0.0150518 s, 7.1 MB/s
dd if=/opt/u-boot/bb-u-boot-am335x-evm/u-boot-dtb.img of=/dev/mmcblk1 count=4 seek=1 bs=384k
2+1 records in
2+1 records out
1066760 bytes (1.1 MB, 1.0 MiB) copied, 0.104583 s, 10.2 MB/s
--------------------------------------------------------------------------------
INFO: Partitioning: /dev/mmcblk1
INFO: sfdisk: [sfdisk from util-linux 2.41]
INFO: sfdisk: [sfdisk --force --wipe-partitions always /dev/mmcblk1]
INFO: sfdisk: [4M,36M,0xC,*]
INFO: sfdisk: [40M,512M,0x82,-]
INFO: sfdisk: [552M,,,-]
Checking that no-one is using this disk right now ... OK

Disk /dev/mmcblk1: 3.56 GiB, 3825205248 bytes, 7471104 sectors
Units: sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 512 bytes

>>> Created a new DOS (MBR) disklabel with disk identifier 0x09535aaf.
/dev/mmcblk1p1: Created a new partition 1 of type 'W95 FAT32 (LBA)' and of size 36 MiB.
/dev/mmcblk1p2: Created a new partition 2 of type 'Linux swap / Solaris' and of size 512 MiB.
/dev/mmcblk1p3: Created a new partition 3 of type 'Linux' and of size 3 GiB.
Partition #3 contains a ext4 signature.
The signature will be removed by a write command.
/dev/mmcblk1p4: Done.

New situation:
Disklabel type: dos
Disk identifier: 0x09535aaf

Device         Boot   Start     End Sectors  Size Id Type
/dev/mmcblk1p1 *       8192   81919   73728   36M  c W95 FAT32 (LBA)
/dev/mmcblk1p2        81920 1130495 1048576  512M 82 Linux swap / Solaris
/dev/mmcblk1p3      1130496 7471103 6340608    3G 83 Linux

Filesystem/RAID signature on partition 3 will be wiped.

The partition table has been altered.
Calling ioctl() to re-read partition table.[   27.639548]  mmcblk1: p1 p2 p3

Syncing disks.
INFO: flush_cache: [blockdev --flushbufs /dev/mmcblk1]
--------------------------------------------------------------------------------
INFO: Formatting: /dev/mmcblk1
mkfs.vfat -F 32 /dev/mmcblk1p1 -n FIRMWARE
mkfs.fat 4.2 (2021-01-31)
--------------------------------------------------------------------------------
INFO: flush_cache: [blockdev --flushbufs /dev/mmcblk1]
--------------------------------------------------------------------------------
mkfs.ext4 -O ^metadata_csum,^64bit,^orphan_file /dev/mmcblk1p3 -L rootfs
mke2fs 1.47.2 (1-Jan-2025)
Discarding device blocks: done                            
Creating filesystem with 792576 4k blocks and 198400 inodes
Filesystem UUID: 30abb01f-1b30-4f4d-b42e-f597bf041756
Superblock backups stored on blocks: 
	32768, 98304, 163840, 229376, 294912

Allocating group tables: done                            
Writing inode tables: done                            
Creating journal (16384 blocks): done
Writing superblocks and filesystem accounting information: done 

--------------------------------------------------------------------------------
INFO: flush_cache: [blockdev --flushbufs /dev/mmcblk1]
--------------------------------------------------------------------------------
Setting up swapspace version 1, size = 512 MiB (536866816 bytes)
no label, UUID=53580b1c-1067-4119-9131-15a21b012bed
INFO: Formatting: /dev/mmcblk1 complete
--------------------------------------------------------------------------------
Copying: /dev/mmcblk0p1 -> /dev/mmcblk1p1
[   32.800243] FAT-fs (mmcblk0p1): Volume was not properly unmounted. Some data may be corrupt. Please run fsck.
cp -rv: /boot/firmware/ -> /tmp/boot/
'/boot/firmware/ID.txt' -> '/tmp/boot/ID.txt'
'/boot/firmware/START.HTM' -> '/tmp/boot/START.HTM'
'/boot/firmware/services' -> '/tmp/boot/services'
'/boot/firmware/sysconf.txt' -> '/tmp/boot/sysconf.txt'
INFO: flush_cache: [blockdev --flushbufs /dev/mmcblk1]
--------------------------------------------------------------------------------
INFO: flush_cache: [blockdev --flushbufs /dev/mmcblk1]
--------------------------------------------------------------------------------
INFO: Copying: /dev/mmcblk0p3 -> /dev/mmcblk1p3
INFO: [mount /dev/mmcblk1p3 /tmp/rootfs/ -o async,noatime]
[   33.135746] EXT4-fs (mmcblk1p3): mounted filesystem 30abb01f-1b30-4f4d-b42e-f597bf041756 r/w with ordered data mode. Quota mode: none.
INFO: rsync: (-aAXHx) [/ -> /tmp/rootfs/]
          1.31G  99%    3.70MB/s    0:05:37 (xfr#38991, to-chk=0/48336)   
--------------------------------------------------------------------------------
INFO: flush_cache: [blockdev --flushbufs /dev/mmcblk1]
--------------------------------------------------------------------------------
INFO: rsync: (-aAXHx) [/ -> /tmp/rootfs/]
              0   0%    0.00kB/s    0:00:00 (xfr#0, to-chk=0/48336)   
--------------------------------------------------------------------------------
INFO: flush_cache: [blockdev --flushbufs /dev/mmcblk1]
--------------------------------------------------------------------------------
INFO: Copying: Kernel modules
INFO: rsync: (-aAXHx) /usr/lib/modules/6.18.37-bone41/ -> /tmp/rootfs/usr/lib/modules/6.18.37-bone41/
         33.31M 100%    1.43MB/s    0:00:22 (xfr#3018, to-chk=0/3463)   
--------------------------------------------------------------------------------
INFO: flush_cache: [blockdev --flushbufs /dev/mmcblk1]
--------------------------------------------------------------------------------
INFO: Generating: /etc/fstab
INFO: [cat /tmp/rootfs/etc/fstab]
# /etc/fstab: static file system information.
#
/dev/mmcblk1p3  /  ext4  noatime,errors=remount-ro  0  1
/dev/mmcblk1p1  /boot/firmware vfat user,uid=1000,gid=1000,defaults 0 2
/dev/mmcblk1p2       none    swap    sw      0       0
debugfs  /sys/kernel/debug  debugfs  mode=755,uid=root,gid=gpio,defaults  0  0
--------------------------------------------------------------------------------
INFO: flush_cache: [blockdev --flushbufs /dev/mmcblk1]
--------------------------------------------------------------------------------
INFO: [cat /tmp/rootfs/boot/uEnv.txt]
#Docs: http://elinux.org/Beagleboard:U-boot_partitioning_layout_2.0

uname_r=6.18.37-bone41
#uuid=
#dtb=

###U-Boot Overlays###
###Documentation: http://elinux.org/Beagleboard:BeagleBoneBlack_Debian#U-Boot_Overlays
###Master Enable
#enable_uboot_overlays=1
###
###Overide capes with eeprom
#uboot_overlay_addr0=<file0>.dtbo
#uboot_overlay_addr1=<file1>.dtbo
#uboot_overlay_addr2=<file2>.dtbo
#uboot_overlay_addr3=<file3>.dtbo
###
###Additional custom capes
#uboot_overlay_addr4=<file4>.dtbo
#uboot_overlay_addr5=<file5>.dtbo
#uboot_overlay_addr6=<file6>.dtbo
#uboot_overlay_addr7=<file7>.dtbo
###
###Custom Cape
#dtb_overlay=<file8>.dtbo
###
###Disable auto loading of virtual capes (emmc/video/wireless/adc)
#disable_uboot_overlay_emmc=1
#disable_uboot_overlay_video=1
#disable_uboot_overlay_audio=1
#disable_uboot_overlay_wireless=1
#disable_uboot_overlay_adc=1
###
###PRUSS OPTIONS
###pru_rproc (4.14.x-ti kernel)
#uboot_overlay_pru=AM335X-PRU-RPROC-4-14-TI-00A0.dtbo
###pru_rproc (4.19.x-ti kernel)
#uboot_overlay_pru=AM335X-PRU-RPROC-4-19-TI-00A0.dtbo
###pru_uio (4.14.x-ti, 4.19.x-ti & mainline/bone kernel)
uboot_overlay_pru=AM335X-PRU-UIO-00A0.dtbo
###
###Cape Universal Enable
#enable_uboot_cape_universal=1
###
###Debug: disable uboot autoload of Cape
#disable_uboot_overlay_addr0=1
#disable_uboot_overlay_addr1=1
#disable_uboot_overlay_addr2=1
#disable_uboot_overlay_addr3=1
###
###U-Boot fdt tweaks... (60000 = 384KB)
#uboot_fdt_buffer=0x60000
###U-Boot Overlays###

console=ttyS0,115200n8
cmdline=fsck.repair=yes earlycon coherent_pool=1M net.ifnames=0 lpj=1990656 rng_core.default_quality=100

#In the event of edid real failures, uncomment this next line:
#cmdline=fsck.repair=yes earlycon coherent_pool=1M net.ifnames=0 lpj=1990656 rng_core.default_quality=100 video=HDMI-A-1:1024x768@60e

#Use an overlayfs on top of a read-only root filesystem:
#cmdline=fsck.repair=yes earlycon coherent_pool=1M net.ifnames=0 lpj=1990656 rng_core.default_quality=100 overlayroot=tmpfs

##enable Generic eMMC Flasher:
#cmdline=init=/usr/sbin/init-beagle-flasher
--------------------------------------------------------------------------------
INFO: [cp -v /etc/beagle-flasher/beaglebone-black-emmc-to-microsd-fat-swap /tmp/rootfs/etc/default/beagle-flasher]
'/etc/beagle-flasher/beaglebone-black-emmc-to-microsd-fat-swap' -> '/tmp/rootfs/etc/default/beagle-flasher'
--------------------------------------------------------------------------------
INFO: [cat /tmp/rootfs/etc/default/generic-sys-mods]
#This file is sourced by /usb/bin/bb-growpart
ROOT_DRIVE=/dev/mmcblk1
ROOT_PARTITION=3
ARCH_SOC_MODULES=am335x
--------------------------------------------------------------------------------
INFO: flush_cache: [blockdev --flushbufs /dev/mmcblk1]
--------------------------------------------------------------------------------
truncate -s 0 /etc/machine-id
touch /etc/bbb.io/ssh_regenerate
Copying: /dev/mmcblk0p3 -> /dev/mmcblk1p3 complete
--------------------------------------------------------------------------------
INFO: flush_cache: [blockdev --flushbufs /dev/mmcblk1]
--------------------------------------------------------------------------------
INFO: [umount /tmp/rootfs/ || umount -l /tmp/rootfs/ || write_failure]
[  427.742434] EXT4-fs (mmcblk1p3): unmounting filesystem 30abb01f-1b30-4f4d-b42e-f597bf041756.
--------------------------------------------------------------------------------
INFO: [umount /tmp || true]
--------------------------------------------------------------------------------
INFO: flush_cache: [blockdev --flushbufs /dev/mmcblk1]
--------------------------------------------------------------------------------
INFO: Force writeback of eMMC buffers by Syncing: /dev/mmcblk1
INFO: [dd if=/dev/mmcblk1 of=/dev/null count=100000 status=progress]
35345920 bytes (35 MB, 34 MiB) copied, 1 s, 35.3 MB/s
100000+0 records in
100000+0 records out
51200000 bytes (51 MB, 49 MiB) copied, 1.51182 s, 33.9 MB/s
--------------------------------------------------------------------------------
INFO: flush_cache: [blockdev --flushbufs /dev/mmcblk1]
--------------------------------------------------------------------------------
INFO: [We are init, trying to shutdown, we may crash, data is RO so safe]
5
INFO: [found: /proc/sysrq-trigger]
INFO: [found: echo s > /proc/sysrq-trigger
INFO: [found: echo o > /proc/sysrq-trigger
4
3
2
1
----------------------------------------------------------------[  434.502653] sysrq: Emergency Sync
----------------
[  434.511567] sysrq: Power Off
[  434.515850] Emergency Sync complete
4
[  434.556632] reboot: Power down
[   14.315384] systemd[1]: Hostname set to <bbb-flasher>.
[   14.328666] systemd[1]: Initializing machine ID from D-Bus machine ID.
[   14.335948] systemd[1]: Installed transient /etc/machine-id file.
         Starting systemd-hostnamed.service - Hostname Service...
[   41.166606] bbbio-set-sysconf[464]: removed '/etc/ssh/ssh_host_ecdsa_key'
[   41.193015] bbbio-set-sysconf[464]: removed '/etc/ssh/ssh_host_ed25519_key'
[   41.217714] bbbio-set-sysconf[464]: removed '/etc/ssh/ssh_host_rsa_key'
[   41.259487] bbbio-set-sysconf[466]: removed '/etc/ssh/ssh_host_ecdsa_key.pub'
[   41.292609] bbbio-set-sysconf[466]: removed '/etc/ssh/ssh_host_ed25519_key.pub'
[   41.301246] bbbio-set-sysconf[466]: removed '/etc/ssh/ssh_host_rsa_key.pub'
voodoo@bbb-flasher:~$ cat /etc/machine-id 
a5044da808324399bffb0cfb07b64fbd

We ran into the issue where every single bbb programmed with a single “flasher” sd card was getting the same IP address.

WE fixed it by running the following on FIRST boot

rm -f /etc/machine-id /var/lib/dbus/machine-id
dbus-uuidgen --ensure=/etc/machine-id
dbus-uuidgen --ensure

Thanks @roberte1997, that’s part of the reason of starting this thread - previous versions worked well for us (way old version). I think that what Robert is working on will solve this - that’s why the machine-id is so important as well and not just host keys.