Bug 28367 - Enable users to specify the mirror port in Installer
Summary: Enable users to specify the mirror port in Installer
Status: RESOLVED FIXED
Alias: None
Product: Mageia
Classification: Unclassified
Component: Installer (show other bugs)
Version: 8
Hardware: All Linux
Priority: Normal normal
Target Milestone: ---
Assignee: Mageia tools maintainers
QA Contact:
URL: http://gitweb.mageia.org/software/dra...
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2021-02-16 10:53 CET by Jybz
Modified: 2022-01-22 11:25 CET (History)
5 users (show)

See Also:
Source RPM: drakx-installer-images-2.82-2.mga8.src.rpm
CVE:
Status comment:


Attachments
Quick untested patch (2.20 KB, patch)
2021-02-17 22:46 CET, Pascal Terjan
Details | Diff

Description Jybz 2021-02-16 10:53:49 CET
Hello !

I have a local mirror of mga8 I use for building mga images fo arm devices due to my bad internet connection.

I wanted to try to reproduce a bug so I try the netinstall in order to use my local repository. But first I was unable.

After deeper research, I found out that the mirror port is hard coded:
On the page for specifying a mirror
> http://gitweb.mageia.org/software/drakx/tree/mdk-stage1/network.c#n1134
I put an address like: 192.168.0.123:8080
On the log, (Alt-F2) I saw: 192.168.0.123:8080:80/
And see that here:
> http://gitweb.mageia.org/software/drakx/tree/mdk-stage1/url.c#n422
it is hardcoded :80.

Such a line http://gitweb.mageia.org/software/drakx/tree/mdk-stage1/network.c#n1178 in url.c can set :80 if ':' is not present, or split at the ':' and user atoi like line http://gitweb.mageia.org/software/drakx/tree/mdk-stage1/url.c#n419
Comment 1 Lewis Smith 2021-02-17 20:41:47 CET
Thank you for this detailed report & supporting evidence.
This is so precise, you should become a packager.
> I try the netinstall in order to use my local repository.
> But first I was unable.
It would be useful to know why you were unable; and why the hardcoded '80' did not work for you.

Assigning to the tools group anyway. Guessed the SRPM.

CC: (none) => lewyssmith
Source RPM: (none) => drakx-net-2.54-1.mga8.src.rpm
Assignee: bugsquad => mageiatools

Comment 2 Aurelien Oudelet 2021-02-17 20:52:33 CET
Even if this is reported against our Installer, I add some word in title.
This is for DrakX stage 1.

CC: (none) => ouaurelien
Summary: Enable users to specify the mirror port => Enable users to specify the mirror port in Installer
Source RPM: drakx-net-2.54-1.mga8.src.rpm => drakx-installer-images-2.82-2.mga8.src.rpm

Comment 3 Lewis Smith 2021-02-17 20:59:38 CET
Thanks for the corrections.

CC: lewyssmith => (none)

Comment 4 Thierry Vignaud 2021-02-17 21:43:37 CET
Care to suggest a patch?

CC: (none) => thierry.vignaud

Comment 5 Pascal Terjan 2021-02-17 22:46:28 CET
Created attachment 12349 [details]
Quick untested patch

CC: (none) => pterjan

Comment 6 Jybz 2021-02-18 11:21:40 CET
> Thank you for this detailed report & supporting evidence.
> This is so precise, you should become a packager.
Thank you, I tried to do the apprentice ship, but we are lost, my mentor seems overloaded, I don't know where we are, except that I'm faaar from being a packager.
See :
> https://wiki.mageia.org/en/Becoming_a_Mageia_Packager#Apprenticeship_in_progress
I should not edit it myself to add the bug report or anything, it is not acceptable. I would disagree that someone is filling it for himself, it is like a lack of trust.


> It would be useful to know why you were unable; and why the hardcoded '80' did not work for you.
There are few possible reason, like
- 80 is a port below 1024, a restricted port, where a specific setup is needed, like apache server or nginx...
- a web server is already running on this port 80, a webserver maybe incompatible in its configuration (a different partition, file location, output limits, or maybe to set up a mirror only locally and having a webserver reachable outside home)

