1. USB on Mustang

    When I got APM Mustang at home I knew that one day I will use it to test desktop environments. Lack of graphics and USB kept me away from it. And I am closer now…

    Yesterday Mark Langsdorf wrote two patches which allow to use USB3 ports from Mustang’s backplate. I applied first version of them, altered DeviceTree blob a bit and after reboot I got that:

    16:36 hrw@pinkiepie-rawhide:~$ lsusb
    Bus 004 Device 001: ID 1d6b:0003 Linux Foundation 3.0 root hub
    Bus 003 Device 001: ID 1d6b:0002 Linux Foundation 2.0 root hub
    Bus 002 Device 001: ID 1d6b:0003 Linux Foundation 3.0 root hub
    Bus 001 Device 002: ID 1234:2088 Brain Actuated Technologies
    Bus 001 Device 001: ID 1d6b:0002 Linux Foundation 2.0 root hub
    

    All with slightly modified 3.18-rc2 kernel from Fedora rawhide.

    Now need to sort out graphics… But first need to buy yet another card…

    Written by Marcin Juszkiewicz on
  2. How to install Fedora 21 on APM Mustang with just HDD?

    After my previous posts I got an email with question “how to install Fedora 21 on Mustang without DVD and network?” so decided to describe hard drive based method.

    Requirements:

    • APM Mustang with UEFI
    • hard drive
    • another computer to prepare hdd
    • Fedora 21 installation ISO
    • serial cable connected to Mustang and other computer
    • Ethernet cable to get network on Mustang
    • VNC viewer to control installation (not needed but recommended)

    First step is preparing hard drive. Create 100MB GPT partition type “ef00” (EFI System), format it as FAT and copy “/EFI” and “/images” directories from DVD. Edit “/EFI/BOOT/grub.cfg” file and change “Fedora-S-21_A-aarch64” to “Fedora-S-21_A” because ext4 labels are shorter than ISO9660 ones.

    Then do another partition — 2GB size. I used ext4 (other ones may work too). Format and label it as ‘Fedora-S-21_A’ using e2label or other tool. Copy content of DVD image into it.

    Now put hard drive into Mustang and power on. From UEFI menu select shell and start run “FS0:EFIBOOTBOOTAA64.efi” to get into GRUB. Press Enter to begin installation.

    As before I went VNC way, selected hard drive and automatic partitioning. After few minutes system was installed and ready to reboot.

    This time there were no issues with adding bootloader into UEFI boot order. Maybe because I left previous entries there?

    And layout of partitions was not changed:

    Fedora release 21 (Twenty One)
    Kernel 3.17.0-301.fc21.aarch64 on an aarch64 (ttyS0)
    
    localhost login: hrw
    [hrw@localhost ~]$ lsblk
    NAME                    MAJ:MIN RM   SIZE RO TYPE MOUNTPOINT
    sda                       8:0    0 298.1G  0 disk
    ├─sda1                    8:1    0   127M  0 part /boot/efi
    ├─sda2                    8:2    0     2G  0 part
    ├─sda3                    8:3    0   500M  0 part /boot
    └─sda4                    8:4    0 294.1G  0 part
      ├─fedora--server-swap 253:0    0     8G  0 lvm  [SWAP]
      ├─fedora--server-root 253:1    0    50G  0 lvm  /
      └─fedora--server-home 253:2    0   236G  0 lvm  /home
    

    So if you have APM Mustang with one hdd and no external network connection on site then looks like this is an easiest way. Sure, it requires some work but allows to make an installation without any extra hardware connected to Mustang.

    Written by Marcin Juszkiewicz on
  3. Let’s install Debian on AArch64

    Today I took a small break and decided to install Debian on APM Mustang. How it went? Read on.

    Requirements: - kernel and initramfs from Debian daily d-i builds - USB stick with GRUB from Fedora (one from my second Fedora installation - APM Mustang with UEFI - serial cable connected to Mustang and other computer - Ethernet cable to get network on Mustang

    Why did I used GRUB from Fedora? Debian one had issues with finding own modules (or something like that).

    Ok, so let’s boot into GRUB. Once there load kernel and initramfs:

    linux /debian/vmlinux console=ttyS0,115220
    initrd /debian/initrd.gz
    boot
    

    Installation went smooth. To the point when installer tried to install GRUB :(

    Rebooted, loaded freshly installed kernel/initramfs from Fedora boot loader but still failed:

    Begin: Loading essential drivers ... done.
    Begin: Running /scripts/init-premount ... done.
    Begin: Mounting root file system ... Begin: Running /scripts/local-top ... done.
    Begin: Waiting for root file system ... done.
    Gave up waiting for root device.  Common problems:
     - Boot args (cat /proc/cmdline)
       - Check rootdelay= (did the system wait long enough?)
       - Check root= (did the system wait for the right device?)
     - Missing modules (cat /proc/modules; ls /dev)
    

    So will not check how Debian works on APM Mustang. But bug will be reported.

    Written by Marcin Juszkiewicz on
  4. Installation of Fedora 21 on clean APM Mustang

    Last week I wrote a blog post about installing Fedora 21 on APM Mustang with use of already existing GRUB. But let’s consider it cheating ;D

    This time I am going to write how to install on fresh clean APM Mustang. I am assuming UEFI firmware not U-Boot so it you use latter then follow Updating to UEFI page on Fedora wiki.

    Requirements:

    • DVD drive
    • DVD disk with Fedora 21 AArch64 DVD image written to it
    • PCI Express SATA controller
    • USB thumb drive (128MB is enough)
    • APM Mustang with UEFI
    • serial cable connected to Mustang and other computer
    • Ethernet cable to get network on Mustang
    • VNC viewer to control installation (not needed but recommended)

    First step is preparing USB thumbdrive. Create GPT partition type ‘ef00’ (EFI System), format it as FAT and copy “/EFI” and “/images” directories from DVD. Then plug it into one of USB ports on back of Mustang. Why only those files instead of whole image? Reason is simple: UEFI knows how to handle USB but Linux kernel does not ;(

    Put PCI Express SATA controller into PCIe slot and connect DVD drive to it. This is needed cause X-Gene SATA controller is unable to handle DVD drive — see bug #1150676. Put Fedora installation disk into drive.

    Now reboot Mustang and wait for UEFI prompt (you may press a key before it goes for PXE boot):

    TianoCore 1.1-rh-0.12-1 UEFI 2.4.0 Aug 21 2014 13:35:29
    CPU: APM ARM 64-bit Potenza 2400MHz PCP 2400MHz
         32 KB ICACHE, 32 KB DCACHE
         SOC 2000MHz IOBAXI 400MHz AXI 250MHz AHB 200MHz GFC 125MHz
    Board: X-Gene Mustang Board
    The default boot selection will start in   1 second
    Attempting PXE boot on MAC: 00:01:73:02:0B:73
    
    
    InstallProtocolInterface: 245DCA21-FB7B-11D3-8F01-00A0C969723B 43FE9600E0
    .PXE-E18: Server response timeout.
    -----------------------
    Global FDT Config
            - VenHw(F40A3869-92C4-4275-8501-4491A1A20C19)/mustang.dtb
    -----------------------
    [a] Boot Manager
    [b] Shell
    [c] Reboot
    [d] Shutdown
    Start: ?
    

    Select “Shell” option. After few seconds UEFI will present you list of recognized filesystems and block devices (I have one clean hard drive connected):

    UEFI Interactive Shell v2.0
    EDK II
    UEFI v2.40 (X-Gene Mustang Board EFI Aug 21 2014 13:43:15, 0x00000000)
    Mapping table
          FS0: Alias(s):HD10a0b:;BLK2:
              PciRoot(0x8)/Pci(0x0,0x0)/USB(0x0,0x0)/HD(1,GPT,07A2CC65-FF01-48F7-9E54-CCB05A154A1D,0x800,0x3B801)
         BLK4: Alias(s):
              VenHw(6C9CEEF0-A406-11E3-A5E2-0800200C9A66)
         BLK3: Alias(s):
              VenHw(02118005-9DA7-443A-92D5-781F022AEDBB)
         BLK6: Alias(s):
              VenHw(F40A3869-92C4-4275-8501-4491A1A20C19)
         BLK5: Alias(s):
              VenHw(B225ED30-6DFD-43A9-BF6B-5753358F2F70)
         BLK0: Alias(s):
              PciRoot(0x7)/Pci(0x0,0x0)/Sata(0x1,0x0,0x0)
         BLK1: Alias(s):
              PciRoot(0x8)/Pci(0x0,0x0)/USB(0x0,0x0)
    

    Enter shell and then enter one command (you can use key for completion): “fs0:EFIBOOTBOOTAA64.efi” to boot Grub from USB:

    Install Fedora-Server 21_Alpha
    Test this media & install Fedora-Server 21_Alpha
    Troubleshooting -->
    
    Use the  and  keys to change the selection.
    Press 'e' to edit the selected item, or 'c' for a command prompt.
    

    Select first option and then it is standard Fedora installation. Anaconda starts and suggests using VNC to control installation as serial line interface lacks many options.

    Fedora installer
    Fedora installer

    Installation takes several minutes. But there is another bug there: unable to add bootloader entry into EFI so we have to fix it before final release.

    Fedora installer bug
    Fedora installer bug

    But bootloader itself is loaded so after reboot we land in UEFI shell again. This time need to run “fs0:\EFI\fedora\grubaa64.efi” and there it goes: fresh Fedora 21 installation.

    Written by Marcin Juszkiewicz on
  5. 2 years of AArch64 work

    I do not remember exactly when I started working on ARMv8 stuff. Checked old emails from Linaro times and found that we discussed AArch64 bootstrap using OpenEmbedded during Linaro Connect Asia (June 2012). But it had to wait a bit…

    First we took OpenEmbedded and created all tasks/images we needed but built them for 32-bit ARM. But during September we had all toolchain parts available: binutils was public, gcc was public, glibc was on a way to be released. I remember that moment when built first “helloworld” — probably as one of first people outside ARM and their hardware partners.

    At first week of October we had ARMv8 sprint in Cambridge, UK (in Linaro and ARM offices). When I arrived and took a seat I got information that glibc just went public. Fetched, rebased my OpenEmbedded tree to drop traces of “private” patches and started build. Once finished all went public at git.linaro.org repository.

    But we still lacked hardware… The only thing available was Versatile Express emulator which required license from ARM Ltd. But then free (but proprietary) emulator was released so everyone was able to boot our images. OMG it was so slow…

    Then fun porting work started. Patched this, that, sent patches to OpenEmbedded and to upstream projects and time was going. And going.

    In January 2013 I started X11 on emulated AArch64. Had to wait few months before other distributions went to that point.

    February 2013 was nice moment as Debian/Ubuntu team presented their AArch64 port. It was their first architecture bootstrapped without using external toolchains. Work was done in Ubuntu due to different approach to development than Debian has. All work was merged back so some time later Debian also had AArch64 port.

    It was March or April when OpenSUSE did mass build of whole distribution for AArch64. They had biggest amount of packages built for quite long time. But I did not tracked their progress too much.

    And then 31st May came. A day when I left Linaro. But I was already after call with Red Hat so future looked quite bright ;D

    June was month when first silicon was publicly presented. I do not know what Jon Masters was showing but it probably was some prototype from Applied Micro.

    On 1st August I got officially hired by Red Hat and started month later. My wife was joking that next step would be Retired Software Engineer ;D

    So I moved from OpenEmbedded to Fedora with my AArch64 work. Lot of work here was already done as Fedora developers were planning 64-bit ARM port few years before — when it was at design phase. So when Fedora 15 was bootstrapped for “armhf” it was done as preparation for AArch64. 64-bit ARM port was started in October 2012 with Fedora 17 packages (and switched to Fedora 19 during work).

    My first task at Red Hat was getting Qt4 working properly. That beast took few days in foundation model… Good that we got first hardware then so it went faster. 1-2 months later and I had remote APM Mustang available for my porting work.

    In January 2014 QEmu got AArch64 system emulation. People started migrating from foundation model.

    Next months were full of hardware announcements. AMD, Cavium, Freescale, Marvell, Mediatek, NVidia, Qualcomm and others.

    In meantime I decided to make crazy experiment with OpenEmbedded. I was first to use it to build for AArch64 so why not be first to build OE on 64-bit ARM?

    And then June came. With APM Mustang for use at home. Finally X11 forwarding started to be useful. One of first things to do was running firefox on AArch64 just to make fun of running software which porting/upstreaming took me biggest amount of time.

    Did not took me long to get idea of transforming APM Mustang (which I named “pinkiepie” as all machines at my home are named after cartoon characters) into ARMv8 desktop. Still waiting for PCI Express riser and USB host support.

    Now we have October. Soon will be 2 years since people got foundation model available. And there are rumors about AArch64 development boards in production with prices below 100 USD. Will do what needed to get one of them on my desk ;)

    Written by Marcin Juszkiewicz on
  6. Read of scrambled sector without authentication

    My daughter is in 1st class of elementary school. One of things she has there is English. For which they use a “Super Sparks Student 1” book from Oxford University Press. Book came with CDROM disk (marked as DVD Video). There are 73 audio files (mp3) and one short movie on it.

    But why I write about it? Because I think that we live in an era when CSS means Cascading Style Shits rather than Content Scramble System. But not everyone thinks like that.

    So back to DVD^wCDROM. Let’s copy data from it. Audio tracks went fine but problems started when tried to copy video:

    [ 3701.096102] sr 5:0:0:0: [sr1]
    [ 3701.096105] Sense Key : Illegal Request [current]
    [ 3701.096109] sr 5:0:0:0: [sr1]
    [ 3701.096114] Add. Sense: Read of scrambled sector without authentication
    [ 3701.096117] sr 5:0:0:0: [sr1] CDB:
    [ 3701.096119] Read(10): 28 00 00 01 8e e3 00 00 01 00
    [ 3701.116089] sr 5:0:0:0: [sr1]
    [ 3701.116096] Result: hostbyte=DID_OK driverbyte=DRIVER_SENSE
    

    Took me a while to remind myself what it means. Scrambled disk! When it became useless? 2001? 1996? No — 1999 (according to Wikipedia). So just 15 years ago…

    I think that Oxford is quite orthodox/conservative but IT goes on faster than they expect.

    Took me few minutes to compile libdvdcss, libdvdread and dvdread then it was just simple “sudo dvdread /dev/sr1 >english.iso” plus extracting files from disk image. Would be faster but you know: I use Fedora (patents, mp3, decss are not accepted in repo).

    Written by Marcin Juszkiewicz on
  7. Let’s install Fedora 21 on AArch64

    As my wife’s laptop got SSD upgrade I had another spare HDD. But what to do with 320GB hdd? Decided to add it into “pinkiepie” (APM Mustang) and test Fedora installation.

    There are probably many ways on how you can install Fedora on x86-64 machine. But on Mustang there are only three:

    • DVD boot
    • PXE boot
    • use any method to load kernel and initrd of net installer

    My DVD-RW drive decided to not read any discs so I bought new one. Put fresh Fedora 21 AArch64 installation DVD into it and… still something wrong. Not with contents of disk but with drive or who knows.

    Decided to skip PXE as it always involves creation of TFTP server, setting DHCP server to direct into proper one etc. Too much work just to deliver two files.

    So I went with last method and used GRUB which I already had on /dev/sda in EFI partition.

    Fetched vmlinuz and initrd.img to /boot/pxeboot/ directory and rebooted machine.

    Then into GRUB and it’s command line:

    linux (hd0,gpt2)/pxeboot/linux console=ttyS0,115200 inst.repo=http://armpkgs.fedoraproject.org/compose/21_Alpha_TC1/Server/aarch64/os/
    initrd (hd0,gpt2)/pxeboot/initrd.img
    

    Then just Ctrl-x and it goes. As it has to fetch 258MB squashfs.img with installer I used that time to install VNC viewer (KRDC) on my desktop — it will be used to control installer as text mode over serial one is very limited.

    Image fetched, booted. Then something like “Do you want to use VNC (recommended) or go with text mode (limited)?” appeared so I went for remote one, used no password and then installer appeared and I was able to select hard drive and what exactly I wanted to install. Too bad that it had to end due to some dependency issues:

    Installation error
    Installation error

    So I went for a fix. Took me some time but next version of “abrt” should be fine.

    Anyway why stop? I decided to alter a way of installation a bit. Let’s use Polish Fedora mirror and local copy of “squashfs.img” file:

    linux (hd0,gpt2)/pxeboot/linux console=ttyS0,115200 inst.repo=http://ftp.icm.edu.pl/pub/Linux/dist/fedora-secondary/development/21/aarch64/os/ inst.stage2=http://192.168.0.13
    initrd (hd0,gpt2)/pxeboot/initrd.img
    

    This time I got wide choice of installation targets (it was only Fedora Server before). Wanted to install XFCE but chosen “Minimal system” instead as installer was unable to tell me what is wrong with my selection.

    Few minutes later (after setting root password and creating normal user) I had installed system. Rebooted, went to UEFI shell, selected FS1: and booted GRUB which loaded fresh Fedora 21 for me.

    Final words? It went much, much better then my previous installation of F21 on same hardware (I used chroot or other crazy stuff). Not checked iSCSI or other exotic (to me) ways of doing storage but that’s maybe for other day.

    Written by Marcin Juszkiewicz on
  8. I am starting to dislike GNU project

    When GNU project was announced over 30 years ago it was something great. But time passed and I have a feeling that it is more and more politics instead of coding.

    I do builds. For over 10 years now. It was ARM all the time with some bits of AVR32, MIPS, x86. During last two years it is nearly 100% AArch64. And during last months my dislike to GNU project grows.

    Why? several reasons.

    Commit messages

    There is a lot of articles about “how to write good commit messages”. I can tell you where to look for bad ones: gcc, binutils, glibc — base of most of GNU/Linux distributions. All of them can be fetched from GIT repositories but look like deep in CVS era. Want to find what was changed? You will get it in commit message. Why it was changed? Forget.

    GNU forks

    Do you know what IceCat is? Or GNUzilla? Let me quote official homepage:

    GNUzilla is the GNU version of the Mozilla suite, and GNU IceCat is the GNU version of the Firefox browser. Its main advantage is an ethical one: it is entirely free software. While the Firefox source code from the Mozilla project is free software, they distribute and recommend non-free software as plug-ins and addons.

    Where is source? Somewhere in GNU cvs probably. I failed to find it. OK, there is a link to something which is probably source tarball but we have XXI century — developers take source control systems got granted.

    Of course IceCat fails to build on AArch64. Why? Because it is based on already obsoleted by upstream version 24 of Firefox. Support for 64-bit ARM platform was merged around Firefox 30 and is complete in version 31. Sure, I could dig for patches for IceCat version but no. This time I refuse.

    I do not know, but maybe GNU project needs some fresh blood which will make them more developer friendly?

    Written by Marcin Juszkiewicz on
Page 25 / 105