{ "version": "https://jsonfeed.org/version/1.1", "user_comment": "This feed allows you to read the posts from this site in any feed reader that supports the JSON Feed format. To add this feed to your reader, copy the following URL -- https://matoken.org/blog/tag/zip/feed/json/ -- and add it your reader.", "home_page_url": "https://matoken.org/blog/tag/zip/", "feed_url": "https://matoken.org/blog/tag/zip/feed/json/", "language": "ja", "title": "zip – matoken's blog", "description": "Is there no plan B?", "icon": "https://matoken.org/blog/wp-content/uploads/2025/03/cropped-1865f695c4eecc844385acef2f078255036adccd42c254580ea3844543ab56d9.jpeg", "items": [ { "id": "http://matoken.org/blog/?p=2840", "url": "https://matoken.org/blog/2020/07/24/hello-world-in-sipeed-lichee-nano/", "title": "Sipeed Lichee Nano\u3067hello world", "content_html": "
2020-07-23\u4f4e\u30ec\u30d9\u30eb\u52c9\u5f37\u4f1a\u306b\u53c2\u52a0\u3057\u307e\u3057\u305f\uff0eZoom.us\u3067\u306e\u958b\u50ac\u3067\u3057\u305f\uff0e
\n\u5185\u5bb9\u306fLinux\u540d\u523a\u7684\u306a\u3082\u306e\u3092\u958b\u767a\u3057\u3088\u3046\u3068\u3044\u3046\u5185\u5bb9\u3067\uff0c\u30ea\u30d5\u30a1\u30ec\u30f3\u30b9\u3068\u3057\u3066SD\u30ab\u30fc\u30c9\u30b5\u30a4\u30ba\u306e\u5c0f\u3055\u306aLinux\u306e\u52d5\u4f5c\u3059\u308barm\u30b3\u30f3\u30d4\u30e5\u30fc\u30bf\u306eSipeed Lichee Nano\u3092\u4f7f\u3044\u307e\u3057\u305f\uff0e
\n\u6b32\u3057\u3044\u5834\u5408\u306f1000\u5186\u3061\u3087\u3044\u304f\u3089\u3044\u304b\u3089\u3067\u5165\u624b\u3067\u304d\u305d\u3046\u3067\u3059\uff0e
\nLichee Nano\u3092\u6301\u3063\u3066\u3044\u306a\u3044\u4eba\u306f\u30ea\u30e2\u30fc\u30c8\u3067\u89e6\u308c\u308b\u3088\u3046\u306b\u3057\u3066\u3042\u3063\u305f\u306e\u3067\u6301\u3063\u3066\u3044\u306a\u3044\u79c1\u3082\u697d\u3057\u3081\u307e\u3057\u305f\uff0e
\n\u3053\u306e\u30ea\u30e2\u30fc\u30c8\u958b\u767a\u306e\u4ed5\u7d44\u307f\u306fLichee Nano\u3068Raspberry Pi\u3092USB\u7d4c\u7531\u306eUART\u3067\u63a5\u7d9a\u3057\uff0cRaspberry Pi\u3067GNU screen\u3092\u8d77\u52d5\uff0cssh\u7d4c\u7531\u3067GNU screen\u306b\u7e4b\u3044\u3067\u64cd\u4f5c\u3068\u3044\u3046\u611f\u3058\u3067\u3059\uff0e
\nGNU screen\u3092Gotty\u7b49\u306b\u3059\u308b\u3068\u30a6\u30a7\u30d6\u30d6\u30e9\u30a6\u30b6\u3067\u53c2\u52a0\u3067\u304d\u3066\u3061\u3087\u3063\u3068\u4fbf\u5229\u304b\u3082\u3068\u601d\u3063\u305f\u308a\u3082\uff0e(GoTTY\u306f\u958b\u767a\u6b62\u307e\u3063\u3066\u308b\u3088\u3046\u306b\u898b\u3048\u308b\u304b\u3089\u5225\u306e\u3082\u306e\u306e\u307b\u3046\u304c\u3044\u3044\u304b\u3082\u3057\u308c\u306a\u3044)
Lichee Nano\u3067\u4f55\u304b\u3092\u52d5\u304b\u3057\u305f\u3044\uff0earm\u3060\u3051\u3069armhf\u52d5\u304f\u306e\u304b\u306a?\u3068\u308a\u3042\u3048\u305a\u306a\u306b\u304b\u8ee2\u9001\u3057\u3066\u52d5\u304b\u3057\u3066\u307f\u3088\u3046\u3068\uff0e
\n\u3068\u308a\u3042\u3048\u305aDebian\u306earmhf\u30d0\u30a4\u30ca\u30ea\u3092uuencode\u3057\u3066\u30b3\u30d4\u30da\u3067\u8ee2\u9001\u3057\u3066\u307f\u307e\u3059.\u3053\u308c\u304c\u52d5\u3051\u3070Debian\u306e\u30d1\u30c3\u30b1\u30fc\u30b8\u7fa4\u304c\u5229\u7528\u3067\u304d\u308b\u304b\u3082\u3060\u3051\u3069\u2026\u2026\uff0e
\n\u307e\u305a\u306f\u7c21\u5358\u305d\u3046\u306afortune\u3092\u8a66\u3057\u307e\u3059.
\n$ apt download -t armhf fortune-mod\n$ unar fortune-mod_1.99.1-7+b1_armhf.deb\n$ cd fortune-mod_1.99.1-7+b1_armhf\n$ tar xf data.tar.xz\n$ cd usr/games\nLichee Nano\u306fserial\u3067\u63a5\u7d9a\u3055\u308c\u3066\u3044\u3066\uff0cInternet\u306b\u306f\u7e4b\u304c\u3063\u3066\u3044\u306a\u3044\u306e\u3067\u30d0\u30a4\u30ca\u30ea\u30d5\u30a1\u30a4\u30eb\u306e\u8ee2\u9001\u306b\u306fuudecode/uuencode\u3092\u4f7f\u3044\u307e\u3057\u305f\uff0e\u4e45\u3005\u3067\u3059\uff0e
\n\u624b\u5143\u306eGNU sharutils 4.15.2\u306euudecode\u306b\u306fbase64\u3092\u4f7f\u3046 -m, --base64 \u304c\u3042\u308b\u306e\u3067\u826f\u3055\u305d\u3046\uff0e\u3068\u601d\u3063\u305f\u3051\u3069Lichee Nano\u306e\u65b9\u306fbusybox\u306e\u3082\u306e\u3067\u975e\u5bfe\u5fdc\u3067\u3057\u305f\uff0e
$ gzip -c fortune | uuencode fortune.gz > fortune.gz.uu\n$ cat fortune.gz.uu | xclip\n# cat | uudecode #\u3053\u3053\u3067\u30af\u30ea\u30c3\u30d7\u30dc\u30fc\u30c9\u304b\u3089\u8cbc\u308a\u4ed8\u3051\n# zcat fortune.gz > fortune\n# rm fortune.gz\n\u305d\u3057\u3066\u2026\u200b\u2026\u200b
\n# ./fortune\n-sh: ./fortune: not found\n# ldd ./fortune\nchecking sub-depends for 'not found'\nchecking sub-depends for '/lib/libc.so.6'\n/lib/ld-linux.so.3 (0xb6fa0000)\nlibrecode.so.0 => not found (0x00000000)\nlibc.so.6 => /lib/libc.so.6 (0x00000000)\n/lib/ld-linux.so.3 => /lib/ld-linux.so.3 (0x00000000)\n\u3053\u308c\u3092\u52d5\u304b\u3059\u306e\u306f\u30c0\u30a4\u30ca\u30df\u30c3\u30af\u30ea\u30f3\u30af\u3055\u308c\u3066\u3044\u308b\u3082\u306e\u3092\u7528\u610f\u3057\u3066\u3042\u3052\u306a\u3044\u3068\u3044\u3051\u306a\u3044\u306e\u3067\u30b9\u30c8\u30ec\u30fc\u30b8\u306e\u5bb9\u91cf\u7684\u306b\u96e3\u3057\u3044\u3067\u3059\u306d\uff0e
\n\u3053\u3053\u3067\u306fgzip\u3067\u5727\u7e2e\u3057\u307e\u3057\u305f\u304c\uff0cLichee Nano\u306ebusybox\u306bxz\u304c\u3042\u308a\u307e\u3057\u305f\uff0egzip\u3088\u308axz\u306b\u3057\u305f\u307b\u3046\u304c\u5c0f\u3055\u304f\u306a\u308a\u307e\u3059\u306d\uff0e\u8a66\u3057\u3066\u307f\u308b\u3068\u3053\u3093\u306a\u611f\u3058\u3067\u3057\u305f\uff0e$ xz -c fortune | uuencode fortune.xz > fortune.xz.uu
-rw-r--r-- 1 matoken matoken 22368 Jul 23 15:11 fortune #\u5143\u30d5\u30a1\u30a4\u30eb\n-rw-r--r-- 1 matoken matoken 30844 Jul 23 14:58 fortune.uu #uudecode\n-rw-r--r-- 1 matoken matoken 14975 Jul 23 15:08 fortune.gz.uu #zip + uudecode\n-rw-r--r-- 1 matoken matoken 13047 Jul 23 15:47 fortune.xz.uu #xz + uudecode\n\u305d\u3046\u3044\u3048\u3070\u3042\u307e\u308a\u6709\u540d\u3067\u306f\u306a\u3044\u3067\u3059\u304cbasE91\u306a\u3093\u3066\u3082\u306e\u3082\u3042\u308a\u307e\u3059\uff0ebase64\u3088\u308a\u30b5\u30a4\u30ba\u304c\u5c0f\u3055\u304f\u306a\u308a\u307e\u3059\u304c\u5c0e\u5165\u304b\u3089\u3084\u3089\u306a\u3044\u3068\u3044\u3051\u306a\u3044\u306e\u3067\u3061\u3087\u3063\u3068\u9762\u5012\uff0e
\nHello world\u3092\u8a66\u3057\u3066\u307f\u307e\u3059\uff0e\u9069\u5f53\u306b\u30d7\u30ed\u30b0\u30e9\u30e0\u3092\u7528\u610f\u3057\u3066\u30b9\u30bf\u30c6\u30a3\u30c3\u30af\u30ea\u30f3\u30af\u3067\u30b3\u30f3\u30d1\u30a4\u30eb\u3057\u3066\u307f\u307e\u3059\uff0e
\n$ cat hello.c\n#include <stdio.h>\nint\nmain(void)\n{\n printf(\"Hello, world!\\n\");\n return 0;\n}\n$ gcc -static ./hello.c\n$ ./a.out\nHello, world!\n$ ls -l a.out\n-rwxr-xr-x 1 pi pi 571120 7\u6708 23 16:18 a.out\n\u3067\u304b\u3044\u2026\u200b\u2026\u200b
\n\u3068\u308a\u3042\u3048\u305a\u3067\u304b\u3044\u306e\u306f\u304a\u3044\u3068\u3044\u3066\u3053\u308c\u3060\u3068arm64\u306a\u306e\u3067\u52d5\u304f\u306f\u305a\u304c\u306a\u3044\uff0e\u3068\u3044\u3046\u3053\u3068\u3067\u30af\u30ed\u30b9\u30b3\u30f3\u30d1\u30a4\u30eb\u74b0\u5883\u3092\u7528\u610f\u3057\u307e\u3059\uff0e
\n\u4eca\u56de\u8a66\u3057\u305f\u30db\u30b9\u30c8\u306fDebian sid amd64/Ubuntu 20.04 LTS arm64/Raspberry Pi OS arm64\u3067\u3059\uff0e\u3044\u305a\u308c\u3082\u540c\u3058\u624b\u9806\u3067OK\u3067\u3057\u305f\uff0e
\ncrossbuild-essential-<arch> \u30d1\u30c3\u30b1\u30fc\u30b8\u3067\u5404\u7a2e\u30a2\u30fc\u30ad\u30c6\u30af\u30c1\u30e3\u306e\u74b0\u5883\u304c\u5c0e\u5165\u3067\u304d\u308b\u3088\u3046\u3067\u3059\uff0e
$ apt-cache search crossbuild-essential-\ncrossbuild-essential-amd64 - Informational list of cross-build-essential packages\ncrossbuild-essential-arm64 - Informational list of cross-build-essential packages\ncrossbuild-essential-armel - Informational list of cross-build-essential packages\ncrossbuild-essential-armhf - Informational list of cross-build-essential packages\ncrossbuild-essential-i386 - Informational list of cross-build-essential packages\ncrossbuild-essential-powerpc - Informational list of cross-build-essential packages\ncrossbuild-essential-ppc64el - Informational list of cross-build-essential packages\ncrossbuild-essential-s390x - Informational list of cross-build-essential packages\ncrossbuild-essential-mips - Informational list of cross-build-essential packages\ncrossbuild-essential-mips64 - Informational list of cross-build-essential packages\ncrossbuild-essential-mips64el - Informational list of cross-build-essential packages\ncrossbuild-essential-mips64r6 - Informational list of cross-build-essential packages\ncrossbuild-essential-mips64r6el - Informational list of cross-build-essential packages\ncrossbuild-essential-mipsel - Informational list of cross-build-essential packages\ncrossbuild-essential-mipsr6 - Informational list of cross-build-essential packages\ncrossbuild-essential-mipsr6el - Informational list of cross-build-essential packages\n\u6ca2\u5c71\u3042\u308a\u307e\u3059\uff0e\u4eca\u56de\u306farmlf/armhf\u306e crossbuild-essential-armel, crossbuild-essential-armhf \u3092\u5c0e\u5165\u3057\u307e\u3057\u305f\uff0e
$ sudo apt install crossbuild-essential-armel crossbuild-essential-armhf\ngcc\u3060\u3051\u3067\u3044\u3044\u5834\u5408\u306farmlf\u306f gcc-arm-linux-gnueabi\uff0carmhf\u306f gcc-arm-linux-gnueabihf \u3060\u3051\u3067OK\u3067\u3059\uff0e
\u307e\u305a\u306f arm-linux-gnueabihf-gcc \u3092\u4f7f\u3063\u3066armhf\u306e\u30d0\u30a4\u30ca\u30ea\u3092\u4f5c\u308a\u307e\u3059\uff0e
$ /usr/bin/arm-linux-gnueabihf-gcc -static ./hello.c\n$ strip a.out\n$ xz -c a.out | uuencode a.out.xz > a.out.xz.uu\narmhf\u306f\u99c4\u76ee\u305d\u3046\u3067\u3059\uff0e
\n# cat | uudecode\n^d\n# xzcat ./a.out.xz > ./a.out\n# chmod +x ./a.out\n# ./a.out\nSegmentation fault\n\u6b21\u306f gcc-arm-linux-gnueabi \u3067armlf\u306e\u30d0\u30a4\u30ca\u30ea\u3092\u4f5c\u3063\u3066\u8a66\u3059\u3068\u52d5\u304d\u307e\u3057\u305f\uff0e
$ /usr/bin/arm-linux-gnueabi-gcc -static ./hello.c\n$ strip a.out\n$ xz -c a.out | uuencode a.out.xz > a.out.xz.uu\n# cat | uudecode\n^d\n# xzcat ./a.out.xz > ./a.out\n# chmod +x ./a.out\n# ./a.out\nHello, world!\n# /usr/bin/time -f \"%M KB\" ./a.out\nHello, world!\n2144 KB\n\u3053\u306e\u8fba\u308a\u3067\u4eca\u56de\u306f\u6642\u9593\u5207\u308c\uff0e\u6b21\u56de\u306e\u540c\u3058\u3088\u3046\u306a\u611f\u3058\u306b\u306a\u308a\u305d\u3046\u3067\u3059\uff0e\u8208\u5473\u306e\u3042\u308b\u65b9\u306f\u4ee5\u4e0b\u306e\u30da\u30fc\u30b8\u304b\u3089\uff0e
\n\u3068\u308a\u3042\u3048\u305aarmel\u306e\u30d0\u30a4\u30ca\u30ea\u304c\u52d5\u304f\u3088\u3046\u306a\u306e\u304c\u308f\u304b\u3063\u305f\u306e\u3067\u9762\u767d\u305d\u3046\u306a\u5c0f\u3055\u306a\u30d7\u30ed\u30b0\u30e9\u30e0\u3092\u8a66\u305d\u3046\u304b\u306a\u3068\u601d\u3063\u3066\u3044\u307e\u3059\uff0ecowsay\u3068\u304b\u597d\u304d\u306a\u3093\u3060\u3051\u3069\u3053\u308c\u306fPerl\u306a\u306e\u3067\u5bb9\u91cf\u7684\u306b\u96e3\u3057\u305d\u3046\uff0e\u3068\u308a\u3042\u3048\u305afortune\u3042\u305f\u308a\u304b\u306a?
\n\u4ee5\u524dPQI Air Pen\u3067\u3084\u3063\u305f\u3088\u3046\u306bSD card\u3092\u7528\u610f\u3057\u3066\u305d\u3053\u306bDebian armlf\u74b0\u5883\u3092\u5c55\u958b\u3057\u3066chroot\u3068\u304b\u3082\u3067\u304d\u305d\u3046\u3067\u3059\uff0e
\nFlickr\u304b\u3089\u30c0\u30a6\u30f3\u30ed\u30fc\u30c9\u3057\u305f\u30a2\u30fc\u30ab\u30a4\u30d6\u304c\u30c0\u30a6\u30f3\u30ed\u30fc\u30c9\u306b\u5931\u6557\u3057\u305f\u306e\u304b\u5185\u5bb9\u304c\u898b\u3089\u308c\u306a\u3044\u3067\u3059\uff0e
\n\u30a2\u30fc\u30ab\u30a4\u30d6\u304c\u58ca\u308c\u3066\u3044\u308b\u5834\u5408 -F \u3067\u3069\u3046\u306b\u304b\u306a\u308a\u305d\u3046?
$ zip -l data-download-1.zip\r\n\t\tzip warning: missing end signature--probably not a zip file (did you\r\n\t\tzip warning: remember to use binary mode when you transferred it?)\r\n\t\tzip warning: (if you are trying to read a damaged archive try -F)\r\n\r\nzip error: Zip file structure invalid (data-download-1.zip)\n
-F \u3067\u306f\u99c4\u76ee\u3067 -FF \u3092\u8a66\u3057\u3066\u307f\u308b
\n$ zip -F data-download-1.zip --out data-download-1_fix.zip\r\nFix archive (-F) - assume mostly intact archive\r\n\t\tzip warning: bad archive - missing end signature\r\n\t\tzip warning: (If downloaded, was binary mode used? If not, the\r\n\t\tzip warning: archive may be scrambled and not recoverable)\r\n\t\tzip warning: Can't use -F to fix (try -FF)\r\n\r\nzip error: Zip file structure invalid (data-download-1.zip)\n
-FF \u3067\u3042\u308b\u7a0b\u5ea6\u6551\u3048\u308b\u611f\u3058
\n$ zip -FF data-download-1.zip --out data-download-1_fix.zip\r\nFix archive (-FF) - salvage what can\r\n\t\tzip warning: Missing end (EOCDR) signature - either this archive\r\n\t\t\t\t\t is not readable or the end is damaged\r\nIs this a single-disk archive? (y/n): y\r\n Assuming single-disk archive\r\nScanning for entries...\r\n copying: img_20140426_180357_13952989767_o.jpg (1935629 bytes)\r\n copying: img_20140723_180327_14575993850_o.jpg (2639807 bytes)\r\n copying: img_20140723_180323_14576035839_o.jpg (3302817 bytes)\r\n copying: img_20140723_180400_14576043890_o.jpg (3611376 bytes)\r\n :\r\n copying: imgp1491_15854514735_o.jpg\r\n\t\tzip warning: no end of stream entry found: imgp1491_15854514735_o.jpg\r\n\t\tzip warning: rewinding and scanning for later entries\n
\u3053\u3046\u3044\u3046\u8010\u969c\u5bb3\u6027\u306f\u975e\u5727\u7e2etar\u3084afio\u3068\u304b\u306e\u307b\u3046\u304c\u5f37\u3044\u3067\u3057\u3087\u3046\u304cWindows\u306a\u3093\u304b\u3067\u306f\u591a\u5206\u6a19\u6e96\u3067\u6271\u3048\u306a\u3044\u3057\u30c0\u30a6\u30f3\u30ed\u30fc\u30c9\u306b\u5931\u6557\u3057\u305f\u5834\u5408\u306f\u518d\u5ea6\u8a66\u307f\u308b\u3053\u3068\u304c\u51fa\u6765\u308b\u306e\u3067\u3084\u3063\u3071zip\u3067\u3044\u3044\u306e\u304b\u306a\uff0e
\n\u3061\u306a\u307f\u306b\u4eca\u56de\u306fFlickr\u304b\u3089\u540c\u3058\u30d5\u30a1\u30a4\u30eb\u30923\u56de\u30c0\u30a6\u30f3\u30ed\u30fc\u30c9\u3057\u3066\u3082\u5168\u90e8\u540c\u3058\u5185\u5bb9\u3067\u58ca\u308c\u3066\u3044\u305f\u306e\u3067\u6050\u3089\u304fFlickr\u5074\u3067\u58ca\u308c\u3066\u3044\u308b\u306a\u3066\u3053\u3068\u3067\u30c7\u30fc\u30bf\u3092\u518d\u30ea\u30af\u30a8\u30b9\u30c8\u3057\u307e\u3057\u305f\u2026\u2026\uff0e
\n$ dpkg-query -W zip tar afio\r\nafio 2.5.1.20160103+gitc8e4317-1\r\ntar 1.30+dfsg-2\r\nzip 3.0-11+b1\r\n$ lsb_release -d\r\nDescription: Debian GNU/Linux unstable (sid)\r\n$ uname -m\r\nx86_64\n