ultraji/linux-0.12

在容器中对未修改的代码进行编译,报错

Opened this issue · 4 comments

没有对源代码进行修改,运行oslab下的run.sh -m,产生如下报错,求助

ubuntu@1f7cda8a507c:~/linux-0.12/oslab$ ./run.sh -m
rm -f Image System.map tmp_make core boot/bootsect boot/setup \
	boot/bootsect.s boot/setup.s
rm -f init/*.o tools/system tools/build boot/*.o
(cd mm;make clean)
make[1]: Entering directory '/home/ubuntu/linux-0.12/linux-0.12/mm'
rm -f core *.o *.a tmp_make
for i in *.c;do rm -f `basename $i .c`.s;done
make[1]: Leaving directory '/home/ubuntu/linux-0.12/linux-0.12/mm'
(cd fs;make clean)
make[1]: Entering directory '/home/ubuntu/linux-0.12/linux-0.12/fs'
rm -f core *.o *.a tmp_make
for i in *.c;do rm -f `basename $i .c`.s;done
make[1]: Leaving directory '/home/ubuntu/linux-0.12/linux-0.12/fs'
(cd kernel;make clean)
make[1]: Entering directory '/home/ubuntu/linux-0.12/linux-0.12/kernel'
rm -f core *.o *.a tmp_make keyboard.s
for i in *.c;do rm -f `basename $i .c`.s;done
(cd chr_drv; make clean)
make[2]: Entering directory '/home/ubuntu/linux-0.12/linux-0.12/kernel/chr_drv'
rm -f core *.o *.a tmp_make keyboard.s
for i in *.c;do rm -f `basename $i .c`.s;done
make[2]: Leaving directory '/home/ubuntu/linux-0.12/linux-0.12/kernel/chr_drv'
(cd blk_drv; make clean)
make[2]: Entering directory '/home/ubuntu/linux-0.12/linux-0.12/kernel/blk_drv'
rm -f core *.o *.a tmp_make
for i in *.c;do rm -f `basename $i .c`.s;done
make[2]: Leaving directory '/home/ubuntu/linux-0.12/linux-0.12/kernel/blk_drv'
(cd math; make clean)
make[2]: Entering directory '/home/ubuntu/linux-0.12/linux-0.12/kernel/math'
rm -f core *.o *.a tmp_make
for i in *.c;do rm -f `basename $i .c`.s;done
make[2]: Leaving directory '/home/ubuntu/linux-0.12/linux-0.12/kernel/math'
make[1]: Leaving directory '/home/ubuntu/linux-0.12/linux-0.12/kernel'
(cd lib;make clean)
make[1]: Entering directory '/home/ubuntu/linux-0.12/linux-0.12/lib'
rm -f core *.o *.a tmp_make
for i in *.c;do rm -f `basename $i .c`.s;done
make[1]: Leaving directory '/home/ubuntu/linux-0.12/linux-0.12/lib'
make: *** No rule to make target 'boot/bootsect.S', needed by 'boot/bootsect.s'.  Stop.
cp: cannot stat 'Image': No such file or directory

看到了已经关闭的issue,在容器里重新clone了一份就没问题了。
但是想在宿主机修改代码再到容器里编译,还是使用挂载方便,有没有什么修改的方法能让挂载没有问题呢?感谢

宿主机文件系统不支持大小写,导致make: *** No rule to make target 'boot/bootsect.S', needed by 'boot/bootsect.s'. Stop.;改变中间产物的名字应该可以规避。

修改一下Makefile文件规则,在大小写不区分的宿主机是有问题的,如mac,我这边把S文件修改成了ss就好了。

#4 实测可用, 容器里重新 clone 一份即可