makeiso.sh

来自「系统启动时检测内存状况的软件C代码」· Shell 代码 · 共 40 行

SH
40
字号
#!/bin/sh# check to see if the correct tools are installedfor X in wc mkisofsdo	if [ "$(which $X)" = "" ]; then		echo "makeiso.sh error: $X is not in your path." >&2		exit 1	elif [ ! -x $(which $X) ]; then		echo "makeiso.sh error: $X is not executable." >&2		exit 1	fi done#check to see if memtest.bin is presentif [ ! -w memtest.bin ]; then 	echo "makeiso.sh error: cannot find memtest.bin, did you compile it?" >&2 	exit 1fi# enlarge the size of memtest.binSIZE=$(wc -c memtest.bin | awk '{print $1}')FILL=$((1474560 - $SIZE))dd if=/dev/zero of=fill.tmp bs=$FILL count=1cat memtest.bin fill.tmp >memtest.imgrm -f fill.tmpecho "generating iso image ..."mkdir "cd"mkdir "cd/boot"mv memtest.img cd/bootcd cdmkisofs -b boot/memtest.img -c boot/boot.catalog -o memtest.iso .mv memtest.iso ..cd ..rm -rf cdecho "done"

⌨️ 快捷键说明

复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?