李東霖
    • Create new note
    • Create a note from template
      • Sharing URL Link copied
      • /edit
      • View mode
        • Edit mode
        • View mode
        • Book mode
        • Slide mode
        Edit mode View mode Book mode Slide mode
      • Customize slides
      • Note Permission
      • Read
        • Only me
        • Signed-in users
        • Everyone
        Only me Signed-in users Everyone
      • Write
        • Only me
        • Signed-in users
        • Everyone
        Only me Signed-in users Everyone
      • Engagement control Commenting, Suggest edit, Emoji Reply
    • Invite by email
      Invitee

      This note has no invitees

    • Publish Note

      Share your work with the world Congratulations! 🎉 Your note is out in the world Publish Note

      Your note will be visible on your profile and discoverable by anyone.
      Your note is now live.
      This note is visible on your profile and discoverable online.
      Everyone on the web can find and read all notes of this public team.
      See published notes
      Unpublish note
      Please check the box to agree to the Community Guidelines.
      View profile
    • Commenting
      Permission
      Disabled Forbidden Owners Signed-in users Everyone
    • Enable
    • Permission
      • Forbidden
      • Owners
      • Signed-in users
      • Everyone
    • Suggest edit
      Permission
      Disabled Forbidden Owners Signed-in users Everyone
    • Enable
    • Permission
      • Forbidden
      • Owners
      • Signed-in users
    • Emoji Reply
    • Enable
    • Versions and GitHub Sync
    • Note settings
    • Note Insights
    • Engagement control
    • Transfer ownership
    • Delete this note
    • Save as template
    • Insert from template
    • Import from
      • Dropbox
      • Google Drive
      • Gist
      • Clipboard
    • Export to
      • Dropbox
      • Google Drive
      • Gist
    • Download
      • Markdown
      • HTML
      • Raw HTML
Menu Note settings Versions and GitHub Sync Note Insights Sharing URL Create Help
Create Create new note Create a note from template
Menu
Options
Engagement control Transfer ownership Delete this note
Import from
Dropbox Google Drive Gist Clipboard
Export to
Dropbox Google Drive Gist
Download
Markdown HTML Raw HTML
Back
Sharing URL Link copied
/edit
View mode
  • Edit mode
  • View mode
  • Book mode
  • Slide mode
Edit mode View mode Book mode Slide mode
Customize slides
Note Permission
Read
Only me
  • Only me
  • Signed-in users
  • Everyone
Only me Signed-in users Everyone
Write
Only me
  • Only me
  • Signed-in users
  • Everyone
