From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from pigeon.gentoo.org ([208.92.234.80] helo=lists.gentoo.org) by finch.gentoo.org with esmtp (Exim 4.60) (envelope-from ) id 1OULwV-0005UJ-TD for garchives@archives.gentoo.org; Thu, 01 Jul 2010 15:44:48 +0000 Received: from pigeon.gentoo.org (localhost [127.0.0.1]) by pigeon.gentoo.org (Postfix) with SMTP id 8C547E0CD8; Thu, 1 Jul 2010 15:44:25 +0000 (UTC) Received: from mail-fx0-f53.google.com (mail-fx0-f53.google.com [209.85.161.53]) by pigeon.gentoo.org (Postfix) with ESMTP id 50AD4E0CD8 for ; Thu, 1 Jul 2010 15:44:25 +0000 (UTC) Received: by fxm19 with SMTP id 19so1554017fxm.40 for ; Thu, 01 Jul 2010 08:44:24 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:mime-version:received:received:in-reply-to :references:date:message-id:subject:from:to:content-type; bh=5RqUsjHI0B+GpnWsFK1BPkwWg45Ue/lXfYx7SnP4LJU=; b=rLQzPY6atYZ1ZbsPVke6zoyTSCG7Xqf2PbehTUT4FVVETGQsqPZTawiAVhp6zTiT2r j93IA3BZ+D6iSfhUskf1k9cNbAWKGfd8YgLP6Dr1ldV4fB14I96y/F7+orM/G7PBikC6 KaoQ9fOLQmgrJ9SH2Zfx2hVztukw2CG7x0aHQ= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=mime-version:in-reply-to:references:date:message-id:subject:from:to :content-type; b=g5KHfTXxZXYpnp/uiB6JubN4/YOfIw4z20YlbP+KFiIvHQLvI2il4W3BRbHWG5KHT7 IjiZjci+gThIo2mom94dNPyO6x3f3wKAnWUXfp1234tlWzvUjwIXJ+RXNPTRajjvPstW ljYlle76pPQSTfuXbNFy4wsyAyBTeovaxesiM= Precedence: bulk List-Post: List-Help: List-Unsubscribe: List-Subscribe: List-Id: Gentoo Linux mail X-BeenThere: gentoo-user@lists.gentoo.org Reply-to: gentoo-user@lists.gentoo.org MIME-Version: 1.0 Received: by 10.204.81.74 with SMTP id w10mr7728979bkk.79.1277999064123; Thu, 01 Jul 2010 08:44:24 -0700 (PDT) Received: by 10.204.56.20 with HTTP; Thu, 1 Jul 2010 08:44:24 -0700 (PDT) In-Reply-To: <20100701162653.592b261c@zaphod.digimed.co.uk> References: <20100701151624.11bd166f@zaphod.digimed.co.uk> <20100701162653.592b261c@zaphod.digimed.co.uk> Date: Thu, 1 Jul 2010 17:44:24 +0200 Message-ID: Subject: Re: [gentoo-user] activating swap by udev event From: SpaceCake To: gentoo-user@lists.gentoo.org Content-Type: multipart/alternative; boundary=0016e6d5618b3d8847048a555801 X-Archives-Salt: 817b3c13-8d35-4fb7-a299-df6f34134a07 X-Archives-Hash: 671fd30678610b6cac395e915b5505c2 --0016e6d5618b3d8847048a555801 Content-Type: text/plain; charset=ISO-8859-1 So, it solves the first problem, identifiying the device, but how can I tell to udev to use always /dev/sds (for example) for this device? Also I'm thinking how can I instruct udev to turn off swap when the device is removed, but this is another story :) Thanks L: 2010/7/1 Neil Bothwick > On Thu, 1 Jul 2010 17:17:15 +0200, SpaceCake wrote: > > > I've never created udev rule so the usal way does not tell me too > > much :) I've checked the net for examples but it looks like very > > complicated for me :) > > http://www.reactivated.net/writing_udev_rules.html > > > My usb stick looks like this > > > > Bus 007 Device 015: ID 058f:6387 Alcor Micro Corp. Transcend JetFlash > > Flash Drive > > > > Can you share with me some example how can I use this info on udev > > rules? > > SUBSYSTEMS=="usb", KERNEL=="sd[a-z]1", ATTRS{idVendor}=="058f", > ATTRS{idProduct}=="6387", RUN="/path/to/your/script" > > That's all on one line. > > -- > Neil Bothwick > > Like an atheist in a grave: all dressed up and no place to go. > --0016e6d5618b3d8847048a555801 Content-Type: text/html; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable So, it solves the first problem, identifiying the device, but how can I tel= l to udev to use always /dev/sds (for example) for this device? Also I'= m thinking how can I instruct udev to turn off swap when the device is remo= ved, but this is another story :)

Thanks
L:


2010/7/1 Neil Bothwi= ck <neil@digimed= .co.uk>
On Thu, 1 Jul 2010 17:17:15 +0200, SpaceCake wrote:

> I've never created udev rule so the usal way does not tell me too<= br> > much :) I've checked the net for examples but it looks like very > complicated for me :)

http://www.reactivated.net/writing_udev_rules.html

> My usb stick looks like this
>
> Bus 007 Device 015: ID 058f:6387 Alcor Micro Corp. Transcend JetFlash<= br> > Flash Drive
>
> Can you share with me some example how can I use this info on udev
> rules?

SUBSYSTEMS=3D=3D"usb", KERNEL=3D=3D"sd[a-z]1", AT= TRS{idVendor}=3D=3D"058f", ATTRS{idProduct}=3D=3D"6387"= , RUN=3D"/path/to/your/script"

That's all on one line.

--
Neil Bothwick

Like an atheist in a grave: all dressed up and no place to go.

--0016e6d5618b3d8847048a555801--