]> git.proxmox.com Git - mirror_ubuntu-zesty-kernel.git/blob - debian/scripts/misc/update-zfs.sh
UBUNTU: [Debian] update spl/zfs version
[mirror_ubuntu-zesty-kernel.git] / debian / scripts / misc / update-zfs.sh
1 #!/bin/bash
2 #
3 # Update spl/zfs from the Ubuntu archive. You will have to manually check
4 # to see if the version has been updated.
5 #
6 SPL_MAJOR_VER=${_SPL_MAJOR_VER:-0.6.5.4}
7 SPL_MINOR_VER=${_SPL_MINOR_VER:-0ubuntu1}
8 SPL_DKMS=${_SPL_DKMS:-http://archive.ubuntu.com/ubuntu/pool/universe/s/spl-linux/spl-dkms_${SPL_MAJOR_VER}-${SPL_MINOR_VER}_amd64.deb}
9
10 ZFS_MAJOR_VER=${_ZFS_MAJOR_VER:-0.6.5.4}
11 ZFS_MINOR_VER=${_ZFS_MINOR_VER:-0ubuntu1}
12 ZFS_DKMS=${_ZFS_DKMS:-http://archive.ubuntu.com/ubuntu/pool/universe/z/zfs-linux/zfs-dkms_${ZFS_MAJOR_VER}-${ZFS_MINOR_VER}_amd64.deb}
13
14 function update_from_archive {
15
16 URL=$1
17 DEST_DIR=$2
18 VER=$3
19
20 rm -rf ${DEST_DIR}.tmp
21 wget -O ${DEST_DIR}.deb ${URL}
22 dpkg -x ${DEST_DIR}.deb ${DEST_DIR}.tmp
23 mkdir -p ${DEST_DIR}
24 rsync -a --delete ${DEST_DIR}.tmp/usr/src/${DEST_DIR}-${VER}*/ ${DEST_DIR}/
25 rm -rf ${DEST_DIR}.deb ${DEST_DIR}.tmp
26 find ${DEST_DIR} -type f | while read f;do git add -f $f;done
27 }
28
29 update_from_archive ${SPL_DKMS} spl ${SPL_MAJOR_VER}
30 update_from_archive ${ZFS_DKMS} zfs ${ZFS_MAJOR_VER}
31
32 git add -u
33 git commit -s -m"UBUNTU: SAUCE: (noup) Update spl to ${SPL_MAJOR_VER}-${SPL_MINOR_VER}, zfs to ${ZFS_MAJOR_VER}-${ZFS_MINOR_VER}"