ALT Linux kernel packages development
 help / color / mirror / Atom feed
From: "Konstantin A. Lepikhov" <lakostis@anti-leasure.ru>
To: ALT Linux Kernel Devel Mailing List <devel-kernel@altlinux.ru>
Subject: [d-kernel] packet writing support scripts
Date: Thu, 7 Oct 2004 22:10:48 +0400
Message-ID: <20041007181048.GA4918@lks.home> (raw)

[-- Attachment #1: Type: text/plain, Size: 733 bytes --]

Здравствуйте!

Задолбало меня родителям объяснять, как надо правильно pktcdvd подключать,
решил сваять скриптик, который это делает автоматом. Работает он по
аналогии с idetune, т.е. запускается из rc.sysinit, умеет смотреть версии
ядра (чтобы лишний раз не стартовать) и возможности привода (чтобы не
пытаться поднять pktsetup на обычном cdrom'е :) Критика приветствуется,
т.к. сделано все на коленке и кривовато.

ЗЫ Так когда же в Сизиф уйдет новое wks26 ядро и появится
kernel-source-2.4.27?

-- 
WBR, Konstantin	      chat with ==>ICQ: 109916175
     Lepikhov,	      speak  to ==>JID: lakostis@jabber.org
aka L.A. Kostis       write  to ==>mailto:lakostis@pisem.net.nospam

...The information is like the bank... 			  (c) EC8OR

[-- Attachment #2: pktsetup --]
[-- Type: text/plain, Size: 1224 bytes --]

#!/bin/sh
#
# /etc/rc.d/scripts/pktsetup - run once at boot time from rc.sysinit
#

# Setup packet device for writing.
# based on /etc/rc.d/scripts/idetune
# written by LAKostis <lakostis at altlinux.org>


WITHOUT_RC_COMPAT=1

# Source function library.
. /etc/init.d/functions

PKTSETUP=/usr/bin/pktsetup
[ -x "$PKTSETUP" ] || exit 0

# in ALTLinux only wks* and std26-* kernel have packet writing support
check_kernel()
{
		local flavor
		local kver
		local valid=0

		flavor=`/bin/uname -r|/bin/cut -d- -f2`
		kver=`kernelversion_minor`

		[ "$kver" -gt 5 ] && `egrep -qs '(std|wks)26' "$flavor"`
		[ "$kver" -eq 4 ] && `egrep -qs 'wks' "$flavor"`
		valid=$?
		echo "$valid"
}		
check_drive()
{
		local drive=$1
		local valid

		`dmesg|egrep -qs "$drive\:.*\/RW"`
		valid=$?
		echo "$valid"
}
# Reset parameters.
sourced=
SourceIfNotEmpty /etc/sysconfig/pktsetup && sourced=1
[ -n "$sourced" ] || continue
if [ -n "$DEVICES" ] && [ "`check_kernel`" -eq 1 ] 2>/dev/null; then
		modprobe pktcdvd
		for DEVICE in "$DEVICES"; do
				if [ "`check_drive $DEVICE`" -eq 1 ]; then
						i=0
						action "Mapping $DEVICE drive as packet device pktcdvd$i:" "$PKTSETUP" pktcdvd$i "$DEVICE"
						i=`expr $i + 1`
				fi
		done		
fi

             reply	other threads:[~2004-10-07 18:10 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2004-10-07 18:10 Konstantin A. Lepikhov [this message]
2004-10-07 19:25 ` Dmitry V. Levin
2004-10-12  6:54 ` Michael Shigorin

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20041007181048.GA4918@lks.home \
    --to=lakostis@anti-leasure.ru \
    --cc=devel-kernel@altlinux.ru \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link

ALT Linux kernel packages development

This inbox may be cloned and mirrored by anyone:

	git clone --mirror http://lore.altlinux.org/devel-kernel/0 devel-kernel/git/0.git

	# If you have public-inbox 1.1+ installed, you may
	# initialize and index your mirror using the following commands:
	public-inbox-init -V2 devel-kernel devel-kernel/ http://lore.altlinux.org/devel-kernel \
		devel-kernel@altlinux.org devel-kernel@altlinux.ru devel-kernel@altlinux.com
	public-inbox-index devel-kernel

Example config snippet for mirrors.
Newsgroup available over NNTP:
	nntp://lore.altlinux.org/org.altlinux.lists.devel-kernel


AGPL code for this site: git clone https://public-inbox.org/public-inbox.git