From e80f07250b72fce61fd5342bcdecfb7f25c6fe14 Mon Sep 17 00:00:00 2001 From: Sunil Mohan Adapa Date: Sat, 4 Feb 2023 16:27:25 -0800 Subject: [PATCH] vagrant: Mount source in /freedombox instead of /vagrant For uniformity with the more often used ./container script. Developers may have to destroy and recreate their vagrant machines for this to take effect. Signed-off-by: Sunil Mohan Adapa Reviewed-by: James Valleroy --- HACKING.md | 6 +++--- Vagrantfile | 8 ++++---- vagrant-scripts/plinth-user-permissions.py | 2 +- 3 files changed, 8 insertions(+), 8 deletions(-) diff --git a/HACKING.md b/HACKING.md index e9211417d..3a749a6f3 100644 --- a/HACKING.md +++ b/HACKING.md @@ -283,10 +283,10 @@ and requires about 4.5 GB of disk space. #### Using the Virtual Machine After logging into the virtual machine (VM), the source code is available in -/vagrant directory: +/freedombox directory: ```bash -vm$ cd /vagrant +vm$ cd /freedombox ``` Run the development version of FreedomBox Service (Plinth) from your source @@ -295,7 +295,7 @@ continuously deploys your code changes into the virtual machine providing a quick feedback cycle during development. ```bash -vm$ sudo -u plinth /vagrant/run --develop +vm$ freedombox-develop ``` If you have changed any system configuration files during your development, diff --git a/Vagrantfile b/Vagrantfile index 3d518b5f0..264c89266 100644 --- a/Vagrantfile +++ b/Vagrantfile @@ -8,7 +8,7 @@ Vagrant.configure(2) do |config| config.vm.box = "freedombox/freedombox-testing-dev" config.vm.network "forwarded_port", guest: 443, host: 4430 config.vm.network "forwarded_port", guest: 445, host: 4450 - config.vm.synced_folder ".", "/vagrant", owner: "plinth", group: "plinth" + config.vm.synced_folder ".", "/freedombox", owner: "plinth", group: "plinth" config.vm.provider "virtualbox" do |vb| vb.cpus = Etc.nprocessors vb.memory = 2048 @@ -22,7 +22,7 @@ Vagrant.configure(2) do |config| systemctl disable plinth SHELL config.vm.provision "shell", inline: <<-SHELL - cd /vagrant/ + cd /freedombox/ ./setup.py install systemctl daemon-reload # Stop any ongoing upgrade @@ -36,14 +36,14 @@ Vagrant.configure(2) do |config| apt-mark unhold freedombox # Install ncurses-term DEBIAN_FRONTEND=noninteractive apt-get install -y ncurses-term - echo 'alias run-develop="sudo -u plinth /vagrant/run --develop"' >> /home/vagrant/.bashrc + echo 'alias freedombox-develop="sudo -u plinth /freedombox/run --develop"' >> /home/vagrant/.bashrc SHELL config.vm.provision "tests", run: "never", type: "shell", path: "plinth/tests/functional/install.sh" config.vm.post_up_message = "FreedomBox virtual machine is ready for development. You can run the development version of Plinth using the following command. $ vagrant ssh -$ sudo -u plinth /vagrant/run --develop +$ freedombox-develop Plinth will be available at https://localhost:4430/plinth (with an invalid SSL certificate). " diff --git a/vagrant-scripts/plinth-user-permissions.py b/vagrant-scripts/plinth-user-permissions.py index 64ade9b4e..796b84648 100755 --- a/vagrant-scripts/plinth-user-permissions.py +++ b/vagrant-scripts/plinth-user-permissions.py @@ -6,7 +6,7 @@ import pathlib content = ''' -Cmnd_Alias FREEDOMBOX_ACTION_DEV = /usr/share/plinth/actions/actions, /vagrant/actions/actions +Cmnd_Alias FREEDOMBOX_ACTION_DEV = /usr/share/plinth/actions/actions, /freedombox/actions/actions Defaults!FREEDOMBOX_ACTION_DEV closefrom_override plinth ALL=(ALL:ALL) NOPASSWD:SETENV : FREEDOMBOX_ACTION_DEV fbx ALL=(ALL:ALL) NOPASSWD : ALL