SlideShare a Scribd company logo
Debugging YaST Scripts
Tips for debugging YaST modules
Ladislav Slezák
Ing.
© Novell Inc. All rights reserved2
Debugger in YaST
There is no debugger in YaST
There was a simple debugger in the past...
So how to debug a YaST script?
© Novell Inc. All rights reserved3
Debugging YaST
Use y2log (/var/log/YaST2/y2log)
• Put y2milestone() wherever it may be useful
• Use y2debug() – not logged by default, for details potentially needed
• Use y2internal() for testing, remove or change it to y2debug later
Use 'showy2log' colorizer
• Command: y2tool showy2log -v -- tail -f
• Displays y2log in colors depending on the log level (errors in red...)
• Formats YCP structures (lists, maps) – more readable output
• Open a separate terminal window with it
© Novell Inc. All rights reserved4
More verbose logging
Enabling debug messages
Set variable Y2DEBUG=1 (ZYPP_FULLLOG=1)
Press Shift+F7 in the Qt UI (dynamic switching on/off
decreases useless output)
Another shortcut
Shift+Ctrl+Alt+X in Qt UI opens an xterm window
with shell.
(That's useful when debugging the installer running from the installation medium, in a running system it
does not make much sense, a terminal can be opened manually very easily.)
© Novell Inc. All rights reserved5
Debugging in YCP
Logging an YCP Backtrace
Use -1 as the first parameter in y2loglevel() call
y2internal(-1, “Backtrace:”);
2007-10-10 15:21:54 <5> cyclops(14553) [YCP] sound/read_routines.ycp:51 Backtrace:
2007-10-10 15:21:54 <5> cyclops(14553) [YCP] sound/read_routines.ycp:157 extractUniqueKey (comment)
2007-10-10 15:21:54 <5> cyclops(14553) [YCP] sound/read_routines.ycp:224 read_modprobe (.modprobe_sound)
2007-10-10 15:21:54 <5> cyclops(14553) [YCP] Sound.ycp:516 read_save_info ()
2007-10-10 15:21:54 <5> cyclops(14553) [YCP] Sound.ycp:710 Sound::ReadModulesConf ()
2007-10-10 15:21:54 <5> cyclops(14553) [YCP] sound/wizards.ycp:262 Sound::Read (true)
2007-10-10 15:21:54 <5> cyclops(14553) [YCP] clients/sound.ycp:588 CommandLine::Run (cmdline)
Breakpoints
Use e.g. Popup::Message() calls
Do not forget to remove them! (svn diff)
© Novell Inc. All rights reserved6
Modifying Installation System
Use /y2update for overriding the current files
YCP interpreter looks the files up in /y2update, $Y2DIR, $HOME/.yast2
and in $PREFIX (/usr)
Create e.g. /y2update/clients, copy the file from /usr there, don't
forget to compile YCP modules (ycpc -c)
Works also for non YCP parts (agents, package-bindings...), very convenient
for debugging YCP clients (clients are reloaded when executed)
Use start_shell=1 boot option to modify the system before start
© Novell Inc. All rights reserved7
Modifying Installation System
Use mount for overlaying the files
Mount with -o option can be used for overriding the original files:
mount -o bind /tmp/foo.ycp /usr/share/YaST2/clients/foo.ycp
Modifying the installation system (inst-sys)
Use Driver Update
See dud Linuxrc option, basically any RPM can be added to the installation
system
Create an addon-product
Similar to y2update
Also for adding packages to the inst-sys
© Novell Inc. All rights reserved8
Debugging YaST Agents
For interactive debugging run
/usr/lib/YaST2/bin/y2base stdio scr
Use `Read(.path), `Write(.path,...),
`Execute(.path,...), `Dir(.path) commands
instead of e.g. SCR::Read() in YCP script
Note: rlwrap (readline wrapper) provides easy editing with history for any
command line tool, use it this way:
rlwrap /usr/lib/YaST2/bin/y2base stdio scr
© Novell Inc. All rights reserved9
Debugging a crash
Crash – usually SIGSEGV (11), SIGABORT (6), see y2log
Backtrace – probably the most valuable information,
tells the exact location of the crash and program stack
When YaST crashes it saves the backtrace to
/var/log/YaST2/signal file.
Use c++filt tool for converting the internal C++ symbols to
a readable form:
cat /var/log/YaST2/signal | c++filt
(Note: The backtrace is created by a standard glibc function, it is not YaST specific.)
© Novell Inc. All rights reserved10
Debugging a crash
GNU gdb can be also used debugging YaST
*-debuginfo packages are required for full debug output
How to get a backtrace?
Start YaST in gdb debugger
gdb /usr/lib/YaST2/bin/y2base
run <module> qt
Attach gdb to running YaST
gdb /usr/lib/YaST2/bin/y2base <PID>
Reproduce the crash
Use 'bt' command in gdb
See http://en.opensuse.org/Bugs/YaST for more details
© Novell Inc. All rights reserved11
UI Debugging
Debugging functions
UI::DumpWidgetTree() - dumps UI tree to y2log
UI::FakeUserInput() - simulates user input (clicking buttons)
© Novell Inc. All rights reserved12
Questions?
Do you have another tip for debugging?
YaST Debugging

