Skip to content

Commit

Permalink
Sorting options in A/B partitions
Browse files Browse the repository at this point in the history
  • Loading branch information
davdiv committed Apr 16, 2024
1 parent 80d314e commit 9572dee
Show file tree
Hide file tree
Showing 2 changed files with 60 additions and 60 deletions.
106 changes: 53 additions & 53 deletions src/alpine/abpartitions/bootParts.ts
Original file line number Diff line number Diff line change
Expand Up @@ -18,35 +18,35 @@ import { prepareApkPackages } from "../prepareApkPackages";
const minEFIPartitionSize = 33 * 1024 * 1024;

export interface ABPartitionsGrubPartitionOptions {
linuxDiskDevice?: string;
grubTimeout?: number;
grubExtraConfig?: string;
grubDiskDevice?: string;
grubSourceImage: string;
grubSourcePath?: string;
grubEnvPartitionIndex: number;
grubEnvPath?: string;
rootPartitionGrubCfg?: string;
grubExtraConfig?: string;
grubSourceImage: string;
grubSourcePath?: string;
grubTimeout?: number;
linuxDiskDevice?: string;
rootPartitionAIndex: number;
rootPartitionBIndex: number;
rootPartitionGrubCfg?: string;
squashfsToolsSource?: ImageOrContainer;
apkCache?: string;
containerCache?: ContainerCache;
logger?: Writable;
}

