PDA

View Full Version : Changing default command prompt and mounting fat32 in read/write mode.



Jeffery Mewtamer
02-24-2014, 05:32 PM
I am running a highly customized harddrive install of Adriane Knoppix 7.2, and I have a few little annoyances I would like help with. I do nearly all of my offline computing from the Command line, and since the SBL screen reader Adriane uses in text mode speaks entire lines by default, it gets quite annoying to listen to it repeat knoppix@microknoppix followed by the path to the working directory every time I need it to read back the command I just typed. I know typing PS1=$ at the command line can be used to change the prompt to a stand-alone dollar sign, but I would like to make this change permanent instead of having to re-enter the command everytime I bring up the command line. I tried adding PS1=$ to the script I use to have vbetool turn off my monitor, but it doesn't seem to work there and I have no idea how to make the change automatic. My other problem is with mounting fat32 file systems. I do 99.9% of my file management from the command line and I normally mount external drives using the command: mount /dev/sdxn /media/sdxn where x is the drive letter and n is the partition number, and for all of my linux format drives(previously included ext3/4, now includes Btrfs and reiserfs) this works fine, but I have a FAT32 formatted SD card that I use for the rare occasions I need to use Windows PCs, and this command mounts it in read-only mode. The file manager provide by the Adriane-mount package can mount it in read-write mode, but it is annoying to have to leave the command line, launch the file manager, mount the SD card, exit the file manager and return to the command line every time I need to access the card and I realize I haven't mounted it since the last reboot. Is there a way I can mount this fat32 SD card in read-write mode from the command-line. Alternatively, is there a way to make the card automounted at boot?

utu
02-24-2014, 09:52 PM
Greetings, Jeffery.

In regards to PS1,
I would expect that if you defined PS1 to suit you in /etc/rc.local,
that should do it until you subsequently change it with another definition.
Is that not the case?

Jeffery Mewtamer
02-25-2014, 01:25 PM
Best I can tell, my /etc/rc.local doesn't contain a existing PS1 definition, and apparently adding such a definition is more complicated than adding the line: PS1=$ on a blank line within the file. I'm no stranger to editing config files manually, but in this case, I am ignorant on how to edit the needed files to recieve the desired result.

utu
02-25-2014, 04:41 PM
.
Greetings again, Jeffery.

I offer the following only if you feel comfortable making changes to your Knoppix.

You might edit /etc/rc.local with the command


sudo leafpad /etc/rc.local

to include a new single command line just before the 'exit 0' line, as follows:


#!/bin/bash
#
# rc.local
#
# Start local services after hardware detection

SERVICES="cups"

for i in $SERVICES; do
[ -x /etc/init.d/"$i" ] && /etc/init.d/"$i" start >/dev/null 2>&1
done

# PS1 re-definition command here.

exit 0


If you were to save and reboot with this /etc/rc.local, there should be no changes in your system.
If you use sudo leafpad /etc/rc.local to remove the initial '#' ahead of the command, and re-save
this changed /etc/rc.local, then I would expect this to change your PS1 for the remainder of this boot
and for subsequent re-boots until or unless your put the initial '#' back and reboot.

It's really not essential here, but it's good practice always to save an original configuration file
just in case somehow you goof up editing the original. With /etc/rc.local, since its permissions
are root:root, this means doing
sudo cp /etc/rc.local /etc/rc.local.orig or something similar.