hongmingjian / epos

《操作系统原理》实验操作系统
61 stars 20 forks source link

编译时遇到问题make: *** [Makefile:21: hd.img] Error 2 #3

Closed hyuuko1 closed 4 years ago

hyuuko1 commented 4 years ago

编译时遇到问题

git clone https://github.com/hongmingjian/epos.git
cd epos
make run

报错:

---省略---
make[1]: Leaving directory '/mnt/d/CourseFiles/大二下/操作系统/epos/userapp'
if [ ! -s hd.img ]; then base64 -d hd.img.bz2.txt | bunzip2 >hd.img ; fi
base64: invalid input

bunzip2: Compressed file ends unexpectedly;
        perhaps it is corrupted?  *Possible* reason follows.
bunzip2: Inappropriate ioctl for device
        Input file = (stdin), output file = (stdout)

It is possible that the compressed file(s) have become corrupted.
You can use the -tvv option to test integrity of such files.

You can use the `bzip2recover' program to attempt to recover
data from undamaged sections of corrupted files.

make: *** [Makefile:21: hd.img] Error 2
root@DESKTOP-DAH1J73:/mnt/d/CourseFiles/大二下/操作系统/epos#

base64版本:base64 (GNU coreutils) 8.30 在 WSL Debian 和 MSYS2 上都试了一下,😭

hongmingjian commented 4 years ago

base64对回车(\r)和换行(\n)比较敏感。不要在Linux(Windows)里面clone,然后在Windows(Linux)中编译。删除文件hd.img.bz2.txt,然后重新pull一下,应该可以解决这个问题。如果还是不行,在“base64 -d hd.img.bz2.txt”中的“-d”后面加一个“i”,即“-di”。

hyuuko1 commented 4 years ago

解决了,是\r\n的问题,谢谢老师😀