Setarch command

Technical issues/questions of an intermediate or advanced nature.
User avatar
Rava
Contributor
Contributor
Posts: 5401
Joined: 11 Jan 2011, 02:46
Distribution: XFCE 5.01 x86_64 + 4.0 i586
Location: Forests of Germany

Setarch command

Post#1 by Rava » 23 Mar 2018, 17:01

Dunno if the following is best put into the Port4.0rc4 bug report thread, or in a update-firefox related thread?
_____________________________________

My system: Porteus 4.0rc4 XFCE x86-64.

I downloaded the most recent firefox ESR (extended support release) en-UK version and put it into /tmp.

Now, the tricky issue here: I downloaded the i586 version. Still, it is only called /tmp/firefox-52.7.2esr.tar.bz2

Then I used the /usr/local/bin/update-firefox-live to convert it into a tgz and xzm.

Now, the package and module are called both /tmp/firefox-52.7.2esr-x86_64-1.

But still these are i586 versions, not x86-64 versions… The update-firefox-live script presumed it would be the same firefox tarball machine architecture than the running system… but the script presumed wrong.

I renamed both package and module into firefox-52.7.2esr-i586-1.* to have it obvious which arch these packages really are.

Just to make it sure it really was the i586 version, I activated it and tried running FFx:

Code: Select all

root@porteus:/# activate /mnt/sdb1/Porteus_modules/4.0/firefox-52.7.2esr-i586-1.xzm 
Quiet mode: off
Updating shared library links:  /sbin/ldconfig
Updating XFCE menu: update-desktop-database
And trying to start that FFx sure did fail:

Code: Select all

guest@porteus:/$ firefox 
bash: /usr/bin/firefox: No such file or directory
guest@porteus:/$ file /usr/bin/firefox
/usr/bin/firefox: symbolic link to /usr/lib64/firefox-52.7.2esr/firefox
guest@porteus:/$ file /usr/lib64/firefox-52.7.2esr/firefox
/usr/lib64/firefox-52.7.2esr/firefox: ELF 32-bit LSB executable, Intel 80386, version 1 (SYSV), dynamically linked, interpreter /lib/ld-linux.so.2, BuildID[sha1]=5ea0c90bc9ddf68f8a3fb5c59e69e6b37c05766c, stripped
It would be possible to add an architecture check, like, checking the main executable, that would here have been firefox/firefox-bin or firefox/firefox and then adjust the name of the created tgz / xzm accordingly… but who would want to code such extra check?

Code: Select all

<_<
>_>
<_<
>_<
Also, I suggest removing either firefox/firefox-bin or firefox/firefox and replacing it with an symbolic link to the remaining other file, since both are the same anyway, and why have two large files in the tgz or xzm when one is sufficient?

… Oddly enough, the non ESR versions of FFx always have been the same, meaning the "firefox" and "firefox-bin" executable, but in this case, they are indeed not:

Code: Select all

root@porteus:/mnt/live/memory/images/firefox-52.7.2esr-i586-1.xzm/usr/lib64/firefox# md5sum firefox firefox-bin 
4f4b680253152cba4aa3711f9b41d45d  firefox
3800ebebd2d2e103776c2318780997a8  firefox-bin

root@porteus:/mnt/live/memory/images/firefox-52.7.2esr-i586-1.xzm/usr/lib64/firefox# sha1sum firefox firefox-bin 
669aee883f5c8ff25eb0ff76019096d1614c0137  firefox
3a5c0520a7e4ac4d294816bf0c999261e56a1e08  firefox-bin

root@porteus:/mnt/live/memory/images/firefox-52.7.2esr-i586-1.xzm/usr/lib64/firefox# l firefox firefox-bin 
-rwxr-xr-x 1 root 188016 2018-03-16 04:03 firefox
-rwxr-xr-x 1 root 188020 2018-03-16 04:03 firefox-bin

root@porteus:/mnt/live/memory/images/firefox-52.7.2esr-i586-1.xzm/usr/lib64/firefox# file firefox firefox-bin 
firefox:     ELF 32-bit LSB executable, Intel 80386, version 1 (SYSV), dynamically linked, interpreter /lib/ld-linux.so.2, BuildID[sha1]=5ea0c90bc9ddf68f8a3fb5c59e69e6b37c05766c, stripped
firefox-bin: ELF 32-bit LSB executable, Intel 80386, version 1 (SYSV), dynamically linked, interpreter /lib/ld-linux.so.2, BuildID[sha1]=5ea0c90bc9ddf68f8a3fb5c59e69e6b37c05766c, stripped
Any idea why they do differ? By creating FFx packages in the past (for both x86-64 and i586) the files "firefox" and "firefox-bin" always have been the same, but I never converted an ESR version before.
And as you can see, the sha1 BuildID is the very same for both "firefox" and "firefox-bin". So I don't really get why the files themselves do differ.

