Hi,
I get: * Udpcast command line version: udpcast-20070602-1.i586.rpm * Udpcast boot disk generator: udpcast-mkimage-20071228-1.i586.rpm * Udpcast Linux kernel for use with boot disk generator: kernel-udpcast-2.6.23.12-1.i586.rpm and build DEB packages using alien (DEB version at http://udpcast.linux.lu/source.html require libc6 higher than I have on etch).
I build an image including my scripts. And predialog doesn't run. (it worked in previous version) If I launch my predialog manually (ALT+F2,...), it works.
My predialog is used to get udpcast parameters from boot and generate /udpcfg.txt before udpc_dialog is launched.
My predialog was: =========================== #!/bin/sh
modprobe ide-cd /bin/udpc_dialog init ( cd /proc/ide ; for i in hd? ; do if fgrep -q cdrom $i/media ; then eject /dev/$i ; echo ejecting /dev/$i ; fi ; done) sh /bin/udpcfg_txt.sh ===========================
But there is an error: When launching cd /proc/ide I see /proc/ide: bad directory And script stops.
Solution: If I comment line used to eject CD, it is OK. My script runs.
Maybe it would be possible to do something using /proc/sys/dev/cdrom/info or /proc/sys/dev/cdrom/autoeject
# grep "drive name" /proc/sys/dev/cdrom/info drive name: hdc #
But # grep "drive name" /proc/sys/dev/cdrom/info | sed -e "s/ //g" #
Troubles with redirections?
I would like to do something like: # grep "drive name" /proc/sys/dev/cdrom/info | tr "\t" " " | sed -e "s/ //g" | cut -d ":" -f2
Regards.
Stephane wrote: [...]
But there is an error: When launching cd /proc/ide I see /proc/ide: bad directory And script stops.
Solution: If I comment line used to eject CD, it is OK. My script runs.
Maybe it would be possible to do something using /proc/sys/dev/cdrom/info or /proc/sys/dev/cdrom/autoeject
# grep "drive name" /proc/sys/dev/cdrom/info drive name: hdc #
But # grep "drive name" /proc/sys/dev/cdrom/info | sed -e "s/ //g" #
Troubles with redirections?
I would like to do something like: # grep "drive name" /proc/sys/dev/cdrom/info | tr "\t" " " | sed -e "s/ //g" | cut -d ":" -f2
Regards.
Indeed, in order to save space, I compiled the kernel without /proc/ide support:
config IDE_PROC_FS bool "legacy /proc/ide/ support" depends on IDE && PROC_FS default y help This option enables support for the various files in /proc/ide. In Linux 2.6 this has been superseded by files in sysfs but many legacy applications rely on this.
If unsure say Y.
As you noted, you can still achieve the same functionality using /sys
One way would for instance be the following command:
fgrep -l cdrom /sys/block/*/device/media | sed 's//sys/block/(.*)/device/media/\1/'
To be run with today's version, in order to avoid the __libc_atexit/--gc-sections bug...
Regards,
Alain
Hi,
Le dimanche 6 janvier 2008 20:18, vous avez écrit :
Stephane wrote: [...]
But there is an error: When launching cd /proc/ide I see /proc/ide: bad directory And script stops.
Solution: If I comment line used to eject CD, it is OK. My script runs.
Maybe it would be possible to do something using /proc/sys/dev/cdrom/info or /proc/sys/dev/cdrom/autoeject
# grep "drive name" /proc/sys/dev/cdrom/info drive name: hdc #
But # grep "drive name" /proc/sys/dev/cdrom/info | sed -e "s/ //g" #
Troubles with redirections?
I would like to do something like: # grep "drive name" /proc/sys/dev/cdrom/info | tr "\t" " " | sed -e "s/ //g" | cut -d ":" -f2
Regards.
Indeed, in order to save space, I compiled the kernel without /proc/ide support:
config IDE_PROC_FS bool "legacy /proc/ide/ support" depends on IDE && PROC_FS default y help This option enables support for the various files in /proc/ide. In Linux 2.6 this has been superseded by files in sysfs but many legacy applications rely on this.
If unsure say Y.
As you noted, you can still achieve the same functionality using /sys
One way would for instance be the following command:
fgrep -l cdrom /sys/block/*/device/media | sed 's//sys/block/(.*)/device/media/\1/'
To be run with today's version, in order to avoid the __libc_atexit/--gc-sections bug...
I get this version but it doesn't solve trouble.
# fgrep -l cdrom /sys/block/*/device/media returns /sys/block/hdc/device/media
It could be fine but
# fgrep -l cdrom /sys/block/*/device/media | sed 's//sys/block/(.*)/device/media/\1/' returns blank
# fgrep -l cdrom /sys/block/*/device/media | cut -d"/" -f4 returns blank
Regards.