Tag Archives: fedora

First successful rpmbuild on RISC-V

I’m very slowly bootstrapping Fedora to run on RISC-V, and today I managed to get rpmbuild to work, so that’s a sort of milestone:

Provides: config(setup) = 2.10.4-1.fc24 setup = 2.10.4-1.fc24
Requires(rpmlib): rpmlib(CompressedFileNames) <= 3.0.4-1 rpmlib(PayloadFilesHavePrefix) <= 4.0-1
Conflicts: bash <= 2.0.4-21 filesystem < 3 initscripts < 4.26
Checking for unpackaged file(s): /usr/lib/rpm/check-files /rpmbuild/BUILDROOT/setup-2.10.4-1.fc24.%{_arch}
warning: Could not canonicalize hostname: ucbvax
Wrote: /rpmbuild/RPMS/noarch/setup-2.10.4-1.fc24.noarch.rpm
Executing(%clean): /bin/sh -e /usr/var/tmp/rpm-tmp.0iJnms
+ umask 022
+ cd //rpmbuild/BUILD
+ cd setup-2.10.4
+ rm -rf '/rpmbuild/BUILDROOT/setup-2.10.4-1.fc24.%{_arch}'
+ exit 0
Executing(--clean): /bin/sh -e /usr/var/tmp/rpm-tmp.Vdj45n
+ umask 022
+ cd //rpmbuild/BUILD
+ rm -rf setup-2.10.4
+ exit 0

Unfortunately because I haven’t got GCC working in the bootstrap environment, I’m a bit limited in the packages that I can build, so I’m starting off with some low-dependency noarch packages. In reality we won’t need to recompile noarch packages at all, they can be copied off other arch builders, but it’s a good test of rpmbuild.

1 Comment

Filed under Uncategorized

Virt-builder Fedora 23 image

Fedora 23 was released today. Get it through virt-builder in just two simple commands:

$ virt-builder fedora-23 \
    --root-password password:123456 \
    --size 20G
$ qemu-system-x86_64 -drive file=fedora-23,if=virtio \
    -m 2048



Filed under Uncategorized

Fedora 22 chrooted on an LG G4 phone

Rooting this phone was ton of hassle. You have to ask LG to send you the unlock code! (My phone, not under contract). As most of the unrooting guides miss out this vital step, here is a guide to doing that.

Anyway, now I have Fedora 22 installed using the instructions from previously. I’ve included the files you need here. NB only for 64 bit ARM phones

The phone is nice and fast. It has a 6 core 64 bit ARM process in big.LITTLE configuration, 2 x fast Cortex-A57 and 4 x slower Cortex-A53. It also has 3GB of RAM.

I wasn’t able to determine if the processor boots in HYP mode, but KVM is disabled in the Android stock kernel unfortunately.

Processor	: AArch64 Processor rev 3 (aarch64)
processor	: 0
processor	: 1
processor	: 2
processor	: 3
processor	: 4
processor	: 5
Features	: fp asimd evtstrm aes pmull sha1 sha2 crc32 
CPU implementer	: 0x41
CPU architecture: 8
CPU variant	: 0x0
CPU part	: 0xd03
CPU revision	: 3

Hardware	: Qualcomm Technologies, Inc MSM8992
Revision	: 000b

Using the on-screen keyboard sucks a lot. I might need to invest in a cheap Bluetooth keyboard.

After the break, dmesg output.

Continue reading


Filed under Uncategorized

Fedora 22 aarch64 virt-builder image

Fedora 22 was released today for x86, and almost simultaneously for aarch64. I have already built a virt-builder image, so you can install it immediately (either on real hardware or under virtualization on x86):

$ virt-builder --arch aarch64 fedora-22

To boot this on x86, use a slightly modified version of the instructions from here:

$ wget http://libguestfs.org/download/builder/fedora-22-aarch64-nvram.xz
$ unxz fedora-22-aarch64-nvram.xz
$ qemu-system-aarch64 -nodefconfig -nodefaults -display none \
    -M virt -cpu cortex-a57 -machine accel=tcg \
    -m 2048 \
    -drive if=pflash,format=raw,file=/usr/share/edk2.git/aarch64/QEMU_EFI-pflash.raw,readonly \
    -drive if=pflash,format=raw,file=fedora-22-aarch64-nvram \
    -device virtio-scsi-device,id=scsi \
    -drive file=fedora-22.img,format=raw,if=none,id=hd0 \
    -device scsi-hd,drive=hd0 \
    -netdev user,id=usernet \
    -device virtio-net-device,netdev=usernet \
    -serial stdio

Leave a comment

Filed under Uncategorized

Fedora 22 virt-builder image

Fedora 22 has been released. And there is a virt-builder cloud image available:

$ virt-builder fedora-22
$ virt-install --import --name test-f22 \
    --ram 2048 --disk path=fedora-22.img,format=raw \
    --os-variant fedora21


Filed under Uncategorized

Fedora 21 chrooted on an aarch64 Nexus 9


A while back I bought a Nexus 9, mainly because it has a weird processor that emulates a 64 bit ARM (aarch64). Google seem to have abandoned this platform entirely, just 6 months after I got it, so fuck you too Google. Anyway here’s how I installed a Fedora 21 aarch64 chroot on the device, using virt-builder and virt-tar-out and a bunch of unnecessary hassle.

First I ran virt-builder, which takes under a minute to produce a Fedora 21 aarch64 disk image. I then used virt-tar-out to convert all the files in that disk image into a tar file:

$ virt-builder --arch aarch64 fedora-21
$ virt-tar-out -a fedora-21.img / chroot.tar

Copy this file over to the N9, and unpack it. I have rooted my N9, so I can do this as root to preserve all the permissions etc:

# mkdir root
# cd root
# tar -xf /sdcard/Download/chroot.tar
# cd ..

And how can there not be a tar utility in Android?? I had to build a static ‘tar’ for aarch64 using my existing aarch64 server, to run the above command. And and and how can there be no chroot utility either!? I ended up compiling that myself too yada yada.

After all that you can do:

# mount -o bind /dev root/dev
# mount -o bind /proc root/proc
# mount -o bind /sys root/sys
# PATH=/usr/bin:/bin LD_PRELOAD= chroot root /bin/bash

which gives me at least a Fedora 21 shell on Android.

Edit: A few further notes:

  1. When setting up a non-root user account inside the chroot, give it the same UID, GID and groups as the ordinary non-privileged Android user account. In particular it must be in the inet group, else network access is blocked.
  2. You may need to set up /etc/resolv.conf by hand in the chroot.

1 Comment

Filed under Uncategorized

How to boot a Fedora 21 aarch64 UEFI guest on x86_64

You can use virt-builder to make Fedora 21 aarch64 guests easily:

$ virt-builder --arch aarch64 fedora-21

but unless you have real aarch64 hardware, how do you boot them?

Well the latest qemu supports working system emulation for 64 bit ARM. So assuming you (a) have compiled a very new qemu-system-aarch64 (I recommend qemu from git), and (b) you have the AAVMF (UEFI for aarch64) firmware, then:

$ qemu-system-aarch64 \
    -nodefconfig -nodefaults -display none \
    -M virt -cpu cortex-a57 -machine accel=tcg -m 2048 \
    -drive if=pflash,format=raw,file=AAVMF_CODE.fd,readonly \
    -drive if=pflash,format=raw,file=vars.fd \
    -drive file=fedora-21.img,format=raw,if=none,id=hd0 \
    -device virtio-blk-device,drive=hd0 \
    -netdev user,id=usernet \
    -device virtio-net-device,netdev=usernet \
    -serial stdio

And that will boot the aarch64 guest.

Edit: If using Gerd’s AAVMF repo, replace AAVMF_CODE.fd with /usr/share/edk2.git/aarch64/QEMU_EFI-pflash.raw


Filed under Uncategorized