...

… …

<paranoia_mode=ON>"Because one of the files, the one usually started, got obviously manipulated by the 5eyes. HurrHurrHurr…"<paranoia_mode=OFF>
(*jk* there. xD Then again, who really knows, eh?)

________
*jk* is short for "just kidding", in case you did not know.
Last edited by Rava on 02 Apr 2018, 03:56, edited 1 time in total.
Reason: set title of new thread to "Setarch command"
Cheers!
Yours Rava

User avatar
Ed_P
Contributor
Contributor
Posts: 8341
Joined: 06 Feb 2013, 22:12
Distribution: Cinnamon 5.01 ISO
Location: Western NY, USA

Porteus-v4.0rc4 bug reports

Post#2 by Ed_P » 23 Mar 2018, 23:23

Rava wrote:
23 Mar 2018, 17:01
Then I used the /usr/local/bin/update-firefox-live to convert it into a tgz and xzm.
The standard approach is to just use the update-firefox command. But if you know where the script is located you can copy it and make it do whatever you want. Do note the module addins will still be 64bit since it is being run on a 64bit system and it doesn't have the 32bit addins you need.
The update-firefox-live script presumed it would be the same firefox tarball machine architecture than the running system… but the script presumed wrong.
Not presumed, designed for, based on the files the system has available to it. Just like a 32bit Porteus system doesn't have 64bit files to build a 64bit module.
Ed

User avatar
ncmprhnsbl
DEV Team
DEV Team
Posts: 3924
Joined: 20 Mar 2012, 03:42
Distribution: v5.0-64bit
Location: australia
Contact:

Porteus-v4.0rc4 bug reports

Post#3 by ncmprhnsbl » 24 Mar 2018, 00:01

Rava wrote:
23 Mar 2018, 17:01
But still these are i586 versions, not x86-64 versions… The update-firefox-live script presumed it would be the same firefox tarball machine architecture than the running system… but the script presumed wrong.
you seem to have forgotten about setarch
eg. if you are in 64bit and want to make 32bit firefox(with tarball in /tmp if desired)

Code: Select all

#setarch i586
#update-firefox
Forum Rules : https://forum.porteus.org/viewtopic.php?f=35&t=44

User avatar
Ed_P
Contributor
Contributor
Posts: 8341
Joined: 06 Feb 2013, 22:12
Distribution: Cinnamon 5.01 ISO
Location: Western NY, USA

Porteus-v4.0rc4 bug reports

Post#4 by Ed_P » 24 Mar 2018, 04:52

ncmprhnsbl wrote:
24 Mar 2018, 00:01
eg. if you in 64bit and want to make 32bit firefox(with tarball in /tmp if desired)

Code: Select all

#setarch i586
#update-firefox
:o What about compat32-libraries files? :%)
Ed

User avatar
Rava
Contributor
Contributor
Posts: 5401
Joined: 11 Jan 2011, 02:46
Distribution: XFCE 5.01 x86_64 + 4.0 i586
Location: Forests of Germany

Porteus-v4.0rc4 bug reports

Post#5 by Rava » 24 Mar 2018, 07:47

ncmprhnsbl wrote:
24 Mar 2018, 00:01
you seem to have forgotten about setarch
eg. if you in 64bit and want to make 32bit firefox(with tarball in /tmp if desired)

Code: Select all

#setarch i586
#update-firefox
Facepalm. .. I really tend to forget about setarch. .. and it is such a neat trick. Thanks for reminding silly old me. :friends:

Ed_P wrote:
24 Mar 2018, 04:52
:o What about compat32-libraries files? :%)
These I avoid like the devil avoids holy water. I just want my system to be pure 64 Bit. :angel:
Ed_P wrote:
23 Mar 2018, 23:23
Do note the module addins will still be 64bit since it is being run on a 64bit system and it doesn't have the 32bit addins you need.
So then I guess a module created like I did will be malfunctioning... even when using setarch?
Or would the script tell me if addins are not available on my 64 bit System?
Sadly I cannot test that since I already deleted the tarball.
Cheers!
Yours Rava

