Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
14 changes: 12 additions & 2 deletions build-alpine-netboot-zfs.sh
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,8 @@

# USAGE:
# podman run -it --rm -v $(pwd):/root/workdir alpine sh /root/workdir/build-alpine-netboot-zfs.sh
# Debug container, by jumping into container shell:
# podman run -it --rm --entrypoint /bin/sh alpinebuilder


set -x
Expand All @@ -24,6 +26,10 @@ cd -

# Start build
adduser build --disabled-password -G abuild
echo Moving aports to /home/build
mv /root/workdir/aports /home/build/
chown -R build:abuild /home/build/aports

# Set password non interactively
echo -e "password\npassword" | passwd build
echo "build ALL=(ALL) NOPASSWD: ALL" >> /etc/sudoers.d/abuild
Expand All @@ -32,7 +38,11 @@ su - build << 'EOF'
set -x
SUDO=sudo abuild-keygen -n -i -a
# aports contains build utilities such as mkimage.sh
git clone --depth 1 https://gitlab.alpinelinux.org/alpine/aports
# No need to reclone since alpine-builder/Containerfile builds
# aports into image
#git clone --depth 1 https://gitlab.alpinelinux.org/alpine/aports

chown build:abuild /home/build/aports
cd aports

# Create & build alpine netboot profile with zfs kernel module enabled
Expand All @@ -43,7 +53,7 @@ profile_zfsnetboot() {
kernel_cmdline="overlay_size=0 console=tty0 console=ttyS0,115200"
syslinux_serial="0 115200"
kernel_addons="zfs"
apks="$apks zfs-scripts zfs zfs-utils-py python3 mkinitfs syslinux util-linux linux-firmware"
apks="$apks zfs-scripts zfs zfs-utils-py python3 mkinitfs=3.10.1-r0 syslinux util-linux linux-firmware"
initfs_features="base network squashfs usb virtio"
output_format="netboot"
image_ext="tar.gz"
Expand Down