tmoe icon indicating copy to clipboard operation
tmoe copied to clipboard

一个奇怪的关于存储空间检测的错误

Open Hope2333 opened this issue 3 years ago • 9 comments

Are you rooted?

Yes

Desktop environment

👣 gnome

Container type

unshare

Configuration

host value
os PostmarketOS(Alpine)
arch arm64
kernel 6.0.2
freespace 9.9G
terminal openssh
tmoe lasted/None

container value

Describe the bug

是这样的 当我试图在ARM64实体机红米2上安装tmoe失败,但是我怎么都找不到原因:提示空间不足,但tmp和/下空间充足,亿点点的懵 (因为懒得做archlinuxarm的系统适配和移植所以干脆用了现成的postmarketos) 消息在下面()

Screenshots

。。

How to reproduce

。。

Expected behavior

。。

Error Logs

xiaomi-wt88047:~$ sudo bash -c "$(curl -L gitee.com/mo2/linux/raw/2/2)" % Total % Received % Xferd Average Speed Time Time Time Current Dload Upload Total Spent Left Speed 100 138 100 138 0 0 349 0 --:--:-- --:--:-- --:--:-- 349 100 8857 100 8857 0 0 7168 0 0:00:01 0:00:01 --:--:-- 2162k https://gitee.com/mo2/linux/raw/2/2.awk Connecting to gitee.com (212.64.63.215:443) saving to '/tmp/tmp.AkmGdB' tmp.AkmGdB 100% |********************************| 82599 0:00:00 ETA '/tmp/tmp.AkmGdB' saved stat: unrecognized option: format=%s BusyBox v1.35.0 (2022-08-01 15:14:44 UTC) multi-call binary.

Usage: stat [-ltf] [-c FMT] FILE...

Display file (default) or filesystem status

    -c FMT  Use the specified format
    -f      Display filesystem status
    -L      Follow links
    -t      Terse display

FMT sequences for files: %a Access rights in octal %A Access rights in human readable form %b Number of blocks allocated (see %B) %B Size in bytes of each block reported by %b %d Device number in decimal %D Device number in hex %f Raw mode in hex %F File type %g Group ID %G Group name %h Number of hard links %i Inode number %n File name %N File name, with -> TARGET if symlink %o I/O block size %s Total size in bytes %t Major device type in hex %T Minor device type in hex %u User ID %U User name %x Time of last access %X Time of last access as seconds since Epoch %y Time of last modification %Y Time of last modification as seconds since Epoch %z Time of last change %Z Time of last change as seconds since Epoch

FMT sequences for file systems: %a Free blocks available to non-superuser %b Total data blocks %c Total file nodes %d Free file nodes %f Free blocks %i File System ID in hex %l Maximum length of filenames %n File name %s Block size (for faster transfer) %S Fundamental block size (for block counts) %t Type in hex %T Type in human readable form file-size: Unfortunately, the file is less than or equal to 4 KiB. This means that the download may have failed. Trying again... https://gi.tmoe.me/m/tmoe/raw/branch/2/2.awk /tmp/tmp.AkmGdB % Total % Received % Xferd Average Speed Time Time Time Current Dload Upload Total Spent Left Speed 100 21719 0 21719 0 0 14252 0 --:--:-- 0:00:01 --:--:-- 14251 stat: unrecognized option: format=%s BusyBox v1.35.0 (2022-08-01 15:14:44 UTC) multi-call binary.

Usage: stat [-ltf] [-c FMT] FILE...

Display file (default) or filesystem status

    -c FMT  Use the specified format
    -f      Display filesystem status
    -L      Follow links
    -t      Terse display

FMT sequences for files: %a Access rights in octal %A Access rights in human readable form %b Number of blocks allocated (see %B) %B Size in bytes of each block reported by %b %d Device number in decimal %D Device number in hex %f Raw mode in hex %F File type %g Group ID %G Group name %h Number of hard links %i Inode number %n File name %N File name, with -> TARGET if symlink %o I/O block size %s Total size in bytes %t Major device type in hex %T Minor device type in hex %u User ID %U User name %x Time of last access %X Time of last access as seconds since Epoch %y Time of last modification %Y Time of last modification as seconds since Epoch %z Time of last change %Z Time of last change as seconds since Epoch

FMT sequences for file systems: %a Free blocks available to non-superuser %b Total data blocks %c Total file nodes %d Free file nodes %f Free blocks %i File System ID in hex %l Maximum length of filenames %n File name %s Block size (for faster transfer) %S Fundamental block size (for block counts) %t Type in hex %T Type in human readable form new-size: Error! The file size is much smaller than the source file. Name: check_file_size() Description: The download may have failed, this file may be broken. You are unable to continue with the operation. If this is not related to the file system's compression mechanism, you are welcome to report the bug. xiaomi-wt88047:~$

Additional context

检查的磁盘空间输出如下 xiaomi-wt88047:~$ df -h Filesystem Size Used Available Use% Mounted on /dev/mapper/mmcblk0p30p2 12.5G 1.9G 9.9G 16% / /dev/dm-0 225.7M 33.5M 180.1M 16% /boot tmpfs 378.3M 1.6M 376.6M 0% /run dev 10.0M 0 10.0M 0% /dev shm 945.7M 980.0K 944.7M 0% /dev/shm none 945.7M 0 945.7M 0% /lib/firmware/msm-firmware-loader /dev/mmcblk0p1 63.9M 45.3M 18.6M 71% /lib/firmware/msm-firmware-loader/mnt/modem tmpfs 4.0M 0 4.0M 0% /sys/fs/cgroup /dev/mmcblk1p1 59.5G 39.2G 20.3G 66% /run/media/user/FA08-3F37 tmpfs 189.1M 20.0K 189.1M 0% /run/user/10000 xiaomi-wt88047:~$

Hope2333 avatar Nov 12 '22 20:11 Hope2333

这个判断的是下载的 awk 文件的大小。 如果下载后的文件 <= 4KiB, 说明下载存在明显的问题。

出错的原因是语法错误。 现在已经修复了,它已经能兼容 busybox 的 stat 的语法了。

实际上,你可以直接下载那个 awk 脚本,不用通过这个 sh 脚本来下载。

2moe avatar Nov 12 '22 22:11 2moe

最后建议把postmarketOS识别为Apine,这样可以使用脚本全部功能

Hope2333 avatar Nov 27 '22 08:11 Hope2333

@2moe 还有这个。。。。

Hope2333 avatar Dec 04 '22 14:12 Hope2333

可以发一下 cat /etc/os-release 输出的内容吗? 还有 cat /etc/apk/arch /etc/apk/repositories

2moe avatar Dec 04 '22 14:12 2moe

xiaomi-wt88047:~$ cat /etc/os-release 
PRETTY_NAME="postmarketOS v22.06.3"
NAME="postmarketOS"
VERSION_ID="v22.06.3"
VERSION="v22.06.3"
ID="postmarketos"
ID_LIKE="alpine"
HOME_URL="https://www.postmarketos.org/"
SUPPORT_URL="https://gitlab.com/postmarketOS"
BUG_REPORT_URL="https://gitlab.com/postmarketOS/pmaports/issues"
LOGO="postmarketos-logo"
xiaomi-wt88047:~$ cat /etc/apk/arch
aarch64
xiaomi-wt88047:~$ cat /etc/apk/repositories 
http://mirror.postmarketos.org/postmarketos/v22.06
http://dl-cdn.alpinelinux.org/alpine/v3.16/main
http://dl-cdn.alpinelinux.org/alpine/v3.16/community
xiaomi-wt88047:~$ 

Hope2333 avatar Dec 11 '22 06:12 Hope2333

ok的话这个issue也可以关了

Hope2333 avatar Dec 11 '22 13:12 Hope2333

先留着吧!还没解决呢!

2moe avatar Dec 11 '22 14:12 2moe

想起了一句玩笑话,“你是想把 bug 留着过年吗?”。 ~~呜, 照目前看,还真的有可能。~~

对它的支持可能要等到下一个 edition 了。 之后会对 alpine 引入更好的支持,同时兼容(支持)这个发行版。

2moe avatar Dec 11 '22 14:12 2moe

ok

Hope2333 avatar Dec 12 '22 02:12 Hope2333