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

Allow packages without files on the root partition to get reenabled #539

Open
Snowflake6 opened this issue Jan 18, 2022 · 8 comments
Open
Labels
install Installation scripts

Comments

@Snowflake6
Copy link

Upgraded from 2.10.(something) to 2.11.0.442. Used toltecctl reenable to reload everything. Output :

reMarkable: ~/ toltecctl reenable
Mounting '/home/root/.entware' over '/opt'
Created symlink /etc/systemd/system/local-fs.target.wants/opt.mount → /lib/systemd/system/opt.mount.
Downloading https://bin.entware.net/armv7sf-k3.2/Packages.gz
Updated list of available packages in /opt/var/opkg-lists/entware
Downloading https://toltec-dev.org/testing/rmall/Packages.gz
Updated list of available packages in /opt/var/opkg-lists/toltec-rmall
Downloading https://toltec-dev.org/testing/rm1/Packages.gz
Updated list of available packages in /opt/var/opkg-lists/toltec-rm1
Removing package xochitl from root...
Removing package toltec-bootstrap from root...
Removing package rm2fb-client from root...
Removing package genie from root...
Disabling genie
Failed to disable unit: Unit file genie.service does not exist.
Removing package libdlib from root...
Removing package tarnish from root...
Removing package remux from root...
Disabling remux
Failed to disable unit: Unit file remux.service does not exist.
Removing package draft from root...
Removing package remarkable-stylus from root...
Installing xochitl (0.0.0-11) to root...
Downloading https://toltec-dev.org/testing/rmall/xochitl_0.0.0-11_rmall.ipk
Installing toltec-bootstrap (0.2.1-1) to root...
Downloading https://toltec-dev.org/testing/rmall/toltec-bootstrap_0.2.1-1_rmall.ipk
Installing rm2fb-client (1:0.0.13-1) to root...
Downloading https://toltec-dev.org/testing/rm1/rm2fb-client_1_0.0.13-1_rm1.ipk
Installing genie (0.1.5-3) to root...
Downloading https://toltec-dev.org/testing/rmall/genie_0.1.5-3_rmall.ipk
Installing libdlib (19.21-2) to root...
Downloading https://toltec-dev.org/testing/rmall/libdlib_19.21-2_rmall.ipk
Installing tarnish (2.3-1) to root...
Downloading https://toltec-dev.org/testing/rmall/tarnish_2.3-1_rmall.ipk
Installing remux (0.1.14-1) to root...
Downloading https://toltec-dev.org/testing/rmall/remux_0.1.14-1_rmall.ipk
Installing draft (0.2.0-21) to root...
Downloading https://toltec-dev.org/testing/rmall/draft_0.2.0-21_rmall.ipk
Installing remarkable-stylus (0.0.3-2) to root...
Downloading https://toltec-dev.org/testing/rmall/remarkable-stylus_0.0.3-2_rmall.ipk
Configuring xochitl.
Configuring rm2fb-client.
Configuring genie.
Run 'systemctl enable genie --now' to enable genie
Configuring tarnish.
Configuring toltec-bootstrap.
Configuring remarkable-stylus.
Configuring libdlib.
Configuring remux.

Run the following command(s) to use remux as your launcher
$ systemctl enable --now remux

Configuring draft.

Run the following command(s) to use draft as your launcher
$ systemctl enable --now draft

Collected errors:
 * pkg_run_script: package "genie" prerm script returned status 1.
 * pkg_run_script: package "remux" prerm script returned status 1.
reMarkable: ~/

No mention of ddvk-hacks in the log.

To resolve, only needed to remove and re-install ddvk-hacks and all is well.

However, I have remarkable-stylus installed and when I tried to remove ddvk-hacks it errored out because remarkable-stylus was a dependency. So I removed remarkable-stylus, then ddvk-hacks, then re-installed ddvk-hacks, and then remarkable-stylus.

@mariusdkm
Copy link

I had the exact same case.
I updated from 2.10.(something) to 2.11.0.442.
I tried running toltecctl reenable again, but that did nothing
So, to re enable ddvk-hacks, I did the same steps (remove and re-install)

@matteodelabre matteodelabre added bug Something isn't working install Installation scripts labels Feb 21, 2022
@matteodelabre matteodelabre removed the bug Something isn't working label Mar 14, 2022
@matteodelabre matteodelabre changed the title toltecctl reenable did not restart ddvk-hacks Allow packages without files on the root partition to get reenabled Mar 14, 2022
@matteodelabre
Copy link
Member

As the saying goes, it’s not a bug, it’s a feature of the reenable script, which only reinstalls packages which have files on the root partition. The ddvk-hacks package does not install packages outside of /opt.

To fix this issue, we need to extend the reenable script to allow packages without files on the root partition to get reinstalled. @Eeems suggested on Discord that we could install scripts to some special directory (e.g., /opt/etc/toltecctl.d) that the packages want to get executed on reenable.

@Eeems
Copy link
Member

Eeems commented Mar 14, 2022

@matteodelabre it might be a good idea to implement this keeping #251 in mind?

@Eeems
Copy link
Member

Eeems commented Aug 18, 2023

The hacky solution for now is to put an empty file on the root partition inside /usr/share/toltec/reenable.d/ named after the package.

@Snowflake6
Copy link
Author

I wonder if some combination of a "list installed" command piped to a command to create files based on each line of that list would be scriptable to make it even easier...

@Eeems
Copy link
Member

Eeems commented Aug 18, 2023

I wonder if some combination of a "list installed" command piped to a command to create files based on each line of that list would be scriptable to make it even easier...

That wouldn't run the install scripts though, which are required to make sure that services get enabled etc. This is why we pipe the list of installed packages, and then filter down to the ones with files on root and reinstall them. It might be worth just running the configure step for every single package, but I'm not sure how easy it is to do that with the correct environment set.

@Snowflake6
Copy link
Author

I think that makes sense. Is there a way to figure out what packages are installed that don't have files on root, so I could add the placeholders to the right folder?

@Eeems
Copy link
Member

Eeems commented Aug 18, 2023

You would just need to invert the logic used to find the ones that have files on the root partition, found here:

while read -r inst_line; do
pkgname="$(echo "$inst_line" | awk '{ print $1 }')"
if opkg files "$pkgname" | grep -v -e "/home/root" -e "$toltec_dest" \
-e "is installed on root" -q; then
on_root_packages[$pkgname]=1
fi
done < <(opkg list-installed)

Adding placeholders to the folder will not do anything unless it's part of the package though, as this logic does not check the folder directly, it only works as it's on the root partition, so when listing files for the package we detect that it's installed on the root partition.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
install Installation scripts
Projects
None yet
Development

No branches or pull requests

4 participants