Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

toltec-base: Disable [email protected] #806

Merged
merged 10 commits into from
Jan 13, 2024

Conversation

gbyl
Copy link

@gbyl gbyl commented Dec 27, 2023

Disable [email protected] in rM1 to avoid the following errors on boot:

systemd[1]: [email protected]: Bound to unit sys-subsystem-net-devices-usb1.device, but unit isn't active.
systemd[1]: Dependency failed for ifplugd on usb1.
systemd[1]: [email protected]: Job [email protected]/start failed with result 'dependency'.

Discussed in #803 (comment)

@gbyl gbyl force-pushed the disable/busybox-ifplugd@usb1 branch from 8d78ff2 to f00f574 Compare December 27, 2023 16:18
Copy link
Member

@Eeems Eeems left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The version number and timestamp for the package need to be updated as well, otherwise it will not be built, and opkg will not detect this as an update.

package/toltec-base/package Outdated Show resolved Hide resolved
package/toltec-base/package Outdated Show resolved Hide resolved
package/toltec-base/package Outdated Show resolved Hide resolved
package/toltec-base/package Outdated Show resolved Hide resolved
@Eeems
Copy link
Member

Eeems commented Dec 27, 2023

Am I correct in assuming that you added systemctl to everything because you were testing with toltecmk? Toltecmk currently doesn't support install-lib or any of the other toltec specific parsing (toltec-dev/build#29). I have an open PR to add them to toltecmk that you can use the build from if you wish: toltec-dev/build#39

@Eeems Eeems added the packages Add or improve packages of the repository label Dec 27, 2023
@gbyl
Copy link
Author

gbyl commented Dec 27, 2023

Thank you for the review! To be honest, I was not aware of these custom methods. I naively tried them in an interactive shell and they failed. That's why I appended the command name.

To check the postremove() method, I ran systemctl unmask sys-subsystem-net-devices-usb1.device on its own and it outright deleted the file. Is that expected?

@Eeems
Copy link
Member

Eeems commented Dec 27, 2023

To check the postremove() method, I ran systemctl unmask sys-subsystem-net-devices-usb1.device on its own and it outright deleted the file. Is that expected?

I would expect it to remove the symlink to /dev/null that masking would have created.

@Eeems Eeems self-requested a review December 27, 2023 23:22
@gbyl
Copy link
Author

gbyl commented Dec 28, 2023

I thought it was odd too, since Toltec installs are supposed to be 100% reversible. I am not able to re-test this without reflashing. Could you make a backup of that file and test unmasking on your device?

@Eeems
Copy link
Member

Eeems commented Dec 28, 2023

I thought it was odd too, since Toltec installs are supposed to be 100% reversible. I am not able to re-test this without reflashing. Could you make a backup of that file and test unmasking on your device?

Since it's a *.device, it probably is a dynamically created file on boot. Does a systemctl daemon-reload recreate the unit for you? If not, how about a reboot? From a quick skim of an update file, I don't see a specific unit for the device.

@gbyl
Copy link
Author

gbyl commented Dec 28, 2023

I tried both and find / -name *.device confirms that it did not come back. The unmasking command definitely removed it. I think we are running into something similar to this: https://unix.stackexchange.com/a/611152

@Eeems
Copy link
Member

Eeems commented Dec 28, 2023

I tried both and find / -name *.device confirms that it did not come back. The unmasking command definitely removed it. I think we are running into something similar to this: https://unix.stackexchange.com/a/611152

Device files are native to systemd and automatically generated. The files do not exist on the device. Masking one will create a symlink to /dev/null and store that in /etc/systemd/system. Unmasking will remove the symlink, and thus reenable the built in unit.

What does systemctl status sys-subsystem-net-devices-usb1.device return for you?

@gbyl
Copy link
Author

gbyl commented Dec 28, 2023

$ systemctl status sys-subsystem-net-devices-usb1.device
● sys-subsystem-net-devices-usb1.device - /sys/subsystem/net/devices/usb1
     Loaded: loaded
     Active: inactive (dead)
$ systemctl enable sys-subsystem-net-devices-usb1.device
Failed to enable unit: Unit file sys-subsystem-net-devices-usb1.device does not exist.

@Eeems
Copy link
Member

Eeems commented Dec 28, 2023

$ systemctl status sys-subsystem-net-devices-usb1.device
● sys-subsystem-net-devices-usb1.device - /sys/subsystem/net/devices/usb1
     Loaded: loaded
     Active: inactive (dead)
$ systemctl enable sys-subsystem-net-devices-usb1.device
Failed to enable unit: Unit file sys-subsystem-net-devices-usb1.device does not exist.

As this is a device file, you don't enable it, it's just enabled by default, you should be able to start the unit. I would recommend not blocking while starting it, though:

systemctl start --no-block sys-subsystem-net-devices-usb1.device

@gbyl
Copy link
Author

gbyl commented Dec 28, 2023

Unfortunately, I got the same result. The start command did not report an error, but the status remains the same.

@Eeems
Copy link
Member

Eeems commented Dec 28, 2023

Unfortunately, I got the same result. The start command did not report an error, but the status remains the same.

And this is after you've also rebooted your device?

@gbyl
Copy link
Author

gbyl commented Dec 28, 2023

