Marco d'Itri wrote: > I am attaching the rules and the script which I am using in the Debian > package to generate on demand aliases for CD readers. This is a bit buggy :( > choose_rules_file() { > [ -e "$RULES_FILE" ] || PRINT_HEADER=1 > if writeable ${RULES_FILE%/*}; then > RO_RULES_FILE='/dev/null' > else > RO_RULES_FILE=$RULES_FILE > RULES_FILE="/dev/.udev/tmp-rules--${RULES_FILE##*/}" > fi > } Sorry, I don't understand how /dev/.udev/tmp-rules--* is moved to /etc/udev/rules.d. In my version, I removed this hack and instead added the rule to fail the entire uevent if / is not writeable. Then the udev_retry script that runs after mounting filesystems picks the uevents up from /dev/.udev/failed (yes, I know that this script is not available in Debian). > find_next_available() { > local links="$(find_all_symlinks $1)" This contains embedded newlines. > local basename=${links%%[0-9]*} This doesn't work as expected because of newlines. To see the effect, connect 4 IDE CD-ROMs to one box (special thanks to Archaic from the Linux From Scratch team for testing this). Anyway, the fixed script (adapted to non-Debian systems) and rules are attached. -- Alexander E. Patrakov