alpine-iso
-
- Offline
- 1 year 2 months ago
- 2016-10-20
Hello,
I am currently trying to build a custom image for my Raspberry Pi3 (.tar.gz), from my laptop, using alpine-iso project.
**
EDIT: this project is probably not compatible with Pi3 anyway, I found an update "add u-boot and rpi2 support" but nothing about rpi3. I probably need to find another way to create my custom tar.gz
**
1. I downloaded the project http://git.alpinelinux.org/cgit/alpine-iso/ and used it to create a simple image (same as alpine-standard-3.5.0-x86_64.iso you can find on the download page) and it works fine.
2. Now, I would like to create an image for armhf architecture from my laptop, not on the Raspberry.
I specified ALPINE_ARCH := armhf
in alpine-rpi.conf.mk but when I type make PROFILE=alpine-rpi iso
, apk fetch is still in x86_64 (my laptop). It doesn't find packages linux-rpi and raspberrypi and it makes sense with this architecture.
3. I changed /etc/apk/arch from x86_64 to armhf. When I do an apk update
, armhf is used: fetch http://mirrors.2f30.org/alpine/v3.4/main/armhf/APKINDEX.tar.gz. However, the Makefile is still stuck on x86_64 ... I am sure changing this file is not the good way (and moreover could corrupt my laptop install).
Something to do with abuild ? Any idea ?
Thank you for your help,
Bibi
**
EDIT2: using Qemu (qemu-system-arm) and install a fresh new Alpine, git alpine-iso, pretend as an armhf archi. Not a proper way in my opinion ... And I read in the end of this page that the kernel doesn't boot for ARM archi: https://wiki.alpinelinux.org/wiki/Alpine_on_ARM
Ok, I keep going and soon, all my rasp-like boards (same issue with uboot) will be flashed with my patched-kernel and all the packages I need without an Internet connection ! I don't want to use build systems such as Yocto or Buildroot because Alpine offers the simplicity for people who don't want to go deep into Linux.
**
Where you able to build your own image for raspberry pi? I am trying to get Alpine running on the RPI with Network and SSH running right away.
Thank you
** EDIT **
I misunderstood your question ... I was not able to create my own image. However, you should already have ssh and network working if you launch the script setup-alpine at startup. But if you want it to work right away (without setup-alpine if no screen for instance), I don't know how to do that. A custom image should be a solution, indeed. Did you try to edit the content of the SD and add the network interface in alpine-rpi-3.5.0-armhf.tar.gz\alpine-rpi-3.5.0-armhf.tar\.\rpi.apkovl.tar.gz\rpi.apkovl.tar\etc\network\interfaces and ping your Pi ? Even if you can ping it, you probably cannot ssh on it if PermitRootLogin is not on.
**
Download https://fr.alpinelinux.org/alpine/v3.5/releases/armhf/alpine-rpi-3.5.0-armhf.tar.gz
If you work on Linux, follow the wiki: http://wiki.alpinelinux.org/wiki/Raspberry_Pi (probably mmcsomething1). If not, you need to launch fdisk as root and follow this tuto http://tldp.org/HOWTO/Partition/fdisk_partitioning.html. Or your can use GParted http://gparted.org/download.php if your prefer a graphic interface.
Just make sure your partition is bootable, specially on a brand-new SD, with
fdisk -l
and check that there is a star next to /dev/On Windows, I used Rufus https://rufus.akeo.ie/ but I had some issues to target an ARM architecture. So with Rufus, I created a bootable USB stick with the GParted iso on it. Booted the laptop on this USB, accessed the SD-card, created all partitions for Alpine, made the first bootable. Back to Windows, copied the content off the tar.gz (7z) archive onto the SD. And it worked !
Bibi
Thanks for you help.
I just tried building my own Image by chroot-ing into alpine on my Debian RaspberryPi.
But the image does not even boot and I t was quite the challenges to generate it...
I also tried to run Alpine in Qemu, but can find the correct Kernel.
My last try was to edit the overlay .tar file to enable network and ssh, but once I change anything, It will not even boot anymore. (I have a screen attached)
At this point I am out of ideas to get it running, I might have to buy a USB Keyboard ...
If you used alpine-iso, did you make your tar.gz image for armhf ? Even if your image does not boot, I would be interested to know how you used the toolchain :-)
About Qemu, apparently it doesn't work, as you can see at the very end of this page: https://wiki.alpinelinux.org/wiki/Alpine_on_ARM
Now, I had to switch to a new subject (a bit related). From my Alpine on the laptop, cross-compile a kernel for the RPi3
make ARCH=arm CROSS_COMPILE=arm-linux-gnueabihf- zImage modules dtbs
(see https://www.raspberrypi.org/documentation/linux/kernel/building.md ). I have an issue to solve with links from gcc to glibc (because Alpine is based on musl). If I can build it properly, maybe it'll give new ideas to use it in Qemu. Maybe something is not good in the Alpine's default .config to work on Qemu so I'm using one from Raspbian (/etc/config.gz).By the way, I don't know where alpine-iso finds a pre-built kernel for arm on a x86-64 host ... That could be the first thing to find out before dealing with packages.
Bibi
Please share, if you get it to run with Qemu. I am interested in how you got it running.
To build an Image for the raspberry i followed this link to chroot on my debian jessie installation on my RPI. that way i don't need to cross-compile or anything
https://wiki.alpinelinux.org/wiki/Installing_Alpine_Linux_in_a_chroot
I had to use an older apk-tools-static package, because the most recent one gives "segmentation fault"
Package I used: apk-tools-static-2.6.7-r0.apk
Then follow this link to make the iso:
https://wiki.alpinelinux.org/wiki/How_to_make_a_custom_ISO_image
Instead of syslinux, install linux-rpi. As there is no syslinux package for the RPI.
Follow the wiki entry and use
make PROFILE=alpine-rpi
followed by
make PROFILE=alpine-rpi sha1
to create the tar.gz
I noticed that this Package does not contain any overlay files. And it does not boot, once copied to SD card.
Hope that helps
Markus