Postmarket OS是一个基于Alpine Linux。能够安装到手机或其他移动设备上。当然linux deploy也可以使用SSH,但linux deploy运行在容器里.使用上会有些限制.

Nexus5 硬件信息

芯片组 Qualcomm MSM8974 Snapdragon 800
中央处理器 4x2.3 GHz Krait 400
显卡 Adreno330
屏幕 1080x1920 IPS
存储 16/32 GB
内存 2 GB
处理器架构 armv7
Unixbench Whe / Dhry score 840.9
1.准备环境
  • 科*学( 环境(最好路由器支持,实测ProxyChains只能部分代理)

  • Ubuntu系统 (或虚拟机 注:Windosw子系统WSL不能工作,实测alpine ,suse Centos 安装会出其他莫名问题)

  • python(>=3.6) pip3 git

    sudo apt install python3 git fastboot
    sudo python3.8 -m easy_install pip #pyhton3.8以下版本可用 sudo apt install python3-pip
2.安装pmbootstrap
  • 安装

    pip3 install --user pmbootstrap
  • 更新

    pip3 install --user --upgrade pmbootstrap
  • 安装后需要注销并重新登陆刷新path

    pmbootstrap log #查看日志记录
    pmbootstrap pull#更新
3.初始化 pmbootstrap init

镜像源地址列表https://mirrors.postmarketos.org/ https://mirrors.alpinelinux.org/

zp@zp:~$ pmbootstrap --mirror-pmOS="http://postmarketos-mirror.southafricanorth.cloudapp.azure.com/"  --mirror-alpine="http://mirrors.ustc.edu.cn/alpine/" init
[07:03:26] Location of the 'work' path. Multiple chroots (native, device arch, device rootfs) will be created in there.
##设置工作路径确保该位置有几个GB的可用空间,并且它是一个相对标准的Linux文件系统
[07:03:26] Work path [/home/zp/.local/var/pmbootstrap]:
[07:03:27] NOTE: pmaports path: /home/zp/.local/var/pmbootstrap/cache_git/pmaports
[07:03:27] Choose the postmarketOS release channel.
[07:03:27] Available (2):
[07:03:27] * edge: Rolling release channel
[07:03:27] * stable: Stable release channel (first beta v20.05, does not have many devices yet)
##选择更新通道 Stable稳定版 edge 滚动更新版
[07:03:27] Channel [edge]:
[07:03:29] Choose your target device vendor (either an existing one, or a new one for porting).
[07:03:29] Available vendors (55): acer, alcatel, amazon, arrow, asus, bq, chuwi, cubietech, essential, fairphone, finepower, fly, fujitsu, google, gp, hisense, htc, huawei, infocus, jolla, leeco, lenovo, lg, medion, meizu, motorola, nextbit, nobby, nokia, oneplus, oppo, ouya, pine64, planet, purism, qemu, raspberry, samsung, semc, sharp, sony, surftab, t2m, tablet, teclast, tokio, trekstor, vernee, wexler, wiko, wileyfox, xiaomi, yu, zte, zuk
##选择 设备的供应商和代码
[07:03:29] Vendor [lg]:
[07:03:30] Available codenames (14): bullhead, d285, d722, d851, d855, dory, e610, h815, hammerhead, lenok, mako, p700, vee7e, w5
##nexus5 是hammerhead
[07:03:30] Device codename [hammerhead]:
[07:03:33] This device has proprietary components, which trade some of your freedom with making more peripherals work.
[07:03:33] We would like to offer full functionality without hurting your freedom, but this is currently not possible for your device.
[07:03:33] device-lg-hammerhead-nonfree-firmware: WiFi, GPU, Modem and ADSP firmware
##是否安装 Wifi GPU Modem 等驱动
[07:03:33] Enable this package? (y/n) [y]:
##设备登陆用户名
[07:03:35] Username [xx]: lg3
[07:03:41] Available user interfaces (13):
#用户界面
[07:03:41] * none: No graphical environment #无图形环境
[07:03:41] * fbkeyboard: Plain framebuffer console with touchscreen keyboard support#带有触摸屏键盘支持的纯帧缓冲控制台
[07:03:41] * gnome: (Wayland) Gnome Shell
[07:03:41] * i3wm: (X11) Tiling WM (keyboard required)#(需要键盘)
[07:03:41] * mate: (X11) MATE Desktop Environment, fork of GNOME2 (stylus recommended)#MATE桌面环境,GNOME2的分支(建议使用手写笔)
[07:03:41] * phosh: (Wayland) Mobile UI developed for the Librem 5 (works only with numeric passwords!)#为Librem 5开发的移动UI(仅适用于数字密码!)
[07:03:41] * plasma-bigscreen: (Wayland) 10-feet variant of Plasma, made for big screen TVs#用于大屏幕电视
[07:03:41] * plasma-desktop: (X11/Wayland) KDE Desktop Environment (works well with tablets)#KDE桌面环境(与平板电脑配合使用)
[07:03:41] * plasma-mobile: (Wayland) Mobile variant of KDE Plasma (does not run without hardware acceleration, allows only numeric passwords!)#(在没有硬件加速的情况下不能运行,仅允许输入数字密码!)
[07:03:41] * shelli: Plain console with touchscreen gesture support#带有触摸屏手势支持的普通控制台
[07:03:41] * sway: (Wayland) Tiling WM, drop-in replacement for i3wm (DOES NOT RUN WITHOUT HW ACCELERATION!)#(不能在没有硬件加速的情况下运行!)
[07:03:41] * sxmo: (X11) Simple X Mobile: Mobile environment based on simple & suckless software (best compatibility on pinephone)
[07:03:41] * weston: (Wayland) Reference compositor (demo, not a phone interface)
[07:03:41] * xfce4: (X11) Lightweight desktop (stylus recommended)
#选择Gui fbkeyboard 其他图形界面不推荐,太卡
[07:03:41] User interface [weston]: fbkeyboard
#除非您知道要更改某些内容,否则只需按一下return键即可在此处使用默认值进行回答
[07:03:48] Additional options: extra free space: 0 MB, boot partition size: 128 MB, parallel jobs: 3, ccache per arch: 5G, sudo timer: False
[07:03:48] Change them? (y/n) [n]:
[07:03:51] Additional packages that will be installed to rootfs. Specify them in a comma separated list (e.g.: vim,file) or "none"
[07:03:51] Extra packages [none]:
[07:03:52] Your host timezone: Etc/UTC
[07:03:52] Use this timezone instead of GMT? (y/n) [y]:
[07:03:54] Available locales (14): C.UTF-8, ch_DE.UTF-8, de_CH.UTF-8, de_DE.UTF-8, en_GB.UTF-8, en_US.UTF-8, es_ES.UTF-8, fr_FR.UTF-8, it_IT.UTF-8, nb_NO.UTF-8, nl_NL.UTF-8, pt_BR.UTF-8, ru_RU.UTF-8, sv_SE.UTF-8
[07:03:54] Choose default locale for installation (y/n) [C.UTF-8]:
#安装后手机显示的计算机名
[07:03:54] Device hostname (short form, e.g. 'foo') [lg-hammerhead]:
[07:03:56] After pmaports are changed, the binary packages may be outdated. If you want to install postmarketOS without changes, reply 'n' for a faster installation.
[07:03:56] Build outdated packages during 'pmbootstrap install'? (y/n) [y]:
[07:03:56] WARNING: The chroots and git repositories in the work dir do not get updated automatically.
[07:03:56] Run 'pmbootstrap status' once a day before working with pmbootstrap to make sure that everything is up-to-date.
[07:03:56] Done!
4.初始化安装pmbootstrap install

执行pmbootstrap install 并等待执行完成(需要漫长等待,可以通过pmbootstrap log 查看详细日志,如果中断可以重新重试)

pmbootstrap --mirror-pmOS="http://postmarketos-mirror.southafricanorth.cloudapp.azure.com/"  --mirror-alpine="http://mirrors.ustc.edu.cn/alpine/" install

中间会提示创建进入手机系统的新密码

5.刷入手机
  • 进入Fastboot Mode .在关闭设备电源的情况下,同时按住“降低音量”和“电源”按钮几秒钟,直到出现“快速启动模式”屏幕 并连接到电脑

  • 解锁OEM (已解锁跳过)

    sudo fastboot oem unlock
  • 将系统刷入到手机

    pmbootstrap --mirror-pmOS="http://postmarketos-mirror.southafricanorth.cloudapp.azure.com/"  --mirror-alpine="http://mirrors.ustc.edu.cn/alpine/"  flasher flash_rootfs --partition userdata
    
    sudo fastboot format system
    
    pmbootstrap  --mirror-pmOS="http://postmarketos-mirror.southafricanorth.cloudapp.azure.com/"  --mirror-alpine="http://mirrors.ustc.edu.cn/alpine/"   flasher flash_kernel
6.Docker安装
#编辑内核 qcom-msm8974代表的是芯片组Qualcomm MSM8974  其他手机需要自行对应
pmbootstrap --mirror-pmOS="http://postmarketos-mirror.southafricanorth.cloudapp.azure.com/" --mirror-alpine="http://mirrors.ustc.edu.cn/alpine/" kconfig edit postmarketos-qcom-msm8974
#编译
pmbootstrap --mirror-pmOS="http://postmarketos-mirror.southafricanorth.cloudapp.azure.com/" --mirror-alpine="http://mirrors.ustc.edu.cn/alpine/" build linux-postmarketos-qcom-msm8974 --force
  • 编译后文件~/.local/var/pmbootstrap/packages/edge/armv7/linux-postmarketos-qcom-msm8974***.apk

  • 通过 sudo apk add -u linux-postmarketos-qcom-msm8974-5.9.0_rc4-r0.apk (此方法我手机安装后重启并未生效,直接重新执行 3,4,5 步骤重新刷入系统生效)

  • 检Docker支持 https://raw.githubusercontent.com/moby/moby/master/contrib/check-config.sh

  • 安装Docker


    sudo sed -i '$a\199.232.28.133 raw.githubusercontent.com' /etc/hosts
    wget https://raw.githubusercontent.com/moby/moby/master/contrib/check-config.sh
    chmod 777 check-config.sh
    ./check-config.sh #安装Docker
    sudo apk add docker
    #启动docker服务
    sudo service docker start
    #设置为自动启动
    sudo rc-update add docker default
    #创建docker用户组并把用户加入组
    sudo groupadd docker
    #把用户添加进docker组中
    sudo gpasswd -a ${USER} docker
    #重启
    sudo reboot
    #docker 加速
    sudo vi /etc/docker/daemon.json
    {
    "registry-mirrors": [
    "https://dockerhub.azk8s.cn",
    "https://reg-mirror.qiniu.com",
    "https://registry.docker-cn.com",
    "http://docker.mirrors.ustc.edu.cn",
    "http://hub-mirror.c.163.com"
    ]
    }
    docker run --rm hello-world
7.其他说明
  • 使用poweroff 并不能完全关机,得进入快速模式下关机,开机也一样

  • 系统自带一个usb网卡,通过电脑与手机连接,电脑自动获取Ip地址,就可以通过usb连接到手机

  • 使用Usb网卡不识别时. 可以先在电脑上查询对应的USB芯片是什么 在编辑内核 Device Drivers => Network device support => <*> USB Network Adapters 中勾选对应USB网卡驱动apk

  • docker 运行时需要选择基于arm的镜像

  • 相机还不能正常工作

  • apk软件包中的openjdk8不建议使用,有性能bug,Docker中使用都比较快

  • 其他常用软件

    sudo apk add python3 py3-pip openjdk8 screen htop unrar curl
    
    sudo apk add mysql mysql-client
    #https://wiki.alpinelinux.org/wiki/Mysql sudo apk add jenkins
    #sudo service jenkins start
    #sudo rc-update add jenkins default #我的世界服务器
    docker run --rm -e EULA=TRUE -it -p 25565:25565 -v ~/mcdata:/data --name mc2 janbe/minecraft-server:multiarch
    #.net core
    docker pull mcr.microsoft.com/dotnet/core/aspnet:3.1.11-buster-slim-arm32v7
    docker pull mcr.microsoft.com/dotnet/core/aspnet:5.0.2-focal-arm32v7
  • 参考

    https://wiki.postmarketos.org/wiki/User_talk:Docker

    https://wiki.postmarketos.org/wiki/Main_Page

    https://wiki.postmarketos.org/wiki/Mirrors

Nexus5安装PostmarketOS(Alpine Linux)并装上Docker的更多相关文章

  1. Python - 安装 - 在 Alpine Linux 下安装 Python2

    概述 在 Alpine Liunx 下安装 python2 感觉又是水了一发... 感觉还是有点丢人, 就像在帮小学生写作业, 写完了后还想找人夸我... 最近看 docker 和 jenkins, ...

  2. 【粗略版】Linux deploy手机上创建自己的服务器

    偶尔看见了一篇安卓手机z安装linux的文章,正好自己有一个旧手机,心里有个大胆的想法. 简单来说,就是把旧手机安装linux然后装上容器,尝试部署一个简单项目,下面会记录下过程: 首先了解下这个软件 ...

  3. 修改alpine Linux的Docker容器的时区

    适用对象 使用 Alpine Linux 发行版的 Docker 镜像容器. 仅仅适用于没有安装uclibc的系统. 修改步骤 进入容器命令行 # docker exec -it container_ ...

  4. 在同一个硬盘上安装多个 Linux 发行版及 Fedora 21 、Fedora 22 初体验

    在同一个硬盘上安装多个 Linux 发行版 以前对多个 Linux 发行版的折腾主要是在虚拟机上完成.我的桌面电脑性能比较强大,玩玩虚拟机没啥问题,但是笔记本电脑就不行了.要在我的笔记本电脑上折腾多个 ...

  5. 把玩Alpine linux(一):安装

    导读 Alpine Linux是一个面向安全应用的轻量级Linux发行版.它采用了musl libc和busybox以减小系统的体积和运行时资源消耗,同时还提供了自己的包管理工具apk.Alpine ...

  6. Linux Mint KDE上安装fcitx+sougou输入法

    今天在韩总废弃的笔记本上安装了Linux Mint系统,装好之后第一件想到的事情就是安装个输入法,由于之前系统自带的输入法框架是ibus,我试用了一下发现很不人性化,所以决定换上fcitx+sougo ...

  7. [linux]centos7.4上安装MySQL-8.0.11【完美安装】

    版本声明 centos7.4 MySQL-8.0.11 1.我用的阿里云的虚拟主机,刚从windows换到linux,需要装下常用工具 #安装下sz rz常用到上传下载的命令 yum install ...

  8. 全网最全的linux上docker安装oracle的详细文档,遇到了n个问题,查了几十篇文章,最终汇总版,再有解决不了的,私聊我,我帮你解决

    目录 全网最全的linux上docker安装oracle的详细文档,遇到了n个问题,查了几十篇文章,最终汇总版,再有解决不了的,私聊我,我帮你解决 1. 拉取阿里镜像oracle 2. 创建初始化数据 ...

  9. Linux Centos 系统上安装BT客户端 Transmission

    Linux Centos 系统上安装BT客户端 Transmission   Transmission是一种BitTorrent客户端,特点是一个跨平台的后端和其上的简洁的用户界面,以MIT许可证和G ...

  10. Linux 桌面玩家指南:11. 在同一个硬盘上安装多个 Linux 发行版以及为 Linux 安装 Nvidia 显卡驱动

    特别说明:要在我的随笔后写评论的小伙伴们请注意了,我的博客开启了 MathJax 数学公式支持,MathJax 使用$标记数学公式的开始和结束.如果某条评论中出现了两个$,MathJax 会将两个$之 ...

随机推荐

  1. 阿里云仓库构建gcr镜像

    经常用到gcr的镜像,但是由于国内无法访问,使用阿里云仓库构建 例如需要获取:gcr.io/spiffe-io/spire-server:1.0.1 镜像 1.使用阿里云code,创建项目,新项目 增 ...

  2. read the docs

    1. 在 GitHub 新建一个repo 2. git clone git@github.com:readthedocs/tutorial-template.git 3. 把刚刚 clone 的 re ...

  3. [Nginx]status:203 Failed to start The NGINX HTTP and reverse proxy server

    怎么感觉Linux的nGinx比Win的事一个一个一个的多啊(半恼) 运行systemctl status nginx时提示: ① Process: 123456 ExecStartPre=/usr/ ...

  4. 国产DP4344兼容替代CSM4344 192K双通道输出数模转换芯片

    DP4344 是一款完整的 2 通道输出数模转换芯片, 内含插值滤波器.Multi-Bit 数模转换器.输出模 拟滤波器,并支持大部分的音频数据格式.DP4344 基于一个带线性模拟低通滤波器的四阶 ...

  5. js array map

      var user = ['Alice', 'Emily', 'Kate'];       console.log(user);      var keys = user.keys(); for ( ...

  6. 火星坐标系 (GCJ-02) 与百度坐标系 (BD-09) 的互转

    /**火星坐标系 (GCJ-02) 与百度坐标系 (BD-09) 的互转  * Created by macremote on 16/5/3.  */ function GPSUtil (){   v ...

  7. Treetop Lights使用条款与免责协议

    Treetop Lights (以下简称"我们")在此特别提醒您务必认真阅读.充分理解本<使用条款与免责协议>(以下简称"本协议")中各条款并选择是 ...

  8. Vue中使用model属性

    model属性接收两个参数 类型:{ prop?: string, event?: string } prop 也就是调用该组件的父组件中使用v-model指令绑定的属性 event 对应的是修改pr ...

  9. Cesium测量优化1

    简介:优化绘制点.线,面鼠标位置获取精度.支持3dties,gltf model,以及box等Geometry Entity上的位置拾取. 测试代码 <template> <div ...

  10. 蓝桥杯训练赛二-问题 A

    题目描述 用简单素数筛选法求N以内的素数. 输入 N 输出 2-N的素数 样例输入 100 样例输出 2 3 5 7 11 13 17 19 23 29 31 37 41 43 47 53 59 61 ...