User avatar
ncmprhnsbl
DEV Team
DEV Team
Posts: 3924
Joined: 20 Mar 2012, 03:42
Distribution: v5.0-64bit
Location: australia
Contact:

Porteus-v4.0rc4 bug reports

Post#6 by ncmprhnsbl » 24 Mar 2018, 08:09

Ed_P wrote:
24 Mar 2018, 04:52
What about compat32-libraries files?
because the firefox tarball contains precompiled binary(ies), all update-firefox does is put stuff in the right dirs (/usr/lib64 for 64bit and /usr/lib for 32bit) in the module..
we're just talking about making the module (on an alternative arch) not running it..
Forum Rules : https://forum.porteus.org/viewtopic.php?f=35&t=44

User avatar
Ed_P
Contributor
Contributor
Posts: 8341
Joined: 06 Feb 2013, 22:12
Distribution: Cinnamon 5.01 ISO
Location: Western NY, USA

Porteus-v4.0rc4 bug reports

Post#7 by Ed_P » 24 Mar 2018, 14:12

Thank you ncmprhnsbl. :beer: I learned something new. I assume this applies to all your update menu options?
Ed

User avatar
Rava
Contributor
Contributor
Posts: 5401
Joined: 11 Jan 2011, 02:46
Distribution: XFCE 5.01 x86_64 + 4.0 i586
Location: Forests of Germany

Porteus-v4.0rc4 bug reports

Post#8 by Rava » 24 Mar 2018, 14:46

ncmprhnsbl wrote:
24 Mar 2018, 08:09
we're just talking about making the module (on an alternative arch) not running it..
Sadly, at least getting an update script on i586 to download x86-64 fails using the above named trick:

Code: Select all

# setarch x86_64
setarch: Kernel cannot set architecture to x86_64
CPU is "Genuine Intel(R) CPU U1400 @ 1.20GHz", System i586 Porteus 4.0rc4 XFCE.

Seems... in such a case, I would have to hack the update-*-live script manually to set the arch to waht I want and then e.g. rename the script into something like update-palemoon-live-x86-64 or such.
Or, ncmprhnsbl, is there another way to tell the script which arch it should download? Like... a parameter to give it which tells the script the desired arch?
Cheers!
Yours Rava

User avatar
ncmprhnsbl
DEV Team
DEV Team
Posts: 3924
Joined: 20 Mar 2012, 03:42
Distribution: v5.0-64bit
Location: australia
Contact:

Porteus-v4.0rc4 bug reports

Post#9 by ncmprhnsbl » 24 Mar 2018, 21:25

Rava wrote:
24 Mar 2018, 14:46
Sadly, at least getting an update script on i586 to download x86-64 fails using the above named trick:
you must first download the tarball(with a browser or wget(or something) if you have a link) and place it in /tmp first, the script will then find it and ask if you want to use it..
sorry for not making this clear..
Forum Rules : https://forum.porteus.org/viewtopic.php?f=35&t=44

User avatar
Ed_P
Contributor
Contributor
Posts: 8341
Joined: 06 Feb 2013, 22:12
Distribution: Cinnamon 5.01 ISO
Location: Western NY, USA

Porteus-v4.0rc4 bug reports

Post#10 by Ed_P » 25 Mar 2018, 03:35

I'm reasonable sure update-firefox downloads the tarball but it would be nice if the update-firefox function indicated which arch it downloaded.

Code: Select all

guest@porteus:~$ su
Password: 
root@porteus:/home/guest# update-firefox
Checking internet ...
Downloading: update-firefox-live  DONE

 Getting latest firefox version ... 
[PASS] Latest version: firefox-60.0b6
 Checking for Porteus ... 
[PASS] Distro is Porteus

The porteus server version is:  58.0.2 
The latest version is:  firefox-60.0b6 
 Would you like to download the porteus server version? [y/n]
 Would you like to build the latest version? [y/n]
root@porteus:/home/guest# setarch i586
root@porteus:/home/guest# update-firefox
Checking internet ...
Downloading: update-firefox-live  DONE

 Getting latest firefox version ... 
[PASS] Latest version: firefox-60.0b6
 Checking for Porteus ... 
[PASS] Distro is Porteus

The porteus server version is:  58.0.2 
The latest version is:  firefox-60.0b6 
 Would you like to download the porteus server version? [y/n]
 Would you like to build the latest version? [y/n]

