Programming to different installation types of Ubuntu - linux

I'm studying for a CS degree, and I need to install Ubuntu for a computer systems class. We are going to do low level Assembly optimizations and stuff like that, so they don't want us to install it in a VMware.
Now, I don't want to do a regular dual-boot install, because I've already done it on my previous computer a couple of years ago, and wrecked my hard-disc with the partitioning. Wikipedia says you can use Wubi to boot Ubuntu from ISO, or install it to a flash drive and boot it from there, and then thus remove the need for partitioning.
Now, my question is - how different it is to program for Ubuntu booted from a regular hard-disc partition, from a Wubi ISO, and from an SD card? I guess the programs will work the same on all options, but we're going to do play with low level Assembly optimizations - can I expect to face any difference in that department?

I'm not sure I'd go this route if it were me personally.
You should be fine in terms of whatever bare metal type stuff you want to do -- you're working with memory, the cache, the chip, etc, so your disk drive shouldn't matter (unless you're doing stuff to the filesystem or something).
Where I think you might get annoyed is the logistics of setting up your development environment. Everytime you boot from your USB stick, you're going to need to sudo apt-get GCC, scite, et. al, load your files on into directories that you want, and then get started. That's a hassle. You could optimize this somewhat by creating a custom ISO of your environment using some kind of tool (you might be able to do it with Clonezilla), but still.. yuck.
I would suggest (speaking of Clonezilla) that you snapshot your hard drive, go ahead and install dual booting with Ubuntu, and then you have a backup if anything goes wrong. Or, I'd think you could get by using the school's machines. Don't they have any Linux boxes that you can ssh into, if not use in labs?
Anyway, good luck. :)

Related

Is it possible (or advisable) to use NixOps to install NixOS to a USB flash drive?

I'd like to install NixOS to a flash drive, and have the operating system run entirely on the flash drive. Is it possible to install to a flash drive using NixOps? Or would I even need to? That is, would it be easier or better just to write a script that would do it?
First let's get this out of the way: if the purpose is just creating a live installer to install NixOS on a system, you should follow the instructions in the NixOS manual.
Assuming you want the drive to be capable of updating itself, you should avoid NixOps. Unlike the nixos-install command, NixOps was not designed to copy only the evaluated and built machine to the target machine. It will not copy the Nix-language expressions over to it, so the target machine will not be able to update or modify itself.
I see two possible approaches for this. The most straightforward one is to use the nixos-install command to install NixOS on the drive like you would install it on an internal drive. To the kernel and every sane BIOS, a USB stick is just another block device to boot from.
The other approach is following the manual and changing the root= parameter, which may make changes persistent. I have never done it for my installation USB sticks, so I don't know whether that really works.

building linux kernels

i Just got the book Linux Kernel Development by Robert Love . It has lots of places where you are required to modify and build the kernel . So how should i go with it . Is it better to use a VM , or should i somehow get a proper test machine for it , since i dont want to goof up on my system and data.
A VM has the advantage of offering snapshots. These allow you to save the state of the machine - if the kernel build doesn't work you simply restore the snapshot, and you are able to take as many snapshots as you have disk space to store them. You are also able to clone and re-deploy the VM image, so you have many identical systems to test on.
The same experiment on a physical machine would require far greater effort (ghosting/cloning the disk, re-installing the OS etc).
VirtualBox is free, cross-platform virtualisation software.
There are a lot of tutorials on the web about this topic, e.g. here:
http://www.digitalhermit.com/linux/Kernel-Build-HOWTO.html
http://www.kernel.org/pub/linux/kernel/people/gregkh/lkn/lkn_pdf/ch04.pdf
You could do either or both. An alternative somewhere in between is to setup a dual boot. This is a little riskier than a VM, but not too much.
coLinux
or run linux iso image using QEMU on windows

Need some advise to begin programming on ARM (with linux) platform

I will have (maybe) to work soon on ARM platform hosting a linux distribution (I don't know which distribution ..).
I know the project concerns video streaming, but I can't tell you more. Actually I only received the announe, and meet nobody yet.
I've never worked on such platform. So the idea for me is to test before the project starts.
What would you advise me to undestand how works such platform ? Internet links? Tutorials? Tools
Morevover, as I don't have any ARM processor at home (well only my iPhone ..) Which virtual machine would you advise me? (I clearly don't want to lose time installing and testing every one of them.)
I am aware of this page on wikipedia. Which one is the more appropriate running on a MacOS X 10.5/intel platform? Which linux distribution to install on the virtual machine?
I know the topic is quite wide, so any idea is welcomed! :-)
For a virtual machine that can emulate a ARM platform try QEMU. You can install a ARM-based Debian Linux distribution and tinker around with it. A google search on ARM, QEMU and Debian will get you started.
Also: Don't worry to much about the ARM CPU. You will use linux, so all the low-level stuff is already done for you. It's much more important to learn how the linux boot process works. How to install stuff ect. You will rarely (if ever) notice that you're running on a ARM device. The big difference to a PC running linux is, that the ARM will be a lot slower.
If you're looking for a real piece of hardware to play around with I suggest that you take a look at the beagleboard (www.beagleboard.org). It's cheap (around $150) and runs (among other things) various linux distributions.
With the beagleboard you'll get the whole linux cross compilation experience if you want (be warned: you'll pull your hair out).
I can't answer all of your questions, but there's a full port of Debian GNU/Linux on ARM. Works fabulously in my experience (I've tried it on a QNAP). Everything that's available in Debian works on QNAP now! So it's probably easiest to first try Debian tools and packages that come close to your project, and then continue from there.

Best/Easy way to set up a quick booting Linux

Hopefully this still falls within StackOverflow's umbrella!
I'm looking to create a quick boot linux laptop for my wife. All it really needs is to be able to do is browse the internet (with flash and video etc.).
Are there any distros that are made for this, or any guides out there that show good ways to speed stuff up? I've read that I should "remove stuff from the kernel that I don't use" but that's a little out of my skill set.
Thanks!
If you're using Ubuntu (or a variant, like xubuntu or kubuntu), there is a package called BootUp-Manager. There's an article about it over at Lifehacker. It lets you check and uncheck things in the startup and shutdown scripts to optimize things (such as turning off checking for new hardware, or whatever)
You may also be able to gain a simple speed-up by going into System->Administration->Services and disabling any services you don't need.
If you'd like to see how much time is being spent on each part, install the package Bootchart, and that should give you a detailed profile of everything that goes on during startup, and let you focus on the most time-consuming parts, and measure your progress as you tune the system.
I believe Xubuntu is designed for low memory footprint/fast booting and whatnot while still having a decent amount of features. Not a Linux user but it just seems to stick out in my head.
Some guys got an EEE PC netbook booting in 5 seconds running a modified version of Fedora. Might be a good starting point: http://lwn.net/Articles/299483/
Try: Damn Small Linux is a very versatile 50MB mini desktop oriented Linux distribution.
Alternatively, get an Asus motherboard with expressgate - it has an onboard Linux (spashtop) that boots in 3 seconds. Its designed for quick web surfing, IM, music etc whilst still letting you boot into your main OS.
If you really want it to boot fast, I would suggest creating an initrd containing exactly the software you need to do what you want it to do. The initrd will get read from the disk once as one large file, and then everything will run out of ram.
This is not an easy solution, the easiest solution will be jishi's solution of using a Live CD, but, that won't be the fastest solution.
I have been using Kubuntu 14.04.4/5 on a Dell laptop with dual boot. Am not real happy at the moment with it. You are all correct about the slowness of a liveCD.
There are LiveCD-versions of working linux-distros with browser and installed flash, java.
Check out LiveCD
http://en.wikipedia.org/wiki/Live_CD
you will find links to different flavours with download.
There are also USB-drive-versions.

Linux Lightweight Distro and X Windows for Development [closed]

Closed. This question does not meet Stack Overflow guidelines. It is not currently accepting answers.
We don’t allow questions seeking recommendations for books, tools, software libraries, and more. You can edit the question so it can be answered with facts and citations.
Closed 4 years ago.
Improve this question
I want to build a lightweight linux configuration to use for development. The first idea is to use it inside a Virtual Machine under Windows, or old Laptops with 1Gb RAM top. Maybe even a distributable environment for developers.
So the whole idea is to use a LAMP server, Java Application Server (Tomcat or Jetty) and X Windows (any Window manager, from FVWM to Enlightment), Eclipse, maybe jEdit and of course Firefox.
Edit: I am changing this post to compile a possible list of distros and window managers that can be used to configure a real lightweight development environment.
I am using as base personal experiences on this matter. Info about the distros can be easily found in their sites. So please, focus on personal use of those systems
Distros
Ubuntu / Xubuntu
Pros:
Personal Experience in old systems or low RAM environment - #Schroeder, #SCdF
Several sugestions based on personal knowledge - #Kyle, #Peter Hoffmann
Gentoo
Pros:
Not targeted to Desktop Users - #paan
Don't come with a huge ammount of applications - #paan
Slackware
Pros:
Suggested as best performance in a wise install/configuration - #Ryan
Damn Small Linux
Pros:
Main focus is the lightweight factor - 50MB LiveCD - #Ryan
Debian
Pros:
Very versatile, can be configured for both heavy and lightweight computers - #Ryan
APT as package manager - #Kyle
Based on compatibility and usability - #Kyle
-- Fell Free to add Prós and Cons on this, so we can compile a good Reference.
-- X Windows suggestion keep coming about XFCE. If others are to add here, open a session for it Like the distro one :)
Try using Gentoo, Most distros with X are targetted towards desktop user and by default includes a lot of other application you don't need and at the same time lacks a lot of the stuff you need. YOu could customize the install but usually a lot of useless stuff will get into the 'base' install anyway.
If you worried about compile time, you can specify portage(the getoo package management system) to fetch binaries when available instead of compiling. It allows you to get the flexibility of installing a system with only the stuff you want.
I used gentoo and never went back.
http://www.gentoo.org/
I installed Arch (www.archlinux.org) on my old MacMini (there is a PPC version) which only has 512MB RAM and a single 2.05GHz processor and it absolutely flys!
It is almost bare after installation, so about a lightweight as you can get.. but comes with pacman, a software package manager, which is as-good-as apt-get (ubuntu/debian) if not better.
You have a choice of installing many desktop managers such as: awesome, dwm, wmii, fvwm, GNOME, XFCE, KDE, etc.. straight from pacman using a single line of code.
In my opinion(!!) it's lightweight like Gentoo but a binary distro so it isn't as much hassle (although I can imagine it can be a little daunting if you're new to Linux). I had a system running (with X and awesome WM) in about 1.5 hours!
I'm in a similar situation to Schroeder; having a laptop with 512mb RAM is a PITA. I tried running Xubuntu but tbh I didn't find it that it was either useable or a great saver on RAM. So I switched to Ubuntu and it's worked out pretty well.
My 2c:
I'd recommend basing your system on Debian - the apt system has become the de-facto way to quickly install and update programs on Linux. Ubuntu is Debian based with an emphasis on usability and compatibility. As for windowing managers, in my opinion Xfce hits the right balance between being lightweight and functional. The Ubuntu-based Xubuntu would probably be a good match.
Remember - for security only install essential network services like SSH.
If it were my decision, I would set up a PXE boot server to easily install Ubuntu Server Edition to any computer on the network. The reason why I would choose Ubuntu is because it's the one I've had the most experience with and the one I can easily find help for. If I needed a windowing manager for the particular installation, I would also install either Xfce or Blackbox. In fact, I have an old laptop in my basement that I've set up in exactly this way and it's worked out quite well for me.
I would recommend to use Archlinux which I'm using now. XFCE is my choice for desktop environment by now but if you prefer more lightweight one you can try LXDE
Archlinux is much like Gentoo but with binary packages prebuilt and with more simpler configuration
If all those distos still won't work for you, you may want to try LFS - Linux From Scratch
I would recommend Xubuntu. It's based on Ubuntu/Debian and optimized for small footprint with the Xfce desktop environment.
I am writing this on a Centrino 1.5GHz, 512MB RAM running Ubuntu. It's Debian based and is the first Linux distro I have tried that actually worked with my laptop on first install. Find more info here.
Second the Arch suggestion. You will be tinkering quite a few configuration files to get everything going, but I've found none better for a lean and mean setup.
I suggest you should checkout the following three distros:
Damn Small Linux - Very lightweight. Includes its own lightweight browser (Dillo), but you can install Firefox easily. The entire distro fits on a 50MB LiveCD.
Slackware - Performance wise Slackware will probably perform the best out of the three, but I'd suggest running your own benchmarks with your hardware.
Debian- Debian is extremely versatile. This is the only distro of the three I'd recommend for both a 32 bit 1GB RAM laptop and also a 4GB RAM 64 bit machine.
I would recommend something mcuh lighter than XFCE: IceWM. It takes so time to configure it to be really usable, but it's worth it. I have a fully running IceWM which only takes about 5MB of RAM.
The primary reason I use Linux is because it can be lightweight. In 1999, I used Redhat, Mandrake (now Mandriva), and Debian. All were faster and more lightweight than my typical Windows 98 installations.
Not so anymore. I now have to research and experiment in order to find distros that are lightweight in both storage and memory footprint, and speedy. These are the ones I have played with lately:
Slitaz, a French distro (I use the English version and it works well).
Crunchbang, a lightweight Ubuntu and Debian-derived distro
Crux, which is source-only and very low-level geeky (I chose it because it has good support for PowerPC, and I was using it on my aging Powerbook G4)
Currently, however, I use Archlinux for most of my work, as it offers a good compromise between lightweight and feature-full.
But if you decide to roll your own distro from scratch, you may want to try Buildroot or Openembedded. I do not have much experience yet with Openembedded, but using Buildroot I have been able to create a very simple OS that boots quickly, loads only what I want, and only takes up 7 MB of storage space (adding development tools will increase this greatly, of course; I am merely using it as an ssh terminal, although I can do some editing with vi, and some text-only web browsing).
As far as window managers, I have been very happy with OpenBox. I frequently experiment with lighter-weight window mangers listed on this page, however.
here is my opinions as well. I have used Fedora, Gentoo, SliTaz, Archlinux, and Puppy Linux for development. The constraints: the system virtual image had to be under 800mb to allow for easy download and include all necessary software. The system had to be fast and customizable. It had to support version control SVN and Git, XAMPP or LAMP, SHH client, window environment (X or whatever) with latest video drivers/higher resolution, and some graphical manipulation software for images.
I tried Archlinux, Puppy, and SliTaz. I have to say that SliTaz was the easiest to work with and to set up. The complete base-OS install from the image is around 120mb using the cooking version. TazPkg is a great package manager but some of the listed packages were outdated. Some of the latest versions needed to be built from source code.
SliTaz is extremely lightweight and you have to live with some older packages in the supported TazPkg package list. There is increasing support and XAMPP, Java, Perl, Python, and SVN port well using TazPkg with latest versions. SliTaz is all about customization and lightweight. The final size was 800mb with all necessary software. ArchLinux and Pupppy, although also lightweight were over 1.5GB after all of the software was installed. The base systems were not comparable to SliTaz.
If anyone is interested in a virtual image for SliTaz with XAMPP to try out, contact away and link will be posted.
All the best and happy development! :)

Resources