Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add AB slot helpers #4

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

learmj
Copy link
Collaborator

@learmj learmj commented Jan 17, 2025

Install a udev rule to create aliases for the other (ie the inactive) slot partitions, and a script to assist with slot identification. Alias nodes are also present in the initramfs.

Install a udev rule to create aliases for the other (ie the inactive)
slot partitions, and a script to assist with slot identification.
Alias nodes are also present in the initramfs.
@learmj
Copy link
Collaborator Author

learmj commented Jan 17, 2025

This allows us to do:

$ ls -l /dev/disk/by-label/
total 0
lrwxrwxrwx 1 root root 15 Jan 17 13:48 BOOTA -> ../../mmcblk0p2
lrwxrwxrwx 1 root root 15 Jan 17 13:48 BOOTB -> ../../mmcblk0p3
lrwxrwxrwx 1 root root 15 Jan 17 13:48 BOOTFS -> ../../mmcblk0p1
lrwxrwxrwx 1 root root 15 Jan 17 13:48 ROOTA -> ../../mmcblk0p4
lrwxrwxrwx 1 root root 15 Jan 17 13:48 ROOTB -> ../../mmcblk0p5
lrwxrwxrwx 1 root root 15 Jan 17 13:48 USERDATA -> ../../mmcblk0p6
$ slot                                                     
A                                                                            
$ slot other                                               
B                                                                            
$ ls -l /dev/disk/by-slot/other/
total 0
lrwxrwxrwx 1 root root 18 Jan 17 13:48 BOOT -> ../../../mmcblk0p3
lrwxrwxrwx 1 root root 18 Jan 17 13:48 ROOT -> ../../../mmcblk0p5
$
$ mount | grep -E 'mmcblk0p2|mmcblk0p3|mmcblk0p4|mmcblk0p5'
/dev/mmcblk0p4 on / type ext4 (rw,relatime,errors=remount-ro)                
/dev/mmcblk0p2 on /boot/firmware type vfat (rw,noatime,fmask=0022,dmask=0022,codepage=437,iocharset=ascii,shortname=mixed,errors=remount-ro)
sudo reboot '0 tryboot'
$ slot
B
$ slot other
A
$ ls -l /dev/disk/by-slot/other/
total 0
lrwxrwxrwx 1 root root 18 Jan 17 13:48 BOOT -> ../../../mmcblk0p2
lrwxrwxrwx 1 root root 18 Jan 17 13:48 ROOT -> ../../../mmcblk0p4
$
$ mount | grep -E 'mmcblk0p2|mmcblk0p3|mmcblk0p4|mmcblk0p5'
/dev/mmcblk0p5 on / type ext4 (rw,relatime,errors=remount-ro)
/dev/mmcblk0p3 on /boot/firmware type vfat (rw,noatime,fmask=0022,dmask=0022,codepage=437,iocharset=ascii,shortname=mixed,errors=remount-ro)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants