Compare commits
No commits in common. "b52133a28bfc8bd7e264a9a3b9ea0cce7e64224a" and "ac8b971cc0dcb4846405ed782a2a8c39fd3d9e32" have entirely different histories.
b52133a28b
...
ac8b971cc0
9
NEWS
9
NEWS
@ -132,13 +132,4 @@ and then run the generated `install.sh` script
|
|||||||
|
|
||||||
result/install.sh root@192.168.8.1
|
result/install.sh root@192.168.8.1
|
||||||
|
|
||||||
2024-12-16
|
|
||||||
|
|
||||||
Config options changed: if you had set config.hardware.dts.includes
|
|
||||||
(maybe in an out-of-tree device port) to specify the search paths
|
|
||||||
in which dtc finds include files, you will need to change this to
|
|
||||||
hardware.dts.includePaths.
|
|
||||||
|
|
||||||
The "new" hardware.dts.includes option is now for dtsi files which
|
|
||||||
should be merged into the device tree.
|
|
||||||
|
|
||||||
|
29
THOUGHTS.txt
29
THOUGHTS.txt
@ -6539,32 +6539,3 @@ using a Makefile
|
|||||||
|
|
||||||
idea 2: when a configuration contains levitate, something similar
|
idea 2: when a configuration contains levitate, something similar
|
||||||
but necessarily more "manual" to do the analogous thing
|
but necessarily more "manual" to do the analogous thing
|
||||||
|
|
||||||
|
|
||||||
Sun Dec 15 18:55:55 GMT 2024
|
|
||||||
|
|
||||||
Where we left off with this, rotuer was crashing randomly or failing
|
|
||||||
to boot every time we tried to add log shipping, which is not very
|
|
||||||
ideal. I started doing something with logging to /dev/pmsg0
|
|
||||||
(CONFIG_PSTORE_PMSG) but I think (there seems not to be anything
|
|
||||||
written down :-( ) that the gl-ar750 kernel needs it added to kconfig and device tree
|
|
||||||
|
|
||||||
https://wiki.postmarketos.org/wiki/User:Knuxify/Enabling_pstore_and_ramoops
|
|
||||||
|
|
||||||
we could add a new hardware.dts.dtsi = [] option so that any module
|
|
||||||
could add a new chunk of dts. (Ideally we'd call it `includes`
|
|
||||||
but that conflicts with the existing use of `includes` to specify
|
|
||||||
search path. Maybe rename?)
|
|
||||||
|
|
||||||
would we ever use it except in a hardware device definition?
|
|
||||||
(Or user config?) I guess if we were consistent with names
|
|
||||||
then we could set up nodes in the device file with status="disabled"
|
|
||||||
and enable them in the module, except that dt doesn't consistently
|
|
||||||
use status and in fact there isn't one for reserved-memory
|
|
||||||
|
|
||||||
we could use global config to enable pstore_msg and check it in
|
|
||||||
the device module to enable the needed hw support
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
00PA727 00PA735
|
|
||||||
|
@ -197,7 +197,7 @@
|
|||||||
rootDevice = "ubi0:liminix";
|
rootDevice = "ubi0:liminix";
|
||||||
dts = {
|
dts = {
|
||||||
src = "${openwrt.src}/target/linux/mediatek/dts/mt7622-linksys-e8450-ubi.dts";
|
src = "${openwrt.src}/target/linux/mediatek/dts/mt7622-linksys-e8450-ubi.dts";
|
||||||
includePaths = [
|
includes = [
|
||||||
"${openwrt.src}/target/linux/mediatek/dts"
|
"${openwrt.src}/target/linux/mediatek/dts"
|
||||||
"${config.system.outputs.kernel.modulesupport}/arch/arm64/boot/dts/mediatek/"
|
"${config.system.outputs.kernel.modulesupport}/arch/arm64/boot/dts/mediatek/"
|
||||||
];
|
];
|
||||||
|
@ -116,7 +116,7 @@
|
|||||||
rootDevice = "/dev/mtdblock5";
|
rootDevice = "/dev/mtdblock5";
|
||||||
dts = {
|
dts = {
|
||||||
src = "${openwrt.src}/target/linux/ath79/dts/qca9531_glinet_gl-ar750.dts";
|
src = "${openwrt.src}/target/linux/ath79/dts/qca9531_glinet_gl-ar750.dts";
|
||||||
includePaths = [
|
includes = [
|
||||||
"${openwrt.src}/target/linux/ath79/dts"
|
"${openwrt.src}/target/linux/ath79/dts"
|
||||||
];
|
];
|
||||||
};
|
};
|
||||||
|
@ -81,7 +81,7 @@
|
|||||||
|
|
||||||
dts = {
|
dts = {
|
||||||
src = "${openwrt.src}/target/linux/ramips/dts/mt7620a_glinet_gl-mt300a.dts";
|
src = "${openwrt.src}/target/linux/ramips/dts/mt7620a_glinet_gl-mt300a.dts";
|
||||||
includePaths = [
|
includes = [
|
||||||
"${openwrt.src}/target/linux/ramips/dts"
|
"${openwrt.src}/target/linux/ramips/dts"
|
||||||
];
|
];
|
||||||
};
|
};
|
||||||
|
@ -78,7 +78,7 @@
|
|||||||
|
|
||||||
dts = {
|
dts = {
|
||||||
src = "${openwrt.src}/target/linux/ramips/dts/mt7628an_glinet_gl-mt300n-v2.dts";
|
src = "${openwrt.src}/target/linux/ramips/dts/mt7628an_glinet_gl-mt300n-v2.dts";
|
||||||
includePaths = [
|
includes = [
|
||||||
"${openwrt.src}/target/linux/ramips/dts"
|
"${openwrt.src}/target/linux/ramips/dts"
|
||||||
];
|
];
|
||||||
};
|
};
|
||||||
|
@ -66,7 +66,7 @@
|
|||||||
# *correct* but it does at least boot
|
# *correct* but it does at least boot
|
||||||
dts = lib.mkForce {
|
dts = lib.mkForce {
|
||||||
src = "${config.system.outputs.kernel.modulesupport}/arch/mips/boot/dts/mti/malta.dts";
|
src = "${config.system.outputs.kernel.modulesupport}/arch/mips/boot/dts/mti/malta.dts";
|
||||||
includePaths = [
|
includes = [
|
||||||
"${config.system.outputs.kernel.modulesupport}/arch/mips/boot/dts/"
|
"${config.system.outputs.kernel.modulesupport}/arch/mips/boot/dts/"
|
||||||
];
|
];
|
||||||
};
|
};
|
||||||
|
@ -410,7 +410,7 @@
|
|||||||
rootDevice = "/dev/mtdblock3";
|
rootDevice = "/dev/mtdblock3";
|
||||||
dts = {
|
dts = {
|
||||||
src = "${openwrt.src}/target/linux/ramips/dts/mt7621_tplink_archer-ax23-v1.dts";
|
src = "${openwrt.src}/target/linux/ramips/dts/mt7621_tplink_archer-ax23-v1.dts";
|
||||||
includePaths = [
|
includes = [
|
||||||
"${openwrt.src}/target/linux/ramips/dts"
|
"${openwrt.src}/target/linux/ramips/dts"
|
||||||
"${config.system.outputs.kernel.modulesupport}/arch/arm64/boot/dts/mediatek/"
|
"${config.system.outputs.kernel.modulesupport}/arch/arm64/boot/dts/mediatek/"
|
||||||
];
|
];
|
||||||
|
@ -348,7 +348,7 @@
|
|||||||
|
|
||||||
dts = {
|
dts = {
|
||||||
src = "${config.system.outputs.kernel.modulesupport}/arch/arm/boot/dts/marvell/armada-385-turris-omnia.dts";
|
src = "${config.system.outputs.kernel.modulesupport}/arch/arm/boot/dts/marvell/armada-385-turris-omnia.dts";
|
||||||
includePaths = [
|
includes = [
|
||||||
"${config.system.outputs.kernel.modulesupport}/arch/arm/boot/dts/marvell/"
|
"${config.system.outputs.kernel.modulesupport}/arch/arm/boot/dts/marvell/"
|
||||||
];
|
];
|
||||||
};
|
};
|
||||||
|
@ -124,7 +124,7 @@
|
|||||||
hash = "sha256-ifriAjWzFACrxVWCANZpUaEZgB/0pdbhnTVQytx6ddg=";
|
hash = "sha256-ifriAjWzFACrxVWCANZpUaEZgB/0pdbhnTVQytx6ddg=";
|
||||||
};
|
};
|
||||||
in {
|
in {
|
||||||
imports = [
|
imports = [
|
||||||
# We include it to ensure the bridge functionality
|
# We include it to ensure the bridge functionality
|
||||||
# is available on the target kernel.
|
# is available on the target kernel.
|
||||||
../../modules/bridge
|
../../modules/bridge
|
||||||
@ -184,7 +184,7 @@
|
|||||||
# Actually, this is not what we want.
|
# Actually, this is not what we want.
|
||||||
# This DTS is insufficient.
|
# This DTS is insufficient.
|
||||||
src = ./mt7621_zyxel_nwa50ax.dtsi;
|
src = ./mt7621_zyxel_nwa50ax.dtsi;
|
||||||
includePaths = [
|
includes = [
|
||||||
# Here's one weird trick to make `ubi` detection
|
# Here's one weird trick to make `ubi` detection
|
||||||
# out of the box.
|
# out of the box.
|
||||||
# We will write ubi on /dev/firmware_a:rootfs location
|
# We will write ubi on /dev/firmware_a:rootfs location
|
||||||
@ -233,7 +233,7 @@
|
|||||||
services.zyxel-dual-image = config.boot.zyxel-dual-image.build {
|
services.zyxel-dual-image = config.boot.zyxel-dual-image.build {
|
||||||
ensureActiveImage = "primary";
|
ensureActiveImage = "primary";
|
||||||
# TODO: use mtd names rather…
|
# TODO: use mtd names rather…
|
||||||
# primary and secondary are always /dev/mtd3 by virtue of the
|
# primary and secondary are always /dev/mtd3 by virtue of the
|
||||||
# dtb being not too wrong…
|
# dtb being not too wrong…
|
||||||
# TODO: remove this hack.
|
# TODO: remove this hack.
|
||||||
primaryMtdPartition = "/dev/mtd3";
|
primaryMtdPartition = "/dev/mtd3";
|
||||||
|
@ -24,14 +24,9 @@ in
|
|||||||
only for QEMU.
|
only for QEMU.
|
||||||
'';
|
'';
|
||||||
};
|
};
|
||||||
includePaths = mkOption {
|
|
||||||
default = [ ];
|
|
||||||
description = "List of directories to search for DTS includes (.dtsi files)";
|
|
||||||
type = types.listOf types.path;
|
|
||||||
};
|
|
||||||
includes = mkOption {
|
includes = mkOption {
|
||||||
default = [ ];
|
default = [ ];
|
||||||
description = "\"dtsi\" fragments to include in the generated device tree";
|
description = "List of directories to search for DTS includes (.dtsi files)";
|
||||||
type = types.listOf types.path;
|
type = types.listOf types.path;
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
|
@ -104,8 +104,8 @@ in
|
|||||||
system.outputs = rec {
|
system.outputs = rec {
|
||||||
dtb = liminix.builders.dtb {
|
dtb = liminix.builders.dtb {
|
||||||
inherit (config.boot) commandLine;
|
inherit (config.boot) commandLine;
|
||||||
dts = config.hardware.dts.includes ++ [config.hardware.dts.src];
|
dts = config.hardware.dts.src;
|
||||||
includes = config.hardware.dts.includePaths ++ [
|
includes = config.hardware.dts.includes ++ [
|
||||||
"${o.kernel.headers}/include"
|
"${o.kernel.headers}/include"
|
||||||
];
|
];
|
||||||
};
|
};
|
||||||
|
@ -84,8 +84,6 @@
|
|||||||
(false err) (expect (string.match err "path traversal"))))]
|
(false err) (expect (string.match err "path traversal"))))]
|
||||||
(expect= (append-path "/tmp" "hello") "/tmp/hello")
|
(expect= (append-path "/tmp" "hello") "/tmp/hello")
|
||||||
(expect= (append-path "/tmp/" "hello") "/tmp/hello")
|
(expect= (append-path "/tmp/" "hello") "/tmp/hello")
|
||||||
(expect= (append-path "/tmp/" "///hello") "/tmp/hello")
|
|
||||||
(expect= (append-path "/tmp/" "///hello/../fish") "/tmp/fish")
|
|
||||||
(traps "/tmp/" "../hello")
|
(traps "/tmp/" "../hello")
|
||||||
(expect= (append-path "/tmp/" "hello/../goodbye") "/tmp/goodbye")
|
(expect= (append-path "/tmp/" "hello/../goodbye") "/tmp/goodbye")
|
||||||
(traps "/tmp/" "hello/../../goodbye"))
|
(traps "/tmp/" "hello/../../goodbye"))
|
||||||
|
@ -2,8 +2,6 @@
|
|||||||
stdenv
|
stdenv
|
||||||
, dtc
|
, dtc
|
||||||
, lib
|
, lib
|
||||||
, runCommand
|
|
||||||
, writeText
|
|
||||||
}:
|
}:
|
||||||
{ dts
|
{ dts
|
||||||
, includes
|
, includes
|
||||||
@ -12,20 +10,14 @@
|
|||||||
cppDtSearchFlags = builtins.concatStringsSep " " (map (f: "-I${f}") includes);
|
cppDtSearchFlags = builtins.concatStringsSep " " (map (f: "-I${f}") includes);
|
||||||
dtcSearchFlags = builtins.concatStringsSep " " (map (f: "-i${f}") includes);
|
dtcSearchFlags = builtins.concatStringsSep " " (map (f: "-i${f}") includes);
|
||||||
cmdline = lib.concatStringsSep " " commandLine;
|
cmdline = lib.concatStringsSep " " commandLine;
|
||||||
chosen = writeText "chosen.dtsi" "/{ chosen { bootargs = ${builtins.toJSON cmdline}; }; };";
|
|
||||||
combined = writeText "combined-dts-fragments"
|
|
||||||
(lib.concatStrings
|
|
||||||
(builtins.map
|
|
||||||
(f: "#include \"${f}\"\n")
|
|
||||||
(dts ++ [ chosen ])));
|
|
||||||
in stdenv.mkDerivation {
|
in stdenv.mkDerivation {
|
||||||
name = "dtb";
|
name = "dtb";
|
||||||
phases = [ "buildPhase" ];
|
phases = [ "buildPhase" ];
|
||||||
nativeBuildInputs = [ dtc ];
|
nativeBuildInputs = [ dtc ];
|
||||||
buildPhase = ''
|
buildPhase = ''
|
||||||
${stdenv.cc.targetPrefix}cpp -nostdinc -x assembler-with-cpp ${cppDtSearchFlags} -undef -D__DTS__ -o dtb.tmp ${combined}
|
${stdenv.cc.targetPrefix}cpp -nostdinc -x assembler-with-cpp ${cppDtSearchFlags} -undef -D__DTS__ -o dtb.tmp ${dts}
|
||||||
|
echo '/{ chosen { bootargs = ${builtins.toJSON cmdline}; }; };' >> dtb.tmp
|
||||||
dtc ${dtcSearchFlags} -I dts -O dtb -o $out dtb.tmp
|
dtc ${dtcSearchFlags} -I dts -O dtb -o $out dtb.tmp
|
||||||
# dtc -I dtb -O dts $out
|
|
||||||
test -e $out
|
test -e $out
|
||||||
'';
|
'';
|
||||||
}
|
}
|
||||||
|
@ -16,18 +16,10 @@
|
|||||||
|
|
||||||
(print (.. "TFTP serving from " options.base-directory))
|
(print (.. "TFTP serving from " options.base-directory))
|
||||||
|
|
||||||
;; this is a copy of anoia append-path
|
(fn merge-pathname [directory filename]
|
||||||
(fn merge-pathname [dirname filename]
|
(if (directory:match "/$")
|
||||||
(let [base (or (string.match dirname "(.*)/$") dirname)
|
(.. directory filename)
|
||||||
result []]
|
(.. directory "/" filename)))
|
||||||
(each [component (string.gmatch filename "([^/]+)")]
|
|
||||||
(if (and (= component "..") (> (# result) 0))
|
|
||||||
(table.remove result)
|
|
||||||
(= component "..")
|
|
||||||
(error "path traversal attempt")
|
|
||||||
true
|
|
||||||
(table.insert result component)))
|
|
||||||
(.. base "/" (table.concat result "/"))))
|
|
||||||
|
|
||||||
(->
|
(->
|
||||||
(tftp:listen
|
(tftp:listen
|
||||||
|
Loading…
Reference in New Issue
Block a user