Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

How To Configure A Different OS? #6

Closed
andrewcooke opened this issue Apr 16, 2022 · 3 comments
Closed

How To Configure A Different OS? #6

andrewcooke opened this issue Apr 16, 2022 · 3 comments

Comments

@andrewcooke
Copy link

Please can you describe how to configure a different OS (eg; https://en.opensuse.org/HCL:Raspberry_Pi4). Do I need to checkout and modify the source then build my own docker image, or is it possible to do this using the default image?

Also, where is this specified in the source? I think it's set via environment variables, but I can't find where the environment variables are set.

Thanks!

@ptrsr
Copy link
Owner

ptrsr commented Apr 19, 2022

Hi @andrewcooke , you probably have to change the dockerfile contents slightly (shouldn't be too difficult). Right now it uses two environment variables to download and extract the buster image. I noticed that the OpenSUSE images are provided as .raw.xz. I am not familiar with that extension, although I believe it should be usable. You may have to remove the unzip step in the dockerfile and change it to something else. After that you should build the image yourself using docker build. This may take an hour or two.

Let me know if you need help with the coding part. Good luck!

@ptrsr
Copy link
Owner

ptrsr commented Apr 19, 2022

Before I forget, there is one issue that comes to mind when using a different OS, and that is the Ansible configuration. Right now, you can find the following lines in the dockerfile:

# Copy setup configuration
RUN mkdir -p /mnt/root/usr/local/lib/systemd/system
COPY src/setup.service /mnt/root/usr/local/lib/systemd/system/
COPY src/setup.sh /mnt/root/usr/local/bin/
RUN ln -rs /mnt/root/usr/local/lib/systemd/system/setup.service /mnt/root/etc/systemd/system/multi-user.target.wants
RUN ln -rs /mnt/root/lib/systemd/system/systemd-time-wait-sync.service /mnt/root/etc/systemd/system/sysinit.target.wants/systemd-time-wait-sync.service
RUN rm mnt/root/etc/systemd/system/timers.target.wants/apt-daily*
RUN ln -rs /mnt/root/dev/null /mnt/root/etc/systemd/system/serial-getty@ttyAMA0.service

You may want to comment out this section, as it installs Ansible using apt-get in a startup script.

Additionally, you may want to remove the section

# Update system and install Ansible
RUN qemu-system-aarch64 \
   -M raspi3 \
   -m 1G \
   -smp 4 \
   -sd $BASE_DIR/$IMAGE_FILE_NAME \
   -kernel $BASE_DIR/$KERNEL_FILE_NAME \
   -dtb $BASE_DIR/$DTB_FILE_NAME \
   -nographic -no-reboot \
   -device usb-net,netdev=net0 -netdev user,id=net0 \
   -append "rw console=ttyAMA0,115200 root=/dev/mmcblk0p2 rootfstype=ext4 rootdelay=1 loglevel=2 modules-load=dwc2,g_ether" \
   2> /dev/null

As this runs the emulator once for installing Ansible (which you may not want / need).

@andrewcooke
Copy link
Author

Oh, yes, ARG DISTRO_IMG (and co). OK, thanks I will give this a try and report back. Thanks!

@ptrsr ptrsr closed this as completed May 10, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants