Thursday, October 16, 2008

Installing VLC on the Aspire One

Bring up a terminal and become root (i.e. "su").

Uninstall the old Media Player (yes, you should do this).

yum remove mplayer\*

Update to the latest Redhat Repository.

yum install fedora-release

Add the Livna repository (where the VLC binaries can be found).

rpm -ivh http://rpm.livna.org/livna-release-8.rpm

Install VLC.

yum install vlc

Lots of "y"s later, you can now play videos by double clicking.


Also! Accessing files on your Windows network.

First, find out the IP address of the system you want to access (mine is 192.168.0.101).

Create a folder under "/mnt" for the link.

Next become root and mount it.

mount -t cifs //192.168.0.101/Work /mnt/MyTargetFolder

Tada, you can now access your files from "/mnt/MyTargetFolder".

For closure, "umount" removes mounts.

Wednesday, October 15, 2008

Adding Icons to the Desktop

Edit the file "/home/user/.config/xfce4/desktop/group-app.xml" to add icons to the desktop.

These icons are ".desktop" files normally found in "/usr/share/applications/".

Typing "ls --time=ctime -c" while in the "/usr/share/applications/" will sort the files by creation time. Scroll to the top, and it should be one of the first files after that command.

If a file gives you trouble once displayed, edit it.

Broke it, then fixed it

I started off my AA1 fun today by playing with the /etc/fstab file. I got a suggestion to check and make sure I was not mounting any tmpfs partitions (specifically /tmp). Well I wasn't, but there was a commented out line in my /etc/fstab that would do exactly that.

Ha ha! Lets uncomment the line.

As a result of that genius, the system now booted up to an odd X-Windows 'esc screen featuring an X cursor and a grey background. And that was it. Good job Mike, you broke it.

In trying to come up with a way to solve this problem, I learned a few things about Grub. While booting, I can mash the TAB key to bring up my Grub interface. From here I can either edit my bootup options (adding or removing arguments from the kernel line, and such), or drop in to a pseudo shell. In the pseudo shell I can't do much, but I can read files on my drive.

cat (hd0,0)/etc/fstab

Yes, I can enjoy my stupidity from the bootloader. Excellent.


The next step was to put a small Linux on a USB key, then try to get in to my main drive from there. I went with Damn Small Linux on a 256 MB key I have. I followed the instructions here to create the key.

http://www.althack.com/2006/03/10/how-to-run-linux-on-a-usb-drive/

Now that I had a key, I got the chance to figure out how to break in to my Linpus install.

From the BIOS boot stage (Acer Logo), you can mash the F12 key to pick a device to boot from. So I picked my Dell USB key, and we were off.

Possibly of note, my key was in the port on the left side. Probably nothing, but hey, just to know. :)

Damn Small Linux is set up in such a way that sudo works without a password. So from a terminal I ran "sudo su" to work my magic.

It wasn't quick, but I eventually found out that the device name for the SSD was "/dev/hdc1", so I mounted said device.

mount /dev/hdc1 /mnt/hd

The "/mnt/hd" folder already exstisted. Then from there, I used the decent looking built in text editor to change the file.

beaver /mnt/hd/etc/fstab

Made my fix, and we were back in business.


Oh, except for one little problem. My touchpad was dead. !?!

What's even more impressive is how I fixed it. I pulled out the battery.

Wow.


Anyways, we're back in action, and we learned something. I'm starting to think this is why I bought the system. :)

Tuesday, October 14, 2008

Working in the backyard

Today, possibly the last somewhat warm day of the year, I decided to sit out in the backyard t work.

Halfway through, I started making system tweaks.

The first is one I've been afraid of. From the terminal running:

xfce-settings-show

I don't know why, but I got the impression that running this application was some sort of "forcefully switch to advanced mode" crazyness. Nope. Instead, it's merely the real configuration tool, akin to the control panel on Windows. Hidden away from you by Acer/Linpus.

From here I was able to make 2 big fixes. I enabled the right click menu (Desktop/Behavior/show desktop menu on right click), which means I can now right click on the desktop to access all this great stuff. The stock user interface I already went through the trouble of editing to include my apps is there, just now I can do more.

Next I switched the Keyboard Map to "default" instead of "emacs" (Keyboard Preferences). What this means is I can now use CTRL+A to select all. Before, it I have no idea what it used to do. Now it's normal.

No idea why that isn't a stock setting. Oh well.

From the Keyboard Preferences tool, it seems I can set up shortcut keys to launch applications, or perform actions. Oooh! If I think of any, I'll be back. :D

More key settings can be found in the User Interface config panel too.

This was followed by a minor change to firefox (about:config), to disable disk caching.


Then lame old me came back inside because it got cold out. :)


And now that I'm back on the desktop, I'm making one more.

From here, the Synaptics touch pad driver has a feature that'll disable itself as you type. As suggested, I started by adding a small shell script block to the end of my "/home/user/.bashrc" file.

However, this is probably not the best solution, as the author of the tip mentions later (haha, after I already made the change).

After commenting out the previous suggestion, I followed the later instructions. From the terminal running (NOT as su/root):

xfce4-autostart-editor

And adding an application.

Synaptics Daemon
/usr/bin/syndaemon -i 1 -d

I made the mistake of runnig this as root, which I'm guessing added this to the root account, but I always start as user.

I also took this opportunity to remove a pair of autoupdate tasks from the list. There's a few more tasks here (compiz, print queue, Acer Task Queue, services no wait) that I'll to do some investigating in to. Might be able to shave off some boot time with these.

Charging Again

Ok, I checked the system. I'm at 18% charge (28 minutes remaining estimate). I'm shutting down the system and plugging in the charger. 11:45 AM right now. I'm going to check on it every half hour or so (by looking over at the currently orange light, for it to turn green).

About 55 minutes later (12:40 PM), I'm at 80% battery. So I guess as I expected, it can "mostly charge" pretty fast. I imagine it'll be another hour to reach the 100% mark.

Well, about half an hour later (1:13 PM), it seems it's charged. I've been out of the room most of the time, so if it finished sooner, I missed it.

Not bad. Full charge in less than an hour and a half. Sure, 10 minutes would be better, but this is tolerable.

Still, keep an eye on Toshiba Netbooks in the future. If they keep them batteries to themselves, that'll be the deal maker right there. "Oh shoot! My 3 hours are up. No problem, I got 10 minutes...".

Monday, October 13, 2008

Linux Startup Research

As expected, Linux boot generally just a whole bunch of scripts. The core script is:

/etc/inittab

Though unless you're feeling extra awesome, you'll never need to touch this file.

This file include a series of scripts found under:

/etc/rc.d/

"inittab" uses the file "rc.S" as the so called "system initialization". I'm pretty sure this is still more low level than I'd ever care to know.

Next, it implements runlevels by executing a script simply called "rc" with a numeric argument. Runlevels are the Linux equivalent of booting in to DOS mode, back from the Windows 95 days. Runlevel 1 is a single user "administrative" mode. There's a few more, but the other important one is Runlevel 5, Multiuser+Networking+GUI mode. In other words, a normal Linux boot.

Inside the "inittab" file, it seems the "rc" script was overloaded (i.e. copied and renamed). "rc.5" is used alternatively to execute argument 5 (i.e. "rc.5 5" instead of "rc 5").

"rc.5" is heavily modified. Many lines are commented out, so it looks as if it's already been well tuned here.

Services scripts live in:

/etc/rc.d/init.d/

There's also a symlink here setup at "/etc/init.d/".

These scripts are just the files that'll be run. What's important is then this.

/etc/rc.d/rc5.d/

A folder full of symlinks to the various scripts found in "init.d", for our preferred runlevel (5).

Every symlink in this folder has a 3 character identity. S or K (for Start or Kill) followed by a numeric priority (01 before 10).

The OS actually calls all Kills first, then all the Starts.

What each actually does is it calls the linked script files with "stop" and "start" as the first argument respectfully. Pretty straight forward. And if I'm reading correctly, system shutdown will be the opposite (previously killed apps get started, and vice versa).

So technically, changing this involves manipulating the symlinks in the folder. Rather that battle with that tediousness, there's an application "/sbin/chkconfig" that can be used to simplify the task.

chkconfig --list

gives you a printout of what I'm guessing is a compare between the contents of "init.d" and the "rc5.d" and related folders. Use:

chkconfig --add ServiceName

to create a symlink for a service, and:

chkconfig --del ServiceName

to remove a symlink for a service.

Next, the application "/sbin/service" can be used to say what current services are running.

service --status-all

gives you a similar list likely a comparison of the contents of "init.d".


Long ass article later (awesome article I must say, I've learned a crap ton), it seems the secret to making Linux boot parallel is none other than GNU MAKE!!! ZOMG!

As I've discovered from a coding standpoint, by creating proper dependaces, I can run gnu make with the -j parameter. -j followed by a number forks that number of threads, and runs the build process concurrently (where dependaces allow). Where there's a prerequisite, it waits.

GNU Make. Mmmmm. As if I wasn't intrigued by Linux before. :D

Current Aspire One grub.conf

I've seen some slightly different grub config's on the various AA1 forums. So here's mine.
default=0
timeout=0
splashimage=(hd0,0)/boot/grub/splash.xpm.gz
hiddenmenu

title Linpus Linux RCD
rootnoverify (hd0,0)
kernel /boot/bzImage ro root=LABEL=linpus vga=0x311 splash=silent loglevel=1 console=tty1 quiet elevator=noop
initrd /boot/initrd-splash.img
(everything below title should be tab indented)

A brief analysis:
rootnoverify sets the root of all further mentioned directories. (hd0,0) should be obvious. It's described in full on the splashimage line up top.
kernel sets the kernel image, the file /boot/bzImage. Everything thereafter are arguments to the kernel.
initrd sets the initial ram disk. Not sure entirely what that means, but that sounds remarkably like an "instant on" sort of feature. Unsure.

elevator=noop is the SSD fix found on the various AA1 forums.

What I was adding to "try" and get bootchart working was a "init=/sbin/bootchartd" string to the kernel arguments. That part doesn't seem to work. More digging...