From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from bombadil.infradead.org ([198.137.202.133]:55608 "EHLO bombadil.infradead.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1756465AbeFOVZU (ORCPT ); Fri, 15 Jun 2018 17:25:20 -0400 Date: Fri, 15 Jun 2018 14:25:19 -0700 From: Matthew Wilcox To: Kent Overstreet , linux-fsdevel@vger.kernel.org Subject: [RFC] ktest: update ndctl and xfstests Message-ID: <20180615212519.GA23569@bombadil.infradead.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Sender: linux-fsdevel-owner@vger.kernel.org List-ID: This makes them part of the root image. I didn't see any existing code for automatically installing these things. There's no attempt to check and magically install dependencies ... but I do skip rebuilding them if they haven't been updated since last git pull. diff --git a/root_image b/root_image index 42f9293..6861949 100755 --- a/root_image +++ b/root_image @@ -195,12 +195,50 @@ ZZ sed -i s/$/-kvm/ "$MNT/etc/hostname" } +update_git() +{ + if [ -d $1 ]; then + cd $1 + git fetch + if cmp -n40 -s .git/FETCH_HEAD .git/refs/heads/master; then + cd .. + exit 0; + fi + git merge FETCH_HEAD + else + git clone $2 + cd $1 + fi + case $1 in + ndctl) + ./autogen.sh + ./configure CFLAGS='-g -O2' --prefix=/usr --sysconfdir=/etc --libdir=/usr/lib + ;; + esac + make + make DESTDIR=$MNT install + case $1 in + xfstests-dev) +# need to make these not fail if the user already exists -- help? +# _chroot "$MNT" useradd fsgqa +# _chroot "$MNT" groupadd fsgqa +# _chroot "$MNT" useradd 123456-fsgqa + ;; + esac + cd .. +} + update_packages() { _chroot "$MNT" apt update _chroot "$MNT" apt upgrade -y _chroot "$MNT" apt install -y "${PACKAGES[@]}" rm -f "$MNT/var/cache/apt/archives/*.deb" + + # ndctl is not yet available as a Debian package + update_git ndctl https://github.com/pmem/ndctl.git + # we want the latest version of xfstests from git + update_git xfstests-dev } trim_image()