Skip to content

Commit

Permalink
Adopt kiwi-ng for builing images
Browse files Browse the repository at this point in the history
  • Loading branch information
mbugni committed Jun 2, 2024
1 parent 7f27975 commit fc2ca2d
Show file tree
Hide file tree
Showing 18 changed files with 33 additions and 981 deletions.
6 changes: 6 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,9 @@
## [39.0.0] - 2024-06-02
### Changed
- Adopt kiwi-ng for builing images
### Removed
- Kickstart scripts

## Fedora 39 - 2023-12-23
### Changed
- Minimize apps in favour of Flatpak
Expand Down
6 changes: 2 additions & 4 deletions Containerfile
Original file line number Diff line number Diff line change
@@ -1,7 +1,5 @@
FROM registry.fedoraproject.org/fedora:39
ADD tools/ks-package-list.py /usr/local/bin/ks-package-list
RUN chmod ugo+x /usr/local/bin/ks-package-list && \
dnf --assumeyes --setopt='tsflags=nodocs' --setopt='install_weak_deps=False' \
install bash-completion pykickstart lorax-lmc-novirt && \
RUN dnf --assumeyes --setopt='tsflags=nodocs' --setopt='install_weak_deps=False' \
install bash-completion distribution-gpg-keys kiwi-cli kiwi-systemdeps && \
dnf --assumeyes clean all && \
rm /etc/rpm/* -rf
66 changes: 25 additions & 41 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,7 +1,8 @@
# Fedora Remix

## Purpose
This project is a [Fedora Remix][01] and aims to offer a complete system for multipurpose usage with localization support. You can [download a live image][02] and try the software, and then install it in your PC if you want.
This project is a [Fedora Remix][01] and aims to offer a complete system for multipurpose usage with localization support.
You can [download a live image][02] and try the software, and then install it in your PC if you want.
You can also customize the image starting from available scripts.

Other goals of this remix are:
Expand All @@ -10,7 +11,7 @@ Other goals of this remix are:
* Flatpak apps usage

## How to build the LiveCD
[See a detailed description][03] of how to build the live media.
[See a detailed description][03] about how to build the live media.

> [!NOTE]
>
Expand All @@ -21,13 +22,13 @@ $ sudo setenforce 0
```

### Prepare the working directories
Clone the project to get sources:
Clone the project into your `<source-path>` to get sources:

```shell
$ git clone https://github.com/mbugni/fedora-remix.git /<source-path>
```

Choose or create a `/<target-path>` where to put results.
Choose or create a `<target-path>` folder where to put results.

### Prepare the build container
Install Podman:
Expand All @@ -46,8 +47,8 @@ Initialize the container by running an interactive shell:

```shell
$ sudo podman run --privileged --network=host -it --volume=/dev:/dev:ro \
--volume=/<source-path>:/live/source:ro --volume=/<target-path>:/live/target \
--name=livebuild-fc39 --hostname=livebuild-fc39 livebuild:fc39 /usr/bin/bash
--volume=/<source-path>:/live/source:ro --volume=/<target-path>:/live/target \
--name=livebuild-fc39 --hostname=livebuild-fc39 livebuild:fc39 /usr/bin/bash
```

The container can be reused and upgraded multiple times. See [Podman docs][06] for more details.
Expand All @@ -59,39 +60,27 @@ $ sudo podman start -ia livebuild-fc39
```

### Build the image

Run build commands inside the container.

#### Prepare the kickstart file

Choose a version (eg: KDE workstation with italian support) and then create a single Kickstart file from the source code:
First, start the build container if not running:

```shell
[] ksflatten --config /live/source/kickstarts/l10n/kde-workstation-it_IT.ks \
--output /live/target/fc39-kde-workstation.ks
$ sudo podman start livebuild-fc39
```

#### Check dependencies (optional)
Run the `ks-package-list` command if you need to check Kickstart dependencies:

```shell
[] ks-package-list --releasever 39 --format "{name}" --verbose \
/live/target/fc39-kde-workstation.ks > /live/target/fc39-kde-packages.txt
```
Choose a variant (eg: KDE workstation with italian support) that corresponds to a profile (eg: `Workstation-it_IT`).

Use the `--help` option to get more info about the tool:
Available profiles/variants are:
* `Minimal` (console only, mainly for testing)
* `Desktop` (minimal KDE environment with basic tools)
* `Workstation` (KDE environment with more features like printing and scanning support)

```shell
[] ks-package-list --help
```
For each variant you can append `-it_IT` to get italian localization (eg: `Desktop-it_IT`).

#### Create the live image
Build the .iso image by running the `livemedia-creator` command:
Build the .iso image by running the `kiwi-ng` command:

```shell
[] livemedia-creator --no-virt --nomacboot --make-iso --project='Fedora' \
--releasever=39 --tmp=/live/target --logfile=/live/target/lmc-logs/livemedia.log \
--ks=/live/target/fc39-kde-workstation.ks
$ sudo podman exec livebuild-fc39 kiwi-ng --profile=Workstation-it_IT --type=iso \
--shared-cache-dir=/live/target/cache system build \
--description=/live/source/kiwi-descriptions --target-dir=/live/target
```

The build can take a while (30 minutes or more), it depends on your machine performances.
Expand All @@ -104,17 +93,11 @@ $ sudo podman image rm livebuild:fc39
```

## Transferring the image to a bootable media
Install live media tools:

```shell
$ sudo dnf install livecd-iso-to-mediums
```

Create a bootable USB/SD device using the .iso image:
You can use a tool like [Ventoy][07] to build multiboot USB devices, or simply transfer the image to a single
USB stick using the `dd` command:

```shell
$ sudo livecd-iso-to-disk --format --reset-mbr \
/<target-path>/lmc-work-<code>/images/boot.iso /dev/sd<X>
$ dd if=/<target-path>/Fedora-Remix.x86_64-<version>.iso of=/dev/<stickdevice>
```

## Post-install tasks
Expand Down Expand Up @@ -145,7 +128,8 @@ The format is based on [Keep a Changelog][05].

[01]: https://fedoraproject.org/wiki/Remix
[02]: https://github.com/mbugni/fedora-remix/releases
[03]: https://weldr.io/lorax/lorax.html
[03]: https://osinside.github.io/kiwi
[04]: http://flagpedia.net/data/flags/mini/it.png
[05]: https://keepachangelog.com/
[06]: https://docs.podman.io/
[06]: https://docs.podman.io/
[07]: https://www.ventoy.net/
195 changes: 0 additions & 195 deletions kickstarts/base-desktop.ks

This file was deleted.

37 changes: 0 additions & 37 deletions kickstarts/base-extras.ks

This file was deleted.

Loading

0 comments on commit fc2ca2d

Please sign in to comment.