We usually use a custom script to setup new FreeBSD machines after system installation, which installs tools from ports tree and sets up system environment. we also need to automate update newly installed FreeBSD-8.2 machines to FreeBSD-8.2p3 by freebsd-update. As I know, freebsd-update doesn't allow me to execute it from a shell script without a "cron" option. So I try to preload a custom program to cheat freebsd-update:
${CAT} > /tmp/isatty.c <<EOF
int isatty(const int fd) { return 1; }
EOF
${CC} -shared -fPIC -o /tmp/isatty.so /tmp/isatty.c
${ENV} LD_PRELOAD=/tmp/isatty.so LESS="-E" ${FREEBSD_UPDATE} fetch install < /dev/null
with this tweak, I can sucessfully run freebsd-update from my custom script, but after the freebsd-installer fetched files from update server, I got this error message:
Fetching metadata signature for 8.3-RELEASE from update5.FreeBSD.org... done.
Fetching metadata index... done.
Fetching 2 metadata files... gunzip: standard input is a terminal -- ignoring
metadata is corrupt.
Do I have any chance to solve this?