Customizing a Lindows MobilePC
The Lindows MobilePC is a slick piece of hardware; see my review in the December 2003 issue of Linux Journal. I bought one and I'm quite pleased with it. The Linux system it ships with, however, is not what I want, so I have spent some time customizing it to better suit my needs.
The Lindows MobilePC is a notebook called an eNote with Lindows 3.0 installed. For this article, I refer to the notebook itself as an eNote. You need root permissions to do almost everything described in this article.
My favorite version of Linux is Debian GNU/Linux, and I wanted my eNote to run the Unstable branch of Debian. This did not require a complete reinstall because Lindows is based on Debian, and Lindows includes all the essential Debian utilities, such as apt-get. Lindows does not use these utilities but its own Click-N-Run system. Lindows.com could have easily removed those utilities, but it left them in place; that was nice.
So, Lindows is a Debian system with some non-Debian packages installed. To switch over to a Debian Unstable install, I wanted to remove all the non-Debian packages and then update to the latest Debian packages.
Switching from Lindows to something else offers you several chances to make mistakes that could leave your eNote unable to boot. It's a good idea to plan ahead for what to do if that happens. First of all, if there is any data you care about, back up that data! Even if you just bought your Lindows MobilePC and haven't done anything with it yet, you probably should have a reference copy of the setup files from /etc, so you can figure out how things used to be if something gets messed up. Probably the easiest way to back up the data is to copy it to another computer, perhaps using the scp command.
If at some point your eNote won't boot, how can you recover? An eNote does not include a floppy drive or a CD drive. It does, however, have the ability to boot from a USB device. If you have a USB CD drive, you can boot from an install CD for your favorite Linux distribution. If you prefer Red Hat, SuSE or some distribution of Linux other than Debian, you can use this technique to install a fresh system. The eNote also has the ability to do a network boot, but I have not tried this yet.
If you don't want to use a network boot or a USB device, there still is an easy way to give yourself a safety net: use the swap space to install an emergency kernel and some recovery tools. First, use swapoff to shut down swapping. Next, using a partition editor such as fdisk or cfdisk, change the type of swap partition from 0x82 (swap) to 0x83 (ext2). Then, use mke2fs to create an ext2 filesystem on the partition, and copy your recovery tools into the space.
The Lindows MobilePC comes with a 256MB swap partition, enough room for a lot of recovery tools. You could use the tool set from a Linux recovery disk distribution, but I suggest you simply grab copies of all the tools already available in the Lindows system. Assuming your swap partition is /dev/hda2, as it was on my MobilePC, these commands would do it:
# mkdir /mnt/tmp # mount /dev/hda2 /mnt/tmp # cp -pr /boot /bin /usr/bin /sbin /lib /mnt/tmp
Now all that remains is to make sure the bootloader can boot from the /dev/hda2 partition in a pinch. Later, I discuss the GRUB bootloader and return to this issue.
If you use this technique, make sure you have a working bootloader installed before you reboot. The recovery tools can't help you if the problem lies with your bootloader.
When it was time for the actual switch to Debian, I took a look at all the packages with
# dpkg -l | less
I knew I wanted to get rid of anything with lindows or xandros in the package name. As the version of XFree86 was a special Lindows version, I figured that was a great place to start. It would not make sense to try to remove XFree86 from a shell prompt running on the KDE desktop, because the whole X environment would be terminated, including my apt-get process. So I needed a shell independent of X. I used Ctrl+Alt+F1 to get a text-mode tty and found that on my Lindows MobilePC that there wasn't a text-mode tty there. So instead I used SSH from another computer on my network, logged in to the MobilePC remotely and got a root shell prompt.
I edited the /etc/apt/sources.list file, which was pointed right at the main US mirror for Debian, and pointed it instead to a mirror closer to my home. Then I updated APT's package list so APT would know what new packages were available:
# apt-get update
Then, it was time to start deleting the stuff I didn't want:
# apt-get remove xfree86-common
APT warned me I was about to remove 126 packages; that's what I wanted, so I pressed the Enter key.
This still left some packages I didn't want, so I built a command line that would find them all and get rid of them. This command looks for all packages with lindows in the name and feeds the list to apt-get remove:
# grep "Package: lindows" < /var/lib/dpkg/available | cut --delimiter=' ' -f2 | xargs apt-get remove -y
Then I did the same for any packages with xandros in the name:
# grep "Package: xandros" < /var/lib/dpkg/available | cut --delimiter=' ' -f2 | xargs apt-get remove -y
I checked to make sure I had done what I intended. dpkg -l was a little bit confusing, because it showed non-installed packages too. So I piped it through fgrep to find only the installed packages (flagged with status ii:
# dpkg -l | fgrep ii | less
Everything looked good thus far, so it was time to upgrade all packages to the latest Debian Unstable versions:
# apt-get dist-upgrade
As sometimes happens with APT, my upgrade hung on some circular dependencies on some packages related to the aRts sound system. I had to delete by hand with dpkg two old packages to get things unstuck:
# dpkg -r libarts1-bin # dpkg -r libarts1-glib # apt-get -f install # apt-get dist-upgrade
Once the dist-upgrade finished, it was time to install the GNOME system:
# apt-get install gnome
This process pulled in 185 new packages and took a while. This step also pulled in XFree86 for me. Again, a few packages didn't install because of circular dependencies. All I had to do was run the command one more time, and everything installed with no further errors:
# apt-get install gnome
I checked to make sure that GDM was installed and found that wasn't. GDM is the login manager I prefer, so I installed it with:
# apt-get install gdm
At this point I decided to run aptitude.
# apt-get install aptitude
aptitude is an ncurses-based APT tool. One of the cool features of aptitude is it can find all the recommended packages and install them. I pressed the G key twice to start the update, and a few dozen more packages installed.
Now, I wanted to make sure that GNOME actually worked, so I manually started up GDM:
# /etc/init.d/gdm start
GDM started, I logged in and my GNOME desktop came right up. I love it when a plan comes together.
|Dynamic DNS—an Object Lesson in Problem Solving||May 21, 2013|
|Using Salt Stack and Vagrant for Drupal Development||May 20, 2013|
|Making Linux and Android Get Along (It's Not as Hard as It Sounds)||May 16, 2013|
|Drupal Is a Framework: Why Everyone Needs to Understand This||May 15, 2013|
|Home, My Backup Data Center||May 13, 2013|
|Non-Linux FOSS: Seashore||May 10, 2013|
- RSS Feeds
- Making Linux and Android Get Along (It's Not as Hard as It Sounds)
- Using Salt Stack and Vagrant for Drupal Development
- Dynamic DNS—an Object Lesson in Problem Solving
- New Products
- Validate an E-Mail Address with PHP, the Right Way
- Drupal Is a Framework: Why Everyone Needs to Understand This
- A Topic for Discussion - Open Source Feature-Richness?
- Download the Free Red Hat White Paper "Using an Open Source Framework to Catch the Bad Guy"
- Tech Tip: Really Simple HTTP Server with Python
- Roll your own dynamic dns
4 hours 17 min ago
- Please correct the URL for Salt Stack's web site
7 hours 28 min ago
- Android is Linux -- why no better inter-operation
9 hours 44 min ago
- Connecting Android device to desktop Linux via USB
10 hours 12 min ago
- Find new cell phone and tablet pc
11 hours 10 min ago
12 hours 39 min ago
- Automatically updating Guest Additions
13 hours 48 min ago
- I like your topic on android
14 hours 34 min ago
- This is the easiest tutorial
21 hours 10 min ago
- Ahh, the Koolaid.
1 day 2 hours ago
Enter to Win an Adafruit Pi Cobbler Breakout Kit for Raspberry Pi
It's Raspberry Pi month at Linux Journal. Each week in May, Adafruit will be giving away a Pi-related prize to a lucky, randomly drawn LJ reader. Winners will be announced weekly.
Fill out the fields below to enter to win this week's prize-- a Pi Cobbler Breakout Kit for Raspberry Pi.
Congratulations to our winners so far:
- 5-8-13, Pi Starter Pack: Jack Davis
- 5-15-13, Pi Model B 512MB RAM: Patrick Dunn
- 5-21-13, Prototyping Pi Plate Kit: Philip Kirby
- Next winner announced on 5-27-13!
Free Webinar: Hadoop
How to Build an Optimal Hadoop Cluster to Store and Maintain Unlimited Amounts of Data Using Microservers
Realizing the promise of Apache® Hadoop® requires the effective deployment of compute, memory, storage and networking to achieve optimal results. With its flexibility and multitude of options, it is easy to over or under provision the server infrastructure, resulting in poor performance and high TCO. Join us for an in depth, technical discussion with industry experts from leading Hadoop and server companies who will provide insights into the key considerations for designing and deploying an optimal Hadoop cluster.
Some of key questions to be discussed are:
- What is the “typical” Hadoop cluster and what should be installed on the different machine types?
- Why should you consider the typical workload patterns when making your hardware decisions?
- Are all microservers created equal for Hadoop deployments?
- How do I plan for expansion if I require more compute, memory, storage or networking?