Better(?) rc.sysinit for 1.07/1.08

Under development: PCMCIA, wireless, etc.
Post Reply
Message
Author
iscove
Posts: 17
Joined: Fri 30 Dec 2005, 02:49

Better(?) rc.sysinit for 1.07/1.08

#1 Post by iscove »

This basic idea looks like it is already in Pup2. Any, FWIW, I've changed the sysinit to look in each storage device for pup001, and if it is found that drive is mounted as /mnt/home. If it is not found, the script prompts for selection of a drive from the keyboard. If no drive is supplied, Puppy runs without a pup001. Seems solid on 2 different machines.

Detection of a USB drive seems to work without using SLEEP; it is done within Barry's original section

cat /proc/pci | grep -i "usb" > /dev/null #old PCs may not have usb.
if [ $? -eq 0 ];then
#need to mount this, but not here if it is in /etc/fstab...
echo -n "Mounting usbfs:"
mount -t usbfs none /proc/bus/usb;check_status $?
#...RH doesn't have this one in fstab, so I won't.
#Here is what could be put into fstab:
# none /proc/bus/usb usbfs defaults 0 0
modprobe usb-storage
#this works, hds shows up in /tmp/drives.txt below
fi

I have not yet tested it with a pup001 on the USB drive, but the drive does show up in the list of available drives created later in /tmp/drives.txt

rc.sysinit is attached

iscove
Posts: 17
Joined: Fri 30 Dec 2005, 02:49

attachment

#2 Post by iscove »

rc.sysinit should be attached.

iscove
Posts: 17
Joined: Fri 30 Dec 2005, 02:49

attachment (again, this time with IE)

#3 Post by iscove »

try again, IE instead of Opera

iscove
Posts: 17
Joined: Fri 30 Dec 2005, 02:49

try again

#4 Post by iscove »

attachment as zip
Attachments
rcsysinit.zip
(9.88 KiB) Downloaded 344 times

User avatar
jmarsden
Posts: 265
Joined: Sat 31 Dec 2005, 22:18
Location: California, USA

Re: Better(?) rc.sysinit for 1.07/1.08

#5 Post by jmarsden »

iscove wrote:cat /proc/pci | grep -i "usb" > /dev/null #old PCs may not have usb.
if [ $? -eq 0 ];then
This seems more complex and harder to read than it needs to be?

Code: Select all

if grep -iqs usb /proc/pci ;then
does the same thing in one line and avoids the /dev/null redirection clutter. In general, cat to a pipe is unnecessary and should be avoided. There are guides to shell scripting that talk about "cat considered harmful" because many people tend to use it where it is not needed. Google for "useless use of cat award" :-)

I suspect putting the usbfs pseudo-filesystem into /etc/fstab (at least with options that auto-mount it at boot) might cause issues on systems with no USB hardware at all? This may be why RH does not do that. This is untested speculation, pure conjecture; I have no evidence to back it up.

Jonathan

Post Reply