我制作了一张带有自定义Linux和"grub2"的Live CD。
我从源代码编译"grub2":
HOST=x86_64-linux-gnu
TARGET=x86_64-unknown-linux-uclibc
CPPFLAGS="-I${INST_CROSS_TOOLS}/usr/include" LDFLAGS="-L${PREFIX_PATH}/usr/lib"
./configure
--prefix="${PREFIX_PATH}"
--host="${HOST}"
--target="${TARGET}"
make
make install
因此,在每个脚本中,某些二进制文件都存在"前缀"变量。这使得"grub2"不起作用。
$ grep -n abradox rootfs/sbin/*
rootfs/sbin/x86_64-unknown-linux-uclibc-grub-install:22:prefix="/home/abradox/data/work/x86_64_installer/x86_64_installer/rootfs"
rootfs/sbin/x86_64-unknown-linux-uclibc-grub-mkconfig:21:prefix="/home/abradox/data/work/x86_64_installer/x86_64_installer/rootfs"
rootfs/sbin/x86_64-unknown-linux-uclibc-grub-mkconfig:25:prefix="/home/abradox/data/work/x86_64_installer/x86_64_installer/rootfs"
rootfs/sbin/x86_64-unknown-linux-uclibc-grub-mknetdir:22:prefix="/home/abradox/data/work/x86_64_installer/x86_64_installer/rootfs"
rootfs/sbin/x86_64-unknown-linux-uclibc-grub-reboot:22:prefix=/home/abradox/data/work/x86_64_installer/x86_64_installer/rootfs
rootfs/sbin/x86_64-unknown-linux-uclibc-grub-set-default:22:prefix=/home/abradox/data/work/x86_64_installer/x86_64_installer/rootfs
请说我。如何将"grub2"安装到"${PREFIX_PATH}",但保持它的工作?
解决方案:使用环境变量"DESTDIR"而不是"--前缀"。
HOST=x86_64-linux-gnu
TARGET=x86_64-unknown-linux-uclibc
CPPFLAGS="-I${INST_CROSS_TOOLS}/usr/include" LDFLAGS="L${PREFIX_PATH}/usr/lib"
./configure
--host="${HOST}"
--target="${TARGET}"
make
make install DESTDIR="${PREFIX_PATH}"
相关文章:配置"--前缀"选项进行交叉编译