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

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



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…]


> 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!

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.


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…

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


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 …



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.


Best regards

David Kalnischkies

P.S.: "Shotgun, not me!" ;)

Attachment: signature.asc
Description: PGP signature


Reply to: