前言
最近需要进行路由器固件分析,然后嘞,为了解开非标准的SquashFS文件系统所以需要安装sasquatch,但是这个需要自己编译的,所以开心的git下来,运行build.sh,问题就出现了:
很明显的失败了,代码中的if出现了问题,报错提示在第1835行出现了错误。该错误是因为’if’条件语句缺少必要的左右花括号’{‘和’}',导致后面的’ERROR’语句无法被包含在条件语句块中执行。
这篇文章只是记录一下解决方案,方便自己之后再遇到解决
解决方案
在官方github上,是有一个请求涉及到了相关的问题的:
https://github.com/devttys0/sasquatch/issues/48
在其中的一个pull中:
https://github.com/devttys0/sasquatch/issues/48#issuecomment-1267506233
给出了解决方案,是采用了:
https://github.com/devttys0/sasquatch/pull/47
这个pull中的一个patch文件来进行补丁。
所以解决流程为:
git clone https://github.com/devttys0/sasquatch.git
cd sasquatch
wget https://github.com/devttys0/sasquatch/pull/47.patch
patch -p1 < 47.patch
sudo ./build.sh
参考文档
https://github.com/devttys0/sasquatch/issues/48
https://github.com/devttys0/sasquatch/pull/47
https://github.com/devttys0/sasquatch/issues/48#issuecomment-1267506233