Only me Signed-in users Everyone
Engagement control Commenting, Suggest edit, Emoji Reply
  • Invite by email
    Invitee

    This note has no invitees

  • Publish Note

    Share your work with the world Congratulations! 🎉 Your note is out in the world Publish Note

    Your note will be visible on your profile and discoverable by anyone.
    Your note is now live.
    This note is visible on your profile and discoverable online.
    Everyone on the web can find and read all notes of this public team.
    See published notes
    Unpublish note
    Please check the box to agree to the Community Guidelines.
    View profile
    Engagement control
    Commenting
    Permission
    Disabled Forbidden Owners Signed-in users Everyone
    Enable
    Permission
    • Forbidden
    • Owners
    • Signed-in users
    • Everyone
    Suggest edit
    Permission
    Disabled Forbidden Owners Signed-in users Everyone
    Enable
    Permission
    • Forbidden
    • Owners
    • Signed-in users
    Emoji Reply
    Enable
    Import from Dropbox Google Drive Gist Clipboard
       owned this note    owned this note      
    Published Linked with GitHub
    Subscribed
    • Any changes
      Be notified of any changes
    • Mention me
      Be notified of mention me
    • Unsubscribe
    Subscribe
    --- slideOptions: theme : white --- <span style="font-size:0.9em;color:#3b9c60">COSCUP 2018</span> <span style="font-size:0.7em;">分享研究 <span style="color:#550088">Mender OTA</span> 開源方案的心得</span> === 講者 : `李東霖` --- <!-- .slide: data-background="https://i.imgur.com/H4VYoCV.jpg" data-background-size="30%" data-background-position="left" --> ### 自我介紹 - 李東霖 - 現在是碩士 0 年級 - 第一次來到 COSCUP <!-- ![](https://i.imgur.com/H4VYoCV.jpg) ![](https://i.imgur.com/TtLsy1I.jpg)--> ---- #### 為什麼來研究 Mender OTA --- <!-- .slide: data-background="https://mender.io/user/themes/mender/images/optimized/logo400px.png" data-background-size="30%" data-background-position="left bottom" --> ### 什麼是 Mender > "Over-the-air software updates > for embedded Linux > Mender is an end-to-end > open source updater > for connected IoT devices" > > [name=Mender 官網] by Apache License 2.0 --- <!-- .slide: data-background="https://mender.io/user/themes/mender/images/optimized/logo400px.png" data-background-size="30%" data-background-position="left bottom" --> ### 架構 ![](https://i.imgur.com/WSkg7eK.png =150%x) --- <!-- .slide: data-background="https://mender.io/user/themes/mender/images/optimized/logo400px.png" data-background-size="30%" data-background-position="left bottom" --> ### Mender client or updater https://github.com/mendersoftware/mender - 用 go 寫成 - 可藉由 yocto project 整合進 device - 也能自行整合 ---- #### partition layout ![](https://i.imgur.com/8B2SMMe.png =80%x) ---- #### image-based v.s. package-based [source](https://mender.io/blog/package-vs-image) ![](https://i.imgur.com/2KZ7DCg.png =80%x) ---- | | image-based | package-based | | -------- | :--------: | :--------: | | 更新範圍 | 大 | 小 | | 更新時間 | 多 | 少 | | 測試難度 | 易 | 難 | | atomic op | :o: | :x: | ---- ### meta-mender https://github.com/mendersoftware/meta-mender 內含有多個 yocto 層(layer) <span> <!-- .element: class="fragment" data-fragment-index="1" --> - ==`meta-mender-core`== - 佈署 mender client - 處理 boot config 和 layout - 有多個 bbclass 供功能整合 </span> <span> <!-- .element: class="fragment" data-fragment-index="2" --> - ==`meta-mender-demo`== - 可與 demo server 一起使用 - 示範 client 功能 </span> ---- ### 官方已整合硬體 - ==`meta-mender-raspberrypi`== - 可搭配 ==`meta-mender-raspberrypi-demo`== - ==`meta-mender-qemu`== - Beagle bone board --- <!-- .slide: data-background="https://mender.io/user/themes/mender/images/optimized/logo400px.png" data-background-size="30%" data-background-position="left bottom" --> ### Mender artifact 使用在 client 進行更新的特殊格式 ==`.mender`== - 版本名稱 - 相容設備 - 更新的 rootfs image - 更新時的狀態腳本 - 可簽名 工具 **`mender-artifact`** 可產生與修改該檔案類型 https://github.com/mendersoftware/mender-artifact ---- ```shell Mender artifact: Name: release-2 Format: mender Version: 2 Signature: no signature Compatible devices: '[qemux86-64]' State scripts: Updates: 0: Type: rootfs-image Files: name: core-image-full-cmdline-qemux86-64.ext4 size: 226492416 modified: 2018-08-08 17:31:30 +0800 CST checksum: 03c643e2401dd3c675c29992be0d15b36f405d5fbfd4619fdff202256dcdc2b6 ``` --- <!-- .slide: data-background="https://mender.io/user/themes/mender/images/optimized/logo400px.png" data-background-size="30%" data-background-position="left bottom" --> ### Mender server ![](https://i.imgur.com/vTIyNW8.png =90%x) ---- #### microservices - [Mender Device Admission Service](https://github.com/mendersoftware/deviceadm) - [Mender Device Authentication Service](https://github.com/mendersoftware/deviceauth) - [Mender Deployment Service](https://github.com/mendersoftware/deployments) - [Mender Device Inventory Service](https://github.com/mendersoftware/inventory) - [Mender User Administration Service](https://github.com/mendersoftware/useradm) - [Mender API Gateway](https://github.com/mendersoftware/mender-api-gateway-docker) - [Minio](https://www.minio.io/) object storage - Storage service proxy based on [OpenResty](https://openresty.org/en/) - [Mender Web GUI](https://github.com/mendersoftware/gui) ---- ![](https://i.imgur.com/gCJZBof.png) ---- #### integration https://github.com/mendersoftware/integration - 每個 microservice 為 docker service - 利用 docker-compose 管理 ```shell $ ./up #開啟所有 service $ ./stop #關閉所有 service ``` --- ### 使用者 流程 ```flow st=>start: 開始 make=>operation: 製作或取得映像檔(包含完整分區) provisioning=>operation: 燒錄進設備並取得 server 授權 newversion=>condition: 有新版本? newart=>operation: 產生新的 mender-artifact upload=>inputoutput: 上傳 mender server deployment=>operation: 使用 server 建立新的佈署 make->provisioning->newversion newversion(no, )->newversion newversion(yes, right)->newart->upload->deployment(right)->newversion ``` ---- ### 設備(Mender client) 流程 ![](https://i.imgur.com/zIAaM8k.png) --- ### state scripts 狀態腳本 - Mender client 狀態轉換間呼叫 - 方便客製化 e.g. 重開前先結束運作功能、啟用網路的時機、設備功能的驗證與啟動... --- ### 安全性 因為任何人都可以知道 mender 的行為 有什麼機制避免被白箱攻擊? ---- #### HTTPS client 有 server 憑證 可驗證 server 來源 ---- #### 設備授權 - 預先授權 - 先產生 key pair 並註冊在 server <br> - 請求授權 - client 自行產生 ,再對 server 請求註冊 ---- #### 更新檔 artifact 簽名 ![](https://i.imgur.com/lNTQiix.png) --- <!-- .slide: data-background="https://mender.io/user/themes/mender/images/optimized/logo400px.png" data-background-size="30%" data-background-position="left bottom" --> ### 商業模式 - open source - know how - hardware & software 服務 --- ### demo --- ### 心得 --- # 感謝聆聽 #### ==any question ?== <style type="text/css"> .reveal section img { border : 0px; } .reveal blockquote { background : rgba(0, 0, 0, 0.15); } </style>

    Import from clipboard

    Paste your markdown or webpage here...

    Advanced permission required

    Your current role can only read. Ask the system administrator to acquire write and comment permission.

    This team is disabled

    Sorry, this team is disabled. You can't edit this note.

    This note is locked

    Sorry, only owner can edit this note.

    Reach the limit

    Sorry, you've reached the max length this note can be.
    Please reduce the content or divide it to more notes, thank you!

    Import from Gist

    Import from Snippet

    or

    Export to Snippet

    Are you sure?

    Do you really want to delete this note?
    All users will lose their connection.

    Create a note from template

    Create a note from template

    Oops...
    This template has been removed or transferred.
    Upgrade
    All
    • All
    • Team
    No template.

    Create a template

    Upgrade

    Delete template

    Do you really want to delete this template?
    Turn this template into a regular note and keep its content, versions, and comments.

    This page need refresh

    You have an incompatible client version.
    Refresh to update.
    New version available!
    See releases notes here
    Refresh to enjoy new features.
    Your user state has changed.
    Refresh to load new user state.

    Sign in

    Forgot password

    or

    By clicking below, you agree to our terms of service.

    Sign in via Facebook Sign in via Twitter Sign in via GitHub Sign in via Dropbox Sign in with Wallet
    Wallet ( )
    Connect another wallet

    New to HackMD? Sign up

    Help

    • English
    • 中文
    • Français
    • Deutsch
    • 日本語
    • Español
    • Català
    • Ελληνικά
    • Português
    • italiano
    • Türkçe
    • Русский
    • Nederlands
    • hrvatski jezik
    • język polski
    • Українська
    • हिन्दी
    • svenska
    • Esperanto
    • dansk

    Documents

    Help & Tutorial

    How to use Book mode

    Slide Example

    API Docs

    Edit in VSCode

    Install browser extension

    Contacts

    Feedback

    Discord

    Send us email

    Resources

    Releases

    Pricing

    Blog

    Policy

    Terms

    Privacy

    Cheatsheet

    Syntax Example Reference
    # Header Header 基本排版
    - Unordered List
    • Unordered List
    1. Ordered List
    1. Ordered List
    - [ ] Todo List
    • Todo List
    > Blockquote
    Blockquote
    **Bold font** Bold font
    *Italics font* Italics font
    ~~Strikethrough~~ Strikethrough
    19^th^ 19th
    H~2~O H2O
    ++Inserted text++ Inserted text
    ==Marked text== Marked text
    [link text](https:// "title") Link
    ![image alt](https:// "title") Image
    `Code` Code 在筆記中貼入程式碼
    ```javascript
    var i = 0;
    ```
    var i = 0;
    :smile: :smile: Emoji list
    {%youtube youtube_id %} Externals
    $L^aT_eX$ LaTeX
    :::info
    This is a alert area.
    :::

    This is a alert area.

    Versions and GitHub Sync
    Get Full History Access

    • Edit version name
    • Delete

    revision author avatar     named on  

    More Less

    Note content is identical to the latest version.
    Compare
      Choose a version
      No search result
      Version not found
    Sign in to link this note to GitHub
    Learn more
    This note is not linked with GitHub
     

    Feedback

    Submission failed, please try again

    Thanks for your support.

    On a scale of 0-10, how likely is it that you would recommend HackMD to your friends, family or business associates?

    Please give us some advice and help us improve HackMD.

     

    Thanks for your feedback

    Remove version name

    Do you want to remove this version name and description?

    Transfer ownership

    Transfer to
      Warning: is a public team. If you transfer note to this team, everyone on the web can find and read this note.

        Link with GitHub

        Please authorize HackMD on GitHub
        • Please sign in to GitHub and install the HackMD app on your GitHub repo.
        • HackMD links with GitHub through a GitHub App. You can choose which repo to install our App.
        Learn more  Sign in to GitHub

        Push the note to GitHub Push to GitHub Pull a file from GitHub

          Authorize again
         

        Choose which file to push to

        Select repo
        Refresh Authorize more repos
        Select branch
        Select file
        Select branch
        Choose version(s) to push
        • Save a new version and push
        • Choose from existing versions
        Include title and tags
        Available push count

        Pull from GitHub

         
        File from GitHub
        File from HackMD

        GitHub Link Settings

        File linked

        Linked by
        File path
        Last synced branch
        Available push count

        Danger Zone

        Unlink
        You will no longer receive notification when GitHub file changes after unlink.

        Syncing

        Push failed

        Push successfully