More Related Content

What's hot (20)

PDF
bcc/BPF tools - Strategy, current tools, future challenges
IO Visor Project
 
PDF
Kernel Recipes 2018 - KernelShark 1.0; What's new and what's coming - Steven ...
Anne Nicolas
 
PDF
Ha opensuse
Kenny (netman)
 
PDF
Kernel crashdump
Adrien Mahieux
 
PDF
Kernel Recipes 2017: Performance Analysis with BPF
Brendan Gregg
 
PDF
Specializing the Data Path - Hooking into the Linux Network Stack
Kernel TLV
 
PPTX
“Linux Kernel CPU Hotplug in the Multicore System”
GlobalLogic Ukraine
 
PDF
Linux Kernel Debugging Essentials workshop
Lubomir Rintel
 
PDF
Performance Analysis Tools for Linux Kernel
lcplcp1
 
PDF
Linux fundamental - Chap 12 Hardware Management
Kenny (netman)
 
PDF
Performance Wins with BPF: Getting Started
Brendan Gregg
 
ODP
Linux kernel debugging(ODP format)
yang firo
 
PDF
Kernel development
Nuno Martins
 
PDF
LSFMM 2019 BPF Observability
Brendan Gregg
 
PDF
UM2019 Extended BPF: A New Type of Software
Brendan Gregg
 
PDF
Davide Berardi - Linux hardening and security measures against Memory corruption
linuxlab_conf
 
ODP
Linux kernel tracing superpowers in the cloud
Andrea Righi
 
PDF
Embedded Recipes 2018 - Finding sources of Latency In your system - Steven Ro...
Anne Nicolas
 
PPTX
“Automation Testing for Embedded Systems”
GlobalLogic Ukraine
 
PDF
BPF Tools 2017
Brendan Gregg
 
bcc/BPF tools - Strategy, current tools, future challenges
IO Visor Project
 
Kernel Recipes 2018 - KernelShark 1.0; What's new and what's coming - Steven ...
Anne Nicolas
 
Ha opensuse
Kenny (netman)
 
Kernel crashdump
Adrien Mahieux
 
Kernel Recipes 2017: Performance Analysis with BPF
Brendan Gregg
 
Specializing the Data Path - Hooking into the Linux Network Stack
Kernel TLV
 
“Linux Kernel CPU Hotplug in the Multicore System”
GlobalLogic Ukraine
 
Linux Kernel Debugging Essentials workshop
Lubomir Rintel
 
Performance Analysis Tools for Linux Kernel
lcplcp1
 
Linux fundamental - Chap 12 Hardware Management
Kenny (netman)
 
Performance Wins with BPF: Getting Started
Brendan Gregg
 
Linux kernel debugging(ODP format)
yang firo
 
Kernel development
Nuno Martins
 
LSFMM 2019 BPF Observability
Brendan Gregg
 
UM2019 Extended BPF: A New Type of Software
Brendan Gregg
 
Davide Berardi - Linux hardening and security measures against Memory corruption
linuxlab_conf
 
Linux kernel tracing superpowers in the cloud
Andrea Righi
 
Embedded Recipes 2018 - Finding sources of Latency In your system - Steven Ro...
Anne Nicolas
 
“Automation Testing for Embedded Systems”
GlobalLogic Ukraine
 
BPF Tools 2017
Brendan Gregg
 

Similar to YaST Debugging (20)

PDF
NIR on the Mesa i965 backend (FOSDEM 2016)
Igalia
 
PDF
App container rkt
Xiaofeng Guo
 
PDF
Slackware Demystified [SELF 2011]
Vincent Batts
 
PDF
Embedded Graphics Drivers in Mesa (ELCE 2019)
Igalia
 
