Bug 12299

Summary: auto-inst cannot use tainted media
Product: Mageia Reporter: José Jorge <lists.jjorge>
Component: InstallerAssignee: Thierry Vignaud <thierry.vignaud>
Status: REOPENED --- QA Contact:
Severity: enhancement    
Priority: Normal CC: ennael1, mageia, mageia, mageia, marja11, stormi-mageia, tmb
Version: CauldronKeywords: NEEDINFO
Target Milestone: ---   
Hardware: All   
OS: Linux   
Whiteboard:
Source RPM: CVE:
Status comment:

Description José Jorge 2014-01-14 11:39:19 CET
I installed a system activating tainted media.

Using the auto_inst file created in /root for another system, the tainted packages are not installed.

Reproducible: 

Steps to Reproduce:
Damien Lallement 2014-02-13 05:40:12 CET

CC: (none) => mageia

Manuel Hiebel 2014-02-16 18:29:33 CET

Assignee: bugsquad => thierry.vignaud

Thierry Vignaud 2014-02-17 18:18:21 CET

Severity: normal => enhancement

Comment 1 Thierry Vignaud 2015-02-06 09:09:30 CET
b/c you didn't selected the tainted media on tat system?
Can you attach your auto_inst file?

Keywords: (none) => NEEDINFO

