From 48fc0800a3d3d725f4e0af3c1e03c408fe29ce3e Mon Sep 17 00:00:00 2001 From: Gregor Kleen Date: Sat, 14 May 2016 23:42:22 +0200 Subject: nomodeset --- hel/boot.nix | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/hel/boot.nix b/hel/boot.nix index af0dfe2d..103fdeca 100644 --- a/hel/boot.nix +++ b/hel/boot.nix @@ -11,6 +11,6 @@ tmpOnTmpfs = true; - extraKernelParams = ["intel_pstate=no_hwp"]; + extraKernelParams = ["intel_pstate=no_hwp" "nomodeset"]; }; } -- cgit v1.2.3 From 387a1045df0f1cef12f4be780eb2fe1ad5783110 Mon Sep 17 00:00:00 2001 From: Gregor Kleen Date: Sun, 15 May 2016 00:05:07 +0200 Subject: Revert "nomodeset" This reverts commit 48fc0800a3d3d725f4e0af3c1e03c408fe29ce3e. --- hel/boot.nix | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/hel/boot.nix b/hel/boot.nix index 103fdeca..af0dfe2d 100644 --- a/hel/boot.nix +++ b/hel/boot.nix @@ -11,6 +11,6 @@ tmpOnTmpfs = true; - extraKernelParams = ["intel_pstate=no_hwp" "nomodeset"]; + extraKernelParams = ["intel_pstate=no_hwp"]; }; } -- cgit v1.2.3 From 6b66a28152c56a79aaad90087519ce563c76b5a4 Mon Sep 17 00:00:00 2001 From: Gregor Kleen Date: Sun, 15 May 2016 15:46:17 +0200 Subject: additional oh-my-zsh modules --- custom/zsh.nix | 2 ++ 1 file changed, 2 insertions(+) diff --git a/custom/zsh.nix b/custom/zsh.nix index 7279cf4f..826a3511 100644 --- a/custom/zsh.nix +++ b/custom/zsh.nix @@ -31,6 +31,8 @@ in rec { tmux zsh-users/zsh-syntax-highlighting systemd + pass + mosh EOBUNDLES if [[ -e ~/.zsh-theme ]]; then -- cgit v1.2.3 From 96b03e1bf70e5ed6021481710a7d6a53a9211c1f Mon Sep 17 00:00:00 2001 From: Gregor Kleen Date: Sun, 15 May 2016 23:07:27 +0200 Subject: allow selection of uucp protocols --- custom/uucp.nix | 16 ++++++++++++++-- 1 file changed, 14 insertions(+), 2 deletions(-) diff --git a/custom/uucp.nix b/custom/uucp.nix index 51caf13c..b58268ae 100644 --- a/custom/uucp.nix +++ b/custom/uucp.nix @@ -6,7 +6,7 @@ let portSpec = name: '' port ${name} type pipe - protocol e + protocol ${if config.services.uucp.protocols ? name then config.services.uucp.protocols."${name}" else config.services.uucp.defaultProtocol} reliable true command ${pkgs.openssh}/bin/ssh -x -o batchmode=yes ${name} ''; @@ -15,7 +15,7 @@ let time Any port ${name} chat "" - protocol e + protocol ${if config.services.uucp.protocols ? name then config.services.uucp.protocols."${name}" else config.services.uucp.defaultProtocol} command-path ${concatStringsSep " " config.services.uucp.commandPath} commands ${concatStringsSep " " (if config.services.uucp.commands ? name then config.services.uucp.commands."${name}" else config.services.uucp.defaultCommands)} ''; @@ -77,6 +77,18 @@ in { description = "Override commands for specific remotes"; }; + defaultProtocol = mkOption { + type = types.string; + default = "e"; + description = "UUCP protocol to use within ssh unless overriden"; + }; + + protocols = mkOption { + type = types.attrsOf types.string; + default = {}; + description = "UUCP protocols to use for specific remotes"; + }; + spoolDir = mkOption { type = types.path; default = "/var/spool/uucp"; -- cgit v1.2.3 From bba00f87fd5460e394fc20252732647e301a67ff Mon Sep 17 00:00:00 2001 From: Gregor Kleen Date: Sun, 15 May 2016 23:18:09 +0200 Subject: video over uucp --- hel.nix | 12 +++++++++--- hel/recv-media.nix | 22 ++++++++++++++++++++++ 2 files changed, 31 insertions(+), 3 deletions(-) create mode 100644 hel/recv-media.nix diff --git a/hel.nix b/hel.nix index 74441e27..b9628a65 100644 --- a/hel.nix +++ b/hel.nix @@ -107,8 +107,8 @@ nodeName = "hel"; remoteNodes = ["isaac" "ymir"]; # legacy name for odin sshUser = { - openssh.authorizedKeys.keys = [ ''no-port-forwarding,no-X11-forwarding,no-agent-forwarding,command="/var/setuid-wrappers/uucico" ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIEgtDHA7oDIaRwggGGznNaKZF68rFTziqefSCn1t9ZKe uucp@odin'' - ''no-port-forwarding,no-X11-forwarding,no-agent-forwarding,command="/var/setuid-wrappers/uucico" ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIFH1QWdgoC03nzW5GBuCl2pqASHeIXIYtE9IInHdaKcO uucp@ymir'' + openssh.authorizedKeys.keys = [ ''no-port-forwarding,no-X11-forwarding,no-agent-forwarding,command="/var/setuid-wrappers/uucico" ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIFH1QWdgoC03nzW5GBuCl2pqASHeIXIYtE9IInHdaKcO uucp@ymir'' + ''no-port-forwarding,no-X11-forwarding,no-agent-forwarding,command="/var/setuid-wrappers/uucico" ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIJhACtnt9+3j2ev4QVA2QBlPtblPnu7yol2njgfMlHtC uucp@odin'' ]; }; sshConfig = '' @@ -119,8 +119,14 @@ Hostname ymir.niflheim.yggdrasil IdentityFile ~/.ssh/ymir ''; - commandPath = []; + commandPath = [ "${pkgs.callPackage ./hel/recv-media.nix {}}/bin" ]; defaultCommands = []; + protocols = { + isaac = "g"; + }; + commands = { + isaac = ["recv-media"]; + }; }; }; diff --git a/hel/recv-media.nix b/hel/recv-media.nix new file mode 100644 index 00000000..f85598f4 --- /dev/null +++ b/hel/recv-media.nix @@ -0,0 +1,22 @@ +{ stdenv, coreutils, ffmpeg-full writeScriptBin }: + +writeScriptBin "recv-media" '' + #!${stdenv.shell} + + PATH=${ffmpeg-full}/bin:${coreutils}/bin + + dir=/var/media + + file="''${dir}/.$(basename "$1")" + file2="''${dir}/.copy.$(basename "$1")" + nFile="''${dir}/$(basename "$1")" + cat > "''${file}" + if ! ffmpeg -v warning -i "''${file}" -c copy "''${file2}" 2>&1 Date: Sun, 15 May 2016 23:18:36 +0200 Subject: syntax --- hel/recv-media.nix | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/hel/recv-media.nix b/hel/recv-media.nix index f85598f4..beda178c 100644 --- a/hel/recv-media.nix +++ b/hel/recv-media.nix @@ -1,4 +1,4 @@ -{ stdenv, coreutils, ffmpeg-full writeScriptBin }: +{ stdenv, coreutils, ffmpeg-full, writeScriptBin }: writeScriptBin "recv-media" '' #!${stdenv.shell} -- cgit v1.2.3 From 81a4f8b5192c89682367723bbb0777c29654422f Mon Sep 17 00:00:00 2001 From: Gregor Kleen Date: Sun, 15 May 2016 23:18:49 +0200 Subject: syntax --- hel/recv-media.nix | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/hel/recv-media.nix b/hel/recv-media.nix index beda178c..24c7a15c 100644 --- a/hel/recv-media.nix +++ b/hel/recv-media.nix @@ -19,4 +19,4 @@ writeScriptBin "recv-media" '' rm -f "''${file}" mv "''${file2}" "''${nFile}" fi -''; +'' -- cgit v1.2.3 From e27a28dd6b899629d11c44baff72f19340ef0cf1 Mon Sep 17 00:00:00 2001 From: Gregor Kleen Date: Sun, 15 May 2016 23:19:56 +0200 Subject: abort on lacking arguments --- hel/recv-media.nix | 2 ++ 1 file changed, 2 insertions(+) diff --git a/hel/recv-media.nix b/hel/recv-media.nix index 24c7a15c..d8192e0f 100644 --- a/hel/recv-media.nix +++ b/hel/recv-media.nix @@ -3,6 +3,8 @@ writeScriptBin "recv-media" '' #!${stdenv.shell} + [[ -z "$1" ]] && exit 2 + PATH=${ffmpeg-full}/bin:${coreutils}/bin dir=/var/media -- cgit v1.2.3 From 1683de93383e8cd17dfa2e1206d965093e57c8bb Mon Sep 17 00:00:00 2001 From: Gregor Kleen Date: Sun, 15 May 2016 23:22:32 +0200 Subject: syntax --- custom/uucp.nix | 4 ++-- hel.nix | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/custom/uucp.nix b/custom/uucp.nix index b58268ae..7035b934 100644 --- a/custom/uucp.nix +++ b/custom/uucp.nix @@ -6,7 +6,7 @@ let portSpec = name: '' port ${name} type pipe - protocol ${if config.services.uucp.protocols ? name then config.services.uucp.protocols."${name}" else config.services.uucp.defaultProtocol} + protocol ${if builtins.hasAttr name config.services.uucp.protocols then config.services.uucp.protocols."${name}" else config.services.uucp.defaultProtocol} reliable true command ${pkgs.openssh}/bin/ssh -x -o batchmode=yes ${name} ''; @@ -17,7 +17,7 @@ let chat "" protocol ${if config.services.uucp.protocols ? name then config.services.uucp.protocols."${name}" else config.services.uucp.defaultProtocol} command-path ${concatStringsSep " " config.services.uucp.commandPath} - commands ${concatStringsSep " " (if config.services.uucp.commands ? name then config.services.uucp.commands."${name}" else config.services.uucp.defaultCommands)} + commands ${concatStringsSep " " (if builtins.hasAttr name config.services.uucp.commands then config.services.uucp.commands."${name}" else config.services.uucp.defaultCommands)} ''; in { options = { diff --git a/hel.nix b/hel.nix index b9628a65..bf669120 100644 --- a/hel.nix +++ b/hel.nix @@ -122,10 +122,10 @@ commandPath = [ "${pkgs.callPackage ./hel/recv-media.nix {}}/bin" ]; defaultCommands = []; protocols = { - isaac = "g"; + "isaac" = "g"; }; commands = { - isaac = ["recv-media"]; + "isaac" = ["recv-media"]; }; }; }; -- cgit v1.2.3 From fdcccad60499bb0599303664dd9e1c2472812a0d Mon Sep 17 00:00:00 2001 From: Gregor Kleen Date: Sun, 15 May 2016 23:23:14 +0200 Subject: syntax --- custom/uucp.nix | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/custom/uucp.nix b/custom/uucp.nix index 7035b934..57a5c23e 100644 --- a/custom/uucp.nix +++ b/custom/uucp.nix @@ -15,7 +15,7 @@ let time Any port ${name} chat "" - protocol ${if config.services.uucp.protocols ? name then config.services.uucp.protocols."${name}" else config.services.uucp.defaultProtocol} + protocol ${if builtins.hasAttr name config.services.uucp.protocols then config.services.uucp.protocols."${name}" else config.services.uucp.defaultProtocol} command-path ${concatStringsSep " " config.services.uucp.commandPath} commands ${concatStringsSep " " (if builtins.hasAttr name config.services.uucp.commands then config.services.uucp.commands."${name}" else config.services.uucp.defaultCommands)} ''; -- cgit v1.2.3 From 40e6133451785fed08d1ae65c5a92130b1ac1b9e Mon Sep 17 00:00:00 2001 From: Gregor Kleen Date: Sun, 15 May 2016 23:30:56 +0200 Subject: uucp extraSys --- custom/uucp.nix | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/custom/uucp.nix b/custom/uucp.nix index 57a5c23e..ef0d98e7 100644 --- a/custom/uucp.nix +++ b/custom/uucp.nix @@ -139,6 +139,14 @@ in { default = ""; description = "Extra configuration to append verbatim to `/etc/uucp/config'"; }; + + extraSys = mkOption { + type = types.string; + default = '' + protocol-parameter g packet-size 4096 + ''; + description = "Extra configuration to prepend verbatim to `/etc/uucp/sys`"; + }; }; }; @@ -195,7 +203,7 @@ in { '' + concatStringsSep "\n" (map portSpec config.services.uucp.remoteNodes); }; environment.etc."uucp/sys" = { - text = concatStringsSep "\n" (map sysSpec config.services.uucp.remoteNodes); + text = config.services.uucp.extraSys + "\n" + concatStringsSep "\n" (map sysSpec config.services.uucp.remoteNodes); }; security.setuidOwners = map (p: {program = p; owner = "root"; group = "root"; setuid = true; setgid = false;}) ["uucico" "uuxqt" "cu" "uucp" "uuname" "uustat" "uux"]; -- cgit v1.2.3 From 7febeb62240c5f9c9e440d5713eedc14005f1ec8 Mon Sep 17 00:00:00 2001 From: Gregor Kleen Date: Sun, 15 May 2016 23:57:18 +0200 Subject: no experiments! --- custom/tinc/def.nix | 1 + 1 file changed, 1 insertion(+) diff --git a/custom/tinc/def.nix b/custom/tinc/def.nix index e14ce5e9..41007ad4 100644 --- a/custom/tinc/def.nix +++ b/custom/tinc/def.nix @@ -118,6 +118,7 @@ in DeviceType = ${data.interfaceType} Device = /dev/net/tun Interface = tinc.${network} + ExperimentalProtocol = no ${data.extraConfig} ''; }; -- cgit v1.2.3 From d6a340e5d9916f7c7e8a57dd676d5d7adb19a2ed Mon Sep 17 00:00:00 2001 From: Gregor Kleen Date: Sun, 15 May 2016 23:58:51 +0200 Subject: tabs break everything --- custom/tinc/def.nix | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/custom/tinc/def.nix b/custom/tinc/def.nix index 41007ad4..3de31418 100644 --- a/custom/tinc/def.nix +++ b/custom/tinc/def.nix @@ -118,7 +118,7 @@ in DeviceType = ${data.interfaceType} Device = /dev/net/tun Interface = tinc.${network} - ExperimentalProtocol = no + ExperimentalProtocol = no ${data.extraConfig} ''; }; -- cgit v1.2.3 From 59bd0a0b15d1dc4c111115c8680be7438459127a Mon Sep 17 00:00:00 2001 From: Gregor Kleen Date: Mon, 16 May 2016 00:04:20 +0200 Subject: tabs! *shakes fist* --- custom/uucp.nix | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/custom/uucp.nix b/custom/uucp.nix index ef0d98e7..8b476363 100644 --- a/custom/uucp.nix +++ b/custom/uucp.nix @@ -143,7 +143,7 @@ in { extraSys = mkOption { type = types.string; default = '' - protocol-parameter g packet-size 4096 + protocol-parameter g packet-size 4096 ''; description = "Extra configuration to prepend verbatim to `/etc/uucp/sys`"; }; -- cgit v1.2.3 From e985c76e88a6d9818371da2c3cf1d678dfd049a4 Mon Sep 17 00:00:00 2001 From: Gregor Kleen Date: Mon, 16 May 2016 00:04:56 +0200 Subject: =?UTF-8?q?my=20nemesis=E2=80=A6?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- custom/uucp.nix | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/custom/uucp.nix b/custom/uucp.nix index 8b476363..ed452f22 100644 --- a/custom/uucp.nix +++ b/custom/uucp.nix @@ -142,9 +142,9 @@ in { extraSys = mkOption { type = types.string; - default = '' + default = '' protocol-parameter g packet-size 4096 - ''; + ''; description = "Extra configuration to prepend verbatim to `/etc/uucp/sys`"; }; }; -- cgit v1.2.3 From 8ce2e7787c725b02af7eff04b094a53f178d71ed Mon Sep 17 00:00:00 2001 From: Gregor Kleen Date: Mon, 16 May 2016 00:34:51 +0200 Subject: simplify recv-media --- hel/recv-media.nix | 20 +++++++++++--------- 1 file changed, 11 insertions(+), 9 deletions(-) diff --git a/hel/recv-media.nix b/hel/recv-media.nix index d8192e0f..3bdf0c73 100644 --- a/hel/recv-media.nix +++ b/hel/recv-media.nix @@ -10,15 +10,17 @@ writeScriptBin "recv-media" '' dir=/var/media file="''${dir}/.$(basename "$1")" - file2="''${dir}/.copy.$(basename "$1")" + #file2="''${dir}/.copy.$(basename "$1")" nFile="''${dir}/$(basename "$1")" + #cat > "''${file}" cat > "''${file}" - if ! ffmpeg -v warning -i "''${file}" -c copy "''${file2}" 2>&1 &1 Date: Mon, 16 May 2016 00:37:58 +0200 Subject: alternate syntax for recv-media --- hel/recv-media.nix | 17 +++++++---------- 1 file changed, 7 insertions(+), 10 deletions(-) diff --git a/hel/recv-media.nix b/hel/recv-media.nix index 3bdf0c73..75aa7950 100644 --- a/hel/recv-media.nix +++ b/hel/recv-media.nix @@ -13,14 +13,11 @@ writeScriptBin "recv-media" '' #file2="''${dir}/.copy.$(basename "$1")" nFile="''${dir}/$(basename "$1")" #cat > "''${file}" - cat > "''${file}" - mv "''${file}" "''${nFile}" - # if ! ffmpeg -v warning -i "''${file}" -c copy "''${file2}" 2>&1 &1 Date: Mon, 16 May 2016 00:39:51 +0200 Subject: arguments start at 1 --- hel/recv-media.nix | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/hel/recv-media.nix b/hel/recv-media.nix index 75aa7950..4ce05d44 100644 --- a/hel/recv-media.nix +++ b/hel/recv-media.nix @@ -13,7 +13,7 @@ writeScriptBin "recv-media" '' #file2="''${dir}/.copy.$(basename "$1")" nFile="''${dir}/$(basename "$1")" #cat > "''${file}" - if ffmpeg -v warning -i "''$0" -c copy "''${file}" 2>&1 &1 Date: Mon, 16 May 2016 00:43:25 +0200 Subject: no integrity checking in recv-media --- hel/recv-media.nix | 18 ++++-------------- 1 file changed, 4 insertions(+), 14 deletions(-) diff --git a/hel/recv-media.nix b/hel/recv-media.nix index 4ce05d44..e0dc261f 100644 --- a/hel/recv-media.nix +++ b/hel/recv-media.nix @@ -1,23 +1,13 @@ -{ stdenv, coreutils, ffmpeg-full, writeScriptBin }: +{ stdenv, coreutils, writeScriptBin }: writeScriptBin "recv-media" '' #!${stdenv.shell} [[ -z "$1" ]] && exit 2 - PATH=${ffmpeg-full}/bin:${coreutils}/bin + PATH=${coreutils}/bin dir=/var/media - - file="''${dir}/.$(basename "$1")" - #file2="''${dir}/.copy.$(basename "$1")" - nFile="''${dir}/$(basename "$1")" - #cat > "''${file}" - if ffmpeg -v warning -i "''$1" -c copy "''${file}" 2>&1 Date: Mon, 16 May 2016 13:43:44 +0200 Subject: wvdial --- hel.nix | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/hel.nix b/hel.nix index bf669120..8c2286b2 100644 --- a/hel.nix +++ b/hel.nix @@ -167,5 +167,11 @@ }; environment.etc."X11/xorg.conf.d/50-wacom.conf".source = lib.mkForce ./hel/wacom.conf; + + environment.wvdial = { + dialerDefaults = '' + Init1 = AT+CGDCONT=1,"IP","internet.t-mobile" + ''; + }; } -- cgit v1.2.3 From 194a35da5a57c0fd7fdaa8a80e70e55a2d2bbfae Mon Sep 17 00:00:00 2001 From: Gregor Kleen Date: Mon, 16 May 2016 13:56:58 +0200 Subject: networkmanager --- hel.nix | 13 +++++++------ 1 file changed, 7 insertions(+), 6 deletions(-) diff --git a/hel.nix b/hel.nix index 8c2286b2..068a8b7f 100644 --- a/hel.nix +++ b/hel.nix @@ -32,6 +32,10 @@ allowedTCPPorts = [ 22 # ssh ]; }; + + networkmanager = { + enable = true; + }; }; powerManagement.enable = true; @@ -140,6 +144,9 @@ media = { members = [ "gkleen" "uucp" ]; }; + networkmanager = { + members = [ "gkleen" ]; + }; }; }; @@ -167,11 +174,5 @@ }; environment.etc."X11/xorg.conf.d/50-wacom.conf".source = lib.mkForce ./hel/wacom.conf; - - environment.wvdial = { - dialerDefaults = '' - Init1 = AT+CGDCONT=1,"IP","internet.t-mobile" - ''; - }; } -- cgit v1.2.3 From f87f06a56dbec79089db49e30d7f25bc4c317e80 Mon Sep 17 00:00:00 2001 From: Gregor Kleen Date: Mon, 16 May 2016 13:57:22 +0200 Subject: networkmanager exclusively --- hel.nix | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/hel.nix b/hel.nix index 068a8b7f..2f031a2d 100644 --- a/hel.nix +++ b/hel.nix @@ -19,13 +19,13 @@ networking = { hostName = "hel"; - wireless = { - enable = true; - userControlled = { - enable = true; - group = "network"; - }; - }; + # wireless = { + # enable = true; + # userControlled = { + # enable = true; + # group = "network"; + # }; + # }; firewall = { enable = true; -- cgit v1.2.3 From 80d02ec79ab41aee9066fe0aeb283012eaf93e75 Mon Sep 17 00:00:00 2001 From: Gregor Kleen Date: Mon, 16 May 2016 14:12:20 +0200 Subject: modemmanger --- hel.nix | 1 + 1 file changed, 1 insertion(+) diff --git a/hel.nix b/hel.nix index 2f031a2d..4a01d934 100644 --- a/hel.nix +++ b/hel.nix @@ -35,6 +35,7 @@ networkmanager = { enable = true; + packages = with pkgs; [ modemmanager ]; }; }; -- cgit v1.2.3 From 947af13a5560b17a897a18616f6af51d1facc0b7 Mon Sep 17 00:00:00 2001 From: Gregor Kleen Date: Mon, 16 May 2016 15:05:23 +0200 Subject: patch libiqm --- hel.nix | 6 + patches/attachment-0003.patch | 446 ++++++++++++++++++++++++++++++++++++++++++ patches/attachment-0004.patch | 329 +++++++++++++++++++++++++++++++ patches/attachment-0005.patch | 50 +++++ 4 files changed, 831 insertions(+) create mode 100644 patches/attachment-0003.patch create mode 100644 patches/attachment-0004.patch create mode 100644 patches/attachment-0005.patch diff --git a/hel.nix b/hel.nix index 4a01d934..1b3520e7 100644 --- a/hel.nix +++ b/hel.nix @@ -57,6 +57,12 @@ (callPackage ./utils/nix/rebuild-system.nix {}) ]; + nixpkgs.config.packageOverrides = pkgs: rec { + libiqm = overrideDerivation pkgs.libiqm (attrs: { + patches = attrs.patches ++ [ ./patches/attachment-0003.patch ./patches/attachment-0004.ptach ./patches/attachment-0005.patch ]; + }); + }; + services = { logind.extraConfig = '' HandleLidSwitch=suspend diff --git a/patches/attachment-0003.patch b/patches/attachment-0003.patch new file mode 100644 index 00000000..35923a90 --- /dev/null +++ b/patches/attachment-0003.patch @@ -0,0 +1,446 @@ +>From 35f6f9c86c3dc66f2855b513e389a99bbcbb74c4 Mon Sep 17 00:00:00 2001 +From: Collin McMillan +Date: Mon, 4 Apr 2016 11:33:46 +0200 +Subject: [PATCH] QMI via MBIM +MIME-Version: 1.0 +Content-Type: text/plain; charset=UTF-8 +Content-Transfer-Encoding: 8bit + +Signed-off-by: Bjørn Mork +--- + build-aux/mbim-codegen/Message.py | 8 ++++---- + build-aux/mbim-codegen/Struct.py | 8 ++++---- + data/Makefile.am | 3 ++- + src/libmbim-glib/generated/Makefile.am | 18 +++++++++++++++--- + src/libmbim-glib/libmbim-glib.h | 1 + + src/libmbim-glib/mbim-cid.c | 25 +++++++++++++++++++++---- + src/libmbim-glib/mbim-cid.h | 12 ++++++++++++ + src/libmbim-glib/mbim-message-private.h | 2 ++ + src/libmbim-glib/mbim-message.c | 31 +++++++++++++++++++------------ + src/libmbim-glib/mbim-uuid.c | 18 ++++++++++++++++-- + src/libmbim-glib/mbim-uuid.h | 11 +++++++++++ + 11 files changed, 107 insertions(+), 30 deletions(-) + +diff --git a/build-aux/mbim-codegen/Message.py b/build-aux/mbim-codegen/Message.py +index aa4e7b7..e66335d 100644 +--- a/build-aux/mbim-codegen/Message.py ++++ b/build-aux/mbim-codegen/Message.py +@@ -394,13 +394,13 @@ class Message: + inner_template += (' {\n') + + if field['format'] == 'byte-array': +- inner_template += (' _mbim_message_command_builder_append_byte_array (builder, FALSE, FALSE, ${field}, ${array_size});\n') ++ inner_template += (' _mbim_message_command_builder_append_byte_array (builder, FALSE, FALSE, TRUE, ${field}, ${array_size});\n') + elif field['format'] == 'unsized-byte-array': +- inner_template += (' _mbim_message_command_builder_append_byte_array (builder, FALSE, FALSE, ${field}, ${field}_size);\n') ++ inner_template += (' _mbim_message_command_builder_append_byte_array (builder, FALSE, FALSE, FALSE, ${field}, ${field}_size);\n') + elif field['format'] == 'ref-byte-array': +- inner_template += (' _mbim_message_command_builder_append_byte_array (builder, TRUE, TRUE, ${field}, ${field}_size);\n') ++ inner_template += (' _mbim_message_command_builder_append_byte_array (builder, TRUE, TRUE, TRUE, ${field}, ${field}_size);\n') + elif field['format'] == 'ref-byte-array-no-offset': +- inner_template += (' _mbim_message_command_builder_append_byte_array (builder, FALSE, TRUE, ${field}, ${field}_size);\n') ++ inner_template += (' _mbim_message_command_builder_append_byte_array (builder, FALSE, TRUE, TRUE, ${field}, ${field}_size);\n') + elif field['format'] == 'uuid': + inner_template += (' _mbim_message_command_builder_append_uuid (builder, ${field});\n') + elif field['format'] == 'guint32': +diff --git a/build-aux/mbim-codegen/Struct.py b/build-aux/mbim-codegen/Struct.py +index 495e22f..8797f3a 100644 +--- a/build-aux/mbim-codegen/Struct.py ++++ b/build-aux/mbim-codegen/Struct.py +@@ -498,14 +498,14 @@ class Struct: + if field['format'] == 'uuid': + inner_template = (' _mbim_struct_builder_append_uuid (builder, &(value->${field}));\n') + elif field['format'] == 'byte-array': +- inner_template = (' _mbim_struct_builder_append_byte_array (builder, FALSE, FALSE, value->${field}, ${array_size});\n') ++ inner_template = (' _mbim_struct_builder_append_byte_array (builder, FALSE, FALSE, TRUE, value->${field}, ${array_size});\n') + elif field['format'] == 'unsized-byte-array': +- inner_template = (' _mbim_struct_builder_append_byte_array (builder, FALSE, FALSE, value->${field}, value->${field}_size);\n') ++ inner_template = (' _mbim_struct_builder_append_byte_array (builder, FALSE, FALSE, FALSE, value->${field}, value->${field}_size);\n') + elif field['format'] == 'ref-byte-array': + if 'array-size-field' in field: +- inner_template = (' _mbim_struct_builder_append_byte_array (builder, TRUE, FALSE, value->${field}, value->${array_size_field});\n') ++ inner_template = (' _mbim_struct_builder_append_byte_array (builder, TRUE, FALSE, TRUE, value->${field}, value->${array_size_field});\n') + else: +- inner_template = (' _mbim_struct_builder_append_byte_array (builder, TRUE, TRUE, value->${field}, value->${field}_size);\n') ++ inner_template = (' _mbim_struct_builder_append_byte_array (builder, TRUE, TRUE, TRUE, value->${field}, value->${field}_size);\n') + elif field['format'] == 'guint32': + inner_template = (' _mbim_struct_builder_append_guint32 (builder, value->${field});\n') + elif field['format'] == 'guint32-array': +diff --git a/data/Makefile.am b/data/Makefile.am +index 111e028..8c8891a 100644 +--- a/data/Makefile.am ++++ b/data/Makefile.am +@@ -10,4 +10,5 @@ EXTRA_DIST = \ + mbim-service-dss.json \ + mbim-service-ms-firmware-id.json \ + mbim-service-ms-host-shutdown.json \ +- mbim-service-proxy-control.json ++ mbim-service-proxy-control.json \ ++ mbim-service-qmi.json +diff --git a/src/libmbim-glib/generated/Makefile.am b/src/libmbim-glib/generated/Makefile.am +index ce81a71..c8b153a 100644 +--- a/src/libmbim-glib/generated/Makefile.am ++++ b/src/libmbim-glib/generated/Makefile.am +@@ -12,7 +12,8 @@ GENERATED_H = \ + mbim-dss.h \ + mbim-ms-firmware-id.h \ + mbim-ms-host-shutdown.h \ +- mbim-proxy-control.h ++ mbim-proxy-control.h \ ++ mbim-qmi.h + + GENERATED_C = \ + mbim-error-types.c \ +@@ -27,7 +28,8 @@ GENERATED_C = \ + mbim-dss.c \ + mbim-ms-firmware-id.c \ + mbim-ms-host-shutdown.c \ +- mbim-proxy-control.c ++ mbim-proxy-control.c \ ++ mbim-qmi.c + + GENERATED_SECTIONS = \ + mbim-basic-connect.sections \ +@@ -39,7 +41,8 @@ GENERATED_SECTIONS = \ + mbim-dss.sections \ + mbim-ms-firmware-id.sections \ + mbim-ms-host-shutdown.sections \ +- mbim-proxy-control.sections ++ mbim-proxy-control.sections \ ++ mbim-qmi.sections + + # Error types + mbim-error-types.h: $(top_srcdir)/src/libmbim-glib/mbim-errors.h $(top_srcdir)/build-aux/templates/mbim-error-types-template.h +@@ -170,6 +173,15 @@ mbim-proxy-control.h mbim-proxy-control.c mbim-proxy-control.sections: $(top_src + --input $(top_srcdir)/data/mbim-service-proxy-control.json \ + --output mbim-proxy-control + ++# QMI-over-MBIM service ++mbim-qmi.h mbim-qmi.c mbim-qmi.sections: $(top_srcdir)/data/mbim-service-qmi.json $(top_srcdir)/build-aux/mbim-codegen/*.py $(top_srcdir)/build-aux/mbim-codegen/mbim-codegen ++ $(AM_V_GEN) \ ++ rm -f mbim-qmi.h && \ ++ rm -f mbim-qmi.c && \ ++ $(top_srcdir)/build-aux/mbim-codegen/mbim-codegen \ ++ --input $(top_srcdir)/data/mbim-service-qmi.json \ ++ --output mbim-qmi ++ + BUILT_SOURCES = $(GENERATED_H) $(GENERATED_C) + + nodist_libmbim_glib_generated_la_SOURCES = \ +diff --git a/src/libmbim-glib/libmbim-glib.h b/src/libmbim-glib/libmbim-glib.h +index b41122b..88d0be8 100644 +--- a/src/libmbim-glib/libmbim-glib.h ++++ b/src/libmbim-glib/libmbim-glib.h +@@ -48,6 +48,7 @@ + #include "mbim-dss.h" + #include "mbim-ms-firmware-id.h" + #include "mbim-ms-host-shutdown.h" ++#include "mbim-qmi.h" + + /* backwards compatibility */ + #include "mbim-compat.h" +diff --git a/src/libmbim-glib/mbim-cid.c b/src/libmbim-glib/mbim-cid.c +index 50dc4f1..cbfd81e 100644 +--- a/src/libmbim-glib/mbim-cid.c ++++ b/src/libmbim-glib/mbim-cid.c +@@ -38,6 +38,9 @@ typedef struct { + gboolean notify; + } CidConfig; + ++/* Note: MBIM_SERVICE_LAST from mbim-uuid.c should probably be visible ++ * here somehow, since MBIM_SERVICE_QMI must be used in the error checks */ ++ + /* Note: index of the array is CID-1 */ + #define MBIM_CID_BASIC_CONNECT_LAST MBIM_CID_BASIC_CONNECT_MULTICARRIER_PROVIDERS + static const CidConfig cid_basic_connect_config [MBIM_CID_BASIC_CONNECT_LAST] = { +@@ -132,6 +135,12 @@ static const CidConfig cid_proxy_control_config [MBIM_CID_PROXY_CONTROL_LAST] = + { TRUE, FALSE, FALSE }, /* MBIM_CID_PROXY_CONTROL_CONFIGURATION */ + }; + ++/* Note: index of the array is CID-1 */ ++#define MBIM_CID_QMI_LAST MBIM_CID_QMI_MSG ++static const CidConfig cid_qmi_config [MBIM_CID_QMI_LAST] = { ++ { TRUE, FALSE, FALSE }, /* MBIM_CID_QMI_MSG */ ++}; ++ + /** + * mbim_cid_can_set: + * @service: a #MbimService. +@@ -149,7 +158,7 @@ mbim_cid_can_set (MbimService service, + g_return_val_if_fail (cid > 0, FALSE); + /* Known service required */ + g_return_val_if_fail (service > MBIM_SERVICE_INVALID, FALSE); +- g_return_val_if_fail (service <= MBIM_SERVICE_PROXY_CONTROL, FALSE); ++ g_return_val_if_fail (service <= MBIM_SERVICE_QMI, FALSE); + + switch (service) { + case MBIM_SERVICE_BASIC_CONNECT: +@@ -172,6 +181,8 @@ mbim_cid_can_set (MbimService service, + return cid_ms_host_shutdown_config[cid - 1].set; + case MBIM_SERVICE_PROXY_CONTROL: + return cid_proxy_control_config[cid - 1].set; ++ case MBIM_SERVICE_QMI: ++ return cid_qmi_config[cid - 1].set; + default: + g_assert_not_reached (); + return FALSE; +@@ -195,7 +206,7 @@ mbim_cid_can_query (MbimService service, + g_return_val_if_fail (cid > 0, FALSE); + /* Known service required */ + g_return_val_if_fail (service > MBIM_SERVICE_INVALID, FALSE); +- g_return_val_if_fail (service <= MBIM_SERVICE_PROXY_CONTROL, FALSE); ++ g_return_val_if_fail (service <= MBIM_SERVICE_QMI, FALSE); + + switch (service) { + case MBIM_SERVICE_BASIC_CONNECT: +@@ -218,6 +229,8 @@ mbim_cid_can_query (MbimService service, + return cid_ms_host_shutdown_config[cid - 1].query; + case MBIM_SERVICE_PROXY_CONTROL: + return cid_proxy_control_config[cid - 1].query; ++ case MBIM_SERVICE_QMI: ++ return cid_qmi_config[cid - 1].query; + default: + g_assert_not_reached (); + return FALSE; +@@ -241,7 +254,7 @@ mbim_cid_can_notify (MbimService service, + g_return_val_if_fail (cid > 0, FALSE); + /* Known service required */ + g_return_val_if_fail (service > MBIM_SERVICE_INVALID, FALSE); +- g_return_val_if_fail (service <= MBIM_SERVICE_PROXY_CONTROL, FALSE); ++ g_return_val_if_fail (service <= MBIM_SERVICE_QMI, FALSE); + + switch (service) { + case MBIM_SERVICE_BASIC_CONNECT: +@@ -264,6 +277,8 @@ mbim_cid_can_notify (MbimService service, + return cid_ms_host_shutdown_config[cid - 1].notify; + case MBIM_SERVICE_PROXY_CONTROL: + return cid_proxy_control_config[cid - 1].notify; ++ case MBIM_SERVICE_QMI: ++ return cid_qmi_config[cid - 1].notify; + default: + g_assert_not_reached (); + return FALSE; +@@ -288,7 +303,7 @@ mbim_cid_get_printable (MbimService service, + g_return_val_if_fail (cid > 0, NULL); + /* Known service required */ + g_return_val_if_fail (service > MBIM_SERVICE_INVALID, NULL); +- g_return_val_if_fail (service <= MBIM_SERVICE_PROXY_CONTROL, NULL); ++ g_return_val_if_fail (service <= MBIM_SERVICE_QMI, NULL); + + switch (service) { + case MBIM_SERVICE_BASIC_CONNECT: +@@ -311,6 +326,8 @@ mbim_cid_get_printable (MbimService service, + return mbim_cid_ms_host_shutdown_get_string (cid); + case MBIM_SERVICE_PROXY_CONTROL: + return mbim_cid_proxy_control_get_string (cid); ++ case MBIM_SERVICE_QMI: ++ return mbim_cid_qmi_get_string (cid); + default: + g_assert_not_reached (); + return FALSE; +diff --git a/src/libmbim-glib/mbim-cid.h b/src/libmbim-glib/mbim-cid.h +index 3315340..36930cd 100644 +--- a/src/libmbim-glib/mbim-cid.h ++++ b/src/libmbim-glib/mbim-cid.h +@@ -219,6 +219,18 @@ typedef enum { + MBIM_CID_PROXY_CONTROL_CONFIGURATION = 1 + } MbimCidProxyControl; + ++/** ++ * MbimCidQmi: ++ * @MBIM_CID_QMI_UNKNOWN: Unknown command. ++ * @MBIM_CID_QMI_MSG: Configuration. ++ * ++ * MBIM commands in the %MBIM_SERVICE_QMI service. ++ */ ++typedef enum { ++ MBIM_CID_QMI_UNKNOWN = 0, ++ MBIM_CID_QMI_MSG = 1 ++} MbimCidQmi; ++ + /* Command helpers */ + + gboolean mbim_cid_can_set (MbimService service, +diff --git a/src/libmbim-glib/mbim-message-private.h b/src/libmbim-glib/mbim-message-private.h +index b5606e0..0459d00 100644 +--- a/src/libmbim-glib/mbim-message-private.h ++++ b/src/libmbim-glib/mbim-message-private.h +@@ -177,6 +177,7 @@ GByteArray *_mbim_struct_builder_complete (MbimStructBuilder + void _mbim_struct_builder_append_byte_array (MbimStructBuilder *builder, + gboolean with_offset, + gboolean with_length, ++ gboolean permit_padding, + const guint8 *buffer, + guint32 buffer_len); + void _mbim_struct_builder_append_uuid (MbimStructBuilder *builder, +@@ -225,6 +226,7 @@ MbimMessage *_mbim_message_command_builder_complete (M + void _mbim_message_command_builder_append_byte_array (MbimMessageCommandBuilder *builder, + gboolean with_offset, + gboolean with_length, ++ gboolean permit_padding, + const guint8 *buffer, + guint32 buffer_len); + void _mbim_message_command_builder_append_uuid (MbimMessageCommandBuilder *builder, +diff --git a/src/libmbim-glib/mbim-message.c b/src/libmbim-glib/mbim-message.c +index b625ee5..7ab28f0 100644 +--- a/src/libmbim-glib/mbim-message.c ++++ b/src/libmbim-glib/mbim-message.c +@@ -492,6 +492,7 @@ void + _mbim_struct_builder_append_byte_array (MbimStructBuilder *builder, + gboolean with_offset, + gboolean with_length, ++ gboolean permit_padding, + const guint8 *buffer, + guint32 buffer_len) + { +@@ -501,12 +502,14 @@ _mbim_struct_builder_append_byte_array (MbimStructBuilder *builder, + */ + if (!with_offset && !with_length) { + g_byte_array_append (builder->fixed_buffer, buffer, buffer_len); +- while (buffer_len % 4 != 0) { +- const guint8 padding = 0; +- +- g_byte_array_append (builder->fixed_buffer, &padding, 1); +- buffer_len++; +- } ++ if(permit_padding) { ++ while (buffer_len % 4 != 0) { ++ const guint8 padding = 0; ++ ++ g_byte_array_append (builder->fixed_buffer, &padding, 1); ++ buffer_len++; ++ } ++ } + return; + } + +@@ -550,12 +553,15 @@ _mbim_struct_builder_append_byte_array (MbimStructBuilder *builder, + if (buffer_len) { + g_byte_array_append (builder->variable_buffer, (const guint8 *)buffer, (guint)buffer_len); + +- while (buffer_len % 4 != 0) { +- const guint8 padding = 0; ++ /* Note: adding zero padding causes trouble for QMI service */ ++ if(permit_padding) { ++ while (buffer_len % 4 != 0) { ++ const guint8 padding = 0; + +- g_byte_array_append (builder->variable_buffer, &padding, 1); +- buffer_len++; +- } ++ g_byte_array_append (builder->variable_buffer, &padding, 1); ++ buffer_len++; ++ } ++ } + } + } + +@@ -824,10 +830,11 @@ void + _mbim_message_command_builder_append_byte_array (MbimMessageCommandBuilder *builder, + gboolean with_offset, + gboolean with_length, ++ gboolean permit_padding, + const guint8 *buffer, + guint32 buffer_len) + { +- _mbim_struct_builder_append_byte_array (builder->contents_builder, with_offset, with_length, buffer, buffer_len); ++ _mbim_struct_builder_append_byte_array (builder->contents_builder, with_offset, with_length, permit_padding, buffer, buffer_len); + } + + void +diff --git a/src/libmbim-glib/mbim-uuid.c b/src/libmbim-glib/mbim-uuid.c +index 6497645..cdc9ba3 100644 +--- a/src/libmbim-glib/mbim-uuid.c ++++ b/src/libmbim-glib/mbim-uuid.c +@@ -38,7 +38,7 @@ + * This section defines the data type for unique identifiers. + */ + +-#define MBIM_SERVICE_LAST MBIM_SERVICE_PROXY_CONTROL ++#define MBIM_SERVICE_LAST MBIM_SERVICE_QMI + + /*****************************************************************************/ + +@@ -229,6 +229,15 @@ static const MbimUuid uuid_proxy_control = { + .e = { 0xd7, 0x1d , 0xbe, 0xfb, 0xb3, 0x9b } + }; + ++/* Note: this UUID is likely to work only for Sierra modems */ ++static const MbimUuid uuid_qmi = { ++ .a = { 0xd1, 0xa3, 0x0b, 0xc2 }, ++ .b = { 0xf9, 0x7a }, ++ .c = { 0x6e, 0x43 }, ++ .d = { 0xbf, 0x65 }, ++ .e = { 0xc7, 0xe2 , 0x4f, 0xb0, 0xf0, 0xd3 } ++}; ++ + static GList *mbim_custom_service_list = NULL; + + typedef struct { +@@ -367,7 +376,7 @@ mbim_uuid_from_service (MbimService service) + GList *l; + + g_return_val_if_fail (service >= MBIM_SERVICE_INVALID && +- (service <= MBIM_SERVICE_PROXY_CONTROL || ++ (service <= MBIM_SERVICE_LAST || + mbim_service_id_is_custom (service)), + &uuid_invalid); + +@@ -394,6 +403,8 @@ mbim_uuid_from_service (MbimService service) + return &uuid_ms_host_shutdown; + case MBIM_SERVICE_PROXY_CONTROL: + return &uuid_proxy_control; ++ case MBIM_SERVICE_QMI: ++ return &uuid_qmi; + default: + for (l = mbim_custom_service_list; l != NULL; l = l->next) { + if (service == ((MbimCustomService *)l->data)->service_id) +@@ -446,6 +457,9 @@ mbim_uuid_to_service (const MbimUuid *uuid) + if (mbim_uuid_cmp (uuid, &uuid_proxy_control)) + return MBIM_SERVICE_PROXY_CONTROL; + ++ if (mbim_uuid_cmp (uuid, &uuid_qmi)) ++ return MBIM_SERVICE_QMI; ++ + for (l = mbim_custom_service_list; l != NULL; l = l->next) { + if (mbim_uuid_cmp (&((MbimCustomService *)l->data)->uuid, uuid)) + return ((MbimCustomService *)l->data)->service_id; +diff --git a/src/libmbim-glib/mbim-uuid.h b/src/libmbim-glib/mbim-uuid.h +index 91def98..d42a256 100644 +--- a/src/libmbim-glib/mbim-uuid.h ++++ b/src/libmbim-glib/mbim-uuid.h +@@ -71,6 +71,7 @@ gboolean mbim_uuid_from_printable (const gchar *str, + * @MBIM_SERVICE_MS_FIRMWARE_ID: Microsoft Firmware ID service. + * @MBIM_SERVICE_MS_HOST_SHUTDOWN: Microsoft Host Shutdown service. + * @MBIM_SERVICE_PROXY_CONTROL: Proxy Control service. ++ * @MBIM_SERVICE_QMI: QMI-over-MBIM service. + * + * Enumeration of the generic MBIM services. + */ +@@ -86,6 +87,7 @@ typedef enum { + MBIM_SERVICE_MS_FIRMWARE_ID = 8, + MBIM_SERVICE_MS_HOST_SHUTDOWN = 9, + MBIM_SERVICE_PROXY_CONTROL = 10, ++ MBIM_SERVICE_QMI = 11 + /* Note: update MBIM_SERVICE_LAST when a new value is added */ + } MbimService; + +@@ -188,6 +190,15 @@ typedef enum { + */ + #define MBIM_UUID_PROXY_CONTROL mbim_uuid_from_service (MBIM_SERVICE_PROXY_CONTROL) + ++/** ++ * MBIM_UUID_QMI: ++ * ++ * Get the UUID of the %MBIM_SERVICE_QMI service. ++ * ++ * Returns: (transfer none): a #MbimUuid. ++ */ ++#define MBIM_UUID_QMI mbim_uuid_from_service (MBIM_SERVICE_QMI) ++ + const gchar *mbim_service_lookup_name (guint service); + + guint mbim_register_custom_service (const MbimUuid *uuid, +-- +2.1.4 + diff --git a/patches/attachment-0004.patch b/patches/attachment-0004.patch new file mode 100644 index 00000000..b1110feb --- /dev/null +++ b/patches/attachment-0004.patch @@ -0,0 +1,329 @@ +>From 4ffa5693bcaf283bc3c8ea7808226eb6e92aaaf5 Mon Sep 17 00:00:00 2001 +From: =?UTF-8?q?Bj=C3=B8rn=20Mork?= +Date: Mon, 4 Apr 2016 14:44:01 +0200 +Subject: [PATCH 1/2] libqmi: support MBIM EXT_QMUX service +MIME-Version: 1.0 +Content-Type: text/plain; charset=UTF-8 +Content-Transfer-Encoding: 8bit + +Signed-off-by: Bjørn Mork +--- + configure.ac | 13 ++++ + src/libqmi-glib/Makefile.am | 4 +- + src/libqmi-glib/qmi-device.c | 156 ++++++++++++++++++++++++++++++++++++++++++- + src/libqmi-glib/qmi-device.h | 4 +- + 4 files changed, 172 insertions(+), 5 deletions(-) + +diff --git a/configure.ac b/configure.ac +index 3e05993..fe6225e 100644 +--- a/configure.ac ++++ b/configure.ac +@@ -95,6 +95,18 @@ fi + + AM_CONDITIONAL([QMI_USERNAME_ENABLED], [test "x$QMI_USERNAME_ENABLED" = "xyes"]) + ++# MBIM QMUX service support ++AC_ARG_ENABLE(mbim-qmux, ++ AS_HELP_STRING([--enable-mbim-qmux], [support QMI over MBIM QMUX service])) ++if test -n "$enable_mbim_qmux"; then ++ PKG_CHECK_MODULES(MBIM, mbim-glib >= 1.13) ++ MBIM_CFLAGS="$MBIM_CFLAGS -DMBIM_QMUX" ++ AC_SUBST(MBIM_CFLAGS) ++ AC_SUBST(MBIM_LIBS) ++fi ++ ++AM_CONDITIONAL(MBIM_QMUX, [test -n "$MBIM_CFLAGS"]) ++ + # udev base directory + AC_ARG_WITH(udev-base-dir, AS_HELP_STRING([--with-udev-base-dir=DIR], [where udev base directory is])) + if test -n "$with_udev_base_dir" ; then +@@ -146,4 +158,5 @@ echo " + udev base directory: ${UDEV_BASE_DIR} + Documentation: ${enable_gtk_doc} + QMI username: ${QMI_USERNAME_ENABLED} (${QMI_USERNAME}) ++ QMUX over MBIM: ${enable_mbim_qmux} + " +diff --git a/src/libqmi-glib/Makefile.am b/src/libqmi-glib/Makefile.am +index b24e3ae..6ff4e66 100644 +--- a/src/libqmi-glib/Makefile.am ++++ b/src/libqmi-glib/Makefile.am +@@ -5,6 +5,7 @@ lib_LTLIBRARIES = libqmi-glib.la + + libqmi_glib_la_CPPFLAGS = \ + $(GLIB_CFLAGS) \ ++ $(MBIM_CFLAGS) \ + -I$(top_srcdir) \ + -I$(top_builddir) \ + -I$(top_srcdir)/src/libqmi-glib \ +@@ -39,7 +40,8 @@ libqmi_glib_la_SOURCES = \ + + libqmi_glib_la_LIBADD = \ + ${top_builddir}/src/libqmi-glib/generated/libqmi-glib-generated.la \ +- $(GLIB_LIBS) ++ $(GLIB_LIBS) \ ++ $(MBIM_LIBS) + + libqmi_glib_la_LDFLAGS = \ + -version-info $(QMI_GLIB_LT_CURRENT):$(QMI_GLIB_LT_REVISION):$(QMI_GLIB_LT_AGE) +diff --git a/src/libqmi-glib/qmi-device.c b/src/libqmi-glib/qmi-device.c +index c4abbbc..6c46bca 100644 +--- a/src/libqmi-glib/qmi-device.c ++++ b/src/libqmi-glib/qmi-device.c +@@ -32,6 +32,10 @@ + #include + #include + ++#ifdef MBIM_QMUX ++#include ++#endif ++ + #include "qmi-device.h" + #include "qmi-message.h" + #include "qmi-ctl.h" +@@ -92,6 +96,10 @@ struct _QmiDevicePrivate { + gchar *path_display; + gboolean no_file_check; + gchar *proxy_path; ++ gboolean mbim_qmux; ++#ifdef MBIM_QMUX ++ MbimDevice *mbimdev; ++#endif + + /* WWAN interface */ + gboolean no_wwan_check; +@@ -1689,7 +1697,6 @@ input_ready_cb (GInputStream *istream, + self->priv->buffer = g_byte_array_sized_new (r); + g_byte_array_append (self->priv->buffer, buffer, r); + +- /* Try to parse input messages */ + parse_response (self); + + return TRUE; +@@ -2134,6 +2141,56 @@ internal_proxy_open_ready (QmiClientCtl *client_ctl, + device_open_context_step (ctx); + } + ++#ifdef MBIM_QMUX ++static void ++mbim_device_open_ready (MbimDevice *dev, ++ GAsyncResult *res, ++ DeviceOpenContext *ctx) ++{ ++ GError *error = NULL; ++ ++ if (!mbim_device_open_finish (dev, res, &error)) { ++ g_simple_async_result_take_error (ctx->result, error); ++ device_open_context_complete_and_free (ctx); ++ return; ++ } ++ g_debug ("[%s] MBIM device Open..", ++ ctx->self->priv->path_display); ++ ++ /* Go on */ ++ ctx->step++; ++ device_open_context_step (ctx); ++ return; ++} ++ ++static void ++mbim_device_new_ready (GObject *source, ++ GAsyncResult *res, ++ DeviceOpenContext *ctx) ++{ ++ MbimDeviceOpenFlags open_flags = MBIM_DEVICE_OPEN_FLAGS_NONE; ++ GError *error = NULL; ++ MbimDevice *device; ++ ++ if (ctx->flags & QMI_DEVICE_OPEN_FLAGS_PROXY) ++ open_flags |= MBIM_DEVICE_OPEN_FLAGS_PROXY; ++ device = mbim_device_new_finish (res, &error); ++ if (!device) { ++ g_simple_async_result_take_error (ctx->result, error); ++ device_open_context_complete_and_free (ctx); ++ return; ++ } ++ ctx->self->priv->mbimdev = device; ++ ++ mbim_device_open_full(device, ++ open_flags, ++ 30, ++ ctx->cancellable, ++ (GAsyncReadyCallback)mbim_device_open_ready, ++ ctx); ++} ++#endif ++ + static void + create_iostream_ready (QmiDevice *self, + GAsyncResult *res, +@@ -2166,6 +2223,20 @@ device_open_context_step (DeviceOpenContext *ctx) + /* Fall down */ + + case DEVICE_OPEN_CONTEXT_STEP_CREATE_IOSTREAM: ++#ifdef MBIM_QMUX ++ if (ctx->flags & QMI_DEVICE_OPEN_FLAGS_MBIM) { ++ GFile *file; ++ ++ ctx->self->priv->mbim_qmux = TRUE; ++ file = g_file_new_for_path (ctx->self->priv->path); ++ mbim_device_new (file, ++ ctx->cancellable, ++ (GAsyncReadyCallback)mbim_device_new_ready, ++ ctx); ++ g_object_unref (file); ++ return; ++ } ++#endif + create_iostream (ctx->self, + !!(ctx->flags & QMI_DEVICE_OPEN_FLAGS_PROXY), + (GAsyncReadyCallback)create_iostream_ready, +@@ -2174,7 +2245,8 @@ device_open_context_step (DeviceOpenContext *ctx) + + case DEVICE_OPEN_CONTEXT_STEP_FLAGS_PROXY: + /* Initialize communication with proxy? */ +- if (ctx->flags & QMI_DEVICE_OPEN_FLAGS_PROXY) { ++ if (ctx->flags & QMI_DEVICE_OPEN_FLAGS_PROXY && ++ !(ctx->flags & QMI_DEVICE_OPEN_FLAGS_MBIM)) { + QmiMessageCtlInternalProxyOpenInput *input; + + input = qmi_message_ctl_internal_proxy_open_input_new (); +@@ -2369,6 +2441,21 @@ destroy_iostream (QmiDevice *self, + return TRUE; + } + ++#ifdef MBIM_QMUX ++static void ++mbim_device_close_ready (MbimDevice *dev, ++ GAsyncResult *res) ++{ ++ GError *error = NULL; ++ ++ if (!mbim_device_close_finish (dev, res, &error)) { ++ g_printerr ("error: couldn't close device: %s", error->message); ++ g_error_free (error); ++ } else ++ g_debug ("Device closed"); ++} ++#endif ++ + /** + * qmi_device_close: + * @self: a #QmiDevice +@@ -2386,6 +2473,15 @@ qmi_device_close (QmiDevice *self, + { + g_return_val_if_fail (QMI_IS_DEVICE (self), FALSE); + ++#ifdef MBIM_QMUX ++ if (self->priv->mbim_qmux) ++ mbim_device_close (self->priv->mbimdev, ++ 15, ++ NULL, ++ (GAsyncReadyCallback) mbim_device_close_ready, ++ NULL); ++ else ++#endif + if (!destroy_iostream (self, error)) { + g_prefix_error (error, "Cannot close QMI device: "); + return FALSE; +@@ -2394,6 +2490,42 @@ qmi_device_close (QmiDevice *self, + return TRUE; + } + ++#ifdef MBIM_QMUX ++static void ++mbim_device_command_ready (MbimDevice *dev, ++ GAsyncResult *res, ++ QmiDevice *qmidev) ++{ ++ MbimMessage *response; ++ GError *error = NULL; ++ const guint8 *buf; ++ guint32 len; ++ ++ response = mbim_device_command_finish (dev, res, &error); ++ if (!response || !mbim_message_response_get_result (response, MBIM_MESSAGE_TYPE_COMMAND_DONE, &error)) { ++ g_prefix_error (&error, "MBIM error: "); ++ // transaction_complete_and_free (tr, NULL, error); ++ g_error_free (error); ++ mbim_message_unref (response); ++ return; ++ } ++ ++ g_debug ("[%s] Received MBIM message\n", qmidev->priv->path_display); ++ ++ ++ /* get the information buffer */ ++ buf = mbim_message_command_done_get_raw_information_buffer (response, &len); ++ if (!G_UNLIKELY (qmidev->priv->buffer)) ++ qmidev->priv->buffer = g_byte_array_sized_new (len); ++ g_byte_array_append (qmidev->priv->buffer, buf, len); ++ ++ /* and parse it as QMI */ ++ parse_response(qmidev); ++ mbim_message_unref (response); ++ return; ++} ++#endif ++ + /*****************************************************************************/ + /* Command */ + +@@ -2462,7 +2594,7 @@ qmi_device_command (QmiDevice *self, + tr = transaction_new (self, message, cancellable, callback, user_data); + + /* Device must be open */ +- if (!self->priv->istream || !self->priv->ostream) { ++ if ((!self->priv->istream || !self->priv->ostream) && !self->priv->mbim_qmux) { + error = g_error_new (QMI_CORE_ERROR, + QMI_CORE_ERROR_WRONG_STATE, + "Device must be open to send commands"); +@@ -2531,6 +2663,24 @@ qmi_device_command (QmiDevice *self, + g_free (printable); + } + ++#ifdef MBIM_QMUX ++ /* wrap QMUX in MBIM? */ ++ if (self->priv->mbim_qmux) { ++ MbimMessage *mbim; ++ ++ mbim = (mbim_message_qmi_msg_set_new (raw_message_len, raw_message, &error)); ++ mbim_device_command (self->priv->mbimdev, ++ mbim, ++ 30, ++ NULL, /* cancellable */ ++ (GAsyncReadyCallback)mbim_device_command_ready, ++ self); ++ g_debug ("[%s] Message sent as MBIM\n", self->priv->path_display); ++ ++ /* FIXME: check errors, set proper MBIM TID */ ++ return; ++ } ++#endif + if (!g_output_stream_write_all (self->priv->ostream, + raw_message, + raw_message_len, +diff --git a/src/libqmi-glib/qmi-device.h b/src/libqmi-glib/qmi-device.h +index 58651e1..957efac 100644 +--- a/src/libqmi-glib/qmi-device.h ++++ b/src/libqmi-glib/qmi-device.h +@@ -97,6 +97,7 @@ gboolean qmi_device_is_open (QmiDevice *self); + * @QMI_DEVICE_OPEN_FLAGS_NET_QOS_HEADER: set network port to transmit/receive QoS headers; mutually exclusive with @QMI_DEVICE_OPEN_FLAGS_NET_NO_QOS_HEADER + * @QMI_DEVICE_OPEN_FLAGS_NET_NO_QOS_HEADER: set network port to not transmit/receive QoS headers; mutually exclusive with @QMI_DEVICE_OPEN_FLAGS_NET_QOS_HEADER + * @QMI_DEVICE_OPEN_FLAGS_PROXY: Try to open the port through the 'qmi-proxy'. ++ * @QMI_DEVICE_OPEN_FLAGS_MBIM: open an MBIM port with QMUX tunneling service + * + * Flags to specify which actions to be performed when the device is open. + */ +@@ -108,7 +109,8 @@ typedef enum { + QMI_DEVICE_OPEN_FLAGS_NET_RAW_IP = 1 << 3, + QMI_DEVICE_OPEN_FLAGS_NET_QOS_HEADER = 1 << 4, + QMI_DEVICE_OPEN_FLAGS_NET_NO_QOS_HEADER = 1 << 5, +- QMI_DEVICE_OPEN_FLAGS_PROXY = 1 << 6 ++ QMI_DEVICE_OPEN_FLAGS_PROXY = 1 << 6, ++ QMI_DEVICE_OPEN_FLAGS_MBIM = 1 << 7 + } QmiDeviceOpenFlags; + + void qmi_device_open (QmiDevice *self, +-- +2.1.4 + diff --git a/patches/attachment-0005.patch b/patches/attachment-0005.patch new file mode 100644 index 00000000..ef455bce --- /dev/null +++ b/patches/attachment-0005.patch @@ -0,0 +1,50 @@ +>From cfa1df1527d81bf8cf3deeaf9ce341cd6c2a954c Mon Sep 17 00:00:00 2001 +From: =?UTF-8?q?Bj=C3=B8rn=20Mork?= +Date: Mon, 4 Apr 2016 14:47:01 +0200 +Subject: [PATCH 2/2] qmicli: support MBIM EXT_QMUX devices +MIME-Version: 1.0 +Content-Type: text/plain; charset=UTF-8 +Content-Transfer-Encoding: 8bit + +Signed-off-by: Bjørn Mork +--- + src/qmicli/qmicli.c | 9 ++++++++- + 1 file changed, 8 insertions(+), 1 deletion(-) + +diff --git a/src/qmicli/qmicli.c b/src/qmicli/qmicli.c +index 85c2faa..c591da2 100644 +--- a/src/qmicli/qmicli.c ++++ b/src/qmicli/qmicli.c +@@ -56,6 +56,7 @@ static gboolean device_open_version_info_flag; + static gboolean device_open_sync_flag; + static gchar *device_open_net_str; + static gboolean device_open_proxy_flag; ++static gboolean device_open_mbim_flag; + static gchar *client_cid_str; + static gboolean client_no_release_cid_flag; + static gboolean verbose_flag; +@@ -99,6 +100,10 @@ static GOptionEntry main_entries[] = { + "Request to use the 'qmi-proxy' proxy", + NULL + }, ++ { "device-open-mbim", 0, 0, G_OPTION_ARG_NONE, &device_open_mbim_flag, ++ "Open an MBIM device with EXT_QMUX support", ++ NULL ++ }, + { "device-open-net", 0, 0, G_OPTION_ARG_STRING, &device_open_net_str, + "Open device with specific link protocol and QoS flags", + "[net-802-3|net-raw-ip|net-qos-header|net-no-qos-header]" +@@ -603,7 +608,9 @@ device_new_ready (GObject *unused, + open_flags |= QMI_DEVICE_OPEN_FLAGS_SYNC; + if (device_open_proxy_flag) + open_flags |= QMI_DEVICE_OPEN_FLAGS_PROXY; +- if (device_open_net_str) ++ if (device_open_mbim_flag) ++ open_flags |= QMI_DEVICE_OPEN_FLAGS_MBIM; ++ if (device_open_net_str) + if (!qmicli_read_net_open_flags_from_string (device_open_net_str, &open_flags)) + exit (EXIT_FAILURE); + +-- +2.1.4 + -- cgit v1.2.3 From 6cc413c0d71fdf38e0e56264ab07c0ca59aff0a0 Mon Sep 17 00:00:00 2001 From: Gregor Kleen Date: Mon, 16 May 2016 15:05:45 +0200 Subject: syntax --- hel.nix | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/hel.nix b/hel.nix index 1b3520e7..77aa20da 100644 --- a/hel.nix +++ b/hel.nix @@ -58,7 +58,7 @@ ]; nixpkgs.config.packageOverrides = pkgs: rec { - libiqm = overrideDerivation pkgs.libiqm (attrs: { + libiqm = pkgs.stdenv.lib.overrideDerivation pkgs.libiqm (attrs: { patches = attrs.patches ++ [ ./patches/attachment-0003.patch ./patches/attachment-0004.ptach ./patches/attachment-0005.patch ]; }); }; -- cgit v1.2.3 From b37bfff42b68ef58d3938b1b271e56eb2e1954ff Mon Sep 17 00:00:00 2001 From: Gregor Kleen Date: Mon, 16 May 2016 15:06:02 +0200 Subject: modemmanager ships with nm --- hel.nix | 1 - 1 file changed, 1 deletion(-) diff --git a/hel.nix b/hel.nix index 77aa20da..9af47211 100644 --- a/hel.nix +++ b/hel.nix @@ -35,7 +35,6 @@ networkmanager = { enable = true; - packages = with pkgs; [ modemmanager ]; }; }; -- cgit v1.2.3 From df195761738b81fd881da9acb2d860e2cc998be9 Mon Sep 17 00:00:00 2001 From: Gregor Kleen Date: Mon, 16 May 2016 15:07:03 +0200 Subject: typo --- hel.nix | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/hel.nix b/hel.nix index 9af47211..e8348019 100644 --- a/hel.nix +++ b/hel.nix @@ -57,7 +57,7 @@ ]; nixpkgs.config.packageOverrides = pkgs: rec { - libiqm = pkgs.stdenv.lib.overrideDerivation pkgs.libiqm (attrs: { + libqmi = pkgs.stdenv.lib.overrideDerivation pkgs.libqmi (attrs: { patches = attrs.patches ++ [ ./patches/attachment-0003.patch ./patches/attachment-0004.ptach ./patches/attachment-0005.patch ]; }); }; -- cgit v1.2.3 From 6e29f1114629ffee5c76c34ac8bd2dc00b04382a Mon Sep 17 00:00:00 2001 From: Gregor Kleen Date: Mon, 16 May 2016 15:07:42 +0200 Subject: no patches --- hel.nix | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/hel.nix b/hel.nix index e8348019..69246280 100644 --- a/hel.nix +++ b/hel.nix @@ -58,7 +58,7 @@ nixpkgs.config.packageOverrides = pkgs: rec { libqmi = pkgs.stdenv.lib.overrideDerivation pkgs.libqmi (attrs: { - patches = attrs.patches ++ [ ./patches/attachment-0003.patch ./patches/attachment-0004.ptach ./patches/attachment-0005.patch ]; + patches = [ ./patches/attachment-0003.patch ./patches/attachment-0004.ptach ./patches/attachment-0005.patch ]; }); }; -- cgit v1.2.3 From 7d2cc58f1d8201ef84579a0643f98316b7b5425a Mon Sep 17 00:00:00 2001 From: Gregor Kleen Date: Mon, 16 May 2016 15:08:05 +0200 Subject: typo --- hel.nix | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/hel.nix b/hel.nix index 69246280..9630382c 100644 --- a/hel.nix +++ b/hel.nix @@ -58,7 +58,7 @@ nixpkgs.config.packageOverrides = pkgs: rec { libqmi = pkgs.stdenv.lib.overrideDerivation pkgs.libqmi (attrs: { - patches = [ ./patches/attachment-0003.patch ./patches/attachment-0004.ptach ./patches/attachment-0005.patch ]; + patches = [ ./patches/attachment-0003.patch ./patches/attachment-0004.patch ./patches/attachment-0005.patch ]; }); }; -- cgit v1.2.3 From d5afb16180151ce613d22007ec30c4d32d704c79 Mon Sep 17 00:00:00 2001 From: Gregor Kleen Date: Mon, 16 May 2016 15:09:02 +0200 Subject: patch mbim, maybe? --- hel.nix | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/hel.nix b/hel.nix index 9630382c..0e2a00fb 100644 --- a/hel.nix +++ b/hel.nix @@ -57,7 +57,7 @@ ]; nixpkgs.config.packageOverrides = pkgs: rec { - libqmi = pkgs.stdenv.lib.overrideDerivation pkgs.libqmi (attrs: { + libmbim = pkgs.stdenv.lib.overrideDerivation pkgs.libmbim (attrs: { patches = [ ./patches/attachment-0003.patch ./patches/attachment-0004.patch ./patches/attachment-0005.patch ]; }); }; -- cgit v1.2.3 From 0d8310c6f128269c8ed21f3c4cbc916c421ea086 Mon Sep 17 00:00:00 2001 From: Gregor Kleen Date: Mon, 16 May 2016 15:09:55 +0200 Subject: patch all the things --- hel.nix | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/hel.nix b/hel.nix index 0e2a00fb..53b91817 100644 --- a/hel.nix +++ b/hel.nix @@ -58,7 +58,10 @@ nixpkgs.config.packageOverrides = pkgs: rec { libmbim = pkgs.stdenv.lib.overrideDerivation pkgs.libmbim (attrs: { - patches = [ ./patches/attachment-0003.patch ./patches/attachment-0004.patch ./patches/attachment-0005.patch ]; + patches = [ ./patches/attachment-0003.patch ./patches/attachment-0005.patch ]; + }); + libqmi = pkgs.stdenv.lib.overrideDerivation pkgs.libqmi (attrs: { + patches = [ ./patches/attachment-0004.patch ./patches/attachment-0005.patch ]; }); }; -- cgit v1.2.3 From d00b976c56007d9dca92b911bcbb61b202d85f01 Mon Sep 17 00:00:00 2001 From: Gregor Kleen Date: Mon, 16 May 2016 15:10:19 +0200 Subject: 5 is only for qmi --- hel.nix | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/hel.nix b/hel.nix index 53b91817..385eca4d 100644 --- a/hel.nix +++ b/hel.nix @@ -58,7 +58,7 @@ nixpkgs.config.packageOverrides = pkgs: rec { libmbim = pkgs.stdenv.lib.overrideDerivation pkgs.libmbim (attrs: { - patches = [ ./patches/attachment-0003.patch ./patches/attachment-0005.patch ]; + patches = [ ./patches/attachment-0003.patch ]; }); libqmi = pkgs.stdenv.lib.overrideDerivation pkgs.libqmi (attrs: { patches = [ ./patches/attachment-0004.patch ./patches/attachment-0005.patch ]; -- cgit v1.2.3 From b5d4db890386255784d76f561f783a754afe65e1 Mon Sep 17 00:00:00 2001 From: Gregor Kleen Date: Mon, 16 May 2016 15:11:11 +0200 Subject: automake --- hel.nix | 1 + 1 file changed, 1 insertion(+) diff --git a/hel.nix b/hel.nix index 385eca4d..1555f872 100644 --- a/hel.nix +++ b/hel.nix @@ -59,6 +59,7 @@ nixpkgs.config.packageOverrides = pkgs: rec { libmbim = pkgs.stdenv.lib.overrideDerivation pkgs.libmbim (attrs: { patches = [ ./patches/attachment-0003.patch ]; + buildInputs = attrs.buildInputs ++ [ pkgs.automake ]; }); libqmi = pkgs.stdenv.lib.overrideDerivation pkgs.libqmi (attrs: { patches = [ ./patches/attachment-0004.patch ./patches/attachment-0005.patch ]; -- cgit v1.2.3 From e7925f98b178208c103226b773fbf029075a913e Mon Sep 17 00:00:00 2001 From: Gregor Kleen Date: Mon, 16 May 2016 15:11:58 +0200 Subject: autoconf --- hel.nix | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/hel.nix b/hel.nix index 1555f872..43d320d8 100644 --- a/hel.nix +++ b/hel.nix @@ -59,7 +59,7 @@ nixpkgs.config.packageOverrides = pkgs: rec { libmbim = pkgs.stdenv.lib.overrideDerivation pkgs.libmbim (attrs: { patches = [ ./patches/attachment-0003.patch ]; - buildInputs = attrs.buildInputs ++ [ pkgs.automake ]; + buildInputs = attrs.buildInputs ++ [ pkgs.automake pkgs.autoconf ]; }); libqmi = pkgs.stdenv.lib.overrideDerivation pkgs.libqmi (attrs: { patches = [ ./patches/attachment-0004.patch ./patches/attachment-0005.patch ]; -- cgit v1.2.3 From 6b10f83739c871e000d6cb629b74ca5600783766 Mon Sep 17 00:00:00 2001 From: Gregor Kleen Date: Mon, 16 May 2016 15:14:34 +0200 Subject: debug output --- hel.nix | 3 +++ 1 file changed, 3 insertions(+) diff --git a/hel.nix b/hel.nix index 43d320d8..cec012c3 100644 --- a/hel.nix +++ b/hel.nix @@ -60,6 +60,9 @@ libmbim = pkgs.stdenv.lib.overrideDerivation pkgs.libmbim (attrs: { patches = [ ./patches/attachment-0003.patch ]; buildInputs = attrs.buildInputs ++ [ pkgs.automake pkgs.autoconf ]; + preConfigure = '' + echo $PATH + ''; }); libqmi = pkgs.stdenv.lib.overrideDerivation pkgs.libqmi (attrs: { patches = [ ./patches/attachment-0004.patch ./patches/attachment-0005.patch ]; -- cgit v1.2.3 From 064a749bfed3e4d93151dc2e46af1969f2201dfb Mon Sep 17 00:00:00 2001 From: Gregor Kleen Date: Mon, 16 May 2016 15:15:45 +0200 Subject: specific automake version --- hel.nix | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) diff --git a/hel.nix b/hel.nix index cec012c3..ba732061 100644 --- a/hel.nix +++ b/hel.nix @@ -59,10 +59,7 @@ nixpkgs.config.packageOverrides = pkgs: rec { libmbim = pkgs.stdenv.lib.overrideDerivation pkgs.libmbim (attrs: { patches = [ ./patches/attachment-0003.patch ]; - buildInputs = attrs.buildInputs ++ [ pkgs.automake pkgs.autoconf ]; - preConfigure = '' - echo $PATH - ''; + buildInputs = attrs.buildInputs ++ [ pkgs.automake114x ]; }); libqmi = pkgs.stdenv.lib.overrideDerivation pkgs.libqmi (attrs: { patches = [ ./patches/attachment-0004.patch ./patches/attachment-0005.patch ]; -- cgit v1.2.3 From 205f1bdfb4007f1f87529c89c83ee003be2c018f Mon Sep 17 00:00:00 2001 From: Gregor Kleen Date: Mon, 16 May 2016 15:16:08 +0200 Subject: autoconf --- hel.nix | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/hel.nix b/hel.nix index ba732061..8c56cdac 100644 --- a/hel.nix +++ b/hel.nix @@ -59,7 +59,7 @@ nixpkgs.config.packageOverrides = pkgs: rec { libmbim = pkgs.stdenv.lib.overrideDerivation pkgs.libmbim (attrs: { patches = [ ./patches/attachment-0003.patch ]; - buildInputs = attrs.buildInputs ++ [ pkgs.automake114x ]; + buildInputs = attrs.buildInputs ++ [ pkgs.automake114x pkgs.autoconf ]; }); libqmi = pkgs.stdenv.lib.overrideDerivation pkgs.libqmi (attrs: { patches = [ ./patches/attachment-0004.patch ./patches/attachment-0005.patch ]; -- cgit v1.2.3 From d03eee59033757188b40a03fbca474f805277ccf Mon Sep 17 00:00:00 2001 From: Gregor Kleen Date: Mon, 16 May 2016 15:17:09 +0200 Subject: aclocal-1.15 is in automake 1.15 --- hel.nix | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/hel.nix b/hel.nix index 8c56cdac..10238209 100644 --- a/hel.nix +++ b/hel.nix @@ -59,7 +59,7 @@ nixpkgs.config.packageOverrides = pkgs: rec { libmbim = pkgs.stdenv.lib.overrideDerivation pkgs.libmbim (attrs: { patches = [ ./patches/attachment-0003.patch ]; - buildInputs = attrs.buildInputs ++ [ pkgs.automake114x pkgs.autoconf ]; + buildInputs = attrs.buildInputs ++ [ pkgs.automake114x pkgs.automake ]; }); libqmi = pkgs.stdenv.lib.overrideDerivation pkgs.libqmi (attrs: { patches = [ ./patches/attachment-0004.patch ./patches/attachment-0005.patch ]; -- cgit v1.2.3 From 2384d8ba30a5b4b363079fc8da673c294179d456 Mon Sep 17 00:00:00 2001 From: Gregor Kleen Date: Mon, 16 May 2016 15:18:03 +0200 Subject: more debug --- hel.nix | 3 +++ 1 file changed, 3 insertions(+) diff --git a/hel.nix b/hel.nix index 10238209..2c9d4427 100644 --- a/hel.nix +++ b/hel.nix @@ -60,6 +60,9 @@ libmbim = pkgs.stdenv.lib.overrideDerivation pkgs.libmbim (attrs: { patches = [ ./patches/attachment-0003.patch ]; buildInputs = attrs.buildInputs ++ [ pkgs.automake114x pkgs.automake ]; + preConfigure = '' + echo $PATH + ''; }); libqmi = pkgs.stdenv.lib.overrideDerivation pkgs.libqmi (attrs: { patches = [ ./patches/attachment-0004.patch ./patches/attachment-0005.patch ]; -- cgit v1.2.3 From f8e4c4ac2dc1dba9a47fed78b7bebb7913708acb Mon Sep 17 00:00:00 2001 From: Gregor Kleen Date: Mon, 16 May 2016 15:21:13 +0200 Subject: debug --- hel.nix | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/hel.nix b/hel.nix index 2c9d4427..9e806876 100644 --- a/hel.nix +++ b/hel.nix @@ -61,7 +61,7 @@ patches = [ ./patches/attachment-0003.patch ]; buildInputs = attrs.buildInputs ++ [ pkgs.automake114x pkgs.automake ]; preConfigure = '' - echo $PATH + cat libqmi-1.12.6/missing ''; }); libqmi = pkgs.stdenv.lib.overrideDerivation pkgs.libqmi (attrs: { -- cgit v1.2.3 From 348646083c4c83d55e3d65b5a82558e871b7e29c Mon Sep 17 00:00:00 2001 From: Gregor Kleen Date: Mon, 16 May 2016 15:21:59 +0200 Subject: ditto --- hel.nix | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/hel.nix b/hel.nix index 9e806876..fe3b9523 100644 --- a/hel.nix +++ b/hel.nix @@ -61,7 +61,7 @@ patches = [ ./patches/attachment-0003.patch ]; buildInputs = attrs.buildInputs ++ [ pkgs.automake114x pkgs.automake ]; preConfigure = '' - cat libqmi-1.12.6/missing + ${pkgs.find}/bin/find . -iname 'missing' ''; }); libqmi = pkgs.stdenv.lib.overrideDerivation pkgs.libqmi (attrs: { -- cgit v1.2.3 From 9540854b7d0da175382ee55dba4132f390435131 Mon Sep 17 00:00:00 2001 From: Gregor Kleen Date: Mon, 16 May 2016 15:22:19 +0200 Subject: package name --- hel.nix | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/hel.nix b/hel.nix index fe3b9523..61467fc5 100644 --- a/hel.nix +++ b/hel.nix @@ -61,7 +61,7 @@ patches = [ ./patches/attachment-0003.patch ]; buildInputs = attrs.buildInputs ++ [ pkgs.automake114x pkgs.automake ]; preConfigure = '' - ${pkgs.find}/bin/find . -iname 'missing' + ${pkgs.findutils}/bin/find . -iname 'missing' ''; }); libqmi = pkgs.stdenv.lib.overrideDerivation pkgs.libqmi (attrs: { -- cgit v1.2.3 From 7b55de01cd11674ef3b625bba20fa292e14e3ee8 Mon Sep 17 00:00:00 2001 From: Gregor Kleen Date: Mon, 16 May 2016 15:22:48 +0200 Subject: more debug --- hel.nix | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/hel.nix b/hel.nix index 61467fc5..6f73a154 100644 --- a/hel.nix +++ b/hel.nix @@ -61,7 +61,7 @@ patches = [ ./patches/attachment-0003.patch ]; buildInputs = attrs.buildInputs ++ [ pkgs.automake114x pkgs.automake ]; preConfigure = '' - ${pkgs.findutils}/bin/find . -iname 'missing' + cat missing ''; }); libqmi = pkgs.stdenv.lib.overrideDerivation pkgs.libqmi (attrs: { -- cgit v1.2.3 From ead4006212967f0553a3f60e91d70e22e1906309 Mon Sep 17 00:00:00 2001 From: Gregor Kleen Date: Mon, 16 May 2016 15:26:56 +0200 Subject: debug --- hel.nix | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/hel.nix b/hel.nix index 6f73a154..aec4f00b 100644 --- a/hel.nix +++ b/hel.nix @@ -61,7 +61,7 @@ patches = [ ./patches/attachment-0003.patch ]; buildInputs = attrs.buildInputs ++ [ pkgs.automake114x pkgs.automake ]; preConfigure = '' - cat missing + ${pkgs.findutils}/bin/find . | ${pkgs.gnugrep}/bin/fgrep aclocal ''; }); libqmi = pkgs.stdenv.lib.overrideDerivation pkgs.libqmi (attrs: { -- cgit v1.2.3 From 7b8ad032acaf0a641c7107a646a0e89009d31710 Mon Sep 17 00:00:00 2001 From: Gregor Kleen Date: Mon, 16 May 2016 15:27:59 +0200 Subject: upps --- hel.nix | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/hel.nix b/hel.nix index aec4f00b..3b3d2094 100644 --- a/hel.nix +++ b/hel.nix @@ -61,7 +61,7 @@ patches = [ ./patches/attachment-0003.patch ]; buildInputs = attrs.buildInputs ++ [ pkgs.automake114x pkgs.automake ]; preConfigure = '' - ${pkgs.findutils}/bin/find . | ${pkgs.gnugrep}/bin/fgrep aclocal + ${pkgs.findutils}/bin/find . -exec ${pkgs.gnugrep}/bin/fgrep aclocal '{}' ';' ''; }); libqmi = pkgs.stdenv.lib.overrideDerivation pkgs.libqmi (attrs: { -- cgit v1.2.3 From 114e91a55d5257e15a98611785203641c59038e6 Mon Sep 17 00:00:00 2001 From: Gregor Kleen Date: Mon, 16 May 2016 15:29:38 +0200 Subject: manual searching --- hel.nix | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/hel.nix b/hel.nix index 3b3d2094..92eee675 100644 --- a/hel.nix +++ b/hel.nix @@ -61,7 +61,7 @@ patches = [ ./patches/attachment-0003.patch ]; buildInputs = attrs.buildInputs ++ [ pkgs.automake114x pkgs.automake ]; preConfigure = '' - ${pkgs.findutils}/bin/find . -exec ${pkgs.gnugrep}/bin/fgrep aclocal '{}' ';' + pwd ''; }); libqmi = pkgs.stdenv.lib.overrideDerivation pkgs.libqmi (attrs: { -- cgit v1.2.3 From b419515a08c3d794d712c12f9d501317ddea60e5 Mon Sep 17 00:00:00 2001 From: Gregor Kleen Date: Mon, 16 May 2016 15:31:34 +0200 Subject: was it qmi all along? --- hel.nix | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/hel.nix b/hel.nix index 92eee675..b1703583 100644 --- a/hel.nix +++ b/hel.nix @@ -59,13 +59,11 @@ nixpkgs.config.packageOverrides = pkgs: rec { libmbim = pkgs.stdenv.lib.overrideDerivation pkgs.libmbim (attrs: { patches = [ ./patches/attachment-0003.patch ]; - buildInputs = attrs.buildInputs ++ [ pkgs.automake114x pkgs.automake ]; - preConfigure = '' - pwd - ''; + buildInputs = attrs.buildInputs ++ [ pkgs.automake ]; }); libqmi = pkgs.stdenv.lib.overrideDerivation pkgs.libqmi (attrs: { patches = [ ./patches/attachment-0004.patch ./patches/attachment-0005.patch ]; + buildInputs = attrs.buildInputs ++ [ pkgs.automake ]; }); }; -- cgit v1.2.3 From 27fa39e3befd59a02eef62669dc2dbb05d5c107a Mon Sep 17 00:00:00 2001 From: Gregor Kleen Date: Mon, 16 May 2016 15:31:56 +0200 Subject: still need proper version --- hel.nix | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/hel.nix b/hel.nix index b1703583..f52688cb 100644 --- a/hel.nix +++ b/hel.nix @@ -59,7 +59,7 @@ nixpkgs.config.packageOverrides = pkgs: rec { libmbim = pkgs.stdenv.lib.overrideDerivation pkgs.libmbim (attrs: { patches = [ ./patches/attachment-0003.patch ]; - buildInputs = attrs.buildInputs ++ [ pkgs.automake ]; + buildInputs = attrs.buildInputs ++ [ pkgs.automake114x ]; }); libqmi = pkgs.stdenv.lib.overrideDerivation pkgs.libqmi (attrs: { patches = [ ./patches/attachment-0004.patch ./patches/attachment-0005.patch ]; -- cgit v1.2.3 From 13ed8ea04facf1e0d05177e88275f33c3ae0b191 Mon Sep 17 00:00:00 2001 From: Gregor Kleen Date: Mon, 16 May 2016 15:32:49 +0200 Subject: autoconf --- hel.nix | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/hel.nix b/hel.nix index f52688cb..04ff3202 100644 --- a/hel.nix +++ b/hel.nix @@ -59,7 +59,7 @@ nixpkgs.config.packageOverrides = pkgs: rec { libmbim = pkgs.stdenv.lib.overrideDerivation pkgs.libmbim (attrs: { patches = [ ./patches/attachment-0003.patch ]; - buildInputs = attrs.buildInputs ++ [ pkgs.automake114x ]; + buildInputs = attrs.buildInputs ++ [ pkgs.automake114x pkgs.autoconf ]; }); libqmi = pkgs.stdenv.lib.overrideDerivation pkgs.libqmi (attrs: { patches = [ ./patches/attachment-0004.patch ./patches/attachment-0005.patch ]; -- cgit v1.2.3 From 9eef0b7bf7b568dba4d530f51db575a0cff2e376 Mon Sep 17 00:00:00 2001 From: Gregor Kleen Date: Mon, 16 May 2016 15:34:19 +0200 Subject: qmi deps --- hel.nix | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/hel.nix b/hel.nix index 04ff3202..20a05071 100644 --- a/hel.nix +++ b/hel.nix @@ -63,7 +63,7 @@ }); libqmi = pkgs.stdenv.lib.overrideDerivation pkgs.libqmi (attrs: { patches = [ ./patches/attachment-0004.patch ./patches/attachment-0005.patch ]; - buildInputs = attrs.buildInputs ++ [ pkgs.automake ]; + buildInputs = attrs.buildInputs ++ [ pkgs.automake pkgs.autoconf ]; }); }; -- cgit v1.2.3 From 04ffebe38c14a56e707a7bf0bf7bc58a720f7e18 Mon Sep 17 00:00:00 2001 From: Gregor Kleen Date: Mon, 16 May 2016 15:36:03 +0200 Subject: json? --- hel.nix | 3 +++ 1 file changed, 3 insertions(+) diff --git a/hel.nix b/hel.nix index 20a05071..44c3f279 100644 --- a/hel.nix +++ b/hel.nix @@ -60,6 +60,9 @@ libmbim = pkgs.stdenv.lib.overrideDerivation pkgs.libmbim (attrs: { patches = [ ./patches/attachment-0003.patch ]; buildInputs = attrs.buildInputs ++ [ pkgs.automake114x pkgs.autoconf ]; + postConfigure = '' + ${pkgs.findutils}/bin/find . -iname '*.json' + ''; }); libqmi = pkgs.stdenv.lib.overrideDerivation pkgs.libqmi (attrs: { patches = [ ./patches/attachment-0004.patch ./patches/attachment-0005.patch ]; -- cgit v1.2.3 From 69ea49f29e3e22d5de4e5fa09badff06cdabe9d9 Mon Sep 17 00:00:00 2001 From: Gregor Kleen Date: Mon, 16 May 2016 15:38:34 +0200 Subject: json! --- hel.nix | 5 +- patches/attachment-0001.patch | 158 ++++++++++++++++++++++++++++++++++++++++++ patches/attachment.patch | 34 +++++++++ 3 files changed, 193 insertions(+), 4 deletions(-) create mode 100644 patches/attachment-0001.patch create mode 100644 patches/attachment.patch diff --git a/hel.nix b/hel.nix index 44c3f279..c8f42f82 100644 --- a/hel.nix +++ b/hel.nix @@ -58,11 +58,8 @@ nixpkgs.config.packageOverrides = pkgs: rec { libmbim = pkgs.stdenv.lib.overrideDerivation pkgs.libmbim (attrs: { - patches = [ ./patches/attachment-0003.patch ]; + patches = [ ./patches/attachment-0003.patch ./patches/attachment.patch ./patches/attachment-0001.patch ]; buildInputs = attrs.buildInputs ++ [ pkgs.automake114x pkgs.autoconf ]; - postConfigure = '' - ${pkgs.findutils}/bin/find . -iname '*.json' - ''; }); libqmi = pkgs.stdenv.lib.overrideDerivation pkgs.libqmi (attrs: { patches = [ ./patches/attachment-0004.patch ./patches/attachment-0005.patch ]; diff --git a/patches/attachment-0001.patch b/patches/attachment-0001.patch new file mode 100644 index 00000000..54882d44 --- /dev/null +++ b/patches/attachment-0001.patch @@ -0,0 +1,158 @@ +From 9550bd568371995acca003d6250ba4535db7d59f Mon Sep 17 00:00:00 2001 +From: Emil Ljungdahl +Date: Wed, 6 Apr 2016 19:25:27 +0200 +Subject: [PATCH 3/3] Avoid affecting the padding behavior for other services + than QMI + +--- + build-aux/mbim-codegen/Message.py | 9 +++++---- + build-aux/mbim-codegen/Struct.py | 9 +++++---- + data/mbim-service-qmi.json | 6 ++++-- + src/libmbim-glib/mbim-message-private.h | 4 ++-- + src/libmbim-glib/mbim-message.c | 10 +++++----- + 5 files changed, 21 insertions(+), 17 deletions(-) + +diff --git a/build-aux/mbim-codegen/Message.py b/build-aux/mbim-codegen/Message.py +index e66335d..a569685 100644 +--- a/build-aux/mbim-codegen/Message.py ++++ b/build-aux/mbim-codegen/Message.py +@@ -381,6 +381,7 @@ class Message: + translations['struct'] = field['struct-type'] if 'struct-type' in field else '' + translations['struct_underscore'] = utils.build_underscore_name_from_camelcase (translations['struct']) + translations['array_size'] = field['array-size'] if 'array-size' in field else '' ++ translations['pad_array'] = field['pad-array'] if 'pad-array' in field else 'TRUE' + + inner_template = '' + if 'available-if' in field: +@@ -394,13 +395,13 @@ class Message: + inner_template += (' {\n') + + if field['format'] == 'byte-array': +- inner_template += (' _mbim_message_command_builder_append_byte_array (builder, FALSE, FALSE, TRUE, ${field}, ${array_size});\n') ++ inner_template += (' _mbim_message_command_builder_append_byte_array (builder, FALSE, FALSE, ${pad_array}, ${field}, ${array_size});\n') + elif field['format'] == 'unsized-byte-array': +- inner_template += (' _mbim_message_command_builder_append_byte_array (builder, FALSE, FALSE, FALSE, ${field}, ${field}_size);\n') ++ inner_template += (' _mbim_message_command_builder_append_byte_array (builder, FALSE, FALSE, ${pad_array}, ${field}, ${field}_size);\n') + elif field['format'] == 'ref-byte-array': +- inner_template += (' _mbim_message_command_builder_append_byte_array (builder, TRUE, TRUE, TRUE, ${field}, ${field}_size);\n') ++ inner_template += (' _mbim_message_command_builder_append_byte_array (builder, TRUE, TRUE, ${pad_array}, ${field}, ${field}_size);\n') + elif field['format'] == 'ref-byte-array-no-offset': +- inner_template += (' _mbim_message_command_builder_append_byte_array (builder, FALSE, TRUE, TRUE, ${field}, ${field}_size);\n') ++ inner_template += (' _mbim_message_command_builder_append_byte_array (builder, FALSE, TRUE, ${pad_array}, ${field}, ${field}_size);\n') + elif field['format'] == 'uuid': + inner_template += (' _mbim_message_command_builder_append_uuid (builder, ${field});\n') + elif field['format'] == 'guint32': +diff --git a/build-aux/mbim-codegen/Struct.py b/build-aux/mbim-codegen/Struct.py +index 8797f3a..84570de 100644 +--- a/build-aux/mbim-codegen/Struct.py ++++ b/build-aux/mbim-codegen/Struct.py +@@ -494,18 +494,19 @@ class Struct: + translations['field'] = utils.build_underscore_name_from_camelcase(field['name']) + translations['array_size'] = field['array-size'] if 'array-size' in field else '' + translations['array_size_field'] = utils.build_underscore_name_from_camelcase(field['array-size-field']) if 'array-size-field' in field else '' ++ translations['pad_array'] = field['pad-array'] if 'pad-array' in field else 'TRUE' + + if field['format'] == 'uuid': + inner_template = (' _mbim_struct_builder_append_uuid (builder, &(value->${field}));\n') + elif field['format'] == 'byte-array': +- inner_template = (' _mbim_struct_builder_append_byte_array (builder, FALSE, FALSE, TRUE, value->${field}, ${array_size});\n') ++ inner_template = (' _mbim_struct_builder_append_byte_array (builder, FALSE, FALSE, ${pad_array}, value->${field}, ${array_size});\n') + elif field['format'] == 'unsized-byte-array': +- inner_template = (' _mbim_struct_builder_append_byte_array (builder, FALSE, FALSE, FALSE, value->${field}, value->${field}_size);\n') ++ inner_template = (' _mbim_struct_builder_append_byte_array (builder, FALSE, FALSE, ${pad_array}, value->${field}, value->${field}_size);\n') + elif field['format'] == 'ref-byte-array': + if 'array-size-field' in field: +- inner_template = (' _mbim_struct_builder_append_byte_array (builder, TRUE, FALSE, TRUE, value->${field}, value->${array_size_field});\n') ++ inner_template = (' _mbim_struct_builder_append_byte_array (builder, TRUE, FALSE, ${pad_array}, value->${field}, value->${array_size_field});\n') + else: +- inner_template = (' _mbim_struct_builder_append_byte_array (builder, TRUE, TRUE, TRUE, value->${field}, value->${field}_size);\n') ++ inner_template = (' _mbim_struct_builder_append_byte_array (builder, TRUE, TRUE, ${pad_array}, value->${field}, value->${field}_size);\n') + elif field['format'] == 'guint32': + inner_template = (' _mbim_struct_builder_append_guint32 (builder, value->${field});\n') + elif field['format'] == 'guint32-array': +diff --git a/data/mbim-service-qmi.json b/data/mbim-service-qmi.json +index b764d01..c11857f 100644 +--- a/data/mbim-service-qmi.json ++++ b/data/mbim-service-qmi.json +@@ -9,7 +9,9 @@ + "service" : "QMI", + "type" : "Command", + "set" : [ { "name" : "QmiMsg", +- "format" : "unsized-byte-array" } ], ++ "format" : "unsized-byte-array", ++ "pad-array" : "FALSE" } ], + "response" : [ { "name" : "QMUX", +- "format" : "unsized-byte-array" } ] } ++ "format" : "unsized-byte-array", ++ "pad-array" : "FALSE" } ] } + ] +diff --git a/src/libmbim-glib/mbim-message-private.h b/src/libmbim-glib/mbim-message-private.h +index 0082026..79071d8 100644 +--- a/src/libmbim-glib/mbim-message-private.h ++++ b/src/libmbim-glib/mbim-message-private.h +@@ -177,7 +177,7 @@ GByteArray *_mbim_struct_builder_complete (MbimStructBuilder + void _mbim_struct_builder_append_byte_array (MbimStructBuilder *builder, + gboolean with_offset, + gboolean with_length, +- gboolean permit_padding, ++ gboolean pad_buffer, + const guint8 *buffer, + guint32 buffer_len); + void _mbim_struct_builder_append_uuid (MbimStructBuilder *builder, +@@ -226,7 +226,7 @@ MbimMessage *_mbim_message_command_builder_complete (M + void _mbim_message_command_builder_append_byte_array (MbimMessageCommandBuilder *builder, + gboolean with_offset, + gboolean with_length, +- gboolean permit_padding, ++ gboolean pad_buffer, + const guint8 *buffer, + guint32 buffer_len); + void _mbim_message_command_builder_append_uuid (MbimMessageCommandBuilder *builder, +diff --git a/src/libmbim-glib/mbim-message.c b/src/libmbim-glib/mbim-message.c +index ad67059..1a0d492 100644 +--- a/src/libmbim-glib/mbim-message.c ++++ b/src/libmbim-glib/mbim-message.c +@@ -492,7 +492,7 @@ void + _mbim_struct_builder_append_byte_array (MbimStructBuilder *builder, + gboolean with_offset, + gboolean with_length, +- gboolean permit_padding, ++ gboolean pad_buffer, + const guint8 *buffer, + guint32 buffer_len) + { +@@ -502,7 +502,7 @@ _mbim_struct_builder_append_byte_array (MbimStructBuilder *builder, + */ + if (!with_offset && !with_length) { + g_byte_array_append (builder->fixed_buffer, buffer, buffer_len); +- if(permit_padding) { ++ if(pad_buffer) { + while (buffer_len % 4 != 0) { + const guint8 padding = 0; + +@@ -554,7 +554,7 @@ _mbim_struct_builder_append_byte_array (MbimStructBuilder *builder, + g_byte_array_append (builder->variable_buffer, (const guint8 *)buffer, (guint)buffer_len); + + /* Note: adding zero padding causes trouble for QMI service */ +- if(permit_padding) { ++ if(pad_buffer) { + while (buffer_len % 4 != 0) { + const guint8 padding = 0; + +@@ -830,11 +830,11 @@ void + _mbim_message_command_builder_append_byte_array (MbimMessageCommandBuilder *builder, + gboolean with_offset, + gboolean with_length, +- gboolean permit_padding, ++ gboolean pad_buffer, + const guint8 *buffer, + guint32 buffer_len) + { +- _mbim_struct_builder_append_byte_array (builder->contents_builder, with_offset, with_length, permit_padding, buffer, buffer_len); ++ _mbim_struct_builder_append_byte_array (builder->contents_builder, with_offset, with_length, pad_buffer, buffer, buffer_len); + } + + void +-- +1.9.1 + diff --git a/patches/attachment.patch b/patches/attachment.patch new file mode 100644 index 00000000..32d4b053 --- /dev/null +++ b/patches/attachment.patch @@ -0,0 +1,34 @@ +From 65d4a4bb0420794ece5082da2cac0b6771e75be7 Mon Sep 17 00:00:00 2001 +From: Emil Ljungdahl +Date: Wed, 6 Apr 2016 19:16:47 +0200 +Subject: [PATCH 2/3] Added json file lost in original qmi-over-mbim patch + +--- + data/mbim-service-qmi.json | 15 +++++++++++++++ + 1 file changed, 15 insertions(+) + create mode 100644 data/mbim-service-qmi.json + +diff --git a/data/mbim-service-qmi.json b/data/mbim-service-qmi.json +new file mode 100644 +index 0000000..b764d01 +--- /dev/null ++++ b/data/mbim-service-qmi.json +@@ -0,0 +1,15 @@ ++ ++[ ++ // ********************************************************************************* ++ { "type" : "Service", ++ "name" : "QMI" }, ++ ++ // ********************************************************************************* ++ { "name" : "msg", ++ "service" : "QMI", ++ "type" : "Command", ++ "set" : [ { "name" : "QmiMsg", ++ "format" : "unsized-byte-array" } ], ++ "response" : [ { "name" : "QMUX", ++ "format" : "unsized-byte-array" } ] } ++] +-- +1.9.1 + -- cgit v1.2.3 From d227faaadebc7b0ea38d7375802413636a85cbf1 Mon Sep 17 00:00:00 2001 From: Gregor Kleen Date: Mon, 16 May 2016 15:39:01 +0200 Subject: just json. --- hel.nix | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/hel.nix b/hel.nix index c8f42f82..5791e49c 100644 --- a/hel.nix +++ b/hel.nix @@ -58,7 +58,7 @@ nixpkgs.config.packageOverrides = pkgs: rec { libmbim = pkgs.stdenv.lib.overrideDerivation pkgs.libmbim (attrs: { - patches = [ ./patches/attachment-0003.patch ./patches/attachment.patch ./patches/attachment-0001.patch ]; + patches = [ ./patches/attachment-0003.patch ./patches/attachment.patch ]; buildInputs = attrs.buildInputs ++ [ pkgs.automake114x pkgs.autoconf ]; }); libqmi = pkgs.stdenv.lib.overrideDerivation pkgs.libqmi (attrs: { -- cgit v1.2.3 From b2d275e8a8622697eeaa502a1f72dea9c468dfe3 Mon Sep 17 00:00:00 2001 From: Gregor Kleen Date: Mon, 16 May 2016 15:42:04 +0200 Subject: switched odin back to e --- hel.nix | 3 --- 1 file changed, 3 deletions(-) diff --git a/hel.nix b/hel.nix index 5791e49c..8f39eb98 100644 --- a/hel.nix +++ b/hel.nix @@ -136,9 +136,6 @@ ''; commandPath = [ "${pkgs.callPackage ./hel/recv-media.nix {}}/bin" ]; defaultCommands = []; - protocols = { - "isaac" = "g"; - }; commands = { "isaac" = ["recv-media"]; }; -- cgit v1.2.3 From 4d36cc4cc85953dae0ba64b30d20b6c01b485792 Mon Sep 17 00:00:00 2001 From: Gregor Kleen Date: Mon, 16 May 2016 15:53:12 +0200 Subject: systemPackages --- hel.nix | 1 + 1 file changed, 1 insertion(+) diff --git a/hel.nix b/hel.nix index 8f39eb98..fc7e58f5 100644 --- a/hel.nix +++ b/hel.nix @@ -54,6 +54,7 @@ shadow (callPackage ./custom/thinklight.nix { thinklight = "kbd_backlight"; }) (callPackage ./utils/nix/rebuild-system.nix {}) + libmbim libqmi ]; nixpkgs.config.packageOverrides = pkgs: rec { -- cgit v1.2.3 From 4ea855490dd670c49834005339cae81badbb20a7 Mon Sep 17 00:00:00 2001 From: Gregor Kleen Date: Mon, 16 May 2016 16:29:34 +0200 Subject: postfix relay on hel --- hel.nix | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) diff --git a/hel.nix b/hel.nix index fc7e58f5..7ce627b8 100644 --- a/hel.nix +++ b/hel.nix @@ -141,6 +141,23 @@ "isaac" = ["recv-media"]; }; }; + + postfix = { + enable = true; + enableSmtp = false; + setSendmail = true; + networksStyle = "host"; + hostname = "hel.midgard.yggdrasil"; + destination = []; + relayHost = "uucp:ymir"; + recipientDelimiter = "+"; + transport = '' + * uucp:ymir + ''; + extraMasterConf = '' + uucp unix - n n - - pipe flags=Fqhu user=uucp argv=/var/setuid-wrappers/uux -z -a$sender - $nexthop!rmail ($recipient) + ''; + }; }; users = { -- cgit v1.2.3 From 72b33a46d09e9175c11a4b3287c674aa8a13dc4f Mon Sep 17 00:00:00 2001 From: Gregor Kleen Date: Mon, 16 May 2016 16:37:29 +0200 Subject: nomail on uucp hourly errors --- ymir.nix | 1 + 1 file changed, 1 insertion(+) diff --git a/ymir.nix b/ymir.nix index 4e45d609..29457823 100644 --- a/ymir.nix +++ b/ymir.nix @@ -497,6 +497,7 @@ in rec { ''; commandPath = ["${pkgs.rmail}/bin" "${pkgs.push2bin}/bin"]; defaultCommands = ["rmail" "push2bin"]; + interval = "@hourly,nomail"; }; services.atd = { -- cgit v1.2.3 From 446bc170e0f17e82cb8a15ace96893678f265c49 Mon Sep 17 00:00:00 2001 From: Gregor Kleen Date: Mon, 16 May 2016 16:41:21 +0200 Subject: syntax --- ymir.nix | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/ymir.nix b/ymir.nix index 29457823..e86e8056 100644 --- a/ymir.nix +++ b/ymir.nix @@ -497,7 +497,7 @@ in rec { ''; commandPath = ["${pkgs.rmail}/bin" "${pkgs.push2bin}/bin"]; defaultCommands = ["rmail" "push2bin"]; - interval = "@hourly,nomail"; + interval = "%hourly,mail(no)"; }; services.atd = { -- cgit v1.2.3 From 112667d6b4425332f2d7b8ddaea4f7c925a4a620 Mon Sep 17 00:00:00 2001 From: Gregor Kleen Date: Mon, 16 May 2016 16:42:25 +0200 Subject: syntax --- ymir.nix | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/ymir.nix b/ymir.nix index e86e8056..bcb31d48 100644 --- a/ymir.nix +++ b/ymir.nix @@ -497,7 +497,7 @@ in rec { ''; commandPath = ["${pkgs.rmail}/bin" "${pkgs.push2bin}/bin"]; defaultCommands = ["rmail" "push2bin"]; - interval = "%hourly,mail(no)"; + interval = "@mail(no) 1h"; }; services.atd = { -- cgit v1.2.3 From 6cb1f4c2515e83cd615f2f0a0c61a1eb47392dd8 Mon Sep 17 00:00:00 2001 From: Gregor Kleen Date: Mon, 16 May 2016 16:43:18 +0200 Subject: cp instead of mv --- hel/recv-media.nix | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/hel/recv-media.nix b/hel/recv-media.nix index e0dc261f..b61840ec 100644 --- a/hel/recv-media.nix +++ b/hel/recv-media.nix @@ -9,5 +9,5 @@ writeScriptBin "recv-media" '' dir=/var/media - mv "$1" "''${dir}/$(basename "$1")" + cp -l "$1" "''${dir}/$(basename "$1")" '' -- cgit v1.2.3 From 2a0fe6e95985596b389136b4ce771775553f8d2b Mon Sep 17 00:00:00 2001 From: Gregor Kleen Date: Mon, 16 May 2016 22:41:28 +0200 Subject: regexp destination --- ymir.nix | 16 +++++++++++++++- 1 file changed, 15 insertions(+), 1 deletion(-) diff --git a/ymir.nix b/ymir.nix index bcb31d48..58495b8f 100644 --- a/ymir.nix +++ b/ymir.nix @@ -327,7 +327,7 @@ in rec { extraAliases = '' uucp: root ''; - destination = ["yggdrasil.li" "ymir.yggdrasil.li" "praseodym.org" "ymir.praseodym.org" "141.li" "ymir.141.li" "xmpp.li" "ymir.xmpp.li" "dirty-haskell.org" "explainuxul.de" "www.explainuxul.de" "lmu.li" "www.lmu.li" "localhost.yggdrasil.li" "localhost"]; + #destination = ["yggdrasil.li" "ymir.yggdrasil.li" "praseodym.org" "ymir.praseodym.org" "141.li" "ymir.141.li" "xmpp.li" "ymir.xmpp.li" "dirty-haskell.org" "explainuxul.de" "www.explainuxul.de" "lmu.li" "www.lmu.li" "localhost.yggdrasil.li" "localhost"]; sslCert = "/var/lib/acme/yggdrasil.li/fullchain.pem"; sslKey = "/var/lib/acme/yggdrasil.li/key.pem"; extraConfig = '' @@ -354,6 +354,20 @@ in rec { #enable TLS logging to see the ciphers for outbound connections smtp_tls_loglevel = 1 + destination = regexp:${pkgs.writeText "destination" '' + /\.?yggdrasil\.li$/ ACCEPT + /\.?praseodym\.org$/ ACCEPT + /\.?141\.li$/ ACCEPT + /\.?xmpp\.li$/ ACCEPT + /\.?dirty-haskell\.org$/ ACCEPT + /\.?explainuxul\.de$/ ACCEPT + /\.?lmu\.li$/ ACCEPT + /\.?yggdrasil$/ ACCEPT + /\.?localdomain$/ ACCEPT + /^localhost$/ ACCEPT + /\.?ymir$/ ACCEPT + ''} + transport_maps = regexp:${pkgs.writeText "transport" '' /^gkleen[@\+]/ uucp:isaac ''} -- cgit v1.2.3 From 29f16288001cd0d64e7c158bb1e327483a9e2d9a Mon Sep 17 00:00:00 2001 From: Gregor Kleen Date: Mon, 16 May 2016 22:45:13 +0200 Subject: ugh. --- ymir.nix | 27 +++++++++++++-------------- 1 file changed, 13 insertions(+), 14 deletions(-) diff --git a/ymir.nix b/ymir.nix index 58495b8f..22638a0e 100644 --- a/ymir.nix +++ b/ymir.nix @@ -328,6 +328,19 @@ in rec { uucp: root ''; #destination = ["yggdrasil.li" "ymir.yggdrasil.li" "praseodym.org" "ymir.praseodym.org" "141.li" "ymir.141.li" "xmpp.li" "ymir.xmpp.li" "dirty-haskell.org" "explainuxul.de" "www.explainuxul.de" "lmu.li" "www.lmu.li" "localhost.yggdrasil.li" "localhost"]; + destination = [''regexp:${pkgs.writeText "destination" '' + /\.?yggdrasil\.li$/ ACCEPT + /\.?praseodym\.org$/ ACCEPT + /\.?141\.li$/ ACCEPT + /\.?xmpp\.li$/ ACCEPT + /\.?dirty-haskell\.org$/ ACCEPT + /\.?explainuxul\.de$/ ACCEPT + /\.?lmu\.li$/ ACCEPT + /\.?yggdrasil$/ ACCEPT + /\.?localdomain$/ ACCEPT + /^localhost$/ ACCEPT + /\.?ymir$/ ACCEPT + ''}'']; sslCert = "/var/lib/acme/yggdrasil.li/fullchain.pem"; sslKey = "/var/lib/acme/yggdrasil.li/key.pem"; extraConfig = '' @@ -354,20 +367,6 @@ in rec { #enable TLS logging to see the ciphers for outbound connections smtp_tls_loglevel = 1 - destination = regexp:${pkgs.writeText "destination" '' - /\.?yggdrasil\.li$/ ACCEPT - /\.?praseodym\.org$/ ACCEPT - /\.?141\.li$/ ACCEPT - /\.?xmpp\.li$/ ACCEPT - /\.?dirty-haskell\.org$/ ACCEPT - /\.?explainuxul\.de$/ ACCEPT - /\.?lmu\.li$/ ACCEPT - /\.?yggdrasil$/ ACCEPT - /\.?localdomain$/ ACCEPT - /^localhost$/ ACCEPT - /\.?ymir$/ ACCEPT - ''} - transport_maps = regexp:${pkgs.writeText "transport" '' /^gkleen[@\+]/ uucp:isaac ''} -- cgit v1.2.3