Build instructions:
- Create a
Dockerfilewith the following contents:
FROM ubuntu:20.04 AS build_stage
RUN apt-get update
RUN apt-get dist-upgrade -y
RUN apt-get install -y libncurses-dev libelf-dev libdw-dev python3 python3-yaml
RUN apt-get install -y build-essential binutils bzip2 flex gawk gcc grep libc-dev libz-dev make perl rsync subversion unzip
RUN apt-get install -y git
RUN apt-get install -y wget python3-distutils
RUN DEBIAN_FRONTEND=noninteractive apt-get install -y qemu-utils
#ENV FORCE_UNSAFE_CONFIGURE=1
RUN groupadd -g 200512 customgroup; \
useradd -m -u 201105 -g customgroup customuser
USER customuser
WORKDIR /home/customuser/prplos
RUN git clone https://gitlab.com/prpl-foundation/prplos/prplos.git .
RUN git checkout prplware-v4.1.0
RUN ./scripts/gen_config.py x86_64 prpl
RUN cat <<'EOF' > enable_vdi_image.patch
--- a/.config
+++ b/.config
@@ -166,7 +166,7 @@ CONFIG_GRUB_BOOTOPTS=""
CONFIG_GRUB_TIMEOUT="1"
CONFIG_GRUB_TITLE="OpenWrt"
# CONFIG_ISO_IMAGES is not set
-# CONFIG_VDI_IMAGES is not set
+CONFIG_VDI_IMAGES=y
# CONFIG_VMDK_IMAGES is not set
# CONFIG_VHDX_IMAGES is not set
CONFIG_TARGET_SERIAL="ttyS0"
@@ -176,7 +176,7 @@ CONFIG_TARGET_SERIAL="ttyS0"
# Image Options
#
CONFIG_TARGET_KERNEL_PARTSIZE=16
-CONFIG_TARGET_ROOTFS_PARTSIZE=150
+CONFIG_TARGET_ROOTFS_PARTSIZE=512
CONFIG_TARGET_ROOTFS_PARTNAME=""
# CONFIG_TARGET_ROOTFS_PERSIST_VAR is not set
# end of Target Images
EOF
RUN patch .config enable_vdi_image.patch
RUN make -j$(nproc) tools/compile
RUN make -j$(nproc) toolchain/compile
RUN make -j$(nproc) target/linux/compile
# update librlyeh
RUN wget https://gitlab.com/prpl-foundation/lcm/libraries/librlyeh/-/archive/v1.4.2/librlyeh-v1.4.2.tar.gz -O dl/librlyeh-v1.4.2.tar.gz
RUN sed -i 's/v1\.4\.1/v1\.4\.2/g' feeds/feed_lcm/libs/librlyeh/Makefile
RUN sed -i 's/022cbf6a8e9ce33f91cf85928a600968adadf8402cfb6ef8a828776f6f7beef0/b5702e3aa2f50a6093c3e9b64879a73c86594297f6f8031ce41b8ae09762927c/' feeds/feed_lcm/libs/librlyeh/Makefile
RUN make -j$(nproc)
FROM scratch AS build_artifacts
COPY --from=build_stage /home/customuser/prplos/bin/targets/x86/64 /- build prplOS images
docker build --output ./dist .
Note: for qemu you only need to keep .dist/prplos-x86-64-generic-squashfs-combined-efi.img
- start vm
qemu-system-x86_64 \
-nographic \
-smp 8 \
-M q35 \
-m 2048 \
-drive file=dist/prplos-x86-64-generic-squashfs-combined-efi.img,id=d0,if=none,format=raw \
-device ide-hd,drive=d0,bus=ide.0 \
-netdev type=user,id=lan, \
-device e1000,netdev=lan,id=nic1 \
-netdev type=user,id=wan,net=10.0.2.0/24,dhcpstart=10.0.2.20,hostfwd=tcp:127.0.0.1:2222-10.0.2.20:22 \
-device e1000,netdev=wan,id=nic2
- enable ssh
obuspa -f /etc/obuspa.db -c set Device.SSH.Server.*.X_PRPLWARE-COM_GroupRestriction ""
obuspa -f /etc/obuspa.db -c set Device.SSH.Server.*.AllowPasswordLogin true
obuspa -f /etc/obuspa.db -c set Device.SSH.Server.*.AllowRootLogin true
obuspa -f /etc/obuspa.db -c set Device.SSH.Server.*.AllowRootPasswordLogin true
obuspa -f /etc/obuspa.db -c set Device.SSH.Server.*.Enable true
- ssh login
ssh root@127.0.0.1 -p 2222