#!/bin/bash source /etc/functions.magic ### # fstab updater script # Copyright (C) Thomas "ShALLaX" Pedley (gentoox@shallax.com) # # This program is free software; you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by # the Free Software Foundation; either version 2 of the License, or # (at your option) any later version. # # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the # GNU General Public License for more details. # # You should have received a copy of the GNU General Public License # along with this program; if not, write to the Free Software # Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA ### $important clear echo "This will update your fstab to allow normal users to access fatx drives." echo "This patch only works with kernel-2.4.22003 onwards." sleep 10 clear $busy ### # Remove all of the old fatx drive entries ### grep -v /dev/hda51 /etc/fstab > /etc/fstab.bak grep -v /dev/hda50 /etc/fstab.bak > /etc/fstab grep -v /dev/hda55 /etc/fstab > /etc/fstab.bak mv /etc/fstab.bak /etc/fstab chown root:root /etc/fstab chmod 640 /etc/fstab ### # Add the new ones. The good thing about this is, both E and F can be set to # rwxrwxrwx but if Gentoox is installed on E, then E will only be set to rwxr-xr-x, and likewise # if its installed on F all thanks to the initrd! This means that no normal user # # should ever be able to wipe out a Gentoox installation. C is always set to # rwxr-xr-x to make sure no one can just wipe out your C drive. ### echo "/dev/hda51 /mnt/fatx/c fatx defaults,noauto,umask=022 0 0" >> /etc/fstab echo "/dev/hda50 /mnt/fatx/e fatx defaults,umask=0000 0 0" >> /etc/fstab echo "/dev/hda55 /mnt/fatx/f fatx defaults,umask=0000 0 0" >> /etc/fstab ### # Early bug where i made the wrong mount point ### rm -rf /mnt/fatx/d 1> /dev/null 2> /dev/null mkdir /mnt/fatx/f 1> /dev/null 2> /dev/null clear