You are not logged in.

#1 2022-11-28 21:44:03

BogdanTheGeek
Member
Registered: 2022-11-28
Posts: 15

[SOLVED]PKGBUILD post_remove() help

Hi,

I create a package for an eclipse based IDE created by a hardware vendor and I would like to execute the eclipse uninstall script when the package gets removed.
From my understanding, the .install file is the way to do it. Not quite sure of the difference between pre_remove() and post_remove() other than the obvious.
The problem I am facing is that I can't get post_remove() to run.

Here is the relevant section in PKGBUILD:

...
install="pkg.install"
...

pkg.install:

post_remove() {
   echo "Uninstalling e2studio"
   ${HOME}/.local/share/renesas/e2_studio/uninstall/installer
}

The way I test it from the $pkgdir:

paru -Sc // remove cache
paru -Ui // build and install local package
paru -R e2studio

Apologies if this is a silly question, this is the first time creating an AUR package. I checked the wiki, other threads and other packages and couldn't figure it out.

Best,
Bogdan

Last edited by BogdanTheGeek (2022-12-14 23:40:23)

Offline

#2 2022-11-28 22:11:20

ayekat
Member
Registered: 2011-01-17
Posts: 1,589

Re: [SOLVED]PKGBUILD post_remove() help

Welcome to the forums!

First, it might help to try to answer the question: What do you expect ${HOME} to be in that moment?
Pacman installs/uninstalls packages system-wide; if you tell it to delete something in "the home directory", it cannot know whose home directory you mean, because there are potentially dozens of user accounts.