PDF
Kqueue : Generic Event notification
Mahendra M
 
PPT
Swug July 2010 - windows debugging by sainath
Dennis Chung
 
PDF
Linux seccomp(2) vs OpenBSD pledge(2)
Giovanni Bechis
 
PDF
Diving into SWUpdate: adding new platform support in 30minutes with Yocto/OE !
Pierre-jean Texier
 
PPTX
NTTドコモ様 導入事例 OpenStack Summit 2015 Tokyo 講演「After One year of OpenStack Cloud...
VirtualTech Japan Inc.
 
PPTX
Examining Oracle GoldenGate Trail Files
Bobby Curtis
 
PPTX
Dpdk applications
Vipin Varghese
 
PPTX
hacking-embedded-devices.pptx
ssuserfcf43f
 
PPT
[CCC-28c3] Post Memory Corruption Memory Analysis
Moabi.com
 
PDF
Android Boot Time Optimization
Kan-Ru Chen
 
PDF
Lecture 6 Kernel Debugging + Ports Development
Mohammed Farrag
 
PDF
You're Off the Hook: Blinding Security Software
Cylance
 
PDF
Crash_Report_Mechanism_In_Tizen
Lex Yu
 
PDF
Varnish http accelerator
no no
 
PPT
Vpu technology &gpgpu computing
Arka Ghosh
 
PDF
LibOS as a regression test framework for Linux networking #netdev1.1
Hajime Tazaki
 
NIR on the Mesa i965 backend (FOSDEM 2016)
Igalia
 
App container rkt
Xiaofeng Guo
 
Slackware Demystified [SELF 2011]
Vincent Batts
 
Embedded Graphics Drivers in Mesa (ELCE 2019)
Igalia
 
Kqueue : Generic Event notification
Mahendra M
 
Swug July 2010 - windows debugging by sainath
Dennis Chung
 
Linux seccomp(2) vs OpenBSD pledge(2)
Giovanni Bechis
 
Diving into SWUpdate: adding new platform support in 30minutes with Yocto/OE !
Pierre-jean Texier
 
NTTドコモ様 導入事例 OpenStack Summit 2015 Tokyo 講演「After One year of OpenStack Cloud...
VirtualTech Japan Inc.
 
Examining Oracle GoldenGate Trail Files
Bobby Curtis
 
Dpdk applications
Vipin Varghese
 
hacking-embedded-devices.pptx
ssuserfcf43f
 
[CCC-28c3] Post Memory Corruption Memory Analysis
Moabi.com
 
Android Boot Time Optimization
Kan-Ru Chen
 
Lecture 6 Kernel Debugging + Ports Development
Mohammed Farrag
 
You're Off the Hook: Blinding Security Software
Cylance
 
Crash_Report_Mechanism_In_Tizen
Lex Yu
 
Varnish http accelerator
no no
 
Vpu technology &gpgpu computing
Arka Ghosh
 
LibOS as a regression test framework for Linux networking #netdev1.1
Hajime Tazaki
 
Ad

More from lslezak (7)

PDF
openSUSE Conference 2017 - YaST News
lslezak
 
ODP
openSUSE Conference 2017 - The Docker at Travis Presentation
lslezak
 
ODP
openSUSE Conference 2017 - The Atom Presentation
lslezak
 
ODP
Integrating the Ruby Debugger into YaST
lslezak
 
ODP
WebYaST (openSUSE conference 2010)
lslezak
 
ODP
DBus PolicyKit and YaST
lslezak
 
ODP
WebYaST presentation at LinuxTag 2010
lslezak
 
openSUSE Conference 2017 - YaST News
lslezak
 
openSUSE Conference 2017 - The Docker at Travis Presentation
lslezak
 
openSUSE Conference 2017 - The Atom Presentation
lslezak
 
Integrating the Ruby Debugger into YaST
lslezak
 
WebYaST (openSUSE conference 2010)
lslezak
 
DBus PolicyKit and YaST
lslezak
 
WebYaST presentation at LinuxTag 2010
lslezak
 
Ad

Recently uploaded (20)

PDF
DevBcn - Building 10x Organizations Using Modern Productivity Metrics
Justin Reock
 
PDF
Fl Studio 24.2.2 Build 4597 Crack for Windows Free Download 2025
faizk77g
 
PDF
Human-centred design in online workplace learning and relationship to engagem...
Tracy Tang
 
PDF
Achieving Consistent and Reliable AI Code Generation - Medusa AI
medusaaico
 
