Skip to content
This repository has been archived by the owner on Jan 31, 2021. It is now read-only.

Commit

Permalink
Convert the minishift ISO into a boot2podman ISO
Browse files Browse the repository at this point in the history
Remove the tests and the release and CI, for now

Besides podman / buildah, also install resolver
  • Loading branch information
afbjorklund committed Dec 7, 2018
1 parent 65268b6 commit fc09ce6
Show file tree
Hide file tree
Showing 11 changed files with 87 additions and 600 deletions.
37 changes: 3 additions & 34 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -3,15 +3,11 @@ BIN_DIR=$(BUILD_DIR)/bin
HANDLE_USER_DATA=$(shell base64 -w 0 scripts/handle-user-data)
HANDLE_USER_DATA_SERVICE=$(shell base64 -w 0 scripts/handle-user-data.service)
YUM_WRAPPER=$(shell base64 -w 0 scripts/yum-wrapper)
CERT_GEN=$(shell base64 -w 0 scripts/cert-gen)
SET_IPADDRESS=$(shell base64 -w 0 scripts/set-ipaddress)
SET_IPADDRESS_SERVICE=$(shell base64 -w 0 scripts/set-ipaddress.service)
VERSION=1.0.0
GITTAG=$(shell git rev-parse --short HEAD)
TODAY=$(shell date +"%d%m%Y%H%M%S")
MINISHIFT_LATEST_URL=$(shell python tests/utils/minishift_latest_version.py)
ARCHIVE_FILE=$(shell echo $(MINISHIFT_LATEST_URL) | rev | cut -d/ -f1 | rev)
MINISHIFT_UNTAR_DIR=$(shell echo $(ARCHIVE_FILE) | sed 's/.tgz//')

ifndef BUILD_ID
BUILD_ID=local
Expand Down Expand Up @@ -41,7 +37,7 @@ clean:
rm -rf $(BUILD_DIR)

.PHONY: fedora_iso
fedora_iso: ISO_NAME=minishift-fedora
fedora_iso: ISO_NAME=boot2podman-fedora
fedora_iso: KICKSTART_FILE=fedora.ks
fedora_iso: fedora_kickstart
fedora_iso: iso_creation
Expand All @@ -57,43 +53,16 @@ fedora_kickstart: kickstart
kickstart: init
@handle_user_data='$(HANDLE_USER_DATA)' handle_user_data_service='$(HANDLE_USER_DATA_SERVICE)' \
set_ipaddress='$(SET_IPADDRESS)' set_ipaddress_service='$(SET_IPADDRESS_SERVICE)' \
yum_wrapper='$(YUM_WRAPPER)' cert_gen='$(CERT_GEN)' \
yum_wrapper='$(YUM_WRAPPER)' \
version='$(VERSION)' build_id='$(GITTAG)-$(TODAY)-$(BUILD_ID)' \
releasever='$(RELEASEVER)' basearch='$(BASEARCH)' \
envsubst < $(KICKSTART_TEMPLATE) > $(BUILD_DIR)/$(KICKSTART_FILE)

.PHONY: iso_creation
iso_creation:
cd $(BUILD_DIR); sudo livecd-creator --config $(BUILD_DIR)/$(KICKSTART_FILE) --logfile=$(BUILD_DIR)/livecd-creator.log --fslabel $(ISO_NAME)
cd $(BUILD_DIR); sudo livecd-creator --config $(BUILD_DIR)/$(KICKSTART_FILE) --logfile=$(BUILD_DIR)/livecd-creator.log --fslabel $(ISO_NAME) --cache=/var/cache/live
# http://askubuntu.com/questions/153833/why-cant-i-mount-the-ubuntu-12-04-installer-isos-in-mac-os-x
# http://www.syslinux.org/wiki/index.php?title=Doc/isolinux#HYBRID_CD-ROM.2FHARD_DISK_MODE
dd if=/dev/zero bs=2k count=1 of=${BUILD_DIR}/tmp.iso
dd if=$(BUILD_DIR)/$(ISO_NAME).iso bs=2k skip=1 >> ${BUILD_DIR}/tmp.iso
mv -f ${BUILD_DIR}/tmp.iso $(BUILD_DIR)/$(ISO_NAME).iso

.PHONY: get_gh-release
get_gh-release: init
curl -sL https://github.com/progrium/gh-release/releases/download/v2.2.1/gh-release_2.2.1_linux_x86_64.tgz > $(BUILD_DIR)/gh-release_2.2.1_linux_x86_64.tgz
tar -xvf $(BUILD_DIR)/gh-release_2.2.1_linux_x86_64.tgz -C $(BUILD_DIR)
rm -fr $(BUILD_DIR)/gh-release_2.2.1_linux_x86_64.tgz

.PHONY: release
release: fedora_iso get_gh-release
rm -rf release && mkdir -p release
cp $(BUILD_DIR)/minishift-fedora26.iso release/
$(BUILD_DIR)/gh-release checksums sha256
$(BUILD_DIR)/gh-release create minishift/minishift-fedora-iso $(VERSION) master v$(VERSION)

$(BIN_DIR)/minishift:
@echo "Downloading latest minishift binary at $(BIN_DIR)/minishift..."
@mkdir -p $(BIN_DIR)
@cd $(BIN_DIR) && \
curl -LO --progress-bar $(MINISHIFT_LATEST_URL) && \
tar xzf $(ARCHIVE_FILE) && \
mv $(MINISHIFT_UNTAR_DIR)/minishift .
@echo "Done."

.PHONY: test
test: $(BIN_DIR)/minishift
sh tests/test.sh

40 changes: 11 additions & 29 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
<a name="creating-a-minishift-fedora-iso"></a>
# Minishift Fedora ISO
<a name="creating-a-boot2podman-fedora-iso"></a>
# Boot2podman Fedora ISO

This repository contains all the instructions and code to build a Live ISO based on Fedora
which can be used by [minishift](https://github.com/minishift/minishift) as an alternative to
the CentOS ISO.
which can be used by [podman-machine](https://github.com/boot2podman/machine) as an alternative to
the Boot2podman ISO.

----

Expand Down Expand Up @@ -45,17 +45,13 @@ If you don't have _livecd-tools or using different linux distro other than Fedor

* [Install livecd-tools](https://github.com/rhinstaller/livecd-tools)

Note: We use to have docker installed on system to get selinux context, [check bugzilla](https://bugzilla.redhat.com/show_bug.cgi?id=1303565)

$ dnf install -y livecd-tools docker


<a name="building-the-iso"></a>
#### Building the ISO

```
$ git clone https://github.com/minishift/minishift-fedora-iso.git
$ cd minishift-fedora-iso
$ git clone https://github.com/boot2podman/boot2podman-fedora-iso.git
$ cd boot2podman-fedora-iso
$ make
```

Expand All @@ -74,11 +70,11 @@ $ make
#### Building the ISO

```
$ git clone https://github.com/minishift/minishift-fedora-iso.git
$ cd minishift-fedora-iso
$ git clone https://github.com/boot2podman/boot2podman-fedora-iso.git
$ cd boot2podman-fedora-iso
$ vagrant up
$ vagrant ssh
$ cd <path to minishift-fedora-iso directory on the VM>/minishift-fedora-iso
$ cd <path to boot2podman-fedora-iso directory on the VM>/boot2podman-fedora-iso
$ make
```

Expand All @@ -102,18 +98,6 @@ Setup your build environment by following the instructions provided in [Building

Note: Building ISO might require you to have Vagrant environment if you are not using host other than Fedora.

#### Run the tests

Once the ISO is built from above step, use following command to run tests:

```
$ make test
```

Note: If you are using the Vagrant environment, you need to exit from it and come back to host to run the above command.

This command will fetch the latest [minishift](http://github/minishift/minishift) binary and run the [tests](tests/test.sh).

<a name="further-reading"></a>
## Further reading

Expand All @@ -124,8 +108,6 @@ image itself. To do so you have to get familiar with
<a name="community"></a>
## Community

You can reach the Minishift community by:

- Signing up to our [mailing list](https://lists.minishift.io/admin/lists/minishift.lists.minishift.io)
You can reach the Podman community by:

- Joining the `#minishift` channel on [Freenode IRC](https://freenode.net/)
- Joining the `#podman` channel on [Freenode IRC](https://freenode.net/)
4 changes: 2 additions & 2 deletions Vagrantfile
Original file line number Diff line number Diff line change
Expand Up @@ -27,9 +27,9 @@ Vagrant.configure(2) do |config|
end

config.vm.provision "shell", inline: <<-SHELL
# Docker and parted packages are required to get selinux context: https://bugzilla.redhat.com/show_bug.cgi?id=1303565
# Podman and parted packages are required to get selinux context: https://bugzilla.redhat.com/show_bug.cgi?id=1303565
sudo dnf -y update
sudo dnf install -y git livecd-tools docker parted make sudo gettext
sudo dnf install -y git livecd-tools podman parted make sudo gettext
cd /opt/
make
SHELL
Expand Down
177 changes: 0 additions & 177 deletions centos_ci.sh

This file was deleted.

Loading

0 comments on commit fc09ce6

Please sign in to comment.