#!/usr/bin/env bash # This script is expected to be used to copy back the `kernel-builder` built # linux configuration to the kernel's source directory. # # Use this to normalize the configuration after: # # - Changing configuration options # - Changing the kernel version set -e set -u PS4=" $ " if (( $# != 2 )); then echo "Usage: bin/kernel-normalize-config " exit 1 fi device="$1"; shift out="$1"; shift set -x build() { nix-build --no-out-link -A config.mobile.device.info.kernel --argstr device "$device" } # The first one actively rebuilds to get the config... cp "$(build)/build.config" "$out" # This one rebuilds with the (assumedly) normalized config cp "$(build)/build.config" "$out" # This last copy and build is likely useless. Though it's a quick no-op cp "$(build)/build.config" "$out"