export const abpartitionsGrubPartition = async ({
grubTimeout = 3,
grubExtraConfig = "",
linuxDiskDevice = "/dev/sda",
grubDiskDevice = "hd0",
grubSourceImage,
grubSourcePath = "/usr/lib/grub",
rootPartitionGrubCfg = "/boot/grub.cfg",
grubEnvPartitionIndex,
grubEnvPath = "/grubenv",
grubExtraConfig = "",
grubSourceImage,
grubSourcePath = "/usr/lib/grub",
grubTimeout = 3,
linuxDiskDevice = "/dev/sda",
rootPartitionAIndex,
rootPartitionBIndex,
rootPartitionGrubCfg = "/boot/grub.cfg",
squashfsToolsSource,
apkCache,
containerCache,
Expand Down Expand Up @@ -131,26 +131,26 @@ export const abpartitionsGrubEnvPartition = async ({
};

export interface ABPartitionsGrubenvAndEfiPartitionOptions {
grubSourceImage: string;
grubPartitionIndex: number;
efiPartitionSize: number;
grubEnvPath?: string;
useEfi?: boolean;
grubDiskDevice?: string;
grubEnvPath?: string;
grubPartitionIndex: number;
grubSourceImage: string;
mtoolsSource?: ImageOrContainer;
useEfi?: boolean;
containerCache?: ContainerCache;
apkCache?: string;
logger?: Writable;
}

export const abpartitionsGrubenvAndEfiPartition = async ({
grubSourceImage,
grubPartitionIndex,
efiPartitionSize,
grubDiskDevice = "hd0",
useEfi,
grubEnvPath = "/grubenv",
efiPartitionSize,
grubPartitionIndex,
grubSourceImage,
mtoolsSource,
useEfi,
containerCache,
apkCache,
logger,
Expand Down Expand Up @@ -201,18 +201,18 @@ export const abpartitionsGrubenvAndEfiPartition = async ({
};

export interface ABPartitionsBiosPartitionOptions {
grubSourceImage: string;
grubPartitionIndex: number;
grubDiskDevice?: string;
grubPartitionIndex: number;
grubSourceImage: string;
containerCache?: ContainerCache;
apkCache?: string;
logger?: Writable;
}

export const abpartitionsBiosPartition = async ({
grubSourceImage,
grubPartitionIndex,
grubDiskDevice = "hd0",
grubPartitionIndex,
grubSourceImage,
containerCache,
apkCache,
logger,
Expand Down Expand Up @@ -244,43 +244,43 @@ export const abpartitionsBiosPartition = async ({
};

export interface ABPartitionsDiskOptions {
biosBootPartitionSize?: number;
bootType?: "bios" | "efi" | "both";
grubTimeout?: number;
grubExtraConfig?: string;
linuxDiskDevice?: string;
grubDiskDevice?: string;
efiPartitionSize?: number;
biosBootPartitionSize?: number;
rootPartition?: FileInImage;
rootPartitionSize: number;
rootPartitionGrubCfg?: string;
grubDiskDevice?: string;
grubEnvPath?: string;
grubExtraConfig?: string;
grubSourceImage?: string;
grubSourcePath?: string;
partedSource?: ImageOrContainer;
grubTimeout?: number;
linuxDiskDevice?: string;
mtoolsSource?: ImageOrContainer;
partedSource?: ImageOrContainer;
rootPartition?: FileInImage;
rootPartitionGrubCfg?: string;
rootPartitionSize: number;
squashfsToolsSource?: ImageOrContainer;
apkCache?: string;
containerCache?: ContainerCache;
logger?: Writable;
}

export const abpartitionsDisk = async ({
biosBootPartitionSize,
bootType = "both",
grubTimeout,
linuxDiskDevice,
grubExtraConfig,
grubDiskDevice,
efiPartitionSize,
biosBootPartitionSize,
rootPartition,
rootPartitionSize,
rootPartitionGrubCfg,
grubDiskDevice,
grubEnvPath,
grubExtraConfig,
grubSourceImage,
grubSourcePath,
partedSource,
grubTimeout,
linuxDiskDevice,
mtoolsSource,
partedSource,
rootPartition,
rootPartitionGrubCfg,
rootPartitionSize,
squashfsToolsSource,
apkCache,
containerCache,
Expand Down Expand Up @@ -317,11 +317,11 @@ export const abpartitionsDisk = async ({

const biosBoot = useBios
? await abpartitionsBiosPartition({
grubSourceImage,
grubPartitionIndex,
grubDiskDevice,
containerCache,
grubPartitionIndex,
grubSourceImage,
apkCache,
containerCache,
logger,
})
: undefined;
Expand All @@ -340,15 +340,15 @@ export const abpartitionsDisk = async ({
name: useEfi ? "efi" : "grubenv",
type: useEfi ? PartitionType.EfiSystem : PartitionType.LinuxData,
file: await abpartitionsGrubenvAndEfiPartition({
useEfi,
grubSourceImage,
efiPartitionSize,
grubDiskDevice,
grubEnvPath,
grubPartitionIndex,
grubDiskDevice,
grubSourceImage,
mtoolsSource,
useEfi,
apkCache,
containerCache,
efiPartitionSize,
logger,
}),
};
Expand All @@ -357,13 +357,13 @@ export const abpartitionsDisk = async ({
name: "grub",
type: PartitionType.LinuxData,
file: await abpartitionsGrubPartition({
linuxDiskDevice,
grubTimeout,
grubDiskDevice,
grubSourceImage,
grubEnvPartitionIndex: grubenvAndEfiPartitionIndex,
grubExtraConfig,
grubSourceImage,
grubSourcePath,
grubEnvPartitionIndex: grubenvAndEfiPartitionIndex,
grubTimeout,
linuxDiskDevice,
rootPartitionAIndex,
rootPartitionBIndex,
rootPartitionGrubCfg,
Expand Down
14 changes: 7 additions & 7 deletions src/alpine/abpartitions/rootPart.ts
Original file line number Diff line number Diff line change
Expand Up @@ -7,26 +7,26 @@ import { MemFile, addFiles } from "../../steps";
import { mksquashfsStep } from "../mksquashfs";

export interface ABPartitionsRootPartitionOptions {
sourceRootImage: string;
sourceRootKernelPath?: string;
kernelCmdline?: string;
rootPartitionGrubCfg?: string;
updateToolPath?: string;
sourceRootImage: string;
sourceRootInitrdPath?: string;
sourceRootKernelPath?: string;
squashfsToolsSource?: ImageOrContainer;
updateToolPath?: string;
apkCache?: string;
containerCache?: ContainerCache;
logger?: Writable;
}

export const abpartitionsRootPartition = async ({
sourceRootImage,
sourceRootKernelPath = "/boot/vmlinuz-lts",
kernelCmdline,
sourceRootInitrdPath = "/boot/initramfs-lts",
rootPartitionGrubCfg = "/boot/grub.cfg",
updateToolPath = "/sbin/buildahckerABTool",
sourceRootImage,
sourceRootInitrdPath = "/boot/initramfs-lts",
sourceRootKernelPath = "/boot/vmlinuz-lts",
squashfsToolsSource,
updateToolPath = "/sbin/buildahckerABTool",
apkCache,
containerCache,
logger,
Expand Down

0 comments on commit 9572dee

Please sign in to comment.