Comment 22 for bug 7337

Revision history for this message
Debian Bug Importer (debzilla) wrote :

Message-ID: <20040812222023.GA18474@slipstream>
Date: Fri, 13 Aug 2004 00:20:23 +0200
From: Thomas Schmidt <email address hidden>
To: Bdale Garbee <email address hidden>
Cc: Adrian Bunk <email address hidden>, <email address hidden>, <email address hidden>
Subject: Re: Bug#263136: This issue might break applications

--mxv5cy4qt+RJ9ypb
Content-Type: multipart/mixed; boundary="wRRV7LY7NUeQGEoC"
Content-Disposition: inline

--wRRV7LY7NUeQGEoC
Content-Type: text/plain; charset=us-ascii
Content-Disposition: inline
Content-Transfer-Encoding: quoted-printable

* Bdale Garbee schrieb am 12.08.04, um 23:22 Uhr:
> Someone want to offer me a patch that implements this? It's not hard, bu=
t I'm
> working on other things today and it'll get done faster if someone hands =
me a
> patch.
>=20
> There's already code in the consoleonly target to do kernel version check=
ing.

Ah, this was the part where i did not know how to realize this check,
thanks for the hint. :)

Well, i created a patch for this bug now, but i am not completely sure
about the check of the $kern_rev3, because it will also output just 8
on kernels like 2.6.8-pre2 (where char-major 250 was used).

The second thing where i am not sure is if it is needed to check for
devfs before calling makedev, and if the ckeck in my patch is right.

See the attached file.

Thomas

--=20
Thomas Schmidt
<email address hidden>

--wRRV7LY7NUeQGEoC
Content-Type: text/plain; charset=us-ascii
Content-Disposition: attachment; filename="263136.diff"
Content-Transfer-Encoding: quoted-printable

diff -Nurd makedev-2.3.1/debian/init.d makedev-2.3.1.new/debian/init.d
--- makedev-2.3.1/debian/init.d 2004-08-13 00:08:20.000000000 +0200
+++ makedev-2.3.1.new/debian/init.d 2004-08-13 00:10:38.000000000 +0200
@@ -8,6 +8,20 @@
 case "$1" in
   start)
  test -L /dev/MAKEDEV || ln -fs /sbin/MAKEDEV /dev/MAKEDEV
+
+ # create dvb-devices, if the dvb-directory allready exists, and=20
+ # no devfs is used (this a workaround for the changed major-number
+ # of the dvb-devices, introduced in kernel 2.6.8, to be able to=20
+ # switch between kernels <=3D 2.6.7 and >=3D 2.6.8, without manual=20
+ # recreation of the devices (MAKEDEV dvb checks the kernel-version=20
+ # and uses the correct major-number))
+=09
+ if [ ! -e /dev/.devfsd ]; then
+ if [ -d /dev/dvb ]; then
+ cd /dev && ./MAKEDEV dvb
+ fi
+ fi
+=09
  ;;
   stop|reload|restart|force-reload)
  ;;
diff -Nurd makedev-2.3.1/MAKEDEV makedev-2.3.1.new/MAKEDEV
--- makedev-2.3.1/MAKEDEV 2004-08-13 00:08:20.000000000 +0200
+++ makedev-2.3.1.new/MAKEDEV 2004-08-13 00:09:44.000000000 +0200
@@ -1974,18 +1974,32 @@
   done
   ;;
  dvb)
+ # check if kernel-version is >=3D 2.6.8, if yes, create dvb-devices with
+ # major-number 212, in the other case 250
+ =09
+ kern_rev1=3D`uname -r | sed -e 's@^\([^.]*\)\..*@\1@'`
+ kern_rev2=3D`uname -r | sed -e 's@^[^.]*\.\([^.]*\)\..*@\1@'`
+ kern_rev3=3D`uname -r | sed -e 's@^[^.]*\.[^.]*\.\([^.][0-9]*\).*@\1@'`
+ =20
+ dvb_major=3D250
+
+ if [ $kern_rev1 -ge 2 ] && [ $kern_rev2 -ge 6 ] && [ $kern_rev3 -ge 8 ]
+ then
+ dvb_major=3D212
+ fi
+
   mkdir -p dvb
   for i in 0 1 2 3
   do
    mkdir -p dvb/adapter$i
- makedev dvb/adapter$i/video0 c 250 `math 64 \* $i + 0` $video
- makedev dvb/adapter$i/audio0 c 250 `math 64 \* $i + 1` $video
- makedev dvb/adapter$i/frontend0 c 250 `math 64 \* $i + 3` $video
- makedev dvb/adapter$i/demux0 c 250 `math 64 \* $i + 4` $video
- makedev dvb/adapter$i/dvr0 c 250 `math 64 \* $i + 5` $video
- makedev dvb/adapter$i/ca0 c 250 `math 64 \* $i + 6` $video
- makedev dvb/adapter$i/net0 c 250 `math 64 \* $i + 7` $video
- makedev dvb/adapter$i/osd0 c 250 `math 64 \* $i + 8` $video
+ makedev dvb/adapter$i/video0 c $dvb_major `math 64 \* $i + 0` $video
+ makedev dvb/adapter$i/audio0 c $dvb_major `math 64 \* $i + 1` $video
+ makedev dvb/adapter$i/frontend0 c $dvb_major `math 64 \* $i + 3` $video
+ makedev dvb/adapter$i/demux0 c $dvb_major `math 64 \* $i + 4` $video
+ makedev dvb/adapter$i/dvr0 c $dvb_major `math 64 \* $i + 5` $video
+ makedev dvb/adapter$i/ca0 c $dvb_major `math 64 \* $i + 6` $video
+ makedev dvb/adapter$i/net0 c $dvb_major `math 64 \* $i + 7` $video
+ makedev dvb/adapter$i/osd0 c $dvb_major `math 64 \* $i + 8` $video
   done
   ;;
  usb)

--wRRV7LY7NUeQGEoC--

--mxv5cy4qt+RJ9ypb
Content-Type: application/pgp-signature; name="signature.asc"
Content-Description: Digital signature
Content-Disposition: inline

-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.2.5 (GNU/Linux)

iD8DBQFBG+0nc9+NqwoydlIRAvnlAKDHmKn/EXurQzIekLxaqpWgAMzDDQCgrjfl
JzXQVsqFUYtL/8gNQmIJj7M=
=+HLe
-----END PGP SIGNATURE-----

--mxv5cy4qt+RJ9ypb--