On my side, my mirror is on a small single board computer armv7 BananaPro. I launch the server when I need it as legacy user with 
> cd /mnt/disk/mirror/
> python3 -m http.server 8888
When I'm done, like finishing updates, I shutdown down the mirror web server.
And to update my mirror
> rsync -aHSv --delete-after --delay-updates rsync://${UPSTREAM_MIRROR_ROOT}/${VERSION}/ ./${VERSION} 2>&1 

I don't want to use the port 80 here.
Comment 7 Nicolas Lécureuil 2021-02-18 13:56:19 CET
how can i build a netinstall for jybz ?

I rebuilded locally drakx-installer-binaries with the patch but i miss the next step. 


Can someone help me ?

CC: (none) => mageia

Comment 8 Thomas Backlund 2021-02-18 13:59:10 CET
install the drakx-installer-binaries, rebuild drakx-installer-images, extract iso from images rpm
Comment 9 Thierry Vignaud 2021-02-18 17:04:25 CET
Note that it was possible to build stage1 as a standalone tool for testing/debugging.
I'ven't attempted that for a long time but it should still be possible.
See https://wiki.mageia.org/en/Stage_One_install#Debugging_and_testing_the_stage1_on_a_test_machine_with_tftp

@neoclust:
drakx-installer-binaries (aka stage1) code is there:
http://gitweb.mageia.org/software/drakx/tree/mdk-stage1

If you want to do the full/slow way:
You can just patch & build drakx-installer-binaries with the above patch.
Then install the resulting package.
Then rebuild drakx-installer-images
Then boot a VM with the iso file from the newly generated drakx-installer-images:

rpm2cpio RPMS/x86_64/drakx-installer-images-2*.x86_64.rpm |cpio -id '*.iso'
mv usr/lib64/drakx-installer-images/install/images/Mageia-Cauldron-netinstall-x86_64.iso Mageia-Cauldron-netinstall-x86_64-auto.iso
Comment 10 Thierry Vignaud 2021-02-18 17:11:14 CET
Sorry wrong link:
https://wiki.mageia.org/en/Stage_One_install#Debugging_the_stage1_using_testing_mode

Before of not rebooting though…
Comment 11 Jybz 2021-05-15 12:44:03 CEST
Any update ?
Comment 12 Jybz 2022-01-04 13:31:29 CET
Any update ?
Comment 13 Thierry Vignaud 2022-01-04 17:43:08 CET
Can you test the patch?
I guess I could build a local image and check it still works w/o providing a port…
Comment 14 Nicolas Lécureuil 2022-01-04 21:28:38 CET
@Thierry: do you think you can create an image ? for Jybz to test
Comment 15 Thierry Vignaud 2022-01-05 11:16:45 CET
Fixed in git.
Tested with:
- no port provided (default)
- explicit 8080
- explicit 80

Status: NEW => RESOLVED
Resolution: (none) => FIXED

Comment 16 Thierry Vignaud 2022-01-07 10:25:18 CET
(In reply to Nicolas Lécureuil from comment #14)
> @Thierry: do you think you can create an image ? for Jybz to test

Current images from https://distrib-coffee.ipsl.jussieu.fr/pub/linux/Mageia/distrib/cauldron/x86_64/install/images/ are good to use.
Comment 17 Morgan Leijström 2022-01-07 11:39:54 CET
Maybe update mga8 netinstaller too?

CC: (none) => fri

Comment 18 Thierry Vignaud 2022-01-08 13:43:19 CET
Nope, the mga8 installer is frozen.
We can backport the fix into the drakx mga8 branch in case we would do a mga8.1 release.
But we would first have to get Jybz test result.
Note that the mga9 boot.iso can be used to install mga8.
Just pick your own local mirror
Comment 19 Jybz 2022-01-22 11:25:14 CET
I just try it.

It works !
With the cauldron netinstall image I could install mga8 on a virtualbox with a local mirror on my network behing the 8888 port.

But... Maybe I miss a step, I got the pointer of SDDM with a black screen. I could login as root on tty2 and try urpmi --auto-update, everything was uptodate and I checked the serverlog, all requests were there.

So I confirm, it works.

Note You need to log in before you can comment on or make changes to this bug.