PDF
New from BookNet Canada for 2025: BNC BiblioShare - Tech Forum 2025
BookNet Canada
 
PDF
Building Real-Time Digital Twins with IBM Maximo & ArcGIS Indoors
Safe Software
 
PPTX
Building Search Using OpenSearch: Limitations and Workarounds
Sease
 
PDF
Persuasive AI: risks and opportunities in the age of digital debate
Speck&Tech
 
PDF
Exolore The Essential AI Tools in 2025.pdf
Srinivasan M
 
PDF
Empower Inclusion Through Accessible Java Applications
Ana-Maria Mihalceanu
 
PDF
SWEBOK Guide and Software Services Engineering Education
Hironori Washizaki
 
PDF
Windsurf Meetup Ottawa 2025-07-12 - Planning Mode at Reliza.pdf
Pavel Shukhman
 
PDF
Impact of IEEE Computer Society in Advancing Emerging Technologies including ...
Hironori Washizaki
 
PDF
HCIP-Data Center Facility Deployment V2.0 Training Material (Without Remarks ...
mcastillo49
 
PPTX
UiPath Academic Alliance Educator Panels: Session 2 - Business Analyst Content
DianaGray10
 
PPTX
AUTOMATION AND ROBOTICS IN PHARMA INDUSTRY.pptx
sameeraaabegumm
 
PDF
CIFDAQ Weekly Market Wrap for 11th July 2025
CIFDAQ
 
PDF
Predicting the unpredictable: re-engineering recommendation algorithms for fr...
Speck&Tech
 
PDF
Blockchain Transactions Explained For Everyone
CIFDAQ
 
PDF
Transcript: New from BookNet Canada for 2025: BNC BiblioShare - Tech Forum 2025
BookNet Canada
 
DevBcn - Building 10x Organizations Using Modern Productivity Metrics
Justin Reock
 
Fl Studio 24.2.2 Build 4597 Crack for Windows Free Download 2025
faizk77g
 
Human-centred design in online workplace learning and relationship to engagem...
Tracy Tang
 
Achieving Consistent and Reliable AI Code Generation - Medusa AI
medusaaico
 
New from BookNet Canada for 2025: BNC BiblioShare - Tech Forum 2025
BookNet Canada
 
Building Real-Time Digital Twins with IBM Maximo & ArcGIS Indoors
Safe Software
 
Building Search Using OpenSearch: Limitations and Workarounds
Sease
 
Persuasive AI: risks and opportunities in the age of digital debate
Speck&Tech
 
Exolore The Essential AI Tools in 2025.pdf
Srinivasan M
 
Empower Inclusion Through Accessible Java Applications
Ana-Maria Mihalceanu
 
SWEBOK Guide and Software Services Engineering Education
Hironori Washizaki
 
Windsurf Meetup Ottawa 2025-07-12 - Planning Mode at Reliza.pdf
Pavel Shukhman
 
Impact of IEEE Computer Society in Advancing Emerging Technologies including ...
Hironori Washizaki
 
HCIP-Data Center Facility Deployment V2.0 Training Material (Without Remarks ...
mcastillo49
 
UiPath Academic Alliance Educator Panels: Session 2 - Business Analyst Content
DianaGray10
 
AUTOMATION AND ROBOTICS IN PHARMA INDUSTRY.pptx
sameeraaabegumm
 
CIFDAQ Weekly Market Wrap for 11th July 2025
CIFDAQ
 
Predicting the unpredictable: re-engineering recommendation algorithms for fr...
Speck&Tech
 
Blockchain Transactions Explained For Everyone
CIFDAQ
 
Transcript: New from BookNet Canada for 2025: BNC BiblioShare - Tech Forum 2025
BookNet Canada
 

YaST Debugging

  • 1. Debugging YaST Scripts Tips for debugging YaST modules Ladislav Slezák Ing.
  • 2. © Novell Inc. All rights reserved2 Debugger in YaST There is no debugger in YaST There was a simple debugger in the past... So how to debug a YaST script?
  • 3. © Novell Inc. All rights reserved3 Debugging YaST Use y2log (/var/log/YaST2/y2log) • Put y2milestone() wherever it may be useful • Use y2debug() – not logged by default, for details potentially needed • Use y2internal() for testing, remove or change it to y2debug later Use 'showy2log' colorizer • Command: y2tool showy2log -v -- tail -f • Displays y2log in colors depending on the log level (errors in red...) • Formats YCP structures (lists, maps) – more readable output • Open a separate terminal window with it
  • 4. © Novell Inc. All rights reserved4 More verbose logging Enabling debug messages Set variable Y2DEBUG=1 (ZYPP_FULLLOG=1) Press Shift+F7 in the Qt UI (dynamic switching on/off decreases useless output) Another shortcut Shift+Ctrl+Alt+X in Qt UI opens an xterm window with shell. (That's useful when debugging the installer running from the installation medium, in a running system it does not make much sense, a terminal can be opened manually very easily.)
  • 5. © Novell Inc. All rights reserved5 Debugging in YCP Logging an YCP Backtrace Use -1 as the first parameter in y2loglevel() call y2internal(-1, “Backtrace:”); 2007-10-10 15:21:54 <5> cyclops(14553) [YCP] sound/read_routines.ycp:51 Backtrace: 2007-10-10 15:21:54 <5> cyclops(14553) [YCP] sound/read_routines.ycp:157 extractUniqueKey (comment) 2007-10-10 15:21:54 <5> cyclops(14553) [YCP] sound/read_routines.ycp:224 read_modprobe (.modprobe_sound) 2007-10-10 15:21:54 <5> cyclops(14553) [YCP] Sound.ycp:516 read_save_info () 2007-10-10 15:21:54 <5> cyclops(14553) [YCP] Sound.ycp:710 Sound::ReadModulesConf () 2007-10-10 15:21:54 <5> cyclops(14553) [YCP] sound/wizards.ycp:262 Sound::Read (true) 2007-10-10 15:21:54 <5> cyclops(14553) [YCP] clients/sound.ycp:588 CommandLine::Run (cmdline) Breakpoints Use e.g. Popup::Message() calls Do not forget to remove them! (svn diff)
  • 6. © Novell Inc. All rights reserved6 Modifying Installation System Use /y2update for overriding the current files YCP interpreter looks the files up in /y2update, $Y2DIR, $HOME/.yast2 and in $PREFIX (/usr) Create e.g. /y2update/clients, copy the file from /usr there, don't forget to compile YCP modules (ycpc -c) Works also for non YCP parts (agents, package-bindings...), very convenient for debugging YCP clients (clients are reloaded when executed) Use start_shell=1 boot option to modify the system before start
  • 7. © Novell Inc. All rights reserved7 Modifying Installation System Use mount for overlaying the files Mount with -o option can be used for overriding the original files: mount -o bind /tmp/foo.ycp /usr/share/YaST2/clients/foo.ycp Modifying the installation system (inst-sys) Use Driver Update See dud Linuxrc option, basically any RPM can be added to the installation system Create an addon-product Similar to y2update Also for adding packages to the inst-sys
  • 8. © Novell Inc. All rights reserved8 Debugging YaST Agents For interactive debugging run /usr/lib/YaST2/bin/y2base stdio scr Use `Read(.path), `Write(.path,...), `Execute(.path,...), `Dir(.path) commands instead of e.g. SCR::Read() in YCP script Note: rlwrap (readline wrapper) provides easy editing with history for any command line tool, use it this way: rlwrap /usr/lib/YaST2/bin/y2base stdio scr
  • 9. © Novell Inc. All rights reserved9 Debugging a crash Crash – usually SIGSEGV (11), SIGABORT (6), see y2log Backtrace – probably the most valuable information, tells the exact location of the crash and program stack When YaST crashes it saves the backtrace to /var/log/YaST2/signal file. Use c++filt tool for converting the internal C++ symbols to a readable form: cat /var/log/YaST2/signal | c++filt (Note: The backtrace is created by a standard glibc function, it is not YaST specific.)
  • 10. © Novell Inc. All rights reserved10 Debugging a crash GNU gdb can be also used debugging YaST *-debuginfo packages are required for full debug output How to get a backtrace? Start YaST in gdb debugger gdb /usr/lib/YaST2/bin/y2base run <module> qt Attach gdb to running YaST gdb /usr/lib/YaST2/bin/y2base <PID> Reproduce the crash Use 'bt' command in gdb See http://en.opensuse.org/Bugs/YaST for more details
  • 11. © Novell Inc. All rights reserved11 UI Debugging Debugging functions UI::DumpWidgetTree() - dumps UI tree to y2log UI::FakeUserInput() - simulates user input (clicking buttons)
  • 12. © Novell Inc. All rights reserved12 Questions? Do you have another tip for debugging?