|
| 1 | +--- |
| 2 | +title: mise で fwup をインストールする |
| 3 | +tags: |
| 4 | + - asdf |
| 5 | + - Nerves |
| 6 | + - mise |
| 7 | + - fwup |
| 8 | +private: false |
| 9 | +updated_at: '2025-11-09T18:39:33+09:00' |
| 10 | +id: d9481735ca8f31cdb22e |
| 11 | +organization_url_name: fukuokaex |
| 12 | +slide: false |
| 13 | +ignorePublish: false |
| 14 | +--- |
| 15 | +## はじめに |
| 16 | + |
| 17 | +[Nerves](https://www.nerves-project.org/) のファームウェア更新ツール [fwup](https://github.com/fwup-home/fwup) を、[mise](https://mise.jdx.dev/) を使ってインストールした手順の記録です。 |
| 18 | + |
| 19 | +https://github.com/fwup-home/fwup |
| 20 | + |
| 21 | +筆者の環境は Debian 系ですが、他の OS でも基本的な流れは同じです。 |
| 22 | + |
| 23 | +## Installation |
| 24 | + |
| 25 | +まず、fwup の公式ドキュメントでは mise(または asdf)を利用したインストール方法が案内されています。 |
| 26 | + |
| 27 | +> If you're already using [asdf](https://asdf-vm.com/) or [mise-en-place](https://mise.jdx.dev/), install `fwup` via [asdf-fwup](https://github.com/fwup-home/asdf-fwup). This will allow you to manage `fwup` versions in your software projects via `.tool-versions` files. |
| 28 | +> |
| 29 | +> — [fwup README](https://github.com/fwup-home/fwup) |
| 30 | +
|
| 31 | +> asdf または mise-en-place を使用している場合は、[asdf-fwup](https://github.com/fwup-home/asdf-fwup) 経由で `fwup` をインストールできます。 |
| 32 | +> `.tool-versions` ファイルを通じて、プロジェクト単位で fwup のバージョン管理が可能になります。 |
| 33 | +
|
| 34 | +mise では `.tool-versions` により、プロジェクトごとに異なるバージョンを簡単に切り替えられます。 |
| 35 | + |
| 36 | +## asdf-fwup プラグインについて |
| 37 | + |
| 38 | +fwup 用の asdf / mise プラグインは [asdf-fwup](https://github.com/fwup-home/asdf-fwup) です。 |
| 39 | + |
| 40 | +> This is the [fwup](https://github.com/fwup-home/fwup) plugin for the [asdf](https://asdf-vm.com/) and [mise-en-place](https://mise.jdx.dev/) package managers. |
| 41 | +> |
| 42 | +> — [asdf-fwup README](https://github.com/fwup-home/asdf-fwup) |
| 43 | +
|
| 44 | +> これは、asdf および mise-en-place 向けの fwup プラグインです。 |
| 45 | +
|
| 46 | +mise は asdf のプラグインエコシステムをそのまま利用できます。 |
| 47 | + |
| 48 | +> mise can use asdf's plugin ecosystem under the hood for backward compatibility. |
| 49 | +> |
| 50 | +> — [mise plugins](https://mise.jdx.dev/plugins.html#asdf-legacy-plugins) |
| 51 | +
|
| 52 | +> mise は下位互換のために、asdf のプラグインエコシステムを内部的に利用できます。 |
| 53 | +
|
| 54 | +そのため、asdf 用プラグインをそのまま mise で扱えます。 |
| 55 | + |
| 56 | +## 依存パッケージについて |
| 57 | + |
| 58 | +各 OS に応じて必要な依存パッケージを事前にインストールしてください。 |
| 59 | + |
| 60 | +例として、Debian 系の場合の例は以下のとおりです。 |
| 61 | + |
| 62 | +```bash |
| 63 | +sudo apt-get install autoconf pkg-config help2man libconfuse-dev libarchive-dev |
| 64 | +``` |
| 65 | + |
| 66 | +macOS や他の OS を使用している場合は、README の[「Dependencies」セクション](https://github.com/fwup-home/asdf-fwup#dependencies) |
| 67 | +を参照してください。 |
| 68 | + |
| 69 | +## mise 経由でのインストール |
| 70 | + |
| 71 | +プラグインを追加して、fwup をインストールします。 |
| 72 | + |
| 73 | +```bash |
| 74 | +mise plugin install fwup https://github.com/fwup-home/asdf-fwup.git |
| 75 | +mise use --global fwup@latest |
| 76 | +``` |
| 77 | + |
| 78 | +これで mise 管理下に fwup が導入され、グローバル環境で利用できるようになります。 |
| 79 | + |
| 80 | +## 動作確認 |
| 81 | + |
| 82 | +インストールが完了したら、バージョンを確認します。 |
| 83 | + |
| 84 | +```bash |
| 85 | +fwup --version |
| 86 | + |
| 87 | +mise ls |
| 88 | +``` |
| 89 | + |
| 90 | +バージョンが表示されればインストール成功です。 |
| 91 | + |
| 92 | +## 補足:Nerves 1.12 での改善点 |
| 93 | + |
| 94 | +以前は、asdf や mise 経由でインストールした fwup を使用すると `mix burn` 実行時に権限エラーが発生することがあり、[Nerves の Issue #1088](https://github.com/nerves-project/nerves/issues/1088) で報告されました。 |
| 95 | + |
| 96 | +https://github.com/nerves-project/nerves/issues/1088 |
| 97 | + |
| 98 | +その後、Nerves 1.12 で改良され、asdfでインストールしたfwupでも安全に `mix burn` できるようになりました 🎉 |
| 99 | + |
| 100 | +https://hexdocs.pm/nerves/changelog.html#v1-12-0-2025-11-01 |
| 101 | + |
| 102 | +## おわりに |
| 103 | + |
| 104 | +fwup は Nerves プロジェクトでのファームウェア更新や SD カード書き込みに欠かせないツールです。 |
| 105 | +mise と組み合わせることで、プロジェクト単位のバージョン管理をシンプルに実現できます。 |
| 106 | +また、Nerves 1.12 以降では mise 経由の fwup も安全に利用可能になりました。 |
0 commit comments