More generally, (even if there was a way for pacman to magically know whose users' files you want to delete), pacman should never touch anything in users' home directories. Files in there are purely under the respective users' control.

There is no need to delete that file anyway. If the program is gone, the files remaining there don't hurt anybody.
On the contrary, if you decide to temporarily uninstall the package, then reinstall it again, users might not be happy to see their files deleted.

Last edited by ayekat (2022-11-28 22:11:55)


pkgshackscfgblag

Offline

#3 2022-11-28 22:12:51

Slithery
Administrator
From: Norfolk, UK
Registered: 2013-12-01
Posts: 5,776

Re: [SOLVED]PKGBUILD post_remove() help

What does the uninstall script do?
It shouldn't be necessary as all files should be removed automatically by pacman when the package is uninstalled.

Can you post your PKGBUILD please.


No, it didn't "fix" anything. It just shifted the brokeness one space to the right. - jasonwryan
Closing -- for deletion; Banning -- for muppetry. - jasonwryan

aur - dotfiles

Offline

#4 2022-11-28 23:07:17

BogdanTheGeek
Member
Registered: 2022-11-28
Posts: 15

Re: [SOLVED]PKGBUILD post_remove() help

ayekat wrote:

Welcome to the forums!
First, it might help to try to answer the question: What do you expect ${HOME} to be in that moment?
Pacman installs/uninstalls packages system-wide; if you tell it to delete something in "the home directory", it cannot know whose home directory you mean, because there are potentially dozens of user accounts.

That a very good point. Would I not see an error like file not found or at least see the echo?

I am not actually sure what the uninstall script does, I would assume it removes the installation directory and maybe some toolchains.
I am not supplying the source files. The user needs to download the installation image (*.run) as the licence does not permit redistribution.

Offline

#5 2022-11-28 23:09:37

BogdanTheGeek
Member
Registered: 2022-11-28
Posts: 15

Re: [SOLVED]PKGBUILD post_remove() help

Slithery wrote:

What does the uninstall script do?
Can you post your PKGBUILD please.

Here is the link to the AUR Package:
https://aur.archlinux.org/packages/e2studio

The only difference is the line from my original post.

Last edited by BogdanTheGeek (2022-11-28 23:13:32)

Offline

#6 2022-11-28 23:16:43

Trilby
Inspector Parrot
Registered: 2011-11-29
Posts: 29,442
Website

Re: [SOLVED]PKGBUILD post_remove() help

Even if you could get pacman to do this, it would be a gaping security hole.  A script in some user's home directory that is presumably user-modifiable would be run as root by pacman with the ability to do god-knows-what to the system.  And in this case, even if the script were not modified, you still don't know what it does, but you want to give it root access to do whatever it wants?

EDIT: oh, my, there are a whole lot of other problems with that PKGBUILD.  You (try to) manipulate files under $HOME in the build function.  Your package function doesn't actually do anything, so if this were properly built in a chroot it would produce an empty package.  Built outside a chroot it may litter files across the filesystem, but none of them are tracked by pacman ... which may be why you are trying to get a post_remove script to remove content.  You also use sudo which shouldn't be used.  You look for the source files in an xdg-dir rather than just in the starting directory.  I'd also wager that this does not install a copy of the license which would be required.  You also appear to attempt to modify a library file owned by a different package (libpcre) though I don't know what either of your "install" commands are meant to do as they list an identical source and destination.

EDIT 2: FYI, I submitted a deletion request for the aur package.  In it's current state it is at best completely useless and at worse potentially harmful to anyone who attempts to use it.  Once you work out the kinks here you can resumbit it.  Note that you can always check here for feedback before submitting something to the AUR.

Last edited by Trilby (2022-11-28 23:28:59)


"UNIX is simple and coherent..." - Dennis Ritchie, "GNU's Not UNIX" -  Richard Stallman

Offline

#7 2022-11-28 23:25:47

BogdanTheGeek
Member
Registered: 2022-11-28
Posts: 15

Re: [SOLVED]PKGBUILD post_remove() help

Trilby wrote:

Even if you could get pacman to do this, it would be a gaping security hole.  A script in some user's home directory that is presumably user-modifiable would be run as root by pacman with the ability to do god-knows-what to the system.  And in this case, even if the script were not modified, you still don't know what it does, but you want to give it root access to do whatever it wants?

It was not my intention to give it root access. Just trying to come up with a way to make this software user friendly on arch, for my sake us much as others'. I am very happy that you guys take the time to see all of these issues so I can learn from them.
I am 100% sure that I'm not doing this the right way. I based my PKGBUILD on the stm32cubeide package which does a similar thing. The post_remove() idea was mine, but it looks to be a bad one.

Offline

#8 2022-11-28 23:30:33

Trilby
Inspector Parrot
Registered: 2011-11-29
Posts: 29,442
Website

Re: [SOLVED]PKGBUILD post_remove() help

Can you provide links to where we can get this from upstream and any upstream instructions for installation?


"UNIX is simple and coherent..." - Dennis Ritchie, "GNU's Not UNIX" -  Richard Stallman

Offline

#9 2022-11-28 23:31:36

BogdanTheGeek
Member
Registered: 2022-11-28
Posts: 15

Re: [SOLVED]PKGBUILD post_remove() help

Trilby wrote:

Even if you could get pacman to do this, it would be a gaping security hole.  A script in some user's home directory that is presumably user-modifiable would be run as root by pacman with the ability to do god-knows-what to the system.  And in this case, even if
EDIT: oh, my, there are a whole lot of other problems with that PKGBUILD.  You (try to) manipulate files under $HOME in the build function.  Your package function doesn't actually do anything, so if this were properly built in a chroot it would produce an empty package.  Built outside a chroot it may litter files across the filesystem, but none of them are tracked by pacman ... which may be why you are trying to get a post_remove script to remove content.  You also use sudo which shouldn't be used.  You look for the source files in an xdg-dir rather than just in the starting directory.  I'd also wager that this does not install a copy of the license which would be required.  You also appear to attempt to modify a library file owned by a different package (libpcre) though I don't know what either of your "install" commands are meant to do as they list an identical source and destination.

Totally agree with you. I started off by just trying to create some static links so that this prebuit binary would run the installer, because I couldn't find any packages that would provide them. I was getting permission errors, as expected so I tried using the install command to copy the files. for whatever reason, running install with the user and group set to root did not work, so I had to use the sudo.
Please point me to the right resources so I can fix these issues.

Offline

#10 2022-11-28 23:33:25

BogdanTheGeek
Member
Registered: 2022-11-28
Posts: 15

Re: [SOLVED]PKGBUILD post_remove() help

Trilby wrote:

EDIT 2: FYI, I submitted a deletion request for the aur package.  In it's current state it is at best completely useless and at worse potentially harmful to anyone who attempts to use it.  Once you work out the kinks here you can resumbit it.  Note that you can always check here for feedback before submitting something to the AUR.

Apologies for the issues caused. I have tested the package on a fresh VM and it worked as expected, with all the possible faults that you have mentioned.

Offline

#11 2022-11-28 23:36:02

BogdanTheGeek
Member
Registered: 2022-11-28
Posts: 15

Re: [SOLVED]PKGBUILD post_remove() help

Trilby wrote:

Can you provide links to where we can get this from upstream and any upstream instructions for installation?

Its in the upsteam url, but here it is anyway:
https://www.renesas.com/us/en/software- … o#download

It requires registration and accepting the EULA, which I believed to be sufficient cover for not including the licence as I am not distributing they software. This package only installs the requirements for their installer.

Offline

#12 2022-11-28 23:37:47

Scimmia
Fellow
Registered: 2012-09-01
Posts: 11,463

Re: [SOLVED]PKGBUILD post_remove() help

It doesn't work fine, it doesn't build a package in any way.

Files need to be installed to $pkgdir.

Last edited by Scimmia (2022-11-28 23:39:40)

Online

#13 2022-11-28 23:41:41

BogdanTheGeek
Member
Registered: 2022-11-28
Posts: 15

Re: [SOLVED]PKGBUILD post_remove() help

Scimmia wrote:

It doesn't work fine, it doesn't build a package in any way.

Ok, fair point. It installs the software though. I know, I know, terrible package, really shouldn't be a package in this state. Help me out, how can I improve it? Its my fist package, just trying to help out.

EDIT: I don't know what the installer script does, or how to extract files from it. Its not a tar-ball like the stm32cubeide, its a binary executable based on java. I'm a C embedded dev, not my cup of tea.

Last edited by BogdanTheGeek (2022-11-28 23:45:37)

Offline

#14 2022-11-28 23:53:32

Trilby
Inspector Parrot
Registered: 2011-11-29
Posts: 29,442
Website

Re: [SOLVED]PKGBUILD post_remove() help

That download link is not useful for anyone not logged in to their site.  The informational page that may be useful for others willing to help is here:
https://en-support.renesas.com/knowledgeBase/19934358

The disclaimer agreement one acknowledges to download the software is not a license.  And even if it was, knowing the user has seen it is not sufficient.  It must be included in the package.  FWIW, the actual license is here:

https://www.renesas.com/us/en/document/ … ?r=2517506

A copy of that document should be included in the built package.

But that ignores the main issue that you are trying to call this a package for the software when really even your attempts are just a package to facilitate the running of their installer which will in turn "install" the software.  If that's the case, forget it - just let users download the installer and run it themselves - the package does not facilitate this in any way.

But after jumping through all sorts of hoops and providing way more invasive information than should be necessary to register for a download (all made up in my case ... f*** em), I still am only get a download resulting in a XHTML error document.  So I can't even see what this is supposed to be.  However, in checking some of their FAQs, I did see a note that there is a debian .deb package available for the software.  If that's the case, use that and convert it via debtap.  There are examples of doing this in the AUR.

BogdanTheGeek wrote:

I'm a C embedded dev, not my cup of tea.

But surely you know how to walk, even if the floor is new to you.

Last edited by Trilby (2022-11-28 23:58:12)


"UNIX is simple and coherent..." - Dennis Ritchie, "GNU's Not UNIX" -  Richard Stallman

Offline

#15 2022-11-29 00:00:13

BogdanTheGeek
Member
Registered: 2022-11-28
Posts: 15

Re: [SOLVED]PKGBUILD post_remove() help

Trilby wrote:

But that ignores the main issue that you are trying to call this a package for the software when really even your attempts are just a package to facilitate the running of their installer which will in turn "install" the software.  If that's the case, forget it - just let users download the installer and run it themselves - the package does not facilitate this in any way.

But after jumping through all sorts of hoops and providing way more invasive information than should be necessary to register for a download (all made up in my case ... f*** em), I still am only get a download resulting in a XHTML error document.  So I can't even see what this is supposed to be.  However, in checking some of their FAQs, I did see a note that there is a debian .deb package available for the software.  If that's the case, use that and convert it via debtap.  There are examples of doing this in the AUR.

Here is the "direct" link, still need to be logged in:
https://www.renesas.com/us/en/document/ … z?r=488826

The problem is, as you have pointed out, that whatever they are distributing is not an universal linux install. Its an ubuntu installer, not sure if its a .deb, but I can look into it. Just to be able to run the installer, it needs to be able to find:
${HOME}/.swt/lib/linux/x86_64/libswt-pi4-gtk-4952r11.so
/usr/lib/libpcre.so.3

Which are just named differently in arch linux.

Last edited by BogdanTheGeek (2022-11-29 00:02:14)

Offline

#16 2022-11-29 00:05:49

Scimmia
Fellow
Registered: 2012-09-01
Posts: 11,463

Re: [SOLVED]PKGBUILD post_remove() help

BogdanTheGeek wrote:
Scimmia wrote:

It doesn't work fine, it doesn't build a package in any way.

Ok, fair point. It installs the software though. I know, I know, terrible package, really shouldn't be a package in this state. Help me out, how can I improve it? Its my fist package, just trying to help out.

Start off with the download. The entire _DOWNLOADS_DIR thing is wrong, you just put the file in the source array as 'file://<filename>'. You then add a checksum array.

Next, line 33, what you're doing there only affects the build, it doesn't make it into the actual package, so it doesn't have any effect there. That's not what you want.

Line 35, you can NEVER EVER use sudo in a PKGBUILD. Again, this ends up only being done on the build system, not in the package, so it doesn't do you any good anyway. If you need a symlink, it needs to be done in the package function and in $pkgdir.

EVERYTHING that needs to end up on the package must be in $pkgdir. Try it youself, take the built package and install it on another system. Nothing would work.

To do this, you would need to get the installer to install things to $pkgdir. No idea how to do that with this installer, if it's even possible at all.

Online

#17 2022-11-29 00:10:03

Trilby
Inspector Parrot
Registered: 2011-11-29
Posts: 29,442
Website

Re: [SOLVED]PKGBUILD post_remove() help

BogdanTheGeek wrote:

Its an ubuntu installer, not sure if its a .deb, but I can look into it.

No, it isn't.  A .deb is a package format.  One cannot execute a .deb (even on debian) - but a .deb can be installed in debian and it can also be converted to a .pkg.tar.xz which can be installed in arch.

BogdanTheGeek wrote:

... it needs to be able to find:
${HOME}/.swt/lib/linux/x86_64/libswt-pi4-gtk-4952r11.so
/usr/lib/libpcre.so.3

What do you base this conclusion on?  I gather you received some error message - post the error message, not your interpretation.  If needed, one could use an LD_PRELOAD hack to use the right libs - but that's assuming your interpretation is from a ld error rather than the installer calling (the equivalent of) dl-open with a hardcoded filename.  If it's caling something like dl-open, but it's from java, then you can modify the path that it's trying to load.  But again, this is all about the installer program which I don't think you should use.  Find the .deb, then use that.


"UNIX is simple and coherent..." - Dennis Ritchie, "GNU's Not UNIX" -  Richard Stallman

Offline

#18 2022-11-29 00:11:48

BogdanTheGeek
Member
Registered: 2022-11-28
Posts: 15

Re: [SOLVED]PKGBUILD post_remove() help

Trilby wrote:

But surely you know how to walk, even if the floor is new to you.

I will save that.
But I am sure you can at least entertain the idea that we have very different shoes, so I will take a bit longer to catch up smile .

How would you go about it?
Leave the installation instructions for arch on their FAQs?
Try to extract all the files and manually install them? (I am not willing to put in the effort for that)
Is there any way this helper script could be modified to be safe and still installed though the AUR, like every other embedded IDE:
https://aur.archlinux.org/packages/stm32cubeide
https://aur.archlinux.org/packages/microchip-mplabx-bin

Granted some of those don't require an account to download the installer.

Offline

#19 2022-11-29 00:21:20

BogdanTheGeek
Member
Registered: 2022-11-28
Posts: 15

Re: [SOLVED]PKGBUILD post_remove() help

Trilby wrote:

What do you base this conclusion on?

./e2studio_installer-2022-10_linux_host.run
SWT OS.java Error: Failed to load swt-pi3, loading swt-pi4 as fallback.
Installer:
An error has occurred. See the log file
/home/bogdan/.eclipse/2034508704_linux_gtk_x86_64/configuration/1669680892871.log

log file:

!SESSION 2022-11-29 00:14:52.669 -----------------------------------------------
eclipse.buildId=unknown
java.version=11.0.15
java.vendor=Eclipse Adoptium
BootLoader constants: OS=linux, ARCH=x86_64, WS=gtk, NL=en_US
Framework arguments:  -install.nolock
Command-line arguments:  -os linux -ws gtk -arch x86_64 -install.nolock

!ENTRY org.eclipse.osgi 4 0 2022-11-29 00:14:54.447
!MESSAGE Application error
!STACK 1
java.lang.UnsatisfiedLinkError: Could not load SWT library. Reasons: 
	no swt-pi4-gtk-4952r11 in java.library.path: [/tmp/.mount_e2studISex1a/opt/e2studio_installer/plugins/org.eclipse.justj.openjdk.hotspot.jre.full.stripped.linux.x86_64_11.0.15.v20220515-1236/jre/lib/server, /tmp/.mount_e2studISex1a/opt/e2studio_installer/plugins/org.eclipse.justj.openjdk.hotspot.jre.full.stripped.linux.x86_64_11.0.15.v20220515-1236/jre/lib, /tmp/.mount_e2studISex1a/opt/e2studio_installer/plugins/org.eclipse.justj.openjdk.hotspot.jre.full.stripped.linux.x86_64_11.0.15.v20220515-1236/jre/../lib, /tmp/.mount_e2studISex1a//opt/e2studio_installer/plugins/org.eclipse.justj.openjdk.hotspot.jre.full.stripped.linux.x86_64_11.0.15.v20220515-1236/jre/lib, /tmp/.mount_e2studISex1a//opt/e2studio_installer/plugins/org.eclipse.justj.openjdk.hotspot.jre.full.stripped.linux.x86_64_11.0.15.v20220515-1236/jre/lib/jli, /tmp/.mount_e2studISex1a//opt/e2studio_installer/plugins/org.eclipse.justj.openjdk.hotspot.jre.full.stripped.linux.x86_64_11.0.15.v20220515-1236/jre/lib/server, /tmp/.mount_e2studISex1a//usr/lib/x86_64-linux-gnu, /tmp/.mount_e2studISex1a//usr/lib/x86_64-linux-gnu/libcanberra-0.30, /tmp/.mount_e2studISex1a//usr/lib/x86_64-linux-gnu/gdk-pixbuf-2.0/2.10.0/loaders, /tmp/.mount_e2studISex1a//usr/lib/x86_64-linux-gnu/gtk-3.0/3.0.0/immodules, /tmp/.mount_e2studISex1a//usr/lib/x86_64-linux-gnu/gtk-3.0/3.0.0/printbackends, /tmp/.mount_e2studISex1a//usr/lib/x86_64-linux-gnu/krb5/plugins/preauth, /tmp/.mount_e2studISex1a//lib/x86_64-linux-gnu, /tmp/.mount_e2studISex1a//lib/x86_64-linux-gnu/security, /tmp/.mount_e2studISex1a//lib/x86_64, ., /usr/java/packages/lib, /usr/lib64, /lib64, /lib, /usr/lib]
	no swt-pi4-gtk in java.library.path: [/tmp/.mount_e2studISex1a/opt/e2studio_installer/plugins/org.eclipse.justj.openjdk.hotspot.jre.full.stripped.linux.x86_64_11.0.15.v20220515-1236/jre/lib/server, /tmp/.mount_e2studISex1a/opt/e2studio_installer/plugins/org.eclipse.justj.openjdk.hotspot.jre.full.stripped.linux.x86_64_11.0.15.v20220515-1236/jre/lib, /tmp/.mount_e2studISex1a/opt/e2studio_installer/plugins/org.eclipse.justj.openjdk.hotspot.jre.full.stripped.linux.x86_64_11.0.15.v20220515-1236/jre/../lib, /tmp/.mount_e2studISex1a//opt/e2studio_installer/plugins/org.eclipse.justj.openjdk.hotspot.jre.full.stripped.linux.x86_64_11.0.15.v20220515-1236/jre/lib, /tmp/.mount_e2studISex1a//opt/e2studio_installer/plugins/org.eclipse.justj.openjdk.hotspot.jre.full.stripped.linux.x86_64_11.0.15.v20220515-1236/jre/lib/jli, /tmp/.mount_e2studISex1a//opt/e2studio_installer/plugins/org.eclipse.justj.openjdk.hotspot.jre.full.stripped.linux.x86_64_11.0.15.v20220515-1236/jre/lib/server, /tmp/.mount_e2studISex1a//usr/lib/x86_64-linux-gnu, /tmp/.mount_e2studISex1a//usr/lib/x86_64-linux-gnu/libcanberra-0.30, /tmp/.mount_e2studISex1a//usr/lib/x86_64-linux-gnu/gdk-pixbuf-2.0/2.10.0/loaders, /tmp/.mount_e2studISex1a//usr/lib/x86_64-linux-gnu/gtk-3.0/3.0.0/immodules, /tmp/.mount_e2studISex1a//usr/lib/x86_64-linux-gnu/gtk-3.0/3.0.0/printbackends, /tmp/.mount_e2studISex1a//usr/lib/x86_64-linux-gnu/krb5/plugins/preauth, /tmp/.mount_e2studISex1a//lib/x86_64-linux-gnu, /tmp/.mount_e2studISex1a//lib/x86_64-linux-gnu/security, /tmp/.mount_e2studISex1a//lib/x86_64, ., /usr/java/packages/lib, /usr/lib64, /lib64, /lib, /usr/lib]
	no swt-pi4 in java.library.path: [/tmp/.mount_e2studISex1a/opt/e2studio_installer/plugins/org.eclipse.justj.openjdk.hotspot.jre.full.stripped.linux.x86_64_11.0.15.v20220515-1236/jre/lib/server, /tmp/.mount_e2studISex1a/opt/e2studio_installer/plugins/org.eclipse.justj.openjdk.hotspot.jre.full.stripped.linux.x86_64_11.0.15.v20220515-1236/jre/lib, /tmp/.mount_e2studISex1a/opt/e2studio_installer/plugins/org.eclipse.justj.openjdk.hotspot.jre.full.stripped.linux.x86_64_11.0.15.v20220515-1236/jre/../lib, /tmp/.mount_e2studISex1a//opt/e2studio_installer/plugins/org.eclipse.justj.openjdk.hotspot.jre.full.stripped.linux.x86_64_11.0.15.v20220515-1236/jre/lib, /tmp/.mount_e2studISex1a//opt/e2studio_installer/plugins/org.eclipse.justj.openjdk.hotspot.jre.full.stripped.linux.x86_64_11.0.15.v20220515-1236/jre/lib/jli, /tmp/.mount_e2studISex1a//opt/e2studio_installer/plugins/org.eclipse.justj.openjdk.hotspot.jre.full.stripped.linux.x86_64_11.0.15.v20220515-1236/jre/lib/server, /tmp/.mount_e2studISex1a//usr/lib/x86_64-linux-gnu, /tmp/.mount_e2studISex1a//usr/lib/x86_64-linux-gnu/libcanberra-0.30, /tmp/.mount_e2studISex1a//usr/lib/x86_64-linux-gnu/gdk-pixbuf-2.0/2.10.0/loaders, /tmp/.mount_e2studISex1a//usr/lib/x86_64-linux-gnu/gtk-3.0/3.0.0/immodules, /tmp/.mount_e2studISex1a//usr/lib/x86_64-linux-gnu/gtk-3.0/3.0.0/printbackends, /tmp/.mount_e2studISex1a//usr/lib/x86_64-linux-gnu/krb5/plugins/preauth, /tmp/.mount_e2studISex1a//lib/x86_64-linux-gnu, /tmp/.mount_e2studISex1a//lib/x86_64-linux-gnu/security, /tmp/.mount_e2studISex1a//lib/x86_64, ., /usr/java/packages/lib, /usr/lib64, /lib64, /lib, /usr/lib]
	Can't load library: /home/bogdan/.swt/lib/linux/x86_64/libswt-pi4-gtk-4952r11.so
	Can't load library: /home/bogdan/.swt/lib/linux/x86_64/libswt-pi4-gtk.so
	Can't load library: /home/bogdan/.swt/lib/linux/x86_64/libswt-pi4.so

This was a quick hack, I never came across the LD_PRELOAD hack.
I don't think it makes best use of anyone time if we go down the rabbit hole to try and get the installer to work if I can't package it. I will look into the deb package. If they distribute it on an ubuntu repo, I would assume its fine to repackage, but I really don't want to get into legal problems with renesas.

Offline

#20 2022-11-29 00:24:58

BogdanTheGeek
Member
Registered: 2022-11-28
Posts: 15

Re: [SOLVED]PKGBUILD post_remove() help

Trilby wrote:

Find the .deb, then use that.

Could you share the link to the discussion where it was mentioned? I could not find any mention of a .deb package being distributed. Perhaps one of the very very old versions was distributed as such, but the only way to get the latest versions is though direct download.

Offline

#21 2022-11-29 00:25:43

Trilby
Inspector Parrot
Registered: 2011-11-29
Posts: 29,442
Website

Re: [SOLVED]PKGBUILD post_remove() help

BogdanTheGeek wrote:

Is there any way this helper script could be modified to be safe and still installed though the AUR, like every other embedded IDE:
https://aur.archlinux.org/packages/stm32cubeide
https://aur.archlinux.org/packages/microchip-mplabx-bin

Why is this even a goal?  This is the very definition of an XY problem.  You want to install their IDE, that's the goal.  Screw the installer, it will not help acheive that goal.  And the examples you linked to (while they have their own problems) they do not package the installer, just the IDEs.  The first seems to do what you said you are unwilling to do (extract and manually installs files) ... though I don't know why you are unwilling to put in the effort to do things properly when you've already put in more effort trying to do it improperly.  The second example does seem to run the installer script, but it does so in a chroot and then moves the resulting content out of the chroot - I don't know if that's a great approach, but it is creative.  But that depends on the installer being able to run in a chroot, this interactive java installer most definitely would not.

BogdanTheGeek wrote:

How would you go about it?

I did say to use the .deb, didn't I?  This is at least the third time.  So yeah, that's how I'd go about it.  Get the .deb package, and use debtap to covert it to a pacman package.  There are - again - examples of this simple process on the AUR and likely in wiki pages on making AUR packages.

For a link to the reference to the .deb package, see post #14, I already linked to it... EDIT: but on second look that may not be this software, but a dependency (the J-Link driver).  EDIT 2: yeah, sorry, there doesn't seem to be a .deb.  So that only leaves the option you said you are unwilling to do.

Still all I'm getting from the download is a e2studio_installer-2022-10_linux_host.run file with just this content:

<?xml version="1.0" encoding="UTF-8"?>
<Error><Code>AuthorizationQueryParametersError</Code><Message>Error parsing the X-Amz-Credential parameter; the Credential is mal-formed; expecting "&lt;YOUR-AKID&gt;/YYYYMMDD/REGION/SERVICE/aws4_request".</Message><RequestId>G8G0PSX8D46ZBF8T</RequestId><HostId>WN00rwD35c2rCZeA8KT8nchhYdCnzATuG+M5IwxQE6NX0OyVB3nqmQGvjvu9aakb+Zapqm5DCRw=</HostId></Error>

Last edited by Trilby (2022-11-29 00:33:24)


"UNIX is simple and coherent..." - Dennis Ritchie, "GNU's Not UNIX" -  Richard Stallman

Offline

#22 2022-11-29 00:40:06

BogdanTheGeek
Member
Registered: 2022-11-28
Posts: 15

Re: [SOLVED]PKGBUILD post_remove() help

Trilby wrote:

Still all I'm getting from the download is a e2studio_installer-2022-10_linux_host.run file with just this content:

Are you using a fancy browser? works fine on chrome/brave. I can post a temporary downlaod link if it helps.

The reason why I am not willing to try to extract files form this installer is that even binwalk gave up on it:

binwalk e2studio_installer-2022-10_linux_host.run

DECIMAL       HEXADECIMAL     DESCRIPTION
--------------------------------------------------------------------------------
140288        0x22400         SHA256 hash constants, little endian
140760        0x225D8         xz compressed data
140800        0x22600         CRC32 polynomial table, little endian
189632        0x2E4C0         Squashfs filesystem, little endian, version 4.0, compression:gzip, size: 1124462433 bytes, 21998 inodes, blocksize: 131072 bytes, created: 1970-01-01 00:00:00

Installing in chroot and copying the files over, might not be the craziest idea. Still a lot of work for what could be an FAQ post with 2 commands to run before the installer.

PS: Sorry if it seems like i'm not answering your latest posts, it takes a while to form good replies, so you might have edited the post or asked another question in the meanwhile.

EDIT: Running binwalk -eM does extact some files from the squashfs section, but I can't possibly require binwalk for makedepends(), right?
EDIT2: Idk if this is horrible or funny as hell, but the squashfs contains an entire userland, complete with systemd, xfce, python, gcc, hp printer drivers....

EDIT3: It actually decompresses to over 70Gb, ran out of room. here it is for anyone interested:
https://file.io/1KnkIX1nTcdw

Last edited by BogdanTheGeek (2022-11-29 00:57:30)

Offline

#23 2022-11-29 00:57:17

Trilby
Inspector Parrot
Registered: 2011-11-29
Posts: 29,442
Website

Re: [SOLVED]PKGBUILD post_remove() help

Nope, not a fancy browser, my own stupid one.  I forgot my downloader doesn't carry over session cookies (yet) so it wasn't really logged in.  I was able to get the download through firefox.  When run, it gives an informative message identifying itself as an appimage and giving explicit instructions on how to extract the content:

$ ./e2studio_installer-2022-10_linux_host.run 
dlopen(): error loading libfuse.so.2

AppImages require FUSE to run. 
You might still be able to extract the contents of this AppImage 
if you run it with the --appimage-extract option. 
See https://github.com/AppImage/AppImageKit/wiki/FUSE 
for more information

Running that command works fine and I get all the properly extracted content (no need for guessing with binwalk).

If I cd into the extracted content and try to run the bare AppRun I not surprisingly get an error:

SWT OS.java Error: Failed to load swt-pi3, loading swt-pi4 as fallback.
Installer:
An error has occurred. See the log file
/tmp/squashfs-root/opt/e2studio_installer/configuration/1669683320604.log.

This is not surprising as I do not have java installed.  But it is installed in the appimage root ... from that same directory:

$ ls ./opt/e2studio_installer/configuration/org.eclipse.osgi/128/0/.cp/
libswt-gtk-4952r11.so      libswt-pi3-gtk-4952r11.so

Are these the libs you were looking for?  You don't need to install them on the host system - you just need to properly launch the appimage.  I don't yet (off the top of my head) know much of anything about appimages, but it's clearly a chroot system which includes it's own necessary libraries - so you don't need to hack away at those - you just need to look up how to run an appimage properly - I suspect it may amount to ensuring fuse is installed, then running the unextracted .run file.

Last edited by Trilby (2022-11-29 00:58:34)


"UNIX is simple and coherent..." - Dennis Ritchie, "GNU's Not UNIX" -  Richard Stallman

Offline

#24 2022-11-29 01:00:31

BogdanTheGeek
Member
Registered: 2022-11-28
Posts: 15

Re: [SOLVED]PKGBUILD post_remove() help

Wow, Nice one!
I had fuse installed so it didn't show up as an AppImage.

Offline

#25 2022-11-29 01:06:39

Trilby
Inspector Parrot
Registered: 2011-11-29
Posts: 29,442
Website

Re: [SOLVED]PKGBUILD post_remove() help

Additionally, as I really dont care to mess with fuse or app images, you can still likely skip the installer and just extract the appimage.  Under the extracted directory, you'd be interested in the content of opt/e2studio_installer/install/repos/e2studio/ which is the actual goal: the ide software.  I suspect that whole directory could be copied to ${pkgdir}/opt and then a tiny launcher script put in ${pkgdir}/usr/bin to run the ide from /opt.


"UNIX is simple and coherent..." - Dennis Ritchie, "GNU's Not UNIX" -  Richard Stallman

Offline

Board footer

Powered by FluxBB