Partition layout

From Apertis
Jump to: navigation, search

As of 15.09, Apertis SD-card images follow this partition layout:

  • mmcblk0: GPT partition table
    • mmcblk0p1: FAT, labelled "boot"
    • mmcblk0p2: FAT, labelled "factory_reset"
    • mmcblk0p3: no filesystem, partition label "flags"
    • mmcblk0p4: FAT, labelled "boot_1"
    • mmcblk0p5: FAT, labelled "boot_2"
    • mmcblk0p6: btrfs, labelled "system"
    • mmcblk0p7: btrfs, labelled "general_storage"
    • mmcblk0p8: no filesystem, partition label "flags_backup"

i386 images follow this simpler layout:

  • vda: GPT partition table
    • vda1: no filesystem, labelled "bios"
    • vda2: ext2, labelled "boot"
    • vda3: btrfs, labelled "system"
    • vda4: btrfs, labelled "general_storage"

Contents

low-level bootloader

On ARM, the U-Boot bootloader starts 1K from the beginning of the disk, and can be upgraded with dd:

   sudo dd if=/usr/lib/u-boot/mx6qsabrelite/u-boot.imx of=/dev/mmcblk0 bs=1024 seek=1

On i386, the boot sector (first 512 bytes) contains "stage 1" of the GRUB BIOS bootloader.

boot

On ARM, the boot partition is not normally mounted. It contains U-Boot's boot.scr and bootflags.bin. During apt updates, a copy of the updated kernel and initramfs are copied here, but these updated copies are not normally used by the boot process.

On i386, the boot partition is mounted at /boot and contains the kernel and initramfs. There is no support for having two separate kernels for update and rollback.

bios

On i386, the bios partition contains the core image ("stage 1.5") of the GRUB BIOS bootloader. There is no filesystem: the core image is written directly to the partition.

factory_reset

On ARM, the factory reset partition contains:

  • a tarball boot.tar.gz which can be unpacked into boot_1 or boot_2 to restore it to its factory state;
  • a tarball root.tar.gz which can be unpacked into the system_1 subdirectory of system to restore it to its factory state;
  • a kernel, initramfs, compiled Device Tree, and U-Boot boot.scr that can unpack those tarballs into their respective locations.

The kernel is a U-Boot uImage, made with mkimage -A arm -O linux -T kernel -C n ${args} -d /boot/vmlinuz-${version}-${abi} uInitrd. (FIXME: what are the required ${args}?)

The initramfs is a U-Boot uInitrd, made with mkimage -A arm -O linux -T ramdisk -C n -d /boot/initrd.img-${version}-${abi} uInitrd.

The Device Tree blob can be found in /usr/lib/linux-image-${version}-${abi}/*.dtb.

flags and flags_backup

On ARM, the first 48 bytes of each partition encode the boot flags as managed by the chaiwala-bootflags package. See that package for details, particularly bootflags.h. The rest of each partition is reserved for future use.

On x86, these partitions are not used. (???)

boot_1 and boot_2

On ARM, each boot partition contains a kernel, initramfs, compiled Device Tree, and U-Boot boot.scr that can boot the system normally. boot_1 corresponds to the system_1 subvolume in the system partition, and boot_2 corresponds to system_2.

A new image only populates boot_1. The first platform upgrade will populate boot_2 and reboot into it, and subsequent platform upgrades will install into whichever is not currently in use.

The kernel and initramfs are exactly the same files used for factory reset.

system

A pair of subvolumes named system_1 and system_2 contain the root filesystem, which consists of the platform and the built-in application bundles. See Filesystem_Layout for full details.

A new image only populates system_1. The first platform upgrade will populate system_2 and reboot into it, and subsequent platform upgrades will install into whichever is not currently in use.

general_storage

This partition contains subvolumes for store application bundles (either preinstalled or user-installed), media and user data. See Filesystem_Layout for full details.

Personal tools
Namespaces

Variants
Actions
Navigation
Tools