Compare commits
No commits in common. "a89f866bf0a054dda12efaec52c34b51ab1ee24a" and "a7b5f8067486f3a51372c6431f64a3bc6f2cc653" have entirely different histories.
a89f866bf0
...
a7b5f80674
36
THOUGHTS.txt
36
THOUGHTS.txt
@ -6634,39 +6634,3 @@ Read 7491584 bytes from volume recovery to 0000000048000000
|
|||||||
Using 'config-1' configuration
|
Using 'config-1' configuration
|
||||||
Trying 'kernel-1' kernel subimage
|
Trying 'kernel-1' kernel subimage
|
||||||
Description: ARM64 OpenWrt Linux-6.6.45
|
Description: ARM64 OpenWrt Linux-6.6.45
|
||||||
|
|
||||||
Sun Dec 22 17:39:56 GMT 2024
|
|
||||||
|
|
||||||
From the output above it looks like the device I have plugged in has
|
|
||||||
an openwrt "recovery" image but not a "production" image
|
|
||||||
|
|
||||||
It also looks like it will be quite hard work to persuade it to boot
|
|
||||||
from usb or anything. It doesn't have any of the extlinux stuff
|
|
||||||
but it does have uefi for what that's worth
|
|
||||||
|
|
||||||
default boot_production command reads a ubi volume called 'fit' and
|
|
||||||
calls bootm on what it finds
|
|
||||||
|
|
||||||
we could define boot_production to ubifsmount liminix; ubifs load
|
|
||||||
<addr> <filename> (which is a fit) and bootm it. *presumably* we could
|
|
||||||
do this from the openwrt recovery image
|
|
||||||
|
|
||||||
but could we install the whole system using said recovery image? I
|
|
||||||
expect we could do, it only requires getting a tarball onto it and
|
|
||||||
unpacking it
|
|
||||||
|
|
||||||
however, extlinux is not going to be helpful
|
|
||||||
(actually it might be a bit, if we ask it to write the fit as
|
|
||||||
well as/instead of the individual files)
|
|
||||||
|
|
||||||
maybe we need separate concepts of "the filesystem contains
|
|
||||||
stuff we need for boot" and "the stuff we need is the stuff
|
|
||||||
that extlinux needs"
|
|
||||||
|
|
||||||
each bootloader makes an output called bootfiles, and
|
|
||||||
the bootablerootdir output copies from bootfiles
|
|
||||||
|
|
||||||
Mon Dec 23 18:28:50 GMT 2024
|
|
||||||
|
|
||||||
it might be worth moving ubi option decls into the hardware module, if
|
|
||||||
they're hardware-dependent
|
|
||||||
|
@ -76,6 +76,11 @@
|
|||||||
];
|
];
|
||||||
config = {
|
config = {
|
||||||
kernel = {
|
kernel = {
|
||||||
|
src = pkgs.pkgsBuildBuild.fetchurl {
|
||||||
|
name = "linux.tar.gz";
|
||||||
|
url = "https://cdn.kernel.org/pub/linux/kernel/v5.x/linux-5.15.137.tar.gz";
|
||||||
|
hash = "sha256-PkdzUKZ0IpBiWe/RS70J76JKnBFzRblWcKlaIFNxnHQ=";
|
||||||
|
};
|
||||||
extraPatchPhase = ''
|
extraPatchPhase = ''
|
||||||
${pkgs.openwrt.applyPatches.mediatek}
|
${pkgs.openwrt.applyPatches.mediatek}
|
||||||
'';
|
'';
|
||||||
|
@ -5,6 +5,11 @@
|
|||||||
];
|
];
|
||||||
config = {
|
config = {
|
||||||
kernel = {
|
kernel = {
|
||||||
|
src = pkgs.pkgsBuildBuild.fetchurl {
|
||||||
|
name = "linux.tar.gz";
|
||||||
|
url = "https://cdn.kernel.org/pub/linux/kernel/v5.x/linux-5.15.137.tar.gz";
|
||||||
|
hash = "sha256-PkdzUKZ0IpBiWe/RS70J76JKnBFzRblWcKlaIFNxnHQ=";
|
||||||
|
};
|
||||||
config = {
|
config = {
|
||||||
MTD = "y";
|
MTD = "y";
|
||||||
MTD_BLOCK = "y";
|
MTD_BLOCK = "y";
|
||||||
|
@ -161,6 +161,12 @@
|
|||||||
appendDTB = true;
|
appendDTB = true;
|
||||||
};
|
};
|
||||||
kernel = {
|
kernel = {
|
||||||
|
src = pkgs.pkgsBuildBuild.fetchurl {
|
||||||
|
name = "linux.tar.gz";
|
||||||
|
url = "https://cdn.kernel.org/pub/linux/kernel/v5.x/linux-5.15.137.tar.gz";
|
||||||
|
hash = "sha256-PkdzUKZ0IpBiWe/RS70J76JKnBFzRblWcKlaIFNxnHQ=";
|
||||||
|
};
|
||||||
|
|
||||||
# Mainline linux 5.19 doesn't have device-tree support for
|
# Mainline linux 5.19 doesn't have device-tree support for
|
||||||
# this device or even for the SoC, so we use the extensive
|
# this device or even for the SoC, so we use the extensive
|
||||||
# OpenWrt kernel patches
|
# OpenWrt kernel patches
|
||||||
|
@ -114,6 +114,11 @@
|
|||||||
};
|
};
|
||||||
|
|
||||||
kernel = {
|
kernel = {
|
||||||
|
src = pkgs.fetchurl {
|
||||||
|
name = "linux.tar.gz";
|
||||||
|
url = "https://cdn.kernel.org/pub/linux/kernel/v5.x/linux-5.15.137.tar.gz";
|
||||||
|
hash = "sha256-PkdzUKZ0IpBiWe/RS70J76JKnBFzRblWcKlaIFNxnHQ=";
|
||||||
|
};
|
||||||
extraPatchPhase = ''
|
extraPatchPhase = ''
|
||||||
${openwrt.applyPatches.ramips}
|
${openwrt.applyPatches.ramips}
|
||||||
${openwrt.applyPatches.rt2x00}
|
${openwrt.applyPatches.rt2x00}
|
||||||
|
@ -125,6 +125,11 @@
|
|||||||
};
|
};
|
||||||
|
|
||||||
kernel = {
|
kernel = {
|
||||||
|
src = pkgs.fetchurl {
|
||||||
|
name = "linux.tar.gz";
|
||||||
|
url = "https://cdn.kernel.org/pub/linux/kernel/v5.x/linux-5.15.137.tar.gz";
|
||||||
|
hash = "sha256-PkdzUKZ0IpBiWe/RS70J76JKnBFzRblWcKlaIFNxnHQ=";
|
||||||
|
};
|
||||||
extraPatchPhase = ''
|
extraPatchPhase = ''
|
||||||
${openwrt.applyPatches.ramips}
|
${openwrt.applyPatches.ramips}
|
||||||
'';
|
'';
|
||||||
|
@ -50,6 +50,11 @@
|
|||||||
];
|
];
|
||||||
config = {
|
config = {
|
||||||
kernel = {
|
kernel = {
|
||||||
|
src = pkgs.pkgsBuildBuild.fetchurl {
|
||||||
|
name = "linux.tar.gz";
|
||||||
|
url = "https://cdn.kernel.org/pub/linux/kernel/v5.x/linux-5.15.137.tar.gz";
|
||||||
|
hash = "sha256-PkdzUKZ0IpBiWe/RS70J76JKnBFzRblWcKlaIFNxnHQ=";
|
||||||
|
};
|
||||||
extraPatchPhase = ''
|
extraPatchPhase = ''
|
||||||
${pkgs.openwrt.applyPatches.ramips}
|
${pkgs.openwrt.applyPatches.ramips}
|
||||||
'';
|
'';
|
||||||
|
@ -250,8 +250,14 @@
|
|||||||
# IMAGE/ramboot-factory.bin := append-kernel | pad-to $$(KERNEL_SIZE) | append-ubi
|
# IMAGE/ramboot-factory.bin := append-kernel | pad-to $$(KERNEL_SIZE) | append-ubi
|
||||||
|
|
||||||
kernel = {
|
kernel = {
|
||||||
|
src = pkgs.fetchurl {
|
||||||
|
name = "linux.tar.gz";
|
||||||
|
url = "https://cdn.kernel.org/pub/linux/kernel/v5.x/linux-5.15.137.tar.gz";
|
||||||
|
hash = "sha256-PkdzUKZ0IpBiWe/RS70J76JKnBFzRblWcKlaIFNxnHQ=";
|
||||||
|
};
|
||||||
extraPatchPhase = ''
|
extraPatchPhase = ''
|
||||||
${openwrt.applyPatches.ramips}
|
${openwrt.applyPatches.ramips}
|
||||||
|
|
||||||
'';
|
'';
|
||||||
config = {
|
config = {
|
||||||
|
|
||||||
|
@ -22,6 +22,7 @@ in rec {
|
|||||||
../modules/outputs/ubimage.nix
|
../modules/outputs/ubimage.nix
|
||||||
../modules/outputs/jffs2.nix
|
../modules/outputs/jffs2.nix
|
||||||
../modules/outputs/ext4fs.nix
|
../modules/outputs/ext4fs.nix
|
||||||
|
../modules/outputs/extlinux.nix
|
||||||
];
|
];
|
||||||
|
|
||||||
kernel.config = {
|
kernel.config = {
|
||||||
|
@ -6,7 +6,7 @@
|
|||||||
{ lib, pkgs, config, ...}:
|
{ lib, pkgs, config, ...}:
|
||||||
let
|
let
|
||||||
inherit (lib) mkOption types ;
|
inherit (lib) mkOption types ;
|
||||||
inherit (pkgs) liminix openwrt;
|
inherit (pkgs) liminix;
|
||||||
|
|
||||||
mergeConditionals = conf : conditions :
|
mergeConditionals = conf : conditions :
|
||||||
# for each key in conditions, if it is present in conf
|
# for each key in conditions, if it is present in conf
|
||||||
@ -21,8 +21,8 @@ let
|
|||||||
in {
|
in {
|
||||||
options = {
|
options = {
|
||||||
kernel = {
|
kernel = {
|
||||||
src = mkOption { type = types.path; default = openwrt.kernelSrc; } ;
|
src = mkOption { type = types.path; } ;
|
||||||
version = mkOption { type = types.str; default = openwrt.kernelVersion;} ;
|
version = mkOption { type = types.str; default = "5.15.137";} ;
|
||||||
modular = mkOption {
|
modular = mkOption {
|
||||||
type = types.bool;
|
type = types.bool;
|
||||||
default = true;
|
default = true;
|
||||||
|
@ -13,8 +13,7 @@ in
|
|||||||
imports = [
|
imports = [
|
||||||
./outputs/squashfs.nix
|
./outputs/squashfs.nix
|
||||||
./outputs/vmroot.nix
|
./outputs/vmroot.nix
|
||||||
./outputs/boot-extlinux.nix
|
./outputs/extlinux.nix
|
||||||
./outputs/boot-fit.nix
|
|
||||||
./outputs/uimage.nix
|
./outputs/uimage.nix
|
||||||
./outputs/updater
|
./outputs/updater
|
||||||
];
|
];
|
||||||
|
@ -1,27 +0,0 @@
|
|||||||
{
|
|
||||||
config
|
|
||||||
, pkgs
|
|
||||||
, lib
|
|
||||||
, ...
|
|
||||||
}:
|
|
||||||
let
|
|
||||||
inherit (lib) mkIf mkEnableOption mkOption types concatStringsSep;
|
|
||||||
inherit (pkgs.pseudofile) dir symlink;
|
|
||||||
cfg = config.boot.loader.fit;
|
|
||||||
o = config.system.outputs;
|
|
||||||
cmdline = concatStringsSep " " config.boot.commandLine;
|
|
||||||
wantsDtb = config.hardware.dts ? src && config.hardware.dts.src != null;
|
|
||||||
in {
|
|
||||||
options.boot.loader.fit.enable = mkEnableOption "FIT in /boot";
|
|
||||||
|
|
||||||
config = mkIf cfg.enable {
|
|
||||||
system.outputs.bootfiles = pkgs.runCommand "boot-fit" {} ''
|
|
||||||
mkdir $out
|
|
||||||
cd $out
|
|
||||||
cp ${o.uimage} fit
|
|
||||||
'';
|
|
||||||
filesystem = dir {
|
|
||||||
boot = symlink config.system.outputs.bootfiles;
|
|
||||||
};
|
|
||||||
};
|
|
||||||
}
|
|
@ -29,17 +29,6 @@ let
|
|||||||
'';
|
'';
|
||||||
in {
|
in {
|
||||||
inherit src;
|
inherit src;
|
||||||
|
|
||||||
# The kernel sources typically used with this version of openwrt
|
|
||||||
# You can find this in `include/kernel-5.15` or similar in the
|
|
||||||
# openwrt sources
|
|
||||||
kernelSrc = pkgsBuildBuild.fetchurl {
|
|
||||||
name = "linux.tar.gz";
|
|
||||||
url = "https://cdn.kernel.org/pub/linux/kernel/v5.x/linux-5.15.137.tar.gz";
|
|
||||||
hash = "sha256-PkdzUKZ0IpBiWe/RS70J76JKnBFzRblWcKlaIFNxnHQ=";
|
|
||||||
};
|
|
||||||
kernelVersion = "5.15.137";
|
|
||||||
|
|
||||||
applyPatches.ath79 = doPatch "ath79";
|
applyPatches.ath79 = doPatch "ath79";
|
||||||
applyPatches.ramips = doPatch "ramips";
|
applyPatches.ramips = doPatch "ramips";
|
||||||
applyPatches.mediatek = doPatch "mediatek"; # aarch64
|
applyPatches.mediatek = doPatch "mediatek"; # aarch64
|
||||||
|
Loading…
Reference in New Issue
Block a user