Skip to content
This repository has been archived by the owner. It is now read-only.

Add framebuffer debugging tools to debug-shell initramfs hook #1188

Closed
ollieparanoid opened this Issue Jan 31, 2018 · 9 comments

Comments

Projects
None yet
3 participants
@ollieparanoid
Copy link
Member

commented Jan 31, 2018

We would need to support adding files in initramfs hooks first. When that is done, we could add the following to the debug-shell hook:

@MayeulC

This comment has been minimized.

Copy link
Contributor

commented Jan 31, 2018

Maybe a script that finds every brightness in /sys, and set it to brightness_max? I don't know whether it would be useful to have that, as compared to manual testing. Plus it could turn on the flashlight. But maybe we could add an interactive approach (or even a menu) that tries different things?

@ollieparanoid

This comment has been minimized.

Copy link
Member Author

commented Jan 31, 2018

maybe we could add an interactive approach (or even a menu) that tries different things?

Just in case you have a UI on the screen in mind: we assume that the screen may not be working at this point. The user is connected via telnet and can execute debugging tools that way.

So for now I would recommend to keep the commands separate without any menu), and once we have a few tools, and good workflows for debugging, we could put that into scripts which do more hand-holding to make it easier for users.

@drebrez

This comment has been minimized.

Copy link
Member

commented Feb 1, 2018

I think adding the msm-fb-refresher into the debug-shell hook is problematic because we will need to install the package in the chroot and it will enable the service.
Instead I suggest to add a simply flag in the fbdebug tool to perform the same ioctl pan operation, it will be just few lines of code and no additional package dependencies

@ollieparanoid

This comment has been minimized.

Copy link
Member Author

commented Feb 2, 2018

Actually the service gets enabled in postmarketos-base right now (which means, postmarketos-base depends on the deviceinfo to be present for that other issue, we can't simply make the device package depend on the pmOS-base package that way, unless we change this!).

But I agree with you, we could add these few lines into fbdebug to make packaging simpler.

@drebrez

This comment has been minimized.

Copy link
Member

commented Feb 2, 2018

Ah ok, now I see it, the package only creates the service.
But I'll add the ioctl pan in fbdebug, so it will be also easier to explain in the wiki:

if fbdebug -pan(or something like that) refreshes the drawed image, then add msm-fb-refresher=true in deviceinfo

@drebrez

This comment has been minimized.

Copy link
Member

commented Feb 6, 2018

@ollieparanoid I've tried adding the fbdebug package to the dependencies of the postmarketos-mkinitfs-hook-debug-shell, but when I run pmbootstrap initfs hook_del debug-shell it doesn't uninstall the fbdebug package from the chroot.
I think we might need a file in the chroot, where the hook writes the additional files he want to add and the mkinitfs reads them.
Or do you have other ideas?

@ollieparanoid

This comment has been minimized.

Copy link
Member Author

commented Feb 7, 2018

I think we might need a file in the chroot, where the hook writes the additional files he want to add and the mkinitfs reads them.

That works, and Alpine does it the same way (they even support wildcards in the file list, which we don't really need right now):

$ apk add mkinitfs
$ cat /etc/mkinitfs/features.d/base.files
/bin/busybox
/bin/sh
/lib/mdev
/sbin/apk
/etc/modprobe.d/*.conf
/etc/mdev.conf
/sbin/nlplug-findfs

I've played with the idea at a very early state of the project to have a build() and run() function inside each hook, and the build() function would add the files to the mkinitfs while the run() function would be the one that gets executed when the hook runs in the initramfs. That approach would have the benefit of having only one file per hook.
But as it stands now, almost none of the hooks require any custom files, and we would need to refactor all existing hooks / support a second format etc.

I don't think my approach would be worth it and I would implement it like Alpine does it.

@drebrez drebrez self-assigned this Feb 19, 2018

@drebrez

This comment has been minimized.

Copy link
Member

commented Feb 24, 2018

@ollieparanoid I've tried adding the fbdebug package to the dependencies of the postmarketos-mkinitfs-hook-debug-shell again, but with the changes in the PR #1247 and when the hook is removed both the packages are removed.
What you think, should we go for the ".files" solution anyway?

@ollieparanoid

This comment has been minimized.

Copy link
Member Author

commented Feb 25, 2018

I think if we don't use the .files approach, we need to add logic to postmarketos-mkinitfs to include the fbdebug binary. But we need to add even more code for the .files apprach, and it will take us longer to test everything.

My recommendation would be doing it without the .files solution now, and maybe adding the .files idea after refactoring the initramfs code to make it easier to maintain (#1134).

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
You can’t perform that action at this time.