composefs/grub: Type 1 entry order is arbitrary when os-release has no VERSION_ID/VERSION
Mantenedores costumam responder em até 2 dias
Ninguém assumiu esta issue ainda.
Avaliação
- Dificuldade
- 2/5
- Tempo estimado
- 1-3 horas
- Facilidade para iniciantes
- 76/100
- Tipo de issue
- Bug
- Clareza
- Claramente especificada
- Status de atividade
- Ativa
- Stack de tecnologia
- rust
- Domínio
- operating-systems
Direção de pesquisa
Comece em crates/lib/src/bootc_composefs/boot.rs no fallback version_opt.unwrap_or_else(|| id.to_hex()) dentro de setup_composefs_bls_boot, depois leia type1_entry_conf_file_name e get_sorted_type1_boot_entries (b.filename.cmp(&a.filename)) para ver como o campo de versão vai parar no nome do arquivo. Substitua o digest por uma constante para a ordenação, mantendo o digest no título, depois reproduza com dois BLSConfigs passados para get_sorted_type1_boot_entries_helper(.., Bootloader::Grub) e execute os testes de boot do composefs. Pronto significa que a entrada de prioridade -1 é ordenada primeiro, independentemente do digest.
Escrita pelo modelo de indexação a partir do texto da issue.
Descrição
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).
- Linguagem predominante
- Rust
- Estrelas
- 2.3k
- Forks
- 230
- Merge médio
- 2d 11h
- PRs com merge (30d)
- 42
Preparar o ambiente
Primeiros passos
- Leia a issue inteira e depois o guia de contribuição do projeto.
- Comente na issue dizendo que vai assumir — evita que duas pessoas façam o mesmo trabalho.
- Faça um fork do repositório e trabalhe em uma branch.
- Abra um pull request que referencie o número da issue.
Mais de bootc-dev/bootc
-
Dificuldade 2/5 1-3 horas Facilidade para iniciantes 68/100
Mantenedores costumam responder em até 2 dias
-
install: improve error message when systemd-boot is selected without composefs backendTalvez livre de novo Um pull request para esta issue foi fechado sem ser mesclado. Aberta
Dificuldade 2/5 1-3 horas Facilidade para iniciantes 76/100
Mantenedores costumam responder em até 2 dias
-
Dificuldade 4/5 3-5 dias Facilidade para iniciantes 55/100
Mantenedores costumam responder em até 2 dias
-
Dificuldade 5/5 Mais de uma semana Facilidade para iniciantes 30/100
Mantenedores costumam responder em até 2 dias
-
Dificuldade 3/5 1-2 dias Facilidade para iniciantes 57/100
Mantenedores costumam responder em até 2 dias
Todas as issues de bootc-dev/bootc
Issues semelhantes
-
[Bug]: layer.move to the place a layer already has fails and stops a script; with several layers it leaves an empty undo stepTalvez já em andamento @jgregoriorincon assumiu hoje. Aberta
Dificuldade 2/5 1-3 horas Facilidade para iniciantes 78/100
opengeos/RustGIS#2621 · 1 comentário ·
Mantenedores costumam responder em até 1 dia
-
good first issue web
Dificuldade 1/5 Menos de uma hora Facilidade para iniciantes 92/100
Mantenedores costumam responder em até 1 dia
-
Dificuldade 2/5 1-3 horas Facilidade para iniciantes 70/100
-
Wait for the IDS correction dialog to settle in the stale-audit testTalvez já em andamento @louistrue assumiu hoje. Abertaready
Dificuldade 2/5 1-3 horas Facilidade para iniciantes 68/100
Mantenedores costumam responder em até 1 dia
-
Dificuldade 2/5 1-3 horas Facilidade para iniciantes 70/100
Mantenedores costumam responder em até 1 dia