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

linux: fix generate-config's handling of "no-choice" options #107181

Merged
merged 1 commit into from Jan 12, 2021

Conversation

lheckemann
Copy link
Member

Motivation for this change

Prior to this change, the script could potentially get confused by
"menus" containing only one valid option. Thus, with

CPU_BIG_ENDIAN = no;
CPU_LITTLE_ENDIAN = yes;
ARM64_PA_BITS_48 = yes;

the endianness would be set incorrectly:

GOT: Physical address space size
GOT: > 1. 48-bit (ARM64_PA_BITS_48)
GOT: choice[1]: 1
GOT: Endianness
GOT: 1. Build big-endian kernel (CPU_BIG_ENDIAN)
GOT: > 2. Build little-endian kernel (CPU_LITTLE_ENDIAN)
CHOICE: 1-2?, ANSWER: 1

This commit fixes this error by forgetting previous menu choices if a
line that follows a menu option is neither another menu option nor the
prompt for choosing one of the options.

Things done
  • Compared linux.configfile before and after this change → identical
  • Fits CONTRIBUTING.md.

@lheckemann lheckemann added the 9.needs: port to stable A PR needs a backport to the stable release. label Dec 19, 2020
Prior to this change, the script could potentially get confused by
"menus" containing only one valid option. Thus, with

CPU_BIG_ENDIAN = no;
CPU_LITTLE_ENDIAN = yes;
ARM64_PA_BITS_48 = yes;

the endianness would be set incorrectly:

GOT: Physical address space size
GOT: > 1. 48-bit (ARM64_PA_BITS_48)
GOT: choice[1]: 1
GOT: Endianness
GOT:   1. Build big-endian kernel (CPU_BIG_ENDIAN)
GOT: > 2. Build little-endian kernel (CPU_LITTLE_ENDIAN)
CHOICE: 1-2?, ANSWER: 1

This commit fixes this error by forgetting previous menu choices if a
line that follows a menu option is neither another menu option nor the
prompt for choosing one of the options.
@womfoo
Copy link
Member

womfoo commented Jan 11, 2021

Thanks @lheckemann! This fixes booting issues on my helios64 (sd-image from angerman/nixos-docker-sd-image-builder)

@lheckemann lheckemann merged commit 97c0e5d into NixOS:master Jan 12, 2021
@lheckemann lheckemann deleted the generate-config-fix branch January 12, 2021 10:14
@erictapen
Copy link
Member

I just backported this in cae18d1, as this seems sane to backport to me.

@erictapen erictapen added 8.has: port to stable A PR already has a backport to the stable release. and removed 9.needs: port to stable A PR needs a backport to the stable release. labels Jan 13, 2021
@lheckemann
Copy link
Member Author

Thanks!

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

Successfully merging this pull request may close these issues.

None yet

3 participants