make volume label different for alt-boot mode

this helps differentiate the modes to end users
This commit is contained in:
bunnie 2025-10-28 23:54:20 +08:00
parent 4235cba854
commit 395791b70b

View file

@ -44,6 +44,12 @@ fn fill_sparse_data(dest: &mut [u8], offset: usize) {
let copy_len = (dest.len().saturating_sub(write_start_in_dest)).min(block.len());
dest[write_start_in_dest..write_start_in_dest + copy_len].copy_from_slice(&block[..copy_len]);
#[cfg(feature = "alt-boot1")]
// patch the volume name so we can tell alt-boot apart
if addr == 0x410000 {
// patch ALT over BAO. Assumes that the block is aligned.
dest[write_start_in_dest..write_start_in_dest + 3].copy_from_slice(&[0x41, 0x4c, 0x54])
}
}
}