Compare commits

..

No commits in common. "99d695930fde7af496ab2ba7543518ea3dbd29f9" and "a834656fefc368201e762efe543d5346eeabff18" have entirely different histories.

12 changed files with 33 additions and 14 deletions

View File

@ -56,7 +56,7 @@ hardware device definition as argument `device`, and to choose an
appropriate output attribute depending on what your device is and how appropriate output attribute depending on what your device is and how
you plan to install onto it. For example: you plan to install onto it. For example:
NIX_PATH=nixpkgs=../nixpkgs:$NIX_PATH NIXPKGS_ALLOW_UNSUPPORTED_SYSTEM=1 nix-build -I liminix-config=./tests/smoke/configuration.nix --arg device "import ./devices/qemu" -A outputs.default NIX_PATH=nixpkgs=../nixpkgs:$NIX_PATH NIXPKGS_ALLOW_UNSUPPORTED_SYSTEM=1 nix-build -I liminix-config=./tests/smoke/configuration.nix --arg device "import ./devices/qemu.nix" -A outputs.default
`outputs.default` is intended to do something appropriate for the `outputs.default` is intended to do something appropriate for the
device, whatever that is. For the qemu device, it creates a directory device, whatever that is. For the qemu device, it creates a directory
@ -129,7 +129,7 @@ internet or mucking about copying files to `/tftproot`. If the
permitted device is to be given the IP address 192.168.8.251 you might permitted device is to be given the IP address 192.168.8.251 you might
do something like this: do something like this:
$ NIX_PATH=nixpkgs=../nixpkgs:$NIX_PATH NIXPKGS_ALLOW_UNSUPPORTED_SYSTEM=1 nix-build -I liminix-config=./tests/smoke/configuration.nix --arg device "import ./devices/gl-ar750" -A outputs.tftpd -o tftpd $ NIX_PATH=nixpkgs=../nixpkgs:$NIX_PATH NIXPKGS_ALLOW_UNSUPPORTED_SYSTEM=1 nix-build -I liminix-config=./tests/smoke/configuration.nix --arg device "import ./devices/gl-ar750.nix" -A outputs.tftpd -o tftpd
$ ./tftpd/bin/tufted -a 192.168.8.251 result $ ./tftpd/bin/tufted -a 192.168.8.251 result
@ -142,7 +142,7 @@ because it has dependencies on other things you didn't know about. Build the
`outputs.manifest` attribute, which is a json representation of the `outputs.manifest` attribute, which is a json representation of the
filesystem, and you can run `nix-store --query` on it: filesystem, and you can run `nix-store --query` on it:
NIX_PATH=nixpkgs=../nixpkgs:$NIX_PATH NIXPKGS_ALLOW_UNSUPPORTED_SYSTEM=1 nix-build -I liminix-config=path/to/your/configuration.nix --arg device "import ./devices/qemu" -A outputs.manifest -o manifest NIX_PATH=nixpkgs=../nixpkgs:$NIX_PATH NIXPKGS_ALLOW_UNSUPPORTED_SYSTEM=1 nix-build -I liminix-config=path/to/your/configuration.nix --arg device "import ./devices/qemu.nix" -A outputs.manifest -o manifest
nix-store -q --tree manifest nix-store -q --tree manifest

View File