root@porteus:/home/guest# echo &arch
[1] 18078

i686
[1]+  Done                    echo
root@porteus:/home/guest# setarch --list
uname26
linux32
linux64
i386
i486
i586
i686
athlon
x86_64
root@porteus:/home/guest# 
Not sure why setarch i586 ended up with arch i686. And this is with using the 4.0rc5 and Cinnamon cinnamon-x86_64-20180321.
Ed

User avatar
ncmprhnsbl
DEV Team
DEV Team
Posts: 3924
Joined: 20 Mar 2012, 03:42
Distribution: v5.0-64bit
Location: australia
Contact:

Porteus-v4.0rc4 bug reports

Post#11 by ncmprhnsbl » 25 Mar 2018, 08:04

ok, i misread Ravas post.. and you're right Ed, the script will download the desired arch..
i would guess that setarch is very much dependent on what the hardware is..
ie if it's a i686 64bit capable processor it will allow i686 or x86_64 (maybe others)
but if the processor is not 64 bit capable then x86_64 is not allowed
Forum Rules : https://forum.porteus.org/viewtopic.php?f=35&t=44

User avatar
ncmprhnsbl
DEV Team
DEV Team
Posts: 3924
Joined: 20 Mar 2012, 03:42
Distribution: v5.0-64bit
Location: australia
Contact:

Setarch command

Post#12 by ncmprhnsbl » 25 Mar 2018, 08:06

moved posts from rc4 bug topic
Forum Rules : https://forum.porteus.org/viewtopic.php?f=35&t=44

User avatar
Rava
Contributor
Contributor
Posts: 5401
Joined: 11 Jan 2011, 02:46
Distribution: XFCE 5.01 x86_64 + 4.0 i586
Location: Forests of Germany

Setarch command

Post#13 by Rava » 25 Mar 2018, 14:52

ncmprhnsbl wrote:
25 Mar 2018, 08:04
but if the processor is not 64 bit capable then x86_64 is not allowed
That is the issue I do have.
Seems the only solution is either hack the download script to just download the x86-64 tarball... and then use the 64bit system to create the module.
Or make a new script that e.g. just creates the current download link. The link is then also usable for Android or iphone.
Cheers!
Yours Rava

User avatar
Ed_P
Contributor
Contributor
Posts: 8341
Joined: 06 Feb 2013, 22:12
Distribution: Cinnamon 5.01 ISO
Location: Western NY, USA

Setarch command

Post#14 by Ed_P » 25 Mar 2018, 17:27

Or manually customize the wget command's Firefox update URL in the browser, bookmark it, and run it.
https://ftp.mozilla.org/pub/firefox/releases/latest/README.txt wrote:This could be pasted into the location bar of a browser, or used with curl or wget, e.g.
wget -O FirefoxSetup.exe "Xhttps://download.mozilla.org/?product=firefox-latest&os=win&lang=en-US"

For other operating systems replace 'os=win' with:
Windows 64bit __os=win64
OS X____________os=osx
Linux x86_64____os=linux64
Linux i686_______os=linux
Note: Remove the X I put before the https to stop the forum from displaying the URL as a link.
Ed

User avatar
Rava
Contributor
Contributor
Posts: 5401
Joined: 11 Jan 2011, 02:46
Distribution: XFCE 5.01 x86_64 + 4.0 i586
Location: Forests of Germany

Setarch command

Post#15 by Rava » 25 Mar 2018, 19:11

Ed_P wrote:
25 Mar 2018, 17:27
Or manually customize the wget command's Firefox update URL in the browser, bookmark it, and run it.
https://ftp.mozilla.org/pub/firefox/releases/latest/README.txt wrote:This could be pasted into the location bar of a browser, or used with curl or wget, e.g.
wget -O FirefoxSetup.exe "Xhttps://download.mozilla.org/?product=firefox-latest&os=win&lang=en-US"

For other operating systems replace 'os=win' with:
Windows 64bit __os=win64
OS X____________os=osx
Linux x86_64____os=linux64
Linux i686_______os=linux
Note: Remove the X I put before the https to stop the forum from displaying the URL as a link.
But the trick with the update scripts is that they find out the most current version by themselves. Would the above URL result in the Version being part of the tarball Name?
Or Would it get a generic name without version info like usually the manual downloads of Adobe FlashPlayer does?
Cheers!
Yours Rava

Post Reply