Compare commits

..

3 Commits

12 changed files with 14 additions and 33 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
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.nix" -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" -A outputs.default
`outputs.default` is intended to do something appropriate for the
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
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.nix" -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" -A outputs.tftpd -o tftpd
$ ./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
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.nix" -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" -A outputs.manifest -o manifest
nix-store -q --tree manifest

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

@ -5,7 +5,6 @@
, lib
, config
, checkedConfig ? {}
, src
, extraPatchPhase ? "true"
} :
@ -16,19 +15,7 @@ let writeConfig = name : config: writeText name
(name: value: (if value == "n" then "# CONFIG_${name} is not set" else "CONFIG_${name}=${value}"))
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 ;
kconfigFile = writeConfig "kconfig" config;
inherit lib; in
stdenv.mkDerivation rec {
name = "kernel";
@ -81,13 +68,12 @@ stdenv.mkDerivation rec {
export KBUILD_OUTPUT=`pwd`
cp ${kconfigFile} .config
cp ${kconfigFile} .config.orig
cp ${kconfigLocal} Kconfig.local
make V=1 olddefconfig
'';
checkConfigurationPhase = ''
echo Checking required config items:
if comm -2 -3 <(grep 'CONFIG' ${checkedConfigFile} |sort) <(grep 'CONFIG' .config|sort) |grep '.' ; then
if comm -2 -3 <(grep 'CONFIG' ${kconfigFile} |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"
exit 0
fi

View File

@ -1,5 +1,5 @@
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.vmlinux -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 -o vmlinux $*
TESTS=$(cat <<"EOF"

View File

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

View File

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