Compare commits
No commits in common. "a9d1582b534439af96ebac11f3eae4eeeb3b1122" and "e1ae986cf66c396f6d5970735abd2042c99ead1f" have entirely different histories.
a9d1582b53
...
e1ae986cf6
|
@ -3,6 +3,7 @@
|
|||
, linotify
|
||||
, anoia
|
||||
, lualinux
|
||||
, lua
|
||||
}:
|
||||
writeFennel "acquire-wan-address" {
|
||||
packages = [ linotify anoia lualinux ];
|
||||
|
|
61
overlay.nix
61
overlay.nix
|
@ -113,21 +113,6 @@ extraPkgs // {
|
|||
'';
|
||||
});
|
||||
|
||||
elfutils =
|
||||
let native = (with final.stdenv; (buildPlatform == hostPlatform));
|
||||
in if native
|
||||
then prev.elfutils
|
||||
else
|
||||
let
|
||||
e = prev.elfutils.overrideAttrs(o: {
|
||||
configureFlags = o.configureFlags ++[
|
||||
"ac_cv_has_stdatomic=no"
|
||||
];
|
||||
});
|
||||
in e.override {
|
||||
enableDebuginfod = false;
|
||||
};
|
||||
|
||||
hostapd =
|
||||
let
|
||||
config = [
|
||||
|
@ -156,10 +141,6 @@ extraPkgs // {
|
|||
});
|
||||
in h.override { openssl = null; sqlite = null; };
|
||||
|
||||
# berlekey db needs libatomic which we haven't figured out yet.
|
||||
# disabling it means we don't have arpd
|
||||
iproute2 = prev.iproute2.override { db = null; };
|
||||
|
||||
kexec-tools-static = prev.kexec-tools.overrideAttrs(o: {
|
||||
# For kexecboot we copy kexec into a ramdisk on the system being
|
||||
# upgraded from. This is more likely to work if kexec is
|
||||
|
@ -196,33 +177,21 @@ extraPkgs // {
|
|||
];
|
||||
});
|
||||
|
||||
openssl = prev.openssl.overrideAttrs (o:
|
||||
with final;
|
||||
let cross = stdenv.buildPlatform != stdenv.hostPlatform;
|
||||
in
|
||||
{
|
||||
# we want to apply
|
||||
# https://patch-diff.githubusercontent.com/raw/openssl/openssl/pull/20273.patch";
|
||||
# which disables overriding the -march cflags to the wrong values,
|
||||
# but openssl is used for bootstrapping so that's easier said than
|
||||
# done. Do it the ugly way..
|
||||
postPatch =
|
||||
o.postPatch
|
||||
+ (
|
||||
lib.optionalString cross ''
|
||||
sed -i.bak 's/linux.*-mips/linux-mops/' Configure
|
||||
''
|
||||
);
|
||||
# openssl with threads requires stdatomic which drags in libgcc
|
||||
# as a dependency
|
||||
configureFlags = []
|
||||
++ (lib.optional cross "no-threads")
|
||||
++ o.configureFlags;
|
||||
|
||||
# don't need or want this bash script
|
||||
postInstall = o.postInstall +
|
||||
(lib.optionalString cross "rm $bin/bin/c_rehash\n");
|
||||
});
|
||||
openssl = prev.openssl.overrideAttrs (o: {
|
||||
# we want to apply
|
||||
# https://patch-diff.githubusercontent.com/raw/openssl/openssl/pull/20273.patch";
|
||||
# which disables overriding the -march cflags to the wrong values,
|
||||
# but openssl is used for bootstrapping so that's easier said than
|
||||
# done. Do it the ugly way..
|
||||
postPatch =
|
||||
o.postPatch
|
||||
+ (
|
||||
with final;
|
||||
lib.optionalString (
|
||||
stdenv.buildPlatform != stdenv.hostPlatform
|
||||
) "\nsed -i.bak 's/linux.*-mips/linux-mops/' Configure\n"
|
||||
);
|
||||
});
|
||||
|
||||
pppBuild = prev.ppp;
|
||||
|
||||
|
|
|
@ -38,10 +38,9 @@
|
|||
(fn dir [name]
|
||||
(let [dp (assert (ll.opendir name) name)]
|
||||
(fn []
|
||||
(case (ll.readdir dp)
|
||||
(name filetype) (values name filetype)
|
||||
(nil err) (do (if (> err 0) (print "ERR" err)) (ll.closedir dp) nil)
|
||||
))))
|
||||
(match (ll.readdir dp)
|
||||
(name type) (values name type)
|
||||
(nil err) (do (if err (print err)) (ll.closedir dp) nil)))))
|
||||
|
||||
(fn rmtree [pathname]
|
||||
(case (file-type pathname)
|
||||
|
|
|
@ -1,14 +1,13 @@
|
|||
(local inotify (require :inotify))
|
||||
(local { : file-exists? } (require :anoia))
|
||||
(local { : file-type : dir &as fs } (require :anoia.fs))
|
||||
(local ll (require :lualinux))
|
||||
|
||||
(fn read-line [name]
|
||||
(with-open [f (assert (io.open name :r) (.. "can't open file " name))]
|
||||
(f:read "*l")))
|
||||
|
||||
(fn watch-fsevents [directory-name]
|
||||
(let [handle (inotify.init { :blocking false})]
|
||||
(let [handle (inotify.init)]
|
||||
(handle:addwatch directory-name
|
||||
inotify.IN_CREATE
|
||||
inotify.IN_MOVE
|
||||
|
@ -40,16 +39,11 @@
|
|||
(coroutine.yield self)
|
||||
(self:wait))))
|
||||
|
||||
(fn read-with-timeout [watcher]
|
||||
(let [fd (watcher:fileno)]
|
||||
(ll.pollin fd 5000)
|
||||
(watcher:read)))
|
||||
|
||||
(fn open [directory]
|
||||
(let [watcher (watch-fsevents directory)
|
||||
has-file? (fn [filename] (file-exists? (.. directory "/" filename)))]
|
||||
{
|
||||
:wait #(read-with-timeout watcher)
|
||||
:wait #(watcher:read)
|
||||
:ready? (fn [self]
|
||||
(and (has-file? "state") (not (has-file? ".lock"))))
|
||||
:output (fn [_ filename]
|
||||
|
|
Loading…
Reference in New Issue