Compare commits

...

8 Commits

Author SHA1 Message Date
Harald Welte dbac2a5254 Merge pull request 'Add debian packaging' (#1) from osmith/rtl8168-eeprom:osmith/debian into master
Reviewed-on: #1
2022-05-16 12:07:41 +00:00
Oliver Smith 630734375f d/changelog: add 1.0.2 2022-05-16 14:05:28 +02:00
Oliver Smith 4efcedfeca Query PCI_FILL_{BASES,SIZES} in pci_fill_info too
The previous fix for missing pci_fill_info() was incomplete, it caused
the device to be found but changing the mac did not succeed. Fix it up
as separate commit, as the other commit is already packaged.
2022-05-16 14:03:10 +02:00
Oliver Smith 347924cc08 d/changelog: add 1.0.1 2022-05-16 10:50:40 +02:00
Oliver Smith 313de8d95e Exit with error if no device was found 2022-05-16 10:45:52 +02:00
Oliver Smith 1bf48da7a8 Fix missing pci_fill_info()
Before reading vendor_id or device_id from struct pci_dev, one must call
pci_fill_info() first. It looks like this had worked with previous
libpci versions, but with libpci 3.7.0 on debian 11 this patch is needed
or else the tool stops at 'starting bus iteration' without finding the
device.

Fixes: SYS#5956
2022-05-16 10:42:08 +02:00
Oliver Smith 189a39639d gitignore: new file 2022-05-10 14:57:00 +02:00
Oliver Smith efa74b0d02 debian: add dir for packaging
Related: SYS#5538
2022-05-10 14:56:56 +02:00
9 changed files with 67 additions and 0 deletions

2
.gitignore vendored Normal file
View File

@ -0,0 +1,2 @@
/rtl8168-eeprom
/rtl8168-eeprom.o

18
debian/changelog vendored Normal file
View File

@ -0,0 +1,18 @@
rtl8168-eeprom (1.0.2) unstable; urgency=medium
* Query PCI_FILL_{BASES,SIZES} in pci_fill_info too
-- Oliver Smith <osmith@sysmocom.de> Mon, 16 May 2022 14:05:15 +0200
rtl8168-eeprom (1.0.1) unstable; urgency=medium
* Fix missing pci_fill_info()
* Exit with error if no device was found
-- Oliver Smith <osmith@sysmocom.de> Mon, 16 May 2022 10:49:48 +0200
rtl8168-eeprom (1.0.0) unstable; urgency=medium
* Initial debian packaging.
-- Oliver Smith <osmith@sysmocom.de> Mon, 09 May 2022 16:28:19 +0200

1
debian/compat vendored Normal file
View File

@ -0,0 +1 @@
10

14
debian/control vendored Normal file
View File

@ -0,0 +1,14 @@
Source: rtl8168-eeprom
Section: devel
Priority: optional
Maintainer: Oliver Smith <osmith@sysmocom.de>
Standards-Version: 4.5.0
Build-Depends: debhelper (>= 10),
gcc,
libpci-dev,
pkg-config
Homepage: https://gitea.sysmocom.de/sysmocom/rtl8168-eeprom
Package: rtl8168-eeprom
Architecture: any
Description: Tool to set MAC address in EEPROM of RTL8168/8111E devices

23
debian/copyright vendored Normal file
View File

@ -0,0 +1,23 @@
Format: http://www.debian.org/doc/packaging-manuals/copyright-format/1.0/
Upstream-Name: rtl8168-eeprom
Files: *
Copyright: Copyright 2015 Harald Welte <hwelte@sysmocom.de>
License: GPL-2+
License: GPL-2+
This program is free software; you can redistribute it
and/or modify it under the terms of the GNU General Public
License as published by the Free Software Foundation; either
version 2 of the License, or (at your option) any later
version.
.
This program is distributed in the hope that it will be
useful, but WITHOUT ANY WARRANTY; without even the implied
warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
PURPOSE. See the GNU General Public License for more
details.
.
On Debian systems, the full text of the GNU General Public
License version 2 can be found in the file
`/usr/share/common-licenses/GPL-2'.

1
debian/rtl8168-eeprom.install vendored Normal file
View File

@ -0,0 +1 @@
/rtl8168-eeprom /usr/bin/

4
debian/rules vendored Executable file
View File

@ -0,0 +1,4 @@
#!/usr/bin/make -f
%:
dh $@

1
debian/source/format vendored Normal file
View File

@ -0,0 +1 @@
3.0 (native)

View File

@ -466,6 +466,7 @@ static void iterate_devices(struct pci_access *pa, char *filter_id, char *filter
continue;
/* our own clumsy implementation of filtering */
pci_fill_info(p, PCI_FILL_IDENT | PCI_FILL_BASES | PCI_FILL_SIZES);
if (p->vendor_id != 0x10ec || p->device_id != 0x8168)
continue;
@ -497,6 +498,8 @@ static void iterate_devices(struct pci_access *pa, char *filter_id, char *filter
if (new_mac)
exit(0);
}
die("no matching device found!\n");
}
int main(int argc, char **argv)