]> git.ipfire.org Git - thirdparty/systemd.git/commitdiff
mkosi: Use RuntimeTrees= to mount sources
authorDaan De Meyer <daan.j.demeyer@gmail.com>
Tue, 17 Oct 2023 14:03:42 +0000 (16:03 +0200)
committerDaan De Meyer <daan.j.demeyer@gmail.com>
Fri, 20 Oct 2023 10:43:57 +0000 (12:43 +0200)
Instead of using ExtraTrees=, let's use the new RuntimeTrees= option
to mount the full repository into the VM/container. Let's also store
the sources under /usr/src/systemd and update the gdbinit file and
vscode HACKING guide section to match the new location.

docs/HACKING.md
mkosi.presets/system/mkosi.conf
mkosi.presets/system/mkosi.extra/usr/share/factory/mkosi/gdbinit.d/systemd.gdb

index fb7caac93cccb63f648ca6b7055041258a944703..0178a43dba05a435e0c08173f1a8d5a2523f8c17 100644 (file)
@@ -234,16 +234,17 @@ QEMU.
 To allow VSCode's debugger to attach to systemd running in a mkosi image, we have to make sure it can access
 the virtual machine spawned by mkosi where systemd is running. mkosi makes this possible via a handy SSH
 option that makes the generated image accessible via SSH when booted. Thus you must build the image with
-`mkosi --ssh`. The easiest way to set the option is to create a file 20-local.conf in mkosi.conf.d/ (in the
-directory you ran mkosi in) and add the following contents:
+`mkosi --ssh`. The easiest way to set the option is to create a file `mkosi.conf` in the root of the
+repository and add the following contents:
 
 ```
 [Host]
 Ssh=yes
+RuntimeTrees=.
 ```
 
 Also make sure that the SSH agent is running on your system and that you've added your SSH key to it with
-`ssh-add`.
+`ssh-add`. Also make sure that `virtiofsd` is installed.
 
 After rebuilding the image and booting it with `mkosi qemu`, you should now be able to connect to it by
 running `mkosi ssh` from the same directory in another terminal window.
@@ -284,14 +285,10 @@ the directory, and add the following contents:
             },
             "MIMode": "gdb",
             "sourceFileMap": {
-                "/work/build/../src": {
+                "/root/src/systemd": {
                     "editorPath": "${workspaceFolder}",
                     "useForBreakpoints": false
                 },
-                "/work/build/*": {
-                    "editorPath": "${workspaceFolder}/mkosi.builddir",
-                    "useForBreakpoints": false
-                }
             }
         }
     ]
index 361bb6af7245159bdb9eb06afd9b3aadb1f22279..08f6fb7dc7629155e6a4843c81528f2347ba951a 100644 (file)
@@ -7,7 +7,6 @@ Dependencies=base
 Autologin=yes
 BaseTrees=../../mkosi.output/base
 ExtraTrees=../../mkosi.output/base-systemd
-ExtraTrees=../../src:/usr/src/src
 Packages=
         acl
         bash-completion
index 598344809c144f6f194ee5008814e905f0280a03..26f882bc2bb3940069f6bd1a24c5951a0c6ccb00 100644 (file)
@@ -1,3 +1,3 @@
 set debuginfod enabled off
 set build-id-verbose 0
-set substitute-path ../src /usr/src
+set substitute-path ../src /root/src/systemd