composefs/grub: Type 1 entry order is arbitrary when os-release has no VERSION_ID/VERSION
Los mantenedores suelen responder en 2 días
Nadie ha tomado este issue todavía.
Evaluación
- Dificultad
- 2/5
- Tiempo estimado
- 1-3 horas
- Aptitud para principiantes
- 76/100
- Tipo de issue
- Error
- Claridad
- Bien especificado
- Estado de actividad
- Activo
- Stack tecnológico
- rust
- Área
- operating-systems
Línea de trabajo
Empieza en crates/lib/src/bootc_composefs/boot.rs en el fallback version_opt.unwrap_or_else(|| id.to_hex()) dentro de setup_composefs_bls_boot, luego lee type1_entry_conf_file_name y get_sorted_type1_boot_entries (b.filename.cmp(&a.filename)) para ver cómo el campo de versión acaba en el nombre de archivo. Sustituye el digest por una constante para la ordenación mientras mantienes el digest en el título, luego reproduce con dos BLSConfigs pasados a get_sorted_type1_boot_entries_helper(.., Bootloader::Grub) y ejecuta las pruebas de arranque de composefs. Hecho significa que la entrada de prioridad -1 se ordena primero independientemente del digest.
Escrito por el modelo de indexación a partir del texto del issue.
Descripción
Summary
When composefs uses GRUB with Type 1 entries, bootc orders the entries by file name, descending (get_sorted_type1_boot_entries, Bootloader::Grub → b.filename.cmp(&a.filename), see #2221). The file name is bootc_{os_id}-{version}-{priority}.conf (type1_entry_conf_file_name). version comes from VERSION_ID, then VERSION, in /usr/lib/os-release.
Some os-release files have neither key, for example Debian sid/testing and Arch Linux. For those, setup_composefs_bls_boot falls back to the deployment's verity digest:
// crates/lib/src/bootc_composefs/boot.rs (main @ 2a59b59, also v1.16.10)
version_opt.unwrap_or_else(|| id.to_hex()),
As a result, the version field is a random hex string that changes with every deployment, and it sorts before the priority field. After an upgrade:
loader/entries/bootc_debian-3f…(new digest)…-1.conf # primary (new)
loader/entries/bootc_debian-c0…(old digest)…-0.conf # secondary (booted)
The descending file-name order puts the old deployment first here, because c > 3. So bootc (and GRUB's blscfg, which uses the same name-version-release order) treats the old deployment as the default, and the upgrade is never booted. With other digests the new one wins. bootc rollback swaps only the priority field, so it is just as arbitrary.
With systemd-boot this does not happen, because the sort-key (bootc-{os_id}-{0,1}) comes first.
Reproducer
bootc install to-disk --composefs-backend --bootloader gruban image whose/usr/lib/os-releasehas noVERSION_IDand noVERSION. A Debian sid based bootc image works, and so does the stock Arch os-release.bootc upgradeto a new image, then reboot so thatbootc-finalize-stagedruns.ls /sysroot/boot/loader/entries: the two entries differ only in the digest and the priority. The-1(new) entry is first only when its digest sorts higher.
The logic needs no VM. Feed two BLSConfigs named as above to get_sorted_type1_boot_entries_helper(.., Bootloader::Grub), and the order follows the digests.
Possible fix
When os-release has no version, use a constant (for example 0) in place of the digest. Then the priority (release) field decides between the deployments of one OS, as it does when VERSION_ID stays the same across builds. The title/version shown to the user can keep the digest.
Context
We hit this while booting TunaOS flounder:gnome-sid (Debian sid, bootc 1.16.10, composefs) through a GRUB chain (tuna-os/wootc#768).
- Lenguaje dominante
- Rust
- Estrellas
- 2.3k
- Forks
- 230
- Merge medio
- 2 d 11 h
- PR fusionados (30 d)
- 42
Preparar el entorno
Primeros pasos
- Lee el issue completo y luego la guía de contribución del proyecto.
- Comenta en el issue que vas a ocuparte — evita que dos personas hagan lo mismo.
- Haz un fork del repositorio y trabaja en una rama.
- Abre un pull request que haga referencia al número del issue.
Más de bootc-dev/bootc
-
Dificultad 2/5 1-3 horas Aptitud para principiantes 68/100
Los mantenedores suelen responder en 2 días
-
install: improve error message when systemd-boot is selected without composefs backendQuizá libre de nuevo Un pull request para esta issue se cerró sin fusionarse. Abierto
Dificultad 2/5 1-3 horas Aptitud para principiantes 76/100
Los mantenedores suelen responder en 2 días
-
Dificultad 4/5 3-5 días Aptitud para principiantes 55/100
Los mantenedores suelen responder en 2 días
-
Dificultad 5/5 Más de una semana Aptitud para principiantes 30/100
Los mantenedores suelen responder en 2 días
-
Dificultad 3/5 1-2 días Aptitud para principiantes 57/100
Los mantenedores suelen responder en 2 días
Todos los issues de bootc-dev/bootc
Issues similares
-
[Bug]: layer.move to the place a layer already has fails and stops a script; with several layers it leaves an empty undo stepPosiblemente ocupada @jgregoriorincon la tomó hoy. Abierto
Dificultad 2/5 1-3 horas Aptitud para principiantes 78/100
opengeos/RustGIS#2621 · 1 comentario ·
Los mantenedores suelen responder en 1 día
-
good first issue web
Dificultad 1/5 Menos de una hora Aptitud para principiantes 92/100
Los mantenedores suelen responder en 1 día
-
Dificultad 2/5 1-3 horas Aptitud para principiantes 70/100
-
Wait for the IDS correction dialog to settle in the stale-audit testPosiblemente ocupada @louistrue la tomó hoy. Abiertoready
Dificultad 2/5 1-3 horas Aptitud para principiantes 68/100
Los mantenedores suelen responder en 1 día
-
Dificultad 2/5 1-3 horas Aptitud para principiantes 70/100
Los mantenedores suelen responder en 1 día