ppcrcd/conf.dir: etc/filesystems etc/pbbuttonsd.conf
usr/lib/ppcrcd/functions usr/lib/ppcrcd/hw-dete...
sparky
cvs at pld-linux.org
Thu Jun 16 19:59:39 CEST 2005
Author: sparky
Date: Thu Jun 16 19:59:28 2005
New Revision: 6104
Added:
ppcrcd/conf.dir/etc/filesystems
Modified:
ppcrcd/conf.dir/etc/pbbuttonsd.conf
ppcrcd/conf.dir/usr/lib/ppcrcd/functions
ppcrcd/conf.dir/usr/lib/ppcrcd/hw-detect
ppcrcd/conf.dir/usr/lib/ppcrcd/load-conf
ppcrcd/conf.dir/usr/lib/ppcrcd/rc.live
ppcrcd/conf.dir/usr/lib/ppcrcd/saveconfig
ppcrcd/conf.dir/usr/lib/ppcrcd/setbootopt
Log:
- many script and preconfiguration fixes
Added: ppcrcd/conf.dir/etc/filesystems
==============================================================================
--- (empty file)
+++ ppcrcd/conf.dir/etc/filesystems Thu Jun 16 19:59:28 2005
@@ -0,0 +1,10 @@
+ext2
+vfat
+minix
+nodev proc
+nodev devpts
+iso9660
+hfsplus
+hfs
+xfs
+reiserfs
Modified: ppcrcd/conf.dir/etc/pbbuttonsd.conf
==============================================================================
--- ppcrcd/conf.dir/etc/pbbuttonsd.conf (original)
+++ ppcrcd/conf.dir/etc/pbbuttonsd.conf Thu Jun 16 19:59:28 2005
@@ -3,7 +3,7 @@
# [SYSTEM]
#userallowed = "paranoid" ; user who is allowed to use IPC
-autorescan = no ; automatic rescan of event devices
+autorescan = yes ; automatic rescan of event devices
CmdTimeout = 4
# [MODULE POWERSAVE]
Modified: ppcrcd/conf.dir/usr/lib/ppcrcd/functions
==============================================================================
--- ppcrcd/conf.dir/usr/lib/ppcrcd/functions (original)
+++ ppcrcd/conf.dir/usr/lib/ppcrcd/functions Thu Jun 16 19:59:28 2005
@@ -94,4 +94,13 @@
}
+### tl: to lower #############################################################
+tl() {
+ if [ -n "$1" ]; then
+ echo $* | tr "[:upper:]" "[:lower:]"
+ else
+ cat | tr "[:upper:]" "[:lower:]"
+ fi
+}
+
# vi:ts=4:sw=4
Modified: ppcrcd/conf.dir/usr/lib/ppcrcd/hw-detect
==============================================================================
--- ppcrcd/conf.dir/usr/lib/ppcrcd/hw-detect (original)
+++ ppcrcd/conf.dir/usr/lib/ppcrcd/hw-detect Thu Jun 16 19:59:28 2005
@@ -55,7 +55,7 @@
echo "$cddevs" | grep -q " $cddev " && continue
cddevs="$cddevs $cddev "
verbose 2 " +-Found cdrom: $cdrom"
- echo "$cdrom /media/$(basename $cdrom) iso9660 defaults,ro,user,noauto" \
+ echo "$cdrom /media/$(basename $cdrom) iso9660,udf,hfsplus,hfs defaults,ro,user,noauto" \
>> /etc/fstab
mkdir -p /media/$(basename $cdrom)
done
@@ -64,11 +64,6 @@
# Searching for partitions ###################################################
verbose 1 " +-Checking partitions"
-type=
-is_type() {
- echo $type | grep -q -i "$1"
- return $?
-}
mac-fdisk -l 2>/dev/null | egrep "^/dev/[a-z]+[0-9]+" > /tmp/parts.mac
fdisk -l 2>/dev/null | egrep "^/dev/[a-z]+[0-9]+" > /tmp/parts.pc
@@ -76,55 +71,89 @@
for dev in /dev/hd??* /dev/sd??*; do
[ -r $dev ] || continue
verbose 3 " +-Checking $dev"
- mnt="/media/$(basename $dev)"
+ mnt="/mnt/$(basename $dev)"
if egrep -q "^$dev[ ]" /tmp/parts.mac; then # mac partitions
verbose 3 -n " +-Mac partition, "
line="$(egrep "^$dev[ ]" /tmp/parts.mac)"
type="$(echo $line | sed 's/^.*)//')"
mnt="${mnt}_$(echo $line | awk '{print $3}')"
- if is_type "Linux"; then
- if is_type "swap"; then
+ case "$(tl $type)" in
+ *linux*swap*)
mnt=
echo "#$dev swap swap defaults 0 0" >> /etc/fstab
verbose 3 "type: swap (not activating)"
- else
+ ;;
+ *linux*)
echo "$dev $mnt auto defaults,noauto,noatime 0 0" >> /etc/fstab
verbose 3 "type: linux"
- fi
- elif is_type "bootblock"; then
- echo "$dev $mnt hfs defaults,noauto,noatime 0 0" >> /etc/fstab
- verbose 3 "type: bootblock"
- elif is_type "HFS"; then
- echo "$dev $mnt hfsplus defaults,noauto,noatime 0 0" >> /etc/fstab
- verbose 3 "type: hfs"
- else
- mnt=
- verbose 3 "type: unknown"
- fi
+ ;;
+ *bootblock*)
+ echo "$dev $mnt hfs,hfsplus defaults,noauto,noatime 0 0" >> /etc/fstab
+ verbose 3 "type: bootblock"
+ ;;
+ *hfs*)
+ echo "$dev $mnt hfsplus,hfs defaults,noauto,noatime 0 0" >> /etc/fstab
+ verbose 3 "type: hfs"
+ ;;
+ *dos*) #PRODOS - fat ?
+ echo "$dev $mnt fat,vfat,msdos defaults,noauto,noatime 0 0" >> /etc/fstab
+ verbose 3 "type: dos"
+ ;;
+ #MFS - not supported
+ *)
+ mnt=
+ verbose 3 "type: unknown"
+ ;;
+ esac
elif egrep -q "^$dev[ ]" /tmp/parts.pc; then # pc partitions
verbose 3 -n " +-PC partition, "
type="$(egrep "^$dev[ ]" /tmp/parts.pc | cut -c 56-)"
- if is_type "Linux"; then
- if is_type "swap"; then
+ case "$(tl $type)" in
+ *linux*swap)
mnt=
echo "#$dev swap swap defaults 0 0" >> /etc/fstab
verbose 3 "type: swap (not activating)"
- else
+ ;;
+ *linux*)
mnt="${mnt}_linux"
echo "$dev $mnt auto defaults,noauto,noatime 0 0" >> /etc/fstab
verbose 3 "type: linux"
- fi
- elif is_type "fat"; then
- mnt="${mnt}_fat"
- echo "$dev $mnt vfat user,noauto,umask=002,uid=0,gid=28,exec,showexec 0 0" >> /etc/fstab
- verbose 3 "type: vfat"
- elif is_type "ntfs"; then
- mnt="${mnt}_ntfs"
- echo "$dev $mnt ntfs user,noauto,umask=002,uid=0,gid=28 0 0" >> /etc/fstab
- verbose 3 "type: ntfs"
- else
- mnt=
- verbose 3 "type: unknown"
+ ;;
+ *dos*)
+ mnt="${mnt}_dos"
+ echo "$dev $mnt msdos,fat,vfat user,noauto,umask=002,uid=0,gid=28,exec,showexec 0 0" >> /etc/fstab
+ verbose 3 "type: dos"
+ ;;
+ *fat*)
+ mnt="${mnt}_fat"
+ echo "$dev $mnt vfat,fat,msdos user,noauto,umask=002,uid=0,gid=28,exec,showexec 0 0" >> /etc/fstab
+ verbose 3 "type: fat"
+ ;;
+ *nfts*)
+ mnt="${mnt}_ntfs"
+ echo "$dev $mnt ntfs user,noauto,umask=002,uid=0,gid=28 0 0" >> /etc/fstab
+ verbose 3 "type: ntfs"
+ ;;
+ *hpfs*)
+ mnt="${mnt}_hpfs"
+ echo "$dev $mnt hpfs user,noauto,umask=002,uid=0,gid=28 0 0" >> /etc/fstab
+ verbose 3 "type: hpfs"
+ ;;
+ *bsd*)
+ mnt="${mnt}_bsd"
+ echo "$dev $mnt ufs user,noauto,umask=002,uid=0,gid=28 0 0" >> /etc/fstab
+ verbose 3 "type: bsd"
+ ;;
+ *minix*)
+ mnt="${mnt}_minix"
+ echo "$dev $mnt minix user,noauto,umask=002,uid=0,gid=28 0 0" >> /etc/fstab
+ verbose 3 "type: minix"
+ ;;
+ *)
+ mnt=
+ verbose 3 "type: unknown"
+ ;;
+ esac
fi
else
mnt=
Modified: ppcrcd/conf.dir/usr/lib/ppcrcd/load-conf
==============================================================================
--- ppcrcd/conf.dir/usr/lib/ppcrcd/load-conf (original)
+++ ppcrcd/conf.dir/usr/lib/ppcrcd/load-conf Thu Jun 16 19:59:28 2005
@@ -27,12 +27,12 @@
[ -n "$FS" ] && FS="-t $FS"
if ! [ -r "/dev/$DEV" ]; then
- warn "No device: /dev/$DEV, waiting 20s"
+ warn "No device: /dev/$DEV, waiting 20s, press 'A' to abort"
i=20
while [ $i -gt 0 ]; do
- echo -n .
[ -r "/dev/$DEV" ] && break
- sleep 1
+ echo -n .
+ /sbin/getkey -c1 a A && break
let $((i--))
done
echo
@@ -46,7 +46,10 @@
[ -r "/media/conf/$FILE" ] || die 9 "No file; $(ls /media/conf/)"
( gunzip -c /media/conf/$FILE || die 10 "Can't uncompress" ) \
- | tar -xf - || die 11 "Can't unpack"
+ | tar --exclude=etc/{fs,m}tab -xf - || die 11 "Can't unpack"
+
+[ -r etc/fstab.add ] && ( echo "#Saved:"; cat etc/fstab.add) >> etc/fstab
+rm -f etc/fstab.add
if [ -r /removed ]; then
while read to_del; do
Modified: ppcrcd/conf.dir/usr/lib/ppcrcd/rc.live
==============================================================================
--- ppcrcd/conf.dir/usr/lib/ppcrcd/rc.live (original)
+++ ppcrcd/conf.dir/usr/lib/ppcrcd/rc.live Thu Jun 16 19:59:28 2005
@@ -43,15 +43,33 @@
[ -n "$verb" ] && echo $verb > /verbose
+### load-conf ################################################################
sh $SHD /usr/lib/ppcrcd/load-conf
CONF_LOADED=$?
+
+### net-detect ###############################################################
sh $SHD /usr/lib/ppcrcd/net-detect
cmdopt nodetect || ( \
[ "$CONF_LOADED" -ne 0 ] && \
sh $SHD /usr/lib/ppcrcd/hw-detect )
+cmdopt nonet && \
+ sed -i -e 's/ONBOOT=.*/ONBOOT=no/' /etc/sysconfig/interfaces/ifcfg-*
+
+
+### swap #####################################################################
+swap=$(cmdvar "swap")
+if [ -z "$swap" ]; then
+ cmdopt nonvswap || swap=$(nvvar swap)
+fi
+if [ -n "$swap" ]; then
+ ######### !!!!!!!!!!!!!!!!!!!!!!!!!!!! TODO
+fi
+
+
+### modules ##################################################################
modules=$(cmdvar "modules")
if [ -z "$modules" ]; then
cmdopt nonvmodules || modules=$(nvvar modules)
@@ -63,9 +81,6 @@
done
fi
-cmdopt nonet && \
- sed -i -e 's/ONBOOT=.*/ONBOOT=no/' /etc/sysconfig/interfaces/ifcfg-*
-
### keytable #################################################################
keytable=$(cmdvar "k(ey){0,1}(map|tab.*)")
@@ -85,6 +100,7 @@
done < /usr/lib/ppcrcd/etc/keymaps
fi
+
### services #################################################################
serv=$(cmdvar service)
if [ -z "$serv" ]; then
Modified: ppcrcd/conf.dir/usr/lib/ppcrcd/saveconfig
==============================================================================
--- ppcrcd/conf.dir/usr/lib/ppcrcd/saveconfig (original)
+++ ppcrcd/conf.dir/usr/lib/ppcrcd/saveconfig Thu Jun 16 19:59:28 2005
@@ -49,6 +49,10 @@
# tar | gzip checking for errors #############################################
cd /tmp
+rm etc/mtab
+egrep -v "(^#{0,1}none|^#/dev/hdXX|swap|^# Examples)" etc/fstab > etc/fstab.add
+rm etc/fstab
+
( tar -cf - etc $([ -r removed ] && echo removed); \
echo $? > /tmp/tar-exit ) \
| gzip -9 -c -f > "$OUT_DIR/$OUT_FILE" \
@@ -66,8 +70,7 @@
echo "Trying to determine kernel conf= options..."
DEV=$(df $OUT_DIR | awk 'FNR==2 {print $1}')
-if echo $DEV | egrep -q "^/dev"; then
-else
+if echo $DEV | egrep -v -q "^/dev"; then
warn "Can't determine device of $OUT_DIR"
exit
fi
Modified: ppcrcd/conf.dir/usr/lib/ppcrcd/setbootopt
==============================================================================
--- ppcrcd/conf.dir/usr/lib/ppcrcd/setbootopt (original)
+++ ppcrcd/conf.dir/usr/lib/ppcrcd/setbootopt Thu Jun 16 19:59:28 2005
@@ -23,18 +23,6 @@
done
}
-# check for ppcrcd variable in nvram #########################################
-if [ -z "$(nvsetenv ppcrcd)" ]; then
- if [ -f /tmp/setbootopt-dangerous ]; then
- /usr/lib/ppcrcd/add-ppcrcd-to-nvram.sh || die $? "oops :-("
- else
- touch /tmp/setbootopt-dangerous
- warn "you don't have ppcrcd option in your nvram"
- warn "to add it there have to be prepared dangerous operation"
- die 66 "if you agree type $0 once again"
- fi
-fi
-
# list: list stored variables ################################################
list() {
nvvar | tr " " "\n"
@@ -64,7 +52,21 @@
EOF
}
-[ "$1" = "-h" -o "$1" = "--help" ] && usage && exit
+# check for ppcrcd variable in nvram #########################################
+if [ -z "$(nvsetenv ppcrcd)" ]; then
+ if [ -f /tmp/setbootopt-dangerous ]; then
+ /usr/lib/ppcrcd/add-ppcrcd-to-nvram.sh || die $? "oops :-("
+ else
+ touch /tmp/setbootopt-dangerous
+ usage
+ echo
+ warn "you don't have ppcrcd option in your nvram"
+ warn "to add it there have to be prepared dangerous operation"
+ die 66 "if you agree type $0 once again"
+ fi
+fi
+
+[ "x$1" = "x-h" -o "x$1" = "x--help" ] && usage && exit
if [ -z "$1" ]; then
[ -z "$(nvsetenv ppcrcd)" ] && usage || list
exit
More information about the pld-cvs-commit
mailing list