@ -29,7 +29,7 @@ let
outputs = rec { outputs = rec {
inherit squashfs; inherit squashfs;
kernel = nixpkgs.kernel.override { kernel = nixpkgs.kernel.override {
inherit (config.kernel) config; inherit (config.kernel) config checkedConfig;
}; };
dtb = (callPackage ./kernel/dtb.nix {}) { dtb = (callPackage ./kernel/dtb.nix {}) {
dts = "${openwrt}/target/linux/ath79/dts/qca9531_glinet_gl-ar750.dts"; dts = "${openwrt}/target/linux/ath79/dts/qca9531_glinet_gl-ar750.dts";

View File

@ -62,7 +62,7 @@
}; };
}; };
kernel = rec { kernel = rec {
config = { checkedConfig = {
MIPS_ELF_APPENDED_DTB = "y"; MIPS_ELF_APPENDED_DTB = "y";
OF = "y"; OF = "y";
USE_OF = "y"; USE_OF = "y";

View File

@ -29,7 +29,7 @@
}; };
kernel = { kernel = {
config = { checkedConfig = {
MIPS_MALTA= "y"; MIPS_MALTA= "y";
CPU_LITTLE_ENDIAN= "n"; CPU_LITTLE_ENDIAN= "n";
CPU_BIG_ENDIAN= "y"; CPU_BIG_ENDIAN= "y";

View File

@ -2,12 +2,13 @@
callPackage callPackage
, config , config
, checkedConfig
, sources , sources
}: }:
{ {
vmlinux = callPackage ./vmlinux.nix { vmlinux = callPackage ./vmlinux.nix {
tree = sources.kernel; tree = sources.kernel;
inherit config; inherit config checkedConfig;
}; };
uimage = callPackage ./uimage.nix { }; uimage = callPackage ./uimage.nix { };

View File

@ -29,6 +29,10 @@ in {
# other strings are also used # other strings are also used
type = types.attrsOf types.nonEmptyStr; type = types.attrsOf types.nonEmptyStr;
}; };
checkedConfig = mkOption {
type = types.attrsOf types.nonEmptyStr;
default = {};
};
}; };
boot.commandLine = mkOption { boot.commandLine = mkOption {
type = types.listOf types.nonEmptyStr; type = types.listOf types.nonEmptyStr;
@ -67,6 +71,7 @@ in {
TMPFS_POSIX_ACL = "y"; TMPFS_POSIX_ACL = "y";
TMPFS_XATTR = "y"; TMPFS_XATTR = "y";
}; };
checkedConfig = config;
}; };
boot.commandLine = [ boot.commandLine = [
"earlyprintk=serial,ttyS0 console=ttyS0,115200 panic=10 oops=panic init=/bin/init loglevel=8 rootfstype=squashfs" "earlyprintk=serial,ttyS0 console=ttyS0,115200 panic=10 oops=panic init=/bin/init loglevel=8 rootfstype=squashfs"

View File

@ -5,7 +5,7 @@
{ {
config = { config = {
kernel = { kernel = {
config = { checkedConfig = {
MTD = "y"; MTD = "y";
MTD_PHRAM = "y"; MTD_PHRAM = "y";
MTD_CMDLINE_PARTS = "y"; MTD_CMDLINE_PARTS = "y";

View File

@ -7,7 +7,7 @@ let
in { in {
config = { config = {
kernel = rec { kernel = rec {
config = { checkedConfig = {
CFG80211= "y"; CFG80211= "y";
MAC80211= "y"; MAC80211= "y";
MAC80211_MESH= "y"; MAC80211_MESH= "y";

View File

@ -5,6 +5,7 @@
, lib , lib
, config , config
, checkedConfig ? {}
, src , src
, extraPatchPhase ? "true" , extraPatchPhase ? "true"
} : } :
@ -15,7 +16,19 @@ let writeConfig = name : config: writeText name
(name: value: (if value == "n" then "# CONFIG_${name} is not set" else "CONFIG_${name}=${value}")) (name: value: (if value == "n" then "# CONFIG_${name} is not set" else "CONFIG_${name}=${value}"))
config config
)); ));
kconfigFile = writeConfig "kconfig" config; kconfigFile = writeConfig "kconfig" (config // checkedConfig);
# KLUDGE FIXME. some symbols we need to enable in some configurations don't
# have a prompt (!), so we can't turn them on just by adding FOO=y and make oldconfig
#
# (!) yes, that was my reaction too
kconfigLocal = writeText "Kconfig.local" ''
config LIMINIX
prompt "Local symbols"
bool
default y
select SOC_QCA955X
'';
checkedConfigFile = writeConfig "checked_kconfig" checkedConfig ;
inherit lib; in inherit lib; in
stdenv.mkDerivation rec { stdenv.mkDerivation rec {
name = "kernel"; name = "kernel";
@ -68,12 +81,13 @@ stdenv.mkDerivation rec {
export KBUILD_OUTPUT=`pwd` export KBUILD_OUTPUT=`pwd`
cp ${kconfigFile} .config cp ${kconfigFile} .config
cp ${kconfigFile} .config.orig cp ${kconfigFile} .config.orig
cp ${kconfigLocal} Kconfig.local
make V=1 olddefconfig make V=1 olddefconfig
''; '';
checkConfigurationPhase = '' checkConfigurationPhase = ''
echo Checking required config items: echo Checking required config items:
if comm -2 -3 <(grep 'CONFIG' ${kconfigFile} |sort) <(grep 'CONFIG' .config|sort) |grep '.' ; then if comm -2 -3 <(grep 'CONFIG' ${checkedConfigFile} |sort) <(grep 'CONFIG' .config|sort) |grep '.' ; then
echo -e "^^^ Some configuration lost :-(\nPerhaps you have mutually incompatible settings, or have disabled options on which these depend.\n" echo -e "^^^ Some configuration lost :-(\nPerhaps you have mutually incompatible settings, or have disabled options on which these depend.\n"
exit 0 exit 0
fi fi

View File

@ -1,5 +1,5 @@
set -e set -e
NIXPKGS_ALLOW_UNSUPPORTED_SYSTEM=1 nix-build '<liminix>' -I liminix-config=../smoke/configuration.nix --arg device "import <liminix/devices/$DEVICE>" -A outputs.kernel -o vmlinux $* NIXPKGS_ALLOW_UNSUPPORTED_SYSTEM=1 nix-build '<liminix>' -I liminix-config=../smoke/configuration.nix --arg device "import <liminix/devices/$DEVICE>" -A outputs.kernel.vmlinux -o vmlinux $*
TESTS=$(cat <<"EOF" TESTS=$(cat <<"EOF"

View File

@ -21,7 +21,6 @@ in rec {
"PPP" = "y"; "PPP" = "y";
"PPPOE" = "y"; "PPPOE" = "y";
"PPPOL2TP" = "y"; "PPPOL2TP" = "y";
"L2TP" = "y";
"PPP_ASYNC" = "y"; "PPP_ASYNC" = "y";
"PPP_BSDCOMP" = "y"; "PPP_BSDCOMP" = "y";
"PPP_DEFLATE" = "y"; "PPP_DEFLATE" = "y";

View File

@ -15,7 +15,7 @@ in rec {
imports = [ ../../modules/wlan.nix ]; imports = [ ../../modules/wlan.nix ];
kernel.config = { kernel.checkedConfig = {
MAC80211_HWSIM = "y"; MAC80211_HWSIM = "y";
}; };