virtualbox packer must use sudo whenever root privs are required
authorkwadronaut <kwadronaut@leap.se>
Sun, 4 Dec 2016 23:05:40 +0000 (00:05 +0100)
committerkwadronaut <kwadronaut@leap.se>
Sun, 4 Dec 2016 23:09:06 +0000 (00:09 +0100)
jessie.json
scripts/zerodisk.sh

index d76653d..142d503 100644 (file)
         {
             "type": "file",
             "source": "files/leap-archive.gpg",
-            "destination": "/etc/apt/trusted.gpg.d/leap-archive.gpg"
+            "destination": "/tmp/leap-archive.gpg"
         },
         {
             "type": "file",
             "source": "files/leap-experimental-archive.gpg",
-            "destination": "/etc/apt/trusted.gpg.d/leap-experimental-archive.gpg"
+            "destination": "/tmp/leap-experimental-archive.gpg"
         },
+       {
+          "type": "shell",
+          "inline": [
+               "echo {{user `password`}} |  sudo -S  cp /tmp/leap-archive.gpg /etc/apt/trusted.gpg.d/leap-archive.gpg",
+               "sudo cp /tmp/leap-experimental-archive.gpg /etc/apt/trusted.gpg.d/leap-experimental-archive.gpg",
+               "sudo chown root:root /etc/apt/trusted.gpg.d/leap-archive.gpg /etc/apt/trusted.gpg.d/leap-experimental-archive.gpg"
+          ]
+       },
         {
             "type": "shell",
             "scripts": [
index 35370d6..530ca4d 100644 (file)
@@ -1,7 +1,7 @@
 #!/bin/bash
 
 # Zero out the free space to save space in the final image:
-dd if=/dev/zero of=/EMPTY bs=1M
+dd if=/dev/zero of=/tmp/EMPTY bs=1M
 rm -f /EMPTY
 
 # Sync to ensure that the delete completes before this moves on.