From df2799eb58e3b7dd6abd98459a72add5d1368eec Mon Sep 17 00:00:00 2001 From: Inessa Vasilevskaya Date: Tue, 30 Aug 2022 15:58:44 +0200 Subject: [PATCH 1/5] Add some initramfs debugging basics This topic has not been covered by our docs, let's finally address this blank spot. --- docs/source/debugging.md | 19 +++++++++++++++++++ 1 file changed, 19 insertions(+) diff --git a/docs/source/debugging.md b/docs/source/debugging.md index b01d15699..56871ec8a 100644 --- a/docs/source/debugging.md +++ b/docs/source/debugging.md @@ -26,3 +26,22 @@ It's possible to go minimal and debug actor execution with remote debugger like 3. In a separate console connect to the debugger via network utility of your choice. The default port is 4444. ```nc localhost 4444``` + + +### Initramfs + +One of the biggest debugging challenges is exploring something in initamfs stage, as currently there is no network +connectivity (this might change soon though). + +1. (can be skipped if you already ended up with an emergency console) +To get access to the emergency console right after leapp execution in initramfs stage has finished you should add an +`rd.break=leapp-upgrade` argument to the kernel commandline. One way to do this is by changing the code of the +[addupgradebootentry actor](https://github.com/oamg/leapp-repository/blob/master/repos/system_upgrade/common/actors/addupgradebootentry/libraries/addupgradebootentry.py#L23) + +2. (can be skipped if you don't need any extra binaries) [TBD] Information on how to include additional binaries into +the initramfs + +3. To get access to the common binaries change `PATH` accordingly. Setting +`PATH="$PATH:$PATH:/sysroot/bin:/sysroot/sbin:/sysroot/usr/bin"` should do the trick. + +4. [TBD] Put info how to collect the logs From 3cb7a6a13e5fea6b6935eb24372e16a69220ca11 Mon Sep 17 00:00:00 2001 From: Inessa Vasilevskaya Date: Wed, 31 Aug 2022 11:40:17 +0200 Subject: [PATCH 2/5] [fixup] Add information about vagrant/libvirt pereference --- docs/source/debugging.md | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/docs/source/debugging.md b/docs/source/debugging.md index 56871ec8a..9d910c8cc 100644 --- a/docs/source/debugging.md +++ b/docs/source/debugging.md @@ -30,7 +30,7 @@ It's possible to go minimal and debug actor execution with remote debugger like ### Initramfs -One of the biggest debugging challenges is exploring something in initamfs stage, as currently there is no network +One of the biggest debugging challenges is exploring something in initramfs stage, as currently there is no network connectivity (this might change soon though). 1. (can be skipped if you already ended up with an emergency console) @@ -45,3 +45,6 @@ the initramfs `PATH="$PATH:$PATH:/sysroot/bin:/sysroot/sbin:/sysroot/usr/bin"` should do the trick. 4. [TBD] Put info how to collect the logs + +> **_NOTE:_** When working in initramfs stage you will need a serial console. Though openstack machines can provide +you with a novnc console, unless you need a shared dev environment consider using vagrant/libvirt. From 35ea51caa9827a9907e64770cd5baf136d8c496c Mon Sep 17 00:00:00 2001 From: Inessa Vasilevskaya Date: Thu, 1 Sep 2022 11:43:55 +0200 Subject: [PATCH 3/5] [fixup] Add chroot howto --- docs/source/debugging.md | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/docs/source/debugging.md b/docs/source/debugging.md index 9d910c8cc..130f3450a 100644 --- a/docs/source/debugging.md +++ b/docs/source/debugging.md @@ -44,7 +44,9 @@ the initramfs 3. To get access to the common binaries change `PATH` accordingly. Setting `PATH="$PATH:$PATH:/sysroot/bin:/sysroot/sbin:/sysroot/usr/bin"` should do the trick. -4. [TBD] Put info how to collect the logs +4. If the binaries are complaining about missing shared libraries, try changing root to /sysroot: `chroot /sysroot` + +5. [TBD] Put info how to collect the logs > **_NOTE:_** When working in initramfs stage you will need a serial console. Though openstack machines can provide you with a novnc console, unless you need a shared dev environment consider using vagrant/libvirt. From 54f638adbde03619f52da8d3b3566e5770ee731c Mon Sep 17 00:00:00 2001 From: Inessa Vasilevskaya Date: Mon, 5 Sep 2022 16:02:38 +0200 Subject: [PATCH 4/5] [fixup] Apply suggestions from mreznik --- docs/source/debugging.md | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/docs/source/debugging.md b/docs/source/debugging.md index 130f3450a..08f484481 100644 --- a/docs/source/debugging.md +++ b/docs/source/debugging.md @@ -43,8 +43,10 @@ the initramfs 3. To get access to the common binaries change `PATH` accordingly. Setting `PATH="$PATH:$PATH:/sysroot/bin:/sysroot/sbin:/sysroot/usr/bin"` should do the trick. +If `/sysroot` is not mounted at the time you may need to mount it manually, e.g. with `systemctl start sysroot.mount`. -4. If the binaries are complaining about missing shared libraries, try changing root to /sysroot: `chroot /sysroot` +4. If the binaries are complaining about missing shared libraries, you could either set `LD_LIBRARY_PATH` variable +to `LD_LIBRARY_PATH=/lib64:/sysroot/lib64` or change root to /sysroot: `chroot /sysroot` 5. [TBD] Put info how to collect the logs From c9b7be841b18ef644e4f3360345e397f89f24329 Mon Sep 17 00:00:00 2001 From: Inessa Vasilevskaya Date: Tue, 22 Nov 2022 14:45:51 +0100 Subject: [PATCH 5/5] [squashme] remount /sysroot --- docs/source/debugging.md | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/docs/source/debugging.md b/docs/source/debugging.md index 08f484481..0628f3ad5 100644 --- a/docs/source/debugging.md +++ b/docs/source/debugging.md @@ -42,13 +42,15 @@ To get access to the emergency console right after leapp execution in initramfs the initramfs 3. To get access to the common binaries change `PATH` accordingly. Setting -`PATH="$PATH:$PATH:/sysroot/bin:/sysroot/sbin:/sysroot/usr/bin"` should do the trick. +`PATH="$PATH:/sysroot/bin:/sysroot/sbin:/sysroot/usr/bin"` should do the trick. If `/sysroot` is not mounted at the time you may need to mount it manually, e.g. with `systemctl start sysroot.mount`. 4. If the binaries are complaining about missing shared libraries, you could either set `LD_LIBRARY_PATH` variable -to `LD_LIBRARY_PATH=/lib64:/sysroot/lib64` or change root to /sysroot: `chroot /sysroot` +to `LD_LIBRARY_PATH=/sysroot/lib64:/lib64` or change root to /sysroot: `chroot /sysroot` -5. [TBD] Put info how to collect the logs +5. If you need to make changes to files on /sysroot, make sure you remount it `mount -o remount,rw /sysroot` + +6. [TBD] Put info how to collect the logs > **_NOTE:_** When working in initramfs stage you will need a serial console. Though openstack machines can provide you with a novnc console, unless you need a shared dev environment consider using vagrant/libvirt.