diff options
| author | Lorenzo Stoakes <lstoakes@gmail.com> | 2016-03-06 18:47:43 +0000 |
|---|---|---|
| committer | Lorenzo Stoakes <lstoakes@gmail.com> | 2016-03-06 18:47:43 +0000 |
| commit | b21724820ca99a2c5d43d3a68977881aa7837bb0 (patch) | |
| tree | f41b770be646ded5f91fd7828e0559cc709776a3 | |
| parent | 0c4c9e5f875e423db627ec5010cfeb1beb3fc113 (diff) | |
tools: fix path on create-image.sh chroot.
When chroot'ing into the generated debian rootfs PATH is inherited from the host
and assumed to reference each of: /bin, /sbin, /usr/bin, /usr/sbin,
/usr/local/bin and /usr/local/sbin. Not all distros use all of these, so enforce
these in the chroot command.
| -rwxr-xr-x | tools/create-image.sh | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/tools/create-image.sh b/tools/create-image.sh index 3f62c961b..3b73b95be 100755 --- a/tools/create-image.sh +++ b/tools/create-image.sh @@ -24,7 +24,8 @@ ssh-keygen -f ssh/id_rsa -t rsa -N '' cat ssh/id_rsa.pub | sudo tee wheezy/root/.ssh/authorized_keys # Install some misc packages. -sudo chroot wheezy /bin/bash -c "apt-get update; ( yes | apt-get install curl tar time strace)" +sudo chroot wheezy /bin/bash -c "export PATH=/bin:/sbin:/usr/bin:/usr/sbin:/usr/local/bin:/usr/local/sbin; " \ +"apt-get update; apt-get install --yes curl tar time strace" # Build a disk image dd if=/dev/zero of=wheezy.img bs=1M seek=1023 count=1 @@ -33,4 +34,3 @@ sudo mkdir -p /mnt/wheezy sudo mount -o loop wheezy.img /mnt/wheezy sudo cp -a wheezy/. /mnt/wheezy/. sudo umount /mnt/wheezy - |
