在 Nexus 5x 上安装 Plasma Mobile 失败“./fetch-demo.sh: 16: ./fetch-demo.sh: pushd: not found”

在 Nexus 5x 上安装 Plasma Mobile 失败“./fetch-demo.sh: 16: ./fetch-demo.sh: pushd: not found”

我最近买了一台二手 Nexus 5X,它已经 root 了,并且安装了 Lineage OS。我想把它转换成 Plasma Mobile,但每次我尝试用命令刷新它时

sudo ./pm-flash

我在中途收到一条错误消息。如果有帮助的话,我会附上整个输出,但错误出现在最后。

neon@neon:/usr/lib/android-sdk/platform-tools/pm-flashtool$ sudo ./pm-flash -p neon
+ CACHEDIR=cache
+ echo 'Waiting for device to be in the fastboot mode'
Waiting for device to be in the fastboot mode
+ fastboot getvar product
product: bullhead
finished. total time: 0.005s
++ fastboot getvar product
++ head -1
++ awk '-F: ' '{print $2}'
+ DEVICE_NAME=bullhead
+ confirm 'Connected device is bullhead, is that correct? [y/N]'
+ read -r -p 'Connected device is bullhead, is that correct? [y/N] ' response
Connected device is bullhead, is that correct? [y/N] y
+ case $response in
+ true
+ PLATFORM=neon
+ echo 'Continuing ...'
Continuing ...
+ getopts cp: opt
+ case $opt in
+ PLATFORM=neon
+ getopts cp: opt
+ '[' -z '' ']'
+ download bullhead neon
+ '[' 2 -eq 0 ']'
+ mkdir -p cache/
+ pushd cache/
/usr/lib/android-sdk/platform-tools/pm-flashtool/cache /usr/lib/android-sdk/platform-tools/pm-flashtool
+ echo 'Downloading latest rootfs ... '
Downloading latest rootfs ... 
+ '[' neon == neon ']'
++ curl https://images.plasma-mobile.org/rootfs_stamp
+ ROOTFS_VERSION=20190208-135835
+ wget -c https://images.plasma-mobile.org/rootfs/pm-rootfs-20190208-135835.tar.gz -P rootfs
--2019-02-12 01:54:53--  https://images.plasma-mobile.org/rootfs/pm-rootfs-20190208-135835.tar.gz
Resolving images.plasma-mobile.org (images.plasma-mobile.org)... 207.154.251.179
Connecting to images.plasma-mobile.org (images.plasma-mobile.org)|207.154.251.179|:443... connected.
HTTP request sent, awaiting response... 200 OK
Length: 560234962 (534M) [application/x-gzip]
Saving to: ‘rootfs/pm-rootfs-20190208-135835.tar.gz’

pm-rootfs-20190208-135835.ta 100%[==============================================>] 534.28M   209KB/s    in 21m 12s 

2019-02-12 02:16:06 (430 KB/s) - ‘rootfs/pm-rootfs-20190208-135835.tar.gz’ saved [560234962/560234962]

+ ln -sf rootfs/pm-rootfs-20190208-135835.tar.gz pm-rootfs-latest.tar.gz
+ '[' neon == arch ']'
+ '[' neon == edge ']'
+ echo '[done]'
[done]
+ echo 'Downloading the latest boot, recovery, and system images  ... '
Downloading the latest boot, recovery, and system images  ... 
++ curl https://images.plasma-mobile.org/halium/bullhead/halium_stamp
+ HALIUM_VERSION=20180209-134208
+ wget -c https://images.plasma-mobile.org/halium/bullhead/recovery.img -P bullhead
--2019-02-12 02:16:07--  https://images.plasma-mobile.org/halium/bullhead/recovery.img
Resolving images.plasma-mobile.org (images.plasma-mobile.org)... 207.154.251.179
Connecting to images.plasma-mobile.org (images.plasma-mobile.org)|207.154.251.179|:443... connected.
HTTP request sent, awaiting response... 200 OK
Length: 16827692 (16M)
Saving to: ‘bullhead/recovery.img’

recovery.img                 100%[==============================================>]  16.05M  1.03MB/s    in 21s     

2019-02-12 02:16:30 (771 KB/s) - ‘bullhead/recovery.img’ saved [16827692/16827692]

+ wget -c https://images.plasma-mobile.org/halium/bullhead/20180209-134208/system.img -P bullhead/20180209-134208
--2019-02-12 02:16:30--  https://images.plasma-mobile.org/halium/bullhead/20180209-134208/system.img
Resolving images.plasma-mobile.org (images.plasma-mobile.org)... 207.154.251.179
Connecting to images.plasma-mobile.org (images.plasma-mobile.org)|207.154.251.179|:443... connected.
HTTP request sent, awaiting response... 200 OK
Length: 195715072 (187M)
Saving to: ‘bullhead/20180209-134208/system.img’

system.img                   100%[==============================================>] 186.65M  1.19MB/s    in 2m 48s  

2019-02-12 02:19:19 (1.11 MB/s) - ‘bullhead/20180209-134208/system.img’ saved [195715072/195715072]