That's right. I'm hoping it's only something local to my device from too much poking around. If you are not able to reproduce this, we can safely assume that, and resume the review of this PR

@Eeems
Copy link
Member

Eeems commented Dec 28, 2023

That's right. I'm hoping it's only something local to my device from too much poking around. If you are not able to reproduce this, we can safely assume that, and resume the review of this PR

I'd like to make sure this is working as expected before merging. I haven't tested this package yet on my device as I've been busy with other things.

What happens if you reload udev? udevadm control --reload-rules && udevadm trigger

@gbyl
Copy link
Author

gbyl commented Dec 29, 2023

No worries. I ran that command and got no output. The status remains the same too. I'm not sure how to troubleshoot further without a reflash to better emulate the experience of the average Toltec user.

@Eeems
Copy link
Member

Eeems commented Dec 29, 2023

No worries. I ran that command and got no output. The status remains the same too. I'm not sure how to troubleshoot further without a reflash to better emulate the experience of the average Toltec user.

You can use codexctl to install specific OS versions easily. From there you can just reenable toltec and be back where you were. Minus any manual changes to the root partition you made.

@gbyl
Copy link
Author

gbyl commented Dec 29, 2023

Excellent. I can confirm it works fine on a fresh install:

$ systemctl status sys-subsystem-net-devices-usb1.device
● sys-subsystem-net-devices-usb1.device - /sys/subsystem/net/devices/usb1
     Loaded: loaded
     Active: inactive (dead)

systemd[1]: sys-subsystem-net-devices-usb1.device: Job sys-subsystem-net-devices-usb1.device/start timed out.
systemd[1]: Timed out waiting for device /sys/subsystem/net/devices/usb1.
systemd[1]: sys-subsystem-net-devices-usb1.device: Job sys-subsystem-net-devices-usb1.device/start failed with result 'timeout'.

Then manually replaying the steps Toltec goes through:

$ systemctl mask sys-subsystem-net-devices-usb1.device
Created symlink /etc/systemd/system/sys-subsystem-net-devices-usb1.device → /dev/null.
$ systemctl unmask sys-subsystem-net-devices-usb1.device
Removed /etc/systemd/system/sys-subsystem-net-devices-usb1.device.

Despite the "removed" message, this time it does come back on the next reboot as expected.

@Eeems
Copy link
Member

Eeems commented Dec 29, 2023

Despite the "removed" message, this time it does come back on the next reboot as expected.

If you look closely at the message produced by the systemctl mask command you'll see that the file being removed by unmask was actually just a symlink to /dev/null. So it's not actually removing the unit file, just the symlink used to instruct systemd that it's masked.

I'm not entirely sure what was happening for you previously, as unmasking it should have been enough for systemd to just automatically start seeing it again. Since this is a device, and not a normal unit file.

@gbyl
Copy link
Author

gbyl commented Dec 29, 2023

Agreed. That makes perfect sense now. Is there anything else that should be changed in this PR?

@Eeems
Copy link
Member

Eeems commented Dec 29, 2023

I'll let you know when I get around to testing it :)

Copy link
Member

@Eeems Eeems left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Tested and works fine on my rM1, someone will need to retest this on a rM2

@Eeems
Copy link
Member

Eeems commented Jan 13, 2024

Tested on my new rM2 and it works 😎

@Eeems Eeems merged commit 21f43f0 into toltec-dev:testing Jan 13, 2024
3 checks passed
@gbyl gbyl deleted the disable/busybox-ifplugd@usb1 branch January 13, 2024 04:48
Eeems added a commit that referenced this pull request Jan 28, 2024
* toltec-base: disable [email protected]

---------

Co-authored-by: gbyl <[email protected]>
Co-authored-by: Nathaniel van Diepen <[email protected]>
Eeems added a commit that referenced this pull request May 21, 2024
### New Packages
- `move-logs-to-opt` - 0.0.1-1 (#821)
  - Move log files to `/opt` to avoid filling up the root partition.
- `oxide-extra` and `liboxide-dev` - 2.7-3 (#760)

### Updated Packages
- `folly` - 0.0.1-4 (#823)
- `koreader` - 2024.01-1 (#826)
- `linux-stracciatella` - 5.4.70.4-1 (#808)
- `oxide`,  `oxide-utils`, `inject_evdev`, and `liboxide` - 2.7-3 (#760)
- `puzzles` - 0.2.4-4 (#785)
- `rm2-suspend-fix` - 0.0.0-3 (#821)
- `genie` - 0.1.7-1 (#825)
- `harmony` - 0.2.3-1 (#825)
- `iago` - 0.1.2-1 (#825)
- `remux` - 0.3.0-1 (#825)
- `simple` - 0.2.1-1 (#825)
- `tilem` - 0.1.1-1 (#764)
- `toltec-base` - 1.3-1 (#806)
- `yaft` - 0.1.1 (#763)
- `zoneinfo-utils` - 2023c-1 (#702)
- `rmfakecloud-proxy` - 0.0.3-5 (#757 #831)

### Packages removed
- `erode`, `tarnish`, `decay`, and `corrupt`
  - Replaced by `oxide`
- `fret`, and `anxiety`
  - Replaced by `oxide-extra`
- `rot`
  - Replaced by `oxide-utils`
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
packages Add or improve packages of the repository
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants