X-Git-Url: https://git.camperquake.de/gitweb.cgi?a=blobdiff_plain;f=scripts%2Fupdate-zfs.sh;h=03023eaefa728c81279fd52edd8681c17626a533;hb=774f7c02b181f6e18b91ebdd3092df57151da3e3;hp=ce772fd244e4b77880d4863afcbd0c7c63730ebb;hpb=77755a5771c339a1d96c36ab1a8f1e41e14507f0;p=zfs.git diff --git a/scripts/update-zfs.sh b/scripts/update-zfs.sh index ce772fd..03023ea 100755 --- a/scripts/update-zfs.sh +++ b/scripts/update-zfs.sh @@ -9,6 +9,8 @@ trap die_int INT RELEASE=$1 PROG=update-zfs.sh +REMOTE_DOC_FILE=man-sunosman-20090930.tar.bz2 +REMOTE_DOC=http://dlc.sun.com/osol/man/downloads/current/${REMOTE_DOC_FILE} REMOTE_SRC=http://dlc.sun.com/osol/on/downloads/${RELEASE}/on-src.tar.bz2 die() { @@ -26,54 +28,71 @@ if [ `basename $DST` != "scripts" ]; then die "Must be run from scripts directory" fi +if [ ! "$RELEASE" ]; then + die "Must specify ZFS release build" +fi + SRC=`mktemp -d /tmp/os-${RELEASE}.XXXXXXXXXX` DST=`dirname $DST` -echo "----------------------------------------------------------------------" +echo "----------------------------------------------------------------" echo "Remote Source: ${REMOTE_SRC}" +echo "Remote Docs: ${REMOTE_DOC}" echo "Local Source: ${SRC}" echo "Local Dest: ${DST}" echo echo "------------- Fetching OpenSolaris ${RELEASE} archive ----------------" -wget ${REMOTE_SRC} -P ${SRC} || +wget -q ${REMOTE_SRC} -P ${SRC} || die "Error 'wget ${REMOTE_SRC}'" -echo "------------- Unpacking OperSolaris ${RELEASE} archive ---------------" +echo "------------- Fetching OpenSolaris documentation ---------------" +wget -q ${REMOTE_DOC} -P ${SRC} || + die "Error 'wget ${REMOTE_DOC}'" + +echo "------------- Unpacking OpenSolaris ${RELEASE} archive ---------------" tar -xjf ${SRC}/on-src.tar.bz2 -C ${SRC} || die "Error 'tar -xjf ${SRC}/on-src.tar.bz2 -C ${SRC}'" +echo "------------- Unpacking OpenSolaris documentation --------------" +tar -xjf ${SRC}/${REMOTE_DOC_FILE} -C ${SRC} || + die "Error 'tar -xjf ${SRC}/${REMOTE_DOC_FILE} -C ${SRC}'" + SRC_LIB=${SRC}/usr/src/lib SRC_CMD=${SRC}/usr/src/cmd SRC_CM=${SRC}/usr/src/common SRC_UTS=${SRC}/usr/src/uts SRC_UCM=${SRC}/usr/src/uts/common SRC_ZLIB=${SRC}/usr/src/uts/common/fs/zfs +SRC_MAN=${SRC}/man DST_MOD=${DST}/module DST_LIB=${DST}/lib DST_CMD=${DST}/cmd +DST_MAN=${DST}/man +umask 022 rm -Rf ${DST}/zfs -echo echo "------------- Updating ZFS from OpenSolaris ${RELEASE} ---------------" -echo "* module/avl + lib/libavl" +echo "* module/avl" mkdir -p ${DST_MOD}/avl/include/sys/ cp ${SRC_CM}/avl/avl.c ${DST_MOD}/avl/ cp ${SRC_UCM}/sys/avl.h ${DST_MOD}/avl/include/sys/ cp ${SRC_UCM}/sys/avl_impl.h ${DST_MOD}/avl/include/sys/ -echo "* module/nvpair + lib/libnvpair" +echo "* module/nvpair" mkdir -p ${DST_MOD}/nvpair/include/sys/ cp ${SRC_CM}/nvpair/nvpair.c ${DST_MOD}/nvpair/ -cp ${SRC_LIB}/libnvpair/libnvpair.c ${DST_MOD}/nvpair/ -cp ${SRC_UCM}/os/nvpair_alloc_system.c ${DST_MOD}/nvpair/ -cp ${SRC_CM}/nvpair/nvpair_alloc_fixed.c ${DST_MOD}/nvpair/ -cp ${SRC_LIB}/libnvpair/libnvpair.h ${DST_MOD}/nvpair/include/ cp ${SRC_UCM}/sys/nvpair.h ${DST_MOD}/nvpair/include/sys/ cp ${SRC_UCM}/sys/nvpair_impl.h ${DST_MOD}/nvpair/include/sys/ -echo "* module/zcommon + lib/libzcommon" +echo "* module/unicode" +mkdir -p ${DST_MOD}/unicode/include/sys/ +cp ${SRC_CM}/unicode/*.c ${DST_MOD}/unicode/ +cp ${SRC_UCM}/sys/u8_textprep.h ${DST_MOD}/unicode/include/sys/ +cp ${SRC_UCM}/sys/u8_textprep_data.h ${DST_MOD}/unicode/include/sys/ + +echo "* module/zcommon" mkdir -p ${DST_MOD}/zcommon/include/sys/fs/ mkdir -p ${DST_MOD}/zcommon/include/sys/fm/fs/ cp ${SRC_CM}/zfs/*.c ${DST_MOD}/zcommon/ @@ -87,24 +106,32 @@ cp ${SRC_UTS}/intel/zfs/spa_boot.c ${DST_MOD}/zfs/ cp ${SRC_ZLIB}/*.c ${DST_MOD}/zfs/ cp ${SRC_ZLIB}/sys/*.h ${DST_MOD}/zfs/include/sys/ rm ${DST_MOD}/zfs/vdev_disk.c +rm ${DST_MOD}/zfs/zvol.c rm ${DST_MOD}/zfs/include/sys/vdev_disk.h -echo "* lib/libspl" -mkdir -p ${DST_LIB}/libspl/include/sys/ -cp ${SRC_LIB}/libc/port/gen/strlcat.c ${DST_LIB}/libspl/ -cp ${SRC_LIB}/libc/port/gen/strlcpy.c ${DST_LIB}/libspl/ -cp ${SRC_LIB}/libc/port/gen/strnlen.c ${DST_LIB}/libspl/ -cp ${SRC_LIB}/libgen/common/mkdirp.c ${DST_LIB}/libspl/ -cp ${SRC_CM}/unicode/u8_textprep.c ${DST_LIB}/libspl/ -cp ${SRC_UCM}/os/list.c ${DST_LIB}/libspl/ -cp ${SRC_UCM}/sys/list.h ${DST_LIB}/libspl/include/sys/ -cp ${SRC_UCM}/sys/list_impl.h ${DST_LIB}/libspl/include/sys/ +echo "* lib/libavl" +# Full source available in 'module/avl' + +echo "* lib/libnvpair" +mkdir -p ${DST_LIB}/libnvpair/include/ +cp ${SRC_UCM}/os/nvpair_alloc_system.c ${DST_LIB}/libnvpair/ +cp ${SRC_LIB}/libnvpair/libnvpair.c ${DST_LIB}/libnvpair/ +cp ${SRC_LIB}/libnvpair/libnvpair.h ${DST_LIB}/libnvpair/include/ + +echo "* lib/libunicode" +# Full source available in 'module/unicode' echo "* lib/libuutil" mkdir -p ${DST_LIB}/libuutil/include/ cp ${SRC_LIB}/libuutil/common/*.c ${DST_LIB}/libuutil/ cp ${SRC_LIB}/libuutil/common/*.h ${DST_LIB}/libuutil/include/ +echo "* lib/libefi" +mkdir -p ${DST_LIB}/libefi/include/sys/ +cp ${SRC_LIB}/libefi/common/rdwr_efi.c ${DST_LIB}/libefi/ +cp ${SRC_UCM}/sys/efi_partition.h ${DST_LIB}/libefi/include/sys/ +cp ${SRC_UCM}/sys/uuid.h ${DST_LIB}/libefi/include/sys/ + echo "* lib/libzpool" mkdir -p ${DST_LIB}/libzpool/include/sys/ cp ${SRC_LIB}/libzpool/common/kernel.c ${DST_LIB}/libzpool/ @@ -131,10 +158,6 @@ echo "* cmd/zdb" mkdir -p ${DST_CMD}/zdb/ cp ${SRC_CMD}/zdb/*.c ${DST_CMD}/zdb/ -echo "* cmd/zdump" -mkdir -p ${DST_CMD}/zdump -cp ${SRC_CMD}/zdump/*.c ${DST_CMD}/zdump/ - echo "* cmd/zinject" mkdir -p ${DST_CMD}/zinject cp ${SRC_CMD}/zinject/*.c ${DST_CMD}/zinject/ @@ -144,6 +167,13 @@ echo "* cmd/ztest" mkdir -p ${DST_CMD}/ztest cp ${SRC_CMD}/ztest/*.c ${DST_CMD}/ztest/ +echo "* man/" +mkdir -p ${DST_MAN}/man8 +cp ${SRC_MAN}/man1m/zfs.1m ${DST_MAN}/man8/zfs.8 +cp ${SRC_MAN}/man1m/zpool.1m ${DST_MAN}/man8/zpool.8 +cp ${SRC_MAN}/man1m/zdb.1m ${DST_MAN}/man8/zdb.8 +chmod -R 644 ${DST_MAN}/man8/* + echo "${REMOTE_SRC}" >${DST}/ZFS.RELEASE rm -Rf ${SRC}