Difference between revisions of "Updating from Root File System Images"
(Changed file to untar from .tgz.md5sum to .tgz) |
|||
Line 45: | Line 45: | ||
# sudo umount /media/rootfs has caused my host to hang due to umounting my host rootfs... | # sudo umount /media/rootfs has caused my host to hang due to umounting my host rootfs... | ||
sudo umount /dev/sdX2 | sudo umount /dev/sdX2 | ||
+ | </pre> | ||
+ | |||
+ | |||
+ | === How to Backup your Root File System === | ||
+ | (these steps not tested yet) | ||
+ | |||
+ | Mount the SD-card on the host [ todo: add link to step-by-step instructions ]. For reference call the mount point /media/rootfs | ||
+ | |||
+ | cd to the top directory on the SD-card: | ||
+ | <pre> | ||
+ | cd /media/rootfs | ||
+ | </pre> | ||
+ | |||
+ | As root create a tarball of the whole thing: | ||
+ | <pre> | ||
+ | tar -cvzf ../my-backup-rootfs.tgz | ||
+ | sync | ||
+ | </pre> | ||
+ | |||
+ | Move out of the root directory and umount | ||
+ | <pre> | ||
+ | cd ../ | ||
+ | umount rootfs | ||
</pre> | </pre> |
Revision as of 18:57, 15 February 2013
There is a distinction between an SD-Card image and a root file system image. The SD-card image has all content needed to boot and run the system. The root file system image contains just the files needed to run.
It is possible just replace the rootfs partition contents to boot a different "distro". We can run ubuntu with the unity desktop, then change to a plain vanilla Debian wheezy and then change to ubuntu using LXDE. It is convenient to avoid downloading SD-card images since they are so large.
The key to making this work is to agree to use a certain kernel as a base. The issue is that the root file system contains kernel modules, that may be inserted into the kernel at run-time. Kernel modules are marked with version information at compile time -- only kernel modules built from the same kernel configuration may/should be used. [ ed. is this a digression? ]
Contents
non-partitioned space
The non-partition space stores u-boot image, u-boot environment variables and proprietary Samsung code. There is no partition to mount, normally you need to use the fastboot command from u-boot consoles to update any thing in this area
boot partition
The bootloader mounts this partition, loads the kernel, and the initial root file system (initrd). It jumps into the kernel and the kernel starts the initialization controlled by the initial ram disk.
At some point, the init process mounts the rootfs partition and then runs the initialization it finds there, the boot proceeds from there.
rootfs partition
This is where the "distro" lives. If you mount a rootfs partition, you will see /usr, /lib, and so on.
How to update using a root file system image
1. Download the root file system image to your host (for example)
cd /media # get the checksum file sudo wget http://odroid.us/odroid/odroidu2/ubuntu/odroidu2_20130104-linaro-lbuntu-desktop-1-rootfs.tgz.md5sum # get the root file system image sudo wget http://odroid.us/odroid/odroidu2/ubuntu/odroidu2_20130104-linaro-lbuntu-desktop-1-rootfs.tgz # verify the tarball is valid md5sum -c odroidu2_20130104-linaro-lbuntu-desktop-1-rootfs.tgz.md5sum
2. Start with and SD-Card with a known-compatible image, say odroidu2_20130104-linaro-ubunty-desktop-uSDeMMC.img 3. Mount the SD-card on the host [ todo: add link to step-by-step instructions ]. For reference call the mount point /media/rootfs 4. cd to the top directory on the SD-card.
cd /media/rootfs
5. As root delete the contents, rm -rf * (really dangerous make sure you are in the right directory)
/media/rootfs# sudo rm -rf *
6. As root, expand the tarball to the top directory on the SD-card
sudo tar -xvzf ../odroidu2_20130104-linaro-lbuntu-desktop-1-rootfs.tgz cd .. sync # replace the X below with the drive designation for the rootfs partition that was mounted (like b or c or d) # sudo umount /media/rootfs has caused my host to hang due to umounting my host rootfs... sudo umount /dev/sdX2
How to Backup your Root File System
(these steps not tested yet)
Mount the SD-card on the host [ todo: add link to step-by-step instructions ]. For reference call the mount point /media/rootfs
cd to the top directory on the SD-card:
cd /media/rootfs
As root create a tarball of the whole thing:
tar -cvzf ../my-backup-rootfs.tgz sync
Move out of the root directory and umount
cd ../ umount rootfs