hypriot / rpi-kernel

Build a Linux kernel for Raspberry Pi 0/1/2/3/3B+
MIT License
134 stars 46 forks source link

Permissions issue #53

Open ThomasGsp opened 5 years ago

ThomasGsp commented 5 years ago

Hi,

I got permission issue during the provisioning.

Fixed by adding "sudo" in scripts/provision.sh

sudo /vagrant/scripts/prepare_build_environment.sh
sudo /vagrant/scripts/compile_kernel.sh

Issues:

docker-raspbian: your host and reload your VM. docker-raspbian: docker-raspbian: Guest Additions Version: 4.3.40 docker-raspbian: VirtualBox Version: 5.1 ==> docker-raspbian: Setting hostname... ==> docker-raspbian: Mounting shared folders... docker-raspbian: /vagrant => /home/tlams/raspkernel/rpi-kernel ==> docker-raspbian: Running provisioner: shell... docker-raspbian: Running: /tmp/vagrant-shell20190728-6960-1ltu9wy.sh docker-raspbian: E: Could not open lock file /var/lib/apt/lists/lock - open (13: Permission denied) docker-raspbian: E: Unable to lock directory /var/lib/apt/lists/ docker-raspbian: E: Could not open lock file /var/lib/dpkg/lock - open (13: Permission denied) docker-raspbian: E: Unable to lock the administration directory (/var/lib/dpkg/), are you root? docker-raspbian: E: Could not open lock file /var/lib/dpkg/lock - open (13: Permission denied) docker-raspbian: E: Unable to lock the administration directory (/var/lib/dpkg/), are you root? docker-raspbian: E: Could not open lock file /var/lib/dpkg/lock - open (13: Permission denied) docker-raspbian: E: Unable to lock the administration directory (/var/lib/dpkg/), are you root? docker-raspbian: E: Could not open lock file /var/lib/dpkg/lock - open (13: Permission denied) docker-raspbian: E: Unable to lock the administration directory (/var/lib/dpkg/), are you root? docker-raspbian: E: Could not open lock file /var/lib/dpkg/lock - open (13: Permission denied) docker-raspbian: E: Unable to lock the administration directory (/var/lib/dpkg/), are you root? docker-raspbian: E: Could not open lock file /var/lib/dpkg/lock - open (13: Permission denied) docker-raspbian: E: Unable to lock the administration directory (/var/lib/dpkg/), are you root? docker-raspbian: E: Could not open lock file /var/lib/dpkg/lock - open (13: Permission denied) docker-raspbian: E: Unable to lock the administration directory (/var/lib/dpkg/), are you root? docker-raspbian: E: Could not open lock file /var/lib/dpkg/lock - open (13: Permission denied) docker-raspbian: E: Unable to lock the administration directory (/var/lib/dpkg/), are you root? docker-raspbian: E: Could not open lock file /var/lib/dpkg/lock - open (13: Permission denied) docker-raspbian: E: Unable to lock the administration directory (/var/lib/dpkg/), are you root? docker-raspbian: E: Could not open lock file /var/lib/dpkg/lock - open (13: Permission denied) docker-raspbian: E: Unable to lock the administration directory (/var/lib/dpkg/), are you root? docker-raspbian: E: Could not open lock file /var/lib/dpkg/lock - open (13: Permission denied) docker-raspbian: E: Unable to lock the administration directory (/var/lib/dpkg/), are you root? docker-raspbian: E: Could not open lock file /var/lib/dpkg/lock - open (13: Permission denied) docker-raspbian: E: Unable to lock the administration directory (/var/lib/dpkg/), are you root? docker-raspbian: E: Could not open lock file /var/lib/dpkg/lock - open (13: Permission denied) docker-raspbian: E: Unable to lock the administration directory (/var/lib/dpkg/), are you root? docker-raspbian: E: Could not open lock file /var/lib/dpkg/lock - open (13: Permission denied) docker-raspbian: E: Unable to lock the administration directory (/var/lib/dpkg/), are you root? docker-raspbian: E: Could not open lock file /var/lib/dpkg/lock - open (13: Permission denied) docker-raspbian: E: Unable to lock the administration directory (/var/lib/dpkg/), are you root? docker-raspbian: E: Could not open lock file /var/lib/dpkg/lock - open (13: Permission denied) docker-raspbian: E: Unable to lock the administration directory (/var/lib/dpkg/), are you root? docker-raspbian: E: Could not open lock file /var/lib/dpkg/lock - open (13: Permission denied) docker-raspbian: E: Unable to lock the administration directory (/var/lib/dpkg/), are you root? docker-raspbian: E: Could not open lock file /var/lib/dpkg/lock - open (13: Permission denied) docker-raspbian: E: Unable to lock the administration directory (/var/lib/dpkg/), are you root? docker-raspbian: ++ nproc docker-raspbian: + NUM_CPUS=4 docker-raspbian: ############### docker-raspbian: ### Using 4 cores docker-raspbian: + echo '###############' docker-raspbian: + echo '### Using 4 cores' docker-raspbian: + BUILD_USER=vagrant docker-raspbian: + BUILD_GROUP=vagrant docker-raspbian: + BUILD_ROOT=/var/kernel_build docker-raspbian: + BUILD_CACHE=/var/kernel_build/cache docker-raspbian: + ARM_TOOLS=/var/kernel_build/cache/tools docker-raspbian: + LINUX_KERNEL=/var/kernel_build/cache/linux-kernel docker-raspbian: + LINUX_KERNEL_COMMIT=36612d5d7a88672a3e7dd6cb458dbbbca0d75efe docker-raspbian: + RASPBERRY_FIRMWARE=/var/kernel_build/cache/rpi_firmware docker-raspbian: + '[' -d /vagrant ']' docker-raspbian: + SRC_DIR=/vagrant docker-raspbian: + LINUX_KERNEL_CONFIGS=/vagrant/kernel_configs docker-raspbian: ++ date +%Y%m%d-%H%M%S docker-raspbian: + NEW_VERSION=20190728-094257 docker-raspbian: + BUILD_RESULTS=/var/kernel_build/results/kernel-20190728-094257 docker-raspbian: + X64_CROSS_COMPILE_CHAIN=arm-bcm2708/gcc-linaro-arm-linux-gnueabihf-raspbian-x64 docker-raspbian: + declare -A CCPREFIX docker-raspbian: + CCPREFIX["rpi1"]=/var/kernel_build/cache/tools/arm-bcm2708/gcc-linaro-arm-linux-gnueabihf-raspbian-x64/bin/arm-linux-gnueabihf- docker-raspbian: + CCPREFIX["rpi2_3"]=/var/kernel_build/cache/tools/arm-bcm2708/gcc-linaro-arm-linux-gnueabihf-raspbian-x64/bin/arm-linux-gnueabihf- docker-raspbian: + declare -A ORIGDEFCONFIG docker-raspbian: + ORIGDEFCONFIG["rpi1"]=bcmrpi_defconfig docker-raspbian: + ORIGDEFCONFIG["rpi2_3"]=bcm2709_defconfig docker-raspbian: + declare -A DEFCONFIG docker-raspbian: + DEFCONFIG["rpi1"]=rpi1_docker_defconfig docker-raspbian: + DEFCONFIG["rpi2_3"]=rpi2_3_docker_defconfig docker-raspbian: + declare -A IMAGE_NAME docker-raspbian: + IMAGE_NAME["rpi1"]=kernel.img docker-raspbian: + IMAGE_NAME["rpi2_3"]=kernel7.img docker-raspbian: *** all parameters are set *** docker-raspbian: *** the kernel timestamp is: 20190728-094257 *** docker-raspbian: ############################################# docker-raspbian: + echo '*** all parameters are set ***' docker-raspbian: + echo '*** the kernel timestamp is: 20190728-094257 ***' docker-raspbian: + echo '#############################################' docker-raspbian: + rm -fr /var/kernel_build/cache/rpi_firmware docker-raspbian: + prepare_kernel_building docker-raspbian: + setup_build_dirs docker-raspbian: + for dir in '$BUILD_ROOT' '$BUILD_CACHE' '$BUILD_RESULTS' '$ARM_TOOLS' '$LINUX_KERNEL' '$RASPBERRY_FIRMWARE' docker-raspbian: + create_dir_for_build_user /var/kernel_build docker-raspbian: + local target_dir=/var/kernel_build docker-raspbian: + mkdir -p /var/kernel_build docker-raspbian: mkdir: cannot create directory ‘/var/kernel_build’ docker-raspbian: : Permission denied The SSH command responded with a non-zero exit status. Vagrant assumes that this means the command failed. The output for this command should be in the log above. Please read the output to determine what went wrong.

Debian 9 Vagrant 2.2.3

Thomas.

adrienbrignon commented 5 years ago

Hello,

Same issue with Vagrant 2.2.5 on Arch Linux (kernel 5.2.11). Thanks @ThomasGsp for the workaround 👍