Comment 2 José Jorge 2015-02-06 18:47:11 CET
(In reply to Thierry Vignaud from comment #1)
> b/c you didn't selected the tainted media on tat system?

I did select at install time.

> Can you attach your auto_inst file?

It did not have any line to activate tainted media. If you think this was enhanced since May 2014, I can try again with Cauldron?
Comment 3 José Jorge 2015-06-23 12:08:26 CEST
New test with fixed patches : this lines are added to the auto_inst.

       'enabled_media' => [],
       'packages' => {
                              'media' => []
                            },

While it seems strange no media is listed, I am now testing an automated install using this new auto_inst file.

Status: NEW => ASSIGNED

Comment 4 José Jorge 2015-06-23 12:11:21 CEST
Bingo, while it skips the media selection screen, it fails saying "no media was selected". Can I fill it manually?
Comment 5 José Jorge 2015-10-25 12:09:46 CET
Ping.  Can I fill it manually?
Comment 6 Mageia Robot 2016-07-05 22:42:01 CEST
commit 8cd9c7cadbb8c35b618742691c525b7e39ebe435
Author: Thierry Vignaud <thierry.vignaud@...>
Date:   Mon May 11 04:05:03 2015 -0400

    remember selected media (mga#12299)
---
 Commit Link:
   http://gitweb.mageia.org/software/drakx/commit/?id=8cd9c7cadbb8c35b618742691c525b7e39ebe435
Comment 7 Mageia Robot 2016-07-05 22:42:04 CEST
commit bb6a6b14d66b6d261d73c10840b8ec2ae1589d1a
Author: Thierry Vignaud <thierry.vignaud@...>
Date:   Mon May 11 04:10:04 2015 -0400

    respect auto_inst media selection (mga#12299)
---
 Commit Link:
   http://gitweb.mageia.org/software/drakx/commit/?id=bb6a6b14d66b6d261d73c10840b8ec2ae1589d1a
Comment 8 Thierry Vignaud 2016-07-05 22:42:42 CEST
Fixed in git

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

Comment 9 José Jorge 2016-07-06 09:21:58 CEST
(In reply to Thierry Vignaud from comment #8)
> Fixed in git

Thank you Thierry, nice to see paternity still allows you to fix bugs ;-)
Comment 10 Olivier Blin 2016-08-18 12:54:49 CEST
This commit likely broke live images build:
no choosen media at /usr/lib/libDrakX/install/any.pm line 595.

Are you aware of the $o->{media}{selected_names} setting that already existed before?

See draklive-config/config/auto_inst.cfg.pl
$o = {
       'media' => [
           {
               type => 'media_cfg',
               url => 'drakx://media',
               selected_names => join(',',
                                      'Core Release', 'Core Updates',
                                      'Nonfree Release', 'Nonfree Updates',
                                  ),
           },


To reproduce :
$ git clone git://git.mageia.org/software/build-system/draklive-config/
$ sudo draklive --config-root $HOME/draklive-config/ --clean --all
using /home/blino/draklive-config/ as directory root
loaded config/live.cfg as config file
=== proceeding with region "all"
* entering step "clean"
umount: /home/draklive/var-data/chroot/Mageia-6-RC-LiveDVD-GNOME-i586-DVD/dev: mountpoint not found
umount: /home/draklive/var-data/chroot/Mageia-6-RC-LiveDVD-GNOME-i586-DVD/proc: mountpoint not found
umount: /home/draklive/var-data/chroot/Mageia-6-RC-LiveDVD-GNOME-i586-DVD/run: mountpoint not found
umount: /home/draklive/var-data/chroot/Mageia-6-RC-LiveDVD-GNOME-i586-DVD/sys/kernel/debug/usb: mountpoint not found
umount: /home/draklive/var-data/chroot/Mageia-6-RC-LiveDVD-GNOME-i586-DVD/sys: mountpoint not found
* step "clean" done
* entering step "install"
running setarch i586 perl /home/bcd/build_bcd/pieces/cauldron/i586/misc/drakx-in-chroot /home/bcd/build_bcd/pieces/cauldron/i586 /home/draklive/var-data/chroot/Mageia-6-RC-LiveDVD-GNOME-i586-DVD --auto_install /home/blino/draklive-config//config/auto_inst.cfg.pl
Entering step `Language'
Entering step `License'
Entering step `Mouse'
Entering step `Hard drive detection'
Entering step `Installation class'
Entering step `Keyboard'
Entering step `Security'
Entering step `Partitioning'
Entering step `Formatting'
Entering step `Choosing packages'
warning: Generating 18 missing index(es), please wait...
error :(
no choosen media at /usr/lib/libDrakX/install/any.pm line 595.

CC: (none) => ennael1, mageia, stormi, tmb

Comment 11 Thierry Vignaud 2016-08-18 13:37:31 CEST
Well it's not documented unlike the new option:
https://wiki.mageia.org/en/Auto_inst#enabled_media

I forgot about selected_names though I did worked on it 7 years ago (http://gitweb.mageia.org/software/drakx/commit/?id=f6be212).

We could rip the new enabled_media option though it's simpler to use.

But I doubt it causes you that error as:
1) Thomas successfully built LiveDVDs w/o any issue
2) the added code is only used if {enabled_media} is in use.

Have you tried draklive w/o the above commits (comment #6 & #7)?
Comment 12 Olivier Blin 2016-08-18 17:27:50 CEST
Thomas built a few lives since then, but kept on a older version on install, see on rabbit
/home/draklive/media/cauldron/i586/install/stage2 :
-r-xr-xr-x 1 root root 66M Jun 29 21:27 mdkinst.sqfs

It seems that the code extracted in enable_choosen_media() was not run in auto_install or draklive mode previously.

BTW, I don't think the match_all_hardware check is needed here, we are always in auto_install mode in draklive:
  media_screen($o) if !$::auto_install && !$::o->{match_all_hardware};
  enable_choosen_media($o);

We should really not have both selected_names and enabled_media options available.

Also, a typo should be fixed:
  choosen -> chosen

Thanks for your reply
Comment 13 Olivier Blin 2016-08-19 00:36:19 CEST
If I stub the install::any::enable_choosen_media() function, the media get chosen correctly for draklive installation.
Comment 14 Thierry Vignaud 2016-08-19 07:59:51 CEST
Then I guess we can revert the two above commits and document selected_names instead.
Can you do it?
Comment 15 Olivier Blin 2016-08-24 15:18:18 CEST
I'll give it a try, but I think we need to adapt your patch to write selected_names in auto_inst
Comment 16 Thierry Vignaud 2016-08-24 18:16:39 CEST
Agreed
Comment 17 Martin Whitaker 2016-10-22 23:04:59 CEST
I've just found this when running draklive. Reopening, because the fix needs rework.

Resolution: FIXED => (none)
Status: RESOLVED => REOPENED
CC: (none) => mageia

Comment 18 Martin Whitaker 2016-12-02 22:42:57 CET
I'm currently working round this by adding an 'enabled_media' field to the Live auto_inst.cfg.pl. For building the standard Live ISOs, that works fine. I think it would still be broken if someone tried using the 'additional_repository' option.
Comment 19 José Jorge 2016-12-03 08:37:43 CET
(In reply to Martin Whitaker from comment #18)
> I'm currently working round this by adding an 'enabled_media' field to the
> Live auto_inst.cfg.pl. For building the standard Live ISOs, that works fine.
> I think it would still be broken if someone tried using the
> 'additional_repository' option.

Thank for the hint, can you give an example of this field, with where to write it?

Maybe it could be written in  https://wiki.mageia.org/en/Auto_inst
Comment 20 Martin Whitaker 2016-12-04 18:08:29 CET
(In reply to José Jorge from comment #19)
> Thank for the hint, can you give an example of this field, with where to
> write it?

The 'additional_repository' option is one of the draklive settings. In the Live auto_inst_cfg.pl file, it then gets automatically added to the 'media' field, resulting in something like:

'media' => [
  {         
    type => 'media_cfg',
    url => 'drakx://media',
    selected_names => join(',',
                        'Core Release', 'Core Updates',
                        'Nonfree Release', 'Nonfree Updates',
                      ),
  },         
  {
    type => 'media',
    url => $additional_repository_value,
  },
],       

> Maybe it could be written in  https://wiki.mageia.org/en/Auto_inst

Yes, it would be good to have it documented there, but as you can see from the above, there's quite a few options to document (and I don't know whether there are any more). 'enabled_media' is a lot simpler...
Comment 21 Mageia Robot 2016-12-08 20:11:39 CET
commit 14c2c8e523d975f8b97cb382b7ccb91651fe27e0
Author: Martin Whitaker <mageia@...>
Date:   Sun Dec 4 20:06:16 2016 +0000

    auto_inst.cfg.pl: add enabled_media (temporary fix for mga#12299).
---
 Commit Link:
   http://gitweb.mageia.org/software/build-system/draklive-config/commit/?id=14c2c8e523d975f8b97cb382b7ccb91651fe27e0
Comment 22 Marja Van Waes 2021-05-26 12:39:23 CEST
(In reply to Mageia Robot from comment #21)
> commit 14c2c8e523d975f8b97cb382b7ccb91651fe27e0
> Author: Martin Whitaker <mageia@...>
> Date:   Sun Dec 4 20:06:16 2016 +0000
> 
>     auto_inst.cfg.pl: add enabled_media (temporary fix for mga#12299).
> ---
>  Commit Link:
>   
> http://gitweb.mageia.org/software/build-system/draklive-config/commit/
> ?id=14c2c8e523d975f8b97cb382b7ccb91651fe27e0

Does this report need to stay open for a more permanent fix?

CC: (none) => marja11