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

Problems using a USB flash drive as an apt source



Hey folks,

I'm trying to support some users, using Debian (CD/DVD) media written
to USB flash. Lots of people are using things this way rather than
optical media these days, of course.

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.

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:

APT::cdrom::CdromOnly "false";

in /etc/apt/apt.conf.d/00trustcdrom, and I've added in /etc/fstab, to
mount my USB stick at /media/cdrom as expected:

/dev/sdc1          /media/cdrom      auto    noauto             0 0

Now using "apt-cdrom add" crashes:

tack:/home/steve# apt-cdrom add
Segmentation fault (core dumped)

GNU gdb (Debian 8.2.1-2+b1) 8.2.1
Copyright (C) 2018 Free Software Foundation, Inc.
License GPLv3+: GNU GPL version 3 or later <http://gnu.org/licenses/gpl.html>
This is free software: you are free to change and redistribute it.
There is NO WARRANTY, to the extent permitted by law.
Type "show copying" and "show warranty" for details.
This GDB was configured as "x86_64-linux-gnu".
Type "show configuration" for configuration details.
For bug reporting instructions, please see:
<http://www.gnu.org/software/gdb/bugs/>.
Find the GDB manual and other documentation resources online at:
    <http://www.gnu.org/software/gdb/documentation/>.

For help, type "help".
Type "apropos word" to search for commands related to "word"...
Reading symbols from /usr/bin/apt-cdrom...Reading symbols from /usr/lib/debug/.build-id/a1/8e9304d77d24ef5f6a2c88966d92e1a3e5a4b8.debug...done.
done.
[New LWP 17871]
[Thread debugging using libthread_db enabled]
Using host libthread_db library "/lib/x86_64-linux-gnu/libthread_db.so.1".
Core was generated by `apt-cdrom add'.
Program terminated with signal SIGSEGV, Segmentation fault.
#0  __strcmp_avx2 () at ../sysdeps/x86_64/multiarch/strcmp-avx2.S:102
102     ../sysdeps/x86_64/multiarch/strcmp-avx2.S: No such file or directory.
(gdb) bt
#0  __strcmp_avx2 () at ../sysdeps/x86_64/multiarch/strcmp-avx2.S:102
#1  0x00007f642c0dd9a9 in FindMountPointForDevice[abi:cxx11](char const*) (devnode=devnode@entry=0x0)
    at ../apt-pkg/contrib/cdromutl.cc:279
#2  0x00007f642c0d4380 in pkgUdevCdromDevices::ScanForRemovable (this=<optimized out>, 
    CdromOnly=<optimized out>) at ../apt-pkg/cdrom.cc:972
#3  0x00007f642c0d461a in pkgUdevCdromDevices::Scan (this=this@entry=0x7ffd36bedd50)
    at ../apt-pkg/cdrom.cc:936
#4  0x000055b44a6d81ba in AddOrIdent (Add=true) at ../cmdline/apt-cdrom.cc:118
#5  0x00007f642c0def46 in CommandLine::DispatchArg (this=this@entry=0x7ffd36bee010, Map=<optimized out>, 
    NoMatch=NoMatch@entry=true) at ../apt-pkg/contrib/cmndline.cc:368
#6  0x00007f642c209630 in DispatchCommandLine (CmdL=..., Cmds=std::vector of length 4, capacity 4 = {...})
    at /usr/include/c++/8/bits/stl_iterator.h:783
#7  0x000055b44a6d7667 in main (argc=<optimized out>, argv=0x7ffd36bee158) at ../cmdline/apt-cdrom.cc:233
(gdb) up
#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?

Cheers,

Steve

-- 
Steve McIntyre, Cambridge, UK.                                steve@einval.com
  Getting a SCSI chain working is perfectly simple if you remember that there
  must be exactly three terminations: one on one end of the cable, one on the
  far end, and the goat, terminated over the SCSI chain with a silver-handled
  knife whilst burning *black* candles. --- Anthony DeBoer


Reply to: