Take the 2-minute tour ×
Ask Ubuntu is a question and answer site for Ubuntu users and developers. It's 100% free, no registration required.

Ubuntu Core's wiki page page contains the instructions to install Ubuntu Core on a target media:

  1. Uncompress (do not unpack) rootfs
  2. Format target media: at least one partition should be ext2, ext3, or ext4
  3. Unpack Ubuntu Core to ext{2,3,4} partition
  4. Install boot-loader
  5. Install Linux
  6. If the Linux kernel requires modules, add these to /lib/modules/$(uname -r) in the ext{2,3,4} file system
  7. Boot the target device
  8. Install any additional required software using apt-get

But what are the specific commands to do the above? The things I'm specifically confused about are:

  1. Uncompressing and unpacking, what's the difference and how do I do them?
  2. What package should I install if I want the generic kernel provided in regular Ubuntu installation?
  3. I won't be installing any drivers or anything related to kernel other than what's provided in the repos, do I need to worry about manually adding kernel modules?

PS I would like to request that all the commands used in the installation process be mentioned in the answer, for the benefit of ones who're completely unfamiliar and myself, should I ever forget.

share|improve this question

1 Answer 1

up vote 12 down vote accepted
+100

All of those commands will require admin-rights. Easiest is to do sudo su to get a root console.

  1. Archives like your core .tar.gz (this is oneiric, precise beta is here) are combined in one file (packed) and reduced in size (compressed).

    gzip -d ubuntu-core-11.10-core-i386.tar.gz

    will uncompress the core to ubuntu-core-11.10-core-i386.tar (no .gz anymore; one big file).

  2. To partition the device for core it's easiest to use a graphical tool like gparted. When that's not available. See here. In a nutshell - assuming you want to partition the device /dev/sda:

    fdisk /dev/sda then press n p 1 <Return> <Return> a 1 w (for details please see link).

    This creates /dev/sda1 partition.

    mkfs.ext4 /dev/sda1

    This creates an ext4 filesystem on the new partition. You can of course use mkfs.ext3, mkfs.ext2 as well.

    Mount it: mount /dev/sda1 /mnt and go there cd /mnt

  3. tar -xf /path/to/where/you/put/ubuntu-core-11.10-core-i386.tar

    will unpack the core (many files).

  4. grub-install --root-directory=/mnt /dev/sda

    will install the bootloader (this is of course just one of many options).

  5. cp /etc/resolv.conf /mnt/etc/resolv.conf

    will allow network access after chroot-ing (in step 7) by copying the DNS resolver configuration

  6. for f in /sys /proc /dev ; do mount --rbind $f /mnt/$f ; done ; chroot /mnt

    will go to a chroot, see Is there an easier way to chroot than bind-mounting? for details about mount rbind

  7. apt-get update && apt-get install linux-{headers,image}-generic

    will install kernel ("linux")

    Note: it's possible that apt-get update will not work because no network is present.

  8. reboot and you're good to go.

I haven't got a machine to test this so the answer probably won't be complete. I will change my answer should you stumble across problems.

share|improve this answer
    
I suppose I can create users using the chroot environment? –  Oxwivi Oct 21 '11 at 10:01
    
Yeah definitely! Remember to use adduser as opposed to useradd as it's more comfortable. –  turbo Oct 21 '11 at 11:31
1  
I will not be able to immediately try these out as well, but I'm accepting it, since to my knowledge, it will work perfectly. I will comment and edit if I come across any hiccups. –  Oxwivi Oct 21 '11 at 14:37
    
Excellent guide. I found this to be an easier process than the one on the Ubuntu wiki here: wiki.ubuntu.com/Core/InstallationExample.However once I finished I could not log in as a normal user, or even su to a normal user from root. I got the error "Cannot execute /bin/bash: Permission denied", and "user not known to the underlying authentication module". The problem was that the root (/) directory did not have read or execute permissions for group or other. Running chmod go+rx / as root fixed this problem. Something to watch out for! –  Alex Dec 17 '12 at 3:23
    
@turbo Each step you are explaining what it does. Except for step five "Go to a chroot:" doesn't explain what you are doing here. Would you please elaborate? –  Pro Backup Feb 11 at 11:29

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.