+ wget -c https://images.plasma-mobile.org/halium/bullhead/20180209-134208/boot.img -P bullhead/20180209-134208
--2019-02-12 02:19:19--  https://images.plasma-mobile.org/halium/bullhead/20180209-134208/boot.img
Resolving images.plasma-mobile.org (images.plasma-mobile.org)... 207.154.251.179
Connecting to images.plasma-mobile.org (images.plasma-mobile.org)|207.154.251.179|:443... connected.
HTTP request sent, awaiting response... 200 OK
Length: 11956224 (11M)
Saving to: ‘bullhead/20180209-134208/boot.img’

boot.img                     100%[==============================================>]  11.40M  1.06MB/s    in 13s     

2019-02-12 02:19:32 (927 KB/s) - ‘bullhead/20180209-134208/boot.img’ saved [11956224/11956224]

+ rm -f bullhead/latest
+ ln -sf 20180209-134208 bullhead/latest
+ echo '[done]'
[done]
+ popd
/usr/lib/android-sdk/platform-tools/pm-flashtool
+ flash-phone bullhead
+ '[' 1 -eq 0 ']'
+ echo -n 'Flashing recovery image ... '
Flashing recovery image ... + fastboot flash recovery cache/bullhead/recovery.img
+ echo -n '[done]'
[done]+ fastboot boot cache/bullhead/recovery.img
downloading 'boot.img'...
OKAY [  0.716s]
booting...
OKAY [  0.551s]
finished. total time: 1.267s
+ wait_for_device
++ adb shell echo 1
+ test -z 'adb server version (40) doesn'\''t match this client (36); killing...
* daemon started successfully *'
+ echo

++ readlink -f cache/pm-rootfs-latest.tar.gz
+ ./rootstock-touch-install /usr/lib/android-sdk/platform-tools/pmflashtool/cache/rootfs/pm-rootfs-20190208-135835.tar.gz cache/bullhead/latest/system.img cache/bullhead/latest/boot.img
mount: mounting /dev/block/mmcblk0p40 on /cache failed: Device or resource busy
mount: mounting /dev/block/mmcblk0p45 on /data failed: Device or resource busy
transfering rootfs tarball ... [done]
preparing system-image on device ... [done]
unpacking rootfs tarball to system-image ... [done]
adding android system image to installation ... [done]
Setting up default password for phablet user to 1234 ... [done]
Cloning into 'fetch-demo-data'...
remote: Counting objects: 12, done.
remote: Compressing objects: 100% (10/10), done.
remote: Total 12 (delta 0), reused 3 (delta 0)
Unpacking objects: 100% (12/12), done.
--2019-02-12 02:23:03--  http://acbf.info/download?id=0016
Resolving acbf.info (acbf.info)... 5.10.124.141
Connecting to acbf.info (acbf.info)|5.10.124.141|:80... connected.
HTTP request sent, awaiting response... 200 OK
Length: unspecified [application/zip]
Saving to: ‘OUTPUT/Documents/Pepper___Carrot___Vol__1.cbz’

OUTPUT/Documents/Pepper___Ca     [                                    <=>        ]  21.77M   943KB/s    in 27s     

2019-02-12 02:23:32 (835 KB/s) - ‘OUTPUT/Documents/Pepper___Carrot___Vol__1.cbz’ saved [22831062]

--2019-02-12 02:23:32--  https://www.gnu.org/licenses/quick-guide-gplv3.pdf
Resolving www.gnu.org (www.gnu.org)... 209.51.188.148, 2001:470:142:3::a
Connecting to www.gnu.org (www.gnu.org)|209.51.188.148|:443... connected.
HTTP request sent, awaiting response... 200 OK
Length: 104908 (102K) [application/pdf]
Saving to: ‘OUTPUT/Documents/quick-guide-gplv3.pdf’

quick-guide-gplv3.pdf        100%[==============================================>] 102.45K   520KB/s    in 0.2s    

2019-02-12 02:23:33 (520 KB/s) - ‘OUTPUT/Documents/quick-guide-gplv3.pdf’ saved [104908/104908]

./fetch-demo.sh: 16: ./fetch-demo.sh: pushd: not found

如果有人能帮助找出为什么它在最后一行卡住,我将不胜感激。

(如果有帮助的话,我正在运行 Linux Mint 18 Xfce。)

答案1

(注:这最初是由 OP 作为对问题的编辑发布的)。

我给 Plasma Mobile 发了一封电子邮件,得到了答复:

问题在于脚本/bin/sh使用的fetch-demo.sh链接指向/bin/dashDebian 和 Linux Mint 等衍生版本。由于 dash 不支持 pushd 支持,因此脚本崩溃。

要修复此问题,fetch-demo.sh脚本应在 Bash 中运行。我刚刚提交了一个补丁来默认修复此问题:https://github.com/plasma-phone-packaging/pm-flashtool/pull/36

如果您不想等到它被接受,请编辑第一行fetch-demo.sh#!/bin/sh#!/bin/bash

相关内容