Bug 775592

Summary: Wrong identification of USB disk in YaST Software repository manager
Product: [openSUSE] openSUSE Distribution Reporter: Mindaugas Baranauskas <opensuse.lietuviu.kalba>
Component: YaST2Assignee: YaST Team <yast-internal>
Status: RESOLVED WONTFIX QA Contact: Jiri Srain <jsrain>
Severity: Normal    
Priority: P3 - Medium CC: mfilka
Version: Leap 42.3   
Target Milestone: Leap 42.3   
Hardware: Other   
OS: openSUSE 12.1   
URL: https://trello.com/c/osCDFCQQ
Whiteboard:
Found By: --- Services Priority:
Business Priority: Blocker: ---
Marketing QA Status: --- IT Deployment: ---
Attachments: Adding repo
Editing repo
y2logs.tgz
y2logs in openSUSE Leap 42.3 beta/rc
Adding repo in openSUSE Leap 42.3
Editing repo in openSUSE Leap 42.3
Editing repo in openSUSE Leap 42.3 expanded

Description Mindaugas Baranauskas 2012-08-11 19:05:29 UTC
User-Agent:       Mozilla/5.0 (X11; Linux x86_64; rv:14.0) Gecko/20100101 Firefox/14.0.1

I can succesfully add local repository from removable media (USB hard disk).
But I can not edit this repository in YaST, 
because YaST tries to found content in other hard disk (not in external).

Reproducible: Always

Steps to Reproduce:
1. Attach external/removable USB hard disk
2. copy some RPM packages
3. create repository via YaST2 > "Software repositories" > [Add] > "USB Mass Storege (USB Stick, Disk)"
4. In YaST2 > "Software repositories" press [Edit] on created repository. 
Actual Results:  
Disk is other than I added:
I see "ST91..." disk (witch have 7 partitions).
Preselected is first partition.
If I just press "OK", I complain because it don't find repo.



Expected Results:  
I added "Seagate" disk (with have 4 partitions),
so I should see the same disk and preselected the same (2) partition.

Becides, while adding repo
USB disk is recognized as:
device=/dev/disk/by%2did/wwn%2d0x5000c5002feab895%2dpart2&filesystem=auto
and main Hard Disk identifiacated as:
device=/dev/disk/by%2did/scsi%2dSATA_ST9120821AS_5PL4HHLC%2dpart1&filesystem=auto
In /etc/zypp/repos.d/ identification after adding repo is correct.
So problem is only in editing existing repo (not in adding repo).
Comment 1 Mindaugas Baranauskas 2012-08-11 19:06:30 UTC
Created attachment 502063 [details]
Adding repo

Example image, you see 4 partitions
Comment 2 Mindaugas Baranauskas 2012-08-11 19:07:47 UTC
Created attachment 502064 [details]
Editing repo

... but while editing repository, you see another disk (and so another number of possible partitions)
Comment 3 Ladislav Slezák 2013-10-15 09:32:22 UTC
Please, attach Yast log (/var/log/YaST2/y2log).
Comment 4 Mindaugas Baranauskas 2013-10-15 10:12:59 UTC
Created attachment 563463 [details]
y2logs.tgz
Comment 5 Mindaugas Baranauskas 2017-06-16 16:34:14 UTC
Created attachment 729256 [details]
y2logs in openSUSE Leap 42.3 beta/rc

I can reproduce in openSUSE Leap 42.3, installed from 
openSUSE-Leap-42.3-DVD-x86_64-Build0279-Media.iso
Comment 6 Mindaugas Baranauskas 2017-06-16 16:35:43 UTC
Created attachment 729257 [details]
Adding repo in  openSUSE Leap 42.3

Updated example images
Comment 7 Mindaugas Baranauskas 2017-06-16 16:36:12 UTC
Created attachment 729258 [details]
Editing repo in  openSUSE Leap 42.3
Comment 8 Mindaugas Baranauskas 2017-06-16 16:40:23 UTC
Created attachment 729259 [details]
Editing repo in openSUSE Leap 42.3 expanded

Fuuny, I don't see same disk in editing, that I selected during adding repo!
Comment 9 Steffen Winterfeldt 2017-07-21 12:36:11 UTC
The cause for this is that via 'add' you select usb devices specifically. While
via 'edit' you see all kinds of disks.

So far the theory.

But in fact

https://github.com/yast/yast-packager/blob/master/src/modules/SourceDialogs.rb#L1137-L1140

shows that the actual implementation knows only either usb or not usb. So via 'edit' you get a selection of all non-usb devices.

IMO, the expression should be

  Ops.get_string(disk, "driver", "") == "usb-storage" && usb_only || !usb_only

to make DetectDisk() return either usb or *all* disks.
Comment 10 Steffen Winterfeldt 2017-07-21 12:39:03 UTC
tracking in yast trello board
Comment 11 Tomáš Chvátal 2019-07-11 11:01:32 UTC
This is automated batch bugzilla cleanup.

The openSUSE 42.3 changed to end-of-life (EOL [1]) status. As such
it is no longer maintained, which means that it will not receive any
further security or bug fix updates.
As a result we are closing this bug.

If you can reproduce this bug against a currently maintained version of 
openSUSE (At this moment openSUSE Leap 15.1, 15.0 and Tumbleweed) please
feel free to reopen this bug against that version (!you must update the
"Version" component in the bug fields, do not just reopen please), or
alternatively create a new ticket.

Thank you for reporting this bug and we are sorry it could not be fixed
during the lifetime of the release.

[1] https://en.opensuse.org/Lifetime