Skip to content

generate-config.pl does not work well with boot.kernelPatches.extraConfig #59914

@nh2

Description

@nh2

Issue description

I have the fealing that the generate-config.pl script is pretty bugged, it keeps failing with repeated question and spews out tons of Error in reading or end of file. afterwards when trying to use boot.kernelPatches.extraConfig:

Output:

QUESTION:     USB Test and Measurement Class support, NAME: USB_TMC, ALTS: N/m/?, ANSWER: m
GOT: 
GOT:     *
GOT:     * NOTE: USB_STORAGE depends on SCSI but BLK_DEV_SD may
GOT:     *
GOT:     *
GOT:     * also be needed; see USB_STORAGE Help for more info
GOT:     *
QUESTION:     USB Mass Storage support, NAME: USB_STORAGE, ALTS: M/n/?, ANSWER: y
GOT: 
GOT: 
GOT: CONFIG_USB_STORAGE:
GOT: 
GOT: Say Y here if you want to connect USB mass storage devices to your
GOT: computer's USB port. This is the driver you need for USB
GOT: floppy drives, USB hard disks, USB tape drives, USB CD-ROMs,
GOT: USB flash devices, and memory sticks, along with
GOT: similar devices. This driver may also be used for some cameras
GOT: and card readers.
GOT: 
GOT: This option depends on 'SCSI' support being enabled, but you
GOT: probably also need 'SCSI device support: SCSI disk support'
GOT: (BLK_DEV_SD) for most USB storage devices.
GOT: 
GOT: To compile this driver as a module, choose M here: the
GOT: module will be called usb-storage.
GOT: 
GOT: Symbol: USB_STORAGE [=m]
GOT: Type  : tristate
GOT: Prompt: USB Mass Storage support
GOT:   Location:
GOT:     -> Device Drivers
GOT:       -> USB support (USB_SUPPORT [=y])
GOT:         -> Support for Host-side USB (USB [=m])
GOT:   Defined at drivers/usb/storage/Kconfig:8
GOT:   Depends on: USB_SUPPORT [=y] && USB [=m] && SCSI [=y]
GOT: 
GOT: 
GOT: 
QUESTION:     USB Mass Storage support, NAME: USB_STORAGE, ALTS: M/n/?, ANSWER: y
repeated question:     USB Mass Storage support at /nix/store/l6m0lgcrls587pz0i644jhfjk6lyj55s-generate-config.pl line 81.

Error in reading or end of file.

Error in reading or end of file.

Error in reading or end of file.

Error in reading or end of file.

and lots more of that, eventually failing with builder for '/nix/store/jjmxf3ivfp7xbz0y9bcqd9swvfrrc6h9-linux-config-4.4.178.drv' failed with exit code 255.

Indeed, it asked a question twice, should the script handle that if stuff is being patched?

Steps to reproduce

  boot.kernelPatches = [ {
    name = "chromiumos-inspired";
    patch = null;
    # https://cateee.net/lkddb/web-lkddb/BLK_DEV_SD.html
    #   Do not compile this driver as a module if your root file system
    #   (the one containing the directory /) is located on a SCSI disk.
    #   In this case, do not compile the driver for your SCSI host
    #   adapter (below) as a module either.
    extraConfig = ''
      SCSI y
      SCSI_MOD y
      BLK_DEV_SD y
      SCSI_SPI_ATTRS y
      ATA y
      SATA_AHCI y
      ATA_GENERIC y

      BLK_DEV_DM y
      DM_BUFIO y
      DM_BIO_PRISON y
      DM_PERSISTENT_DATA y
      DM_CRYPT y
      DM_THIN_PROVISIONING y
      DM_VERITY y

      USB_NET_DRIVERS y

      INPUT_EVDEV y

      KEYBOARD_CROS_EC y

      SERIO y
      SERIO_I8042 y
      SERIO_LIBPS2 y

      HW_RANDOM y
      HW_RANDOM_TPM y
      HW_RANDOM_INTEL y
      NVRAM y
      TCG_TPM y
      TCG_TIS y
      DEVPORT y

      ITCO_WDT y
      ITCO_VENDOR_SUPPORT y

      SSB_SDIOHOST y

      AGP y
      AGP_INTEL y
      INTEL_GTT y
      DRM y
      DRM_KMS_HELPER y

      FB_SYS_FILLRECT y
      FB_SYS_COPYAREA y
      FB_SYS_IMAGEBLIT y
      FB_SYS_FOPS y
      BACKLIGHT_GENERIC y

      #USB_STORAGE y
      USB_STORAGE_REALTEK y
      USB_UAS y
      USB_SERIAL y

      MMC y
      MMC_BLOCK y
      MMC_BLOCK_MINORS 16

      MMC_SDHCI y
      MMC_SDHCI_PCI y
      MMC_SDHCI_ACPI y
      LEDS_CLASS y

      DMA_OF y

      ASHMEM y
      ANDROID_TIMED_OUTPUT y
      ANDROID_TIMED_GPIO y
      SYNC y
      SW_SYNC y
      SW_SYNC_USER y
      ION y
      ION_DUMMY y
      ACPI_WMI y
      MXM_WMI y

      CHROMEOS_LAPTOP y
      CHROMEOS_PSTORE y
      CROS_EC_CHARDEV y
      CROS_EC_LPC y

      GOOGLE_FIRMWARE y

      EFI_VARS y
      EFI_VARS_PSTORE y
      EXT4_FS y
      EXT4_USE_FOR_EXT2 y
      EXT4_ENCRYPTION y
      JBD2 y
      FS_MBCACHE y
      AUTOFS4_FS y

      PSTORE_RAM y

      ENCRYPTED_KEYS y

      LSM_MMAP_MIN_ADDR 32768
      SECURITY_SELINUX_BOOTPARAM_VALUE 1
      DEFAULT_SECURITY "selinux"
    '';

Technical details

On commit 05a53ec

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions