From: Sage Weil Date: Tue, 10 Apr 2012 20:41:16 +0000 (-0700) Subject: kernel: kludge around mysterious 0-byte .git/HEAD files X-Git-Tag: 1.1.0~2576 X-Git-Url: http://git.apps.os.sepia.ceph.com/?a=commitdiff_plain;h=1ac5554d759289c5bd7c147f00da0aa4a44c12b5;p=teuthology.git kernel: kludge around mysterious 0-byte .git/HEAD files No idea where these are coming from, but they break nodes with behavior like ubuntu@plana08:~$ sudo install -d -m0755 /lib/firmware/updates && cd /lib/firmware/updates && sudo git init Reinitialized existing Git repository in /lib/firmware/updates/.git/ ubuntu@plana08:/lib/firmware/updates$ sudo git --git-dir=/lib/firmware/updates/.git config --get remote.origin.url >/dev/null || sudo git --git-dir=/lib/firmware/updates/.git remote add origin git://ceph.newdream.net/git/linux-firmware.git ubuntu@plana08:/lib/firmware/updates$ cd /lib/firmware/updates && sudo git pull origin master fatal: Not a git repository (or any of the parent directories): .git where the .git directory looks like total 32 drwxr-xr-x 7 root root 4096 2012-04-10 12:52 . drwxr-xr-x 3 root root 4096 2012-04-06 13:54 .. drwxr-xr-x 2 root root 4096 2012-04-06 13:54 branches -rwxr--r-- 1 root root 236 2012-04-10 11:33 config -rw-r--r-- 1 root root 0 2012-04-10 12:52 config.lock -rw-r--r-- 1 root root 0 2012-04-06 13:54 description -rw-r--r-- 1 root root 0 2012-04-06 13:54 FETCH_HEAD -rw-r--r-- 1 root root 0 2012-04-06 13:54 HEAD drwxr-xr-x 2 root root 4096 2012-04-06 13:54 hooks drwxr-xr-x 2 root root 4096 2012-04-06 13:54 info drwxr-xr-x 4 root root 4096 2012-04-06 13:54 objects drwxr-xr-x 4 root root 4096 2012-04-06 13:54 refs Hopefully someone can figure out what is causing this and revert this later. --- diff --git a/teuthology/task/kernel.py b/teuthology/task/kernel.py index e2a560e26c..7ffd5b9444 100644 --- a/teuthology/task/kernel.py +++ b/teuthology/task/kernel.py @@ -101,6 +101,16 @@ def install_firmware(ctx, config): log.info('Installing linux-firmware on {role}...'.format(role=role)) role_remote.run( args=[ + # kludge around mysterious 0-byte .git/HEAD files + 'cd', fw_dir, + run.Raw('&&'), + 'test', '-d', '.git', + run.Raw('&&'), + 'test', '!', '-s', '.git/HEAD', + run.Raw('&&'), + 'sudo', 'rm', '-rf', '.git', + run.Raw(';'), + # init 'sudo', 'install', '-d', '-m0755', fw_dir, run.Raw('&&'), 'cd', fw_dir,