[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Re: Problems using a USB flash drive as an apt source



Hi David!

On Mon, Sep 09, 2019 at 09:36:14PM +0200, David Kalnischkies wrote:
>On Mon, Sep 09, 2019 at 07:20:17PM +0100, Steve McIntyre wrote:
>> I spoke to Julian a while back about this, and he suggested something
>> along the lines of "oh, just use apt-cdrom as normal, but configure
>> apt to look at all removable media, not just cdrom drives". That seems
>> sensible enough, so I'm trying that now, using apt on my buster
>> system.
>
>[To be honest, I am a tiny bit surprised that this isn't the default…
>I thought it is, but a quick check says it isn't… mhhhh. Wasn't that
>like the point of using udev all these years ago I wonder…]

ACK!

>> I might just be doing something stupid (very possible, tired after an
>> over-running point release weekend!). After looking in the apt-cdrom
>> code, I've added the following config item:
>
>No worries… you tried and even looked at the code! That means you are
>more experienced with that program than [at least] I am and potentially
>everyone else in the team!

Oh, bugger - I was *hoping* I was doing something obviously wrong and
you'd be able to point out my mistake. :-)

>On the upside, if that turns out to be a bug we can backport that even
>into the dark ages with ease! ;)  [only partly joking…].
>
>> #1  0x00007f642c0dd9a9 in FindMountPointForDevice[abi:cxx11](char const*) (devnode=devnode@entry=0x0)
>>     at ../apt-pkg/contrib/cdromutl.cc:279
>> 279                 if (strcmp(out[0], devnode) != 0)
>> (gdb) p devnode
>> $1 = 0x0
>> 
>> devnode is NULL, which the code is clearly not expecting. Am I doing
>> something wrong here? What am I missing, please?
>
>That is an input parameter which comes from udev_device_get_devnode(3).
>Call is in apt-pkg/cdrom.cc and I don't see much error checking there,
>but then the manpage doesn't say what those errors could be – nor do
>I have a sensible idea why/how that call could fail.

ACK. I don't know how to drive udev *either* here -it's not something
I've ever had to do...

>We have no test covering this udev stuff, so I wouldn't really be
>surprised if that is "just" completely broken. I guess from your CD team
>PoV you might have some experience with writing automatic tests
>in that area so if you have some valuable pointers…

Ummm, maybe... :-)

>That said, shouldn't that work even without touching fstab (even if the
>apt-cdrom manpage says the opposite)?

I was wondering, but not sure.

>On the other hand, it might be good to skip udev-based auto-everything
>to check if at least the rest works [we have a basic test for that, but
>who knows…]. apt-cdrom --no-mount --cdrom /path/to/mounted/usbstick …

Not good:

tack:/home/steve# mount /dev/sdc1 /mnt
mount: /mnt: WARNING: device write-protected, mounted read-only.
tack:/home/steve# ulimit -c unlimited
tack:/home/steve# apt-cdrom add --no-mount --cdrom /mnt 
Segmentation fault (core dumped)

The stack trace points to the same problem I reported.

>Sorry for not having a more useful reply for now. I guess Julian or
>I have to bite the bullet and actually have a closer look at apt-cdrom.

ACK!

-- 
Steve McIntyre, Cambridge, UK.                                steve@einval.com
Dance like no one's watching. Encrypt like everyone is.
 - @torproject


Reply to: