G's Blog

PinePhone

Quick PinePhone update and new music (#100DaysToOffload Day 8)

So yesterday i tried using my PinePhone for a whole day. The results where promising but still some improvements. The latest Ubuntu Touch image now has notifications and ringtones. Also the timezone settings work properly(not a giant issue but something that's been bothering me). Call audio seems much better than last image i used. The remaining issues are around Power Consumption and sleep. The battery did not last half the day and when my wife called me after the phone had been sleeping for a while it did not ring and instead went right to voicemail.

Still the great improvement in call audio quality is a great step. I give it a month at the most and things should be in a much better position.

Another thing i did yesterday was pick up some new music from BandCamp. Since they where having another day of waiving there fees i figured i should pick something up. There was so much i wanted to get but in the end had to let my bank account decide. So i got the following:

Metropolis Deluxe Edition By NightCrawler First album i ever heard from this artist and i was impressed.

Dark Water By Electric Dragon Another First for me but was a must have.

And lastly

Bionic Chrysalis By DEADLIFE A great artist i already have 2 of his other albums. This one is a prelude to another album of his(The order of Chaos). Well i feel like it is not sure if it is officially.

I'll be getting more from all these artists in the future for sure. Give them a listen. Well worth your time.

Well that is all for today.

Until tomorrow. Stay Safe!

@mgrondin@youdabomb.social

#PinePhone #Tech #Music #BandCampFriday

Until next time. Stay safe!

G @mgrondin@youdabomb.social

PinePhone has arrived

So this actually happened a few day ago (Thursday Feb 27th) but i did not take the time to post here.

Anyways the day finally came!!

PinePhone image here

I'm so excited to start playing with this. I have done some playing around and documented some of it here

and here

There will be more to come so watch here, on peertube and on pleroma for more updates.

That's all for now

G

#pinephone #tech

Until next time. Stay safe!

G @mgrondin@youdabomb.social

PinePhone(ARM) Build Environment setup

So as most of you already know i have ordered a PinePhone. I want to be able to contribute and test as much as I can so I wanted to be able to build packages for it. I figured building direct on the device would be painfully slow so wanted to set something up on my desktop to do so.

I bounced around a few ideas. Cross Compile, Chroot to cross compile in, Emulate ARM with Qemu... In the end I decided to give the Qemu option a go first as it seems like the easiest to setup/maintain. I wasn't completely wrong but it was also a little more complicated than i had assumed at first.

My first idea was just to run one of the pinephone images using qemu. Turns out that can't really be done as qemu can't fully emulate the pinephone. So my next attempt was to run ArchARM using qemu. This is what i will detail here.

So first step is to download the latest generic ARM package found here.

I have setup a folder to host all the files related to ArchARM. So we will want to create an image to hold the ArchARM file system. We do this like so

qemu-img create -f qcow2 -o preallocation=full ArchARM.img 64G

This will create a 64GB image and preallocate the space. This will improve performance.

Next we will create a filesystem and mount this image to copy the base ArchARM system to it. To do this we need to install libguestfs. It is in the AUR and i think soon to be in the community repo. With that installed we can:

Create the filesystem inside the image virt-format --filesystem=ext4 -a ArchARM.img

make the folder to mount it on sudo mkdir /mnt/virtfs

Mount the image sudo guestmount -m /dev/sda1 -a ArchARM.img /mnt/virtfs/

The -m option specifies the partition inside the image to mount. This is not the sda1 on your actual system.

Now we can extract the ArchARM archive to the image

This should be done as root(Not using sudo)

bsdtar -xpf ArchLinuxARM-aarch64-latest.tar.gz -C /mnt/virtfs

Now we need the kernel and initrd from the image so we can boot it with qemu

cp /mnt/virtfs/boot/Image.gz .

cp /mnt/virtfs/boot/initramfs-linux.img .

This will need to be done anytime the kernel is updated in the Virtual Machine.

Now we can unmount the image and we should be able to boot our ARM VirtualMachine.

After some trial and error the proper command to do this is:

qemu-system-aarch64 -machine virt -cpu cortex-a53 -nographic -m 2048 -smp cores=4 -kernel /media/Storage/ArchARM/Image.gz -initrd /media/Storage/ArchARM/ArchARM/boot/initramfs-linux.img -append 'root=/dev/vda1 rw quiet' -drive if=none,file=/media/Storage/ArchARM/ArchARM.img,format=qcow2,id=hd -device virtio-blk-pci,drive=hd -netdev user,id=mynet -device virtio-net-pci,netdev=mynet

This will give the VM 2GB of ram and 4 processor cores. Adjust if your system can't provide that comfortably.

If all goes well you'll get into ArchARM

Starting version 243.162-2-arch
/dev/vda1: clean, 34582/4194304 files, 635873/16777184 blocks

Arch Linux 5.4.1-1-ARCH (ttyAMA0)

alarm login: alarm
Password: 
[alarm@alarm ~]$ uname -a
Linux alarm 5.4.1-1-ARCH #1 SMP Sat Nov 30 18:54:05 UTC 2019 aarch64 GNU/Linux
[alarm@alarm ~]$

YAY!! now have a fully working ARM system.

Only other thing I'm doing is creating a function in fish(my shell. Bash users could create an alias) so that i can start up this VM by just typing strarm.

Hope this was helpful to some. Let me know if you have any questions or feedback.

Have a great day

G

#Tech #ARM #PinePhone

Until next time. Stay safe!

G @mgrondin@youdabomb.social