Hello :wave:
This is just a post letting people know I'll be working on porting pmOS to the Beaglebone Black* and would love help!
This is a great platform for experimenting, in my opinion, mainly due to the built-in serial port.
You can follow my commits in my fork
*I still have plans for more Android-y devices but I need to accrue more first....
Useful links:
Collection of Utilities from the Defunct Angstrom Project: Useful, but the scripts are woefully out of date.
U-Boot on the BBB: Guide to compile from U-Boot from source, very useful and should probably be done in an alpine chroot.
Port of Alpine to BBB: A little confused what's going on, I need to dig through the scripts more to see what's up. @BrianSidebotham any input?
Walkthough of Generic Linux on the BBB: Looks really thorough, going to be using a lot from this.
Mainline Kernel for am33x Devices!: Wow! The above link led me here, amazing work @RobertCNelson ! :+1:
Accidentally closed the issue :sweat_smile: ignore this....
Cool that you're attempting this port!
Alpine already has a u-boot-beaglebone package, and this is in the README.txt of the regular u-boot package (on which the BBB specific one depends):
-----------
- ROM looks for 1st partition with FAT, and loads MLO from it
- NOTE: MLO needs to be the first file created on this partition
- Install u-boot with:
cp am335x_boneblack/{MLO,u-boot.img} /media/mmcblk0p1/
So it looks like Alpine already runs on the BBB. Here would be one way to install Alpine and then convert it to postmarketOS (not tested):
MLO (must be the first file!) and u-boot.img from /usr/share/u-boot/am335x_boneblack/ inside the tarball to the ext4 partitionIf you get the Alpine installation working, I would recommend to register an account in the Alpine wiki and document the installation step by step for other users (as it seems like there isn't really a step by step guide yet).
With some code changes, we could also make it possible to get this working with pmbootstrap install --sdcard. But right now, it will format the boot partition as ext2 instead of fat32 and we don't have a mechanism to copy the MLO file as first file.
@ollieparanoid the boot rom also supports raw boot, so if you can't guarantee MLO will be written first to fat.
sudo dd if=./MLO of=/dev/mmcblk0 count=1 seek=1 bs=128k
sudo dd if=./u-boot.img of=/dev/mmcblk0 count=2 seek=1 bs=384k
PS, one idea we've had after ELC.. Shove the MLO into raw boot, but leave the "u-boot.img" in the first partition. Then you get the best of both worlds, the bootloader will always find MLO and as "u-boot.img" grows bigger from more device tree's included, you won't run out of space in the 4MB hole we setup at the front of the drive.
Regards,
Still fighting with u-boot, but making progress as it definitely boots the newer version.
@ethanrjones97: at least some progress :+1:
You might need to cat the kernel together with the dtb file before you can boot it, in case this is not obvious.
I've gotten it to almost boot the kernel, but it hangs at the "starting kernel" message...

Removing the initramfs gives me the kernel - it just panics obviously.

@ethanrjones97 you forgot to pass root=xyz
root=/dev/mmcblk0p1
or
root=/dev/mmcblk1p2
Regards,
@RobertCNelson at least from what I've been hacking around with it, this version of alpine doesn't seem to "use" a it for root. Everything is contained in the initramfs and then some important bits are grabbed from the "root" (/boot and /apks)
Currently I've got it to
but then it just spams that "it can't find my console device".....to my console :man_shrugging: :man_facepalming:

@ethanrjones97
ah, then just use root=/dev/ram, it should get you farther into initramfs
Since you can't find /dev/ttyO0, you probally don't have the correct kernel configs:
CONFIG_SERIAL_8250_OMAP -> /dev/ttyS0
CONFIG_SERIAL_8250_OMAP_TTYO_FIXUP -> changes /dev/ttyOx from bootloader to /dev/ttySx (as passed thru /proc/cmdline)
(we use udev rules to map /dev/ttySx -> /dev/ttyOx for userspace compatibility...)
CONFIG_SERIAL_OMAP -> /dev/ttyO0
CONFIG_SERIAL_OMAP_CONSOLE
Regards,
@RobertCNelson I had a feeling it was related to something like that. The TI wiki page mentions:
CONFIG_OMAP_LL_DEBUG_UART3
In case of similar errors, but it seemed to have been removed / only applies to TI's kernels.
Thanks for all your help so far!
that got ripped out in the device-tree transition...
@RobertCNelson
good to know
Any books on this I should be reading/referencing? You clearly know your stuff.
Oh, I've just been around the block with omap3's since 2.6.26. ;)
So the only book would be kernel.org's git tree, but that's missing another dozen or so things we tried that went nowhere. ;)
Regards,
Was on a bit of a hiatus without my beaglebone or laptop.
I'm back now, implementing the configs suggested by @RobertCNelson :smile:
Attempted to boot it up with CONFIG_SERIAL_OMAP & CONFIG_SERIAL_OMAP_CONSOLE enabled. I'm now getting an error: getty: bad speed: 115200n8 very odd. I found a bug report opened for alpine's init which seemed to reference a similar problem, but it's apparently been patched...
For reference I'm using:

@ethanrjones97: Great research! I assume this error happened after enabling the postmarketOS repositories? If that is the case, it would make sense: postmarketOS has a postmarketos-mkinitfs package, which replaces Alpine's mkinitfs and works completely different (that design choice was made in the beginning, because we have a completely different use case).
After looking into the bug report you found, it seems that the following commits fixed the issue:
Both of them modify the function setup_inittab_console() in their initramfs-init.in file. Alpine's mkinitfs and the pmOS one are under the same license (GPL2), so you could try to integrate that function (I'd use the latest version of it) into our initramfs and get the inittab console set up correctly that way. Our mkinitfs is in aports/main/postmarketos-mkintifs and you can use test/static_code_analysis.sh to check the shell syntax after each modifications, as well as trying to boot it with qemu-amd64.
Sadly I still haven't got a shell. That happens right before I'm supposed to get one I think. This is still vanilla Alpine 3.7.0 for arm - minus kernel.
I've been in their IRC and appearantly the vanilla setup works fine for a couple people, I'm beginning to think I need an HDMI cable as it could be outputting to there. 馃
Yeah, then I would try it with the HDMI cable.
HDMI cable was a bust however....

We have a shell!
Most helpful comment
HDMI cable was a bust however....

We have a shell!