]> git.apps.os.sepia.ceph.com Git - teuthology.git/commitdiff
kernel: kludge around mysterious 0-byte .git/HEAD files
authorSage Weil <sage@newdream.net>
Tue, 10 Apr 2012 20:41:16 +0000 (13:41 -0700)
committerSage Weil <sage@newdream.net>
Tue, 10 Apr 2012 20:41:16 +0000 (13:41 -0700)
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.

teuthology/task/kernel.py

index e2a560e26cb375609eab78edb7033ad5f3645594..7ffd5b9444169c8fb4457e24835efb0f7b25871f 100644 (file)
@@ -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,