Allen Abraham bf2eb46fc8 fix: Resolving comments on MP
- Adding parition ordering using imagecraft
- Removing redundant locales install
- Better logging for empty ARCH and SUBPROJECT
- Using mktemp for mountpoint
2026-03-11 15:07:29 -04:00

105 lines
2.6 KiB
YAML

name: ubuntu-minimal
version: "0.1"
base: bare
build-base: devel
summary: Minimal Ubuntu image for CPC
description: A minimal Ubuntu image to be built using livecd-rootfs by CPC
platforms:
amd64:
volumes:
pc:
schema: gpt
structure:
# 1. BIOS Boot
- name: bios-boot
type: 21686148-6449-6E6F-744E-656564454649
role: system-boot
filesystem: vfat
size: 4M
partition-number: 14
# 2. EFI System Partition
- name: efi
type: C12A7328-F81F-11D2-BA4B-00A0C93EC93B
filesystem: vfat
filesystem-label: UEFI
role: system-boot
size: 106M
partition-number: 15
# 3. Linux Extended Boot
- name: boot
type: 0FC63DAF-8483-4772-8E79-3D69D8477DE4
filesystem: ext4
filesystem-label: BOOT
role: system-data
size: 1G
partition-number: 13
# 4. Root Filesystem
- name: rootfs
type: 0FC63DAF-8483-4772-8E79-3D69D8477DE4
filesystem: ext4
filesystem-label: cloudimg-rootfs
role: system-data
size: 3G
partition-number: 1
filesystems:
default:
- mount: "/"
device: "(volume/pc/rootfs)"
- mount: "/boot"
device: "(volume/pc/boot)"
- mount: "/boot/efi"
device: "(volume/pc/efi)"
parts:
rootfs:
plugin: nil
build-packages: ["mmdebstrap"]
override-build: |
mmdebstrap --arch $CRAFT_ARCH_BUILD_FOR \
--mode=sudo \
--format=dir \
--variant=minbase \
--include=apt \
resolute \
$CRAFT_PART_INSTALL/ \
http://archive.ubuntu.com/ubuntu/
rm -r $CRAFT_PART_INSTALL/dev/*
mkdir $CRAFT_PART_INSTALL/boot/efi
organize:
'*': (overlay)/
packages:
plugin: nil
overlay-packages:
- ubuntu-server-minimal
- grub2-common
- grub-pc
- shim-signed
- linux-image-generic
overlay-script: |
rm $CRAFT_OVERLAY/etc/cloud/cloud.cfg.d/90_dpkg.cfg
snaps:
plugin: nil
after: [packages]
overlay-script: |
env SNAPPY_STORE_NO_CDN=1 snap prepare-image --classic \
--arch=amd64 --snap snapd --snap core24 "" $CRAFT_OVERLAY
fstab:
plugin: nil
after: [snaps]
overlay-script: |
cat << EOF > $CRAFT_OVERLAY/etc/fstab
LABEL=cloudimg-rootfs / ext4 discard,errors=remount-ro 0 1
LABEL=BOOT /boot ext4 defaults 0 2
LABEL=UEFI /boot/efi vfat umask=0077 0 1
EOF
cloud-init:
plugin: dump
source: cloud-init/