Results 1 to 5 of 5

Thread: Initial success running Leap on an ODROID-N2

  1. #1

    Default Initial success running Leap on an ODROID-N2

    Hi - I'm not sure if this is the correct place for this, but I was asked to share details by folks on reddit, so here I am.

    I have been able to successfully bootstrap Leap-15.0 on an ODROID-N2 board. In principle, Leap-15.1 should work the same way when an aarch64 version is available, and Tumbleweed should also be okay. I must reiterate that this is not a "clean room" installation; I used the pre-installed version of Ubuntu to help me get to a running openSUSE Leap. Here are the full details and instructions for those who are interested. I would very much like for the N2 to become an officially supported board, but I have neither the skill nor time to get it there, but I'm willing to participate with someone who does.

    What I bought (I'm in the US, so from Ameridroid):

    ODROID-N2 with 4 GB memory
    eMMC module, 128 GB, red dot (Ubuntu pre-installed)
    12V/2A supply
    black case

    Already had:
    USB keyboard
    USB wireless mouse
    HDMI monitor
    Ethernet cable
    eMMC/micro-SD adapter
    micro-SD/SD adapter
    desktop has SD card reader/writer

    I store stuff in the ODROID-N2 directory under my home directory (i.e. ~/ODROID-N2). I downloaded the Leap rootfs image from http://download.opensuse.org/ports/a....0/appliances/ and stored it there. When I insert the eMMC module in my desktop (via adapters), it comes up as /dev/sdg.

    Phase 1 - running stuff on my desktop to modify the eMMC module
    First, a backup:

    Code:
    dd if=/dev/sdg of=odroid-n2_ubuntu.img bs=1M
    Make temporary mount points in /mnt:

    Code:
    mkdir /mnt/mnt1 /mnt/mnt2
    Mount the boot partition on mnt1, then the root partition on mnt2:

    Code:
    mount /dev/sdg1 /mnt/mnt1
    mount /dev/sdg2 /mnt/mnt2
    Go to root directory and wipe it (BE CAREFUL THAT YOU ARE RUNNING THIS IN THE CORRECT DIRECTORY!)

    Code:
    cd /mnt/mnt2
    rm -rf *
    Untar the aarch64 Leap here

    Code:
    tar -xJf ~/ODROID-N2/openSUSE-Leap15.0-ARM-JeOS.aarch64-rootfs.aarch64-2018.07.02-Buildlp150.1.1.tar.xz
    At this point, I installed the MMC card onto the N2, and it booted using the Ubuntu kernel and the Leap user space

    WARNING FOR BELOW!!! - the /boot directory you see at this point (by doing a simple "ls /" is not the directory that the system boots from! This /boot is on /dev/mmcblk0p2. The true boot partition is /dev/mmcblk0p1; we will mount that as /mnt later on.

    Phase 2 - modifications when running on the N2 directly. I am logged in as a user and have a working ethernet connection. I store things in a directory called System in my home directory.

    Follow the instructions (more or less) for building the kernel at https://wiki.odroid.com/odroid-n2/so...uilding_kernel. Grab the source and change into it's directory:

    Code:
    cd System
    mkdir kernel
    cd kernel
    git clone --depth 1 https://github.com/hardkernel/linux.git -b odroidn2-4.9.y
    cd linux
    Do the compile. Note that this puts the modules into /lib/modules on /dev/mmcblk0p2, exactly where we want them

    Code:
    make odroidn2_defconfig
    make -j4
    sudo make modules_install
    Now mount the true boot partition on /mnt and copy over the kernel image

    Code:
    sudo mount /dev/mmcblk0p1 /mnt
    sudo cp -f arch/arm64/boot/Image.gz arch/arm64/boot/dts/amlogic/meson64_odroidn2.dtb /mnt
    Copy over the config file since we need it in a minute

    Code:
    sudo cp .config /boot/config-4.9.177+
    Next I think we have to rebuild the uInitrd file. I used https://wiki.odroid.com/odroid-xu4/s...uilding_kernel for guidance, though the tools in openSUSE are vastly different from Ubuntu.

    Unfortunately, I seem to have lost the mkimage and dracut commands I used for rebuilding the initramfs file. (They don't appear in my bash history that I can access at the moment.) I think they were the following:

    Code:
    cd /boot
    dracut -H -f /boot/initramfs-4.9.177+.img 4.9.177+
    mkimage -A arm -O linux -T ramdisk -C none -a 0 -e 0 -n uInitrd -d /boot/initramfs-4.9.177+.img /boot/uInitrd-4.9.177+.img
    I've rerun these and they seem to produce the right outputs, but the final /uInitrd-4.9.177+.img file isn't quite the same size as the one I produced yesterday. (Very close, however.)

    Copy the new uInitrd file to the actual boot directory

    Code:
    cp uInitrd-4.9.177+.img /mnt/uInitrd
    If you have a look at the /mnt directory which contains the true boot partition with ls -l, you should see a new Image.gz, meson64_odroidn2.dtb, and uIinitrd. Holdovers from the Ubuntu install that are still necessary (I think) are boot.ini and boot.ini.default. I seem to have auto-created edid.bin and display.bin files, but they were not part of the original Ubuntu setup.

    I have not tested this extensively yet having just completed all this yesterday, but I have a running xfce desktop, am able to surf the web with Firefox, and have compiled and run the hardinfo benchmarks on it. It's a very speedy little board; eventually I hope to turn it into a web server and nextcloud host (thus my interest in Leap rather than Tumbleweed).

  2. #2

    Default Re: Initial success running Leap on an ODROID-N2

    Update:

    Unfortunately, I seem to have lost the mkimage and dracut commands I used for rebuilding the initramfs file. (They don't appear in my bash history that I can access at the moment.) I think they were the following:

    Code:
    cd /boot
    dracut -H -f /boot/initramfs-4.9.177+.img 4.9.177+
    mkimage -A arm -O linux -T ramdisk -C none -a 0 -e 0 -n uInitrd -d /boot/initramfs-4.9.177+.img /boot/uInitrd-4.9.177+.img
    I've rerun these and they seem to produce the right outputs, but the final /uInitrd-4.9.177+.img file isn't quite the same size as the one I produced yesterday. (Very close, however.)
    I have found the commands - I forgot that I had changed to root user at some point. So as root:

    Code:
    cd /boot
    dracut -H -f /boot/initramfs-4.9.177+.img 4.9.177+
    mkimage -A arm64 -O linux -T ramdisk -a 0x0 -e 0x0 -n initramfs-4.9.177+.img -d initramfs-4.9.177+.img uInitrd-4.9.177+
    mv uInitrd-4.9.177+ /mnt/uInitrd
    I see that Leap-15.1 images are available - they must have come online after I downloaded the 15.0 version, so I think I will start from scratch and follow my own instructions. See if I know what I'm talking about.

    Note! I am guessing there are further little bits from the Ubuntu install that help in the boot process. Looking at the Ubuntu Partition Table at https://wiki.odroid.com/odroid-n2/so...artition_table, I have done nothing with the things labeled "BL1/MBR", "U-Boot", and "U-Boot Environment". Everything associated with U-Boot is still TBD. A proper clean room openSUSE install will have to figure out how to deal with this.

  3. #3
    Join Date
    Jun 2008
    Location
    San Diego, Ca, USA
    Posts
    11,849
    Blog Entries
    2

    Default Re: Initial success running Leap on an ODROID-N2

    Based on my experience primarily withRPi images, AFAIK all ARM images utilize uboot, but the available documentation to modify beyond common boot options is extremely complex and undocumented... not just by the openSUSE maintainers, but the upstream uboot itself.

    If you mount an entire openSUSE ARM image, I'm not sure how you can avoid including the openSUSE version of uboot.

    TSU
    Beginner Wiki Quickstart - https://en.opensuse.org/User:Tsu2/Quickstart_Wiki
    Solved a problem recently? Create a wiki page for future personal reference!
    Learn something new?
    Attended a computing event?
    Post and Share!

  4. #4

    Default Re: Initial success running Leap on an ODROID-N2

    Agreed, but at least for now, whatever Ubuntu uses will start up the openSUSE kernel, initrd, and user space if they are named identically. That is what I did to bootstrap this and so far it has been sufficient. Reading the U-Boot documentation makes my head hurt, so I have no idea how to do a 100% openSUSE image for this, but I'll settle for a 99.9% openSUSE setup for now.

  5. #5

    Default Re: Initial success running Leap on an ODROID-N2

    While I'm here, I went through through the exercise of starting from scratch (reinstalling the Ubuntu backup and booting it to make sure I wasn't cheating). I now have a nice, shiny Leap-15.1 installation on my N2. A few additional notes that I forgot about:

    I was very sloppy in not including a lot of "sudo" prefixes in the commands in Phase 1 (on the desktop). Nearly everything there requires root permission, so either change to root or be prepared to add a lot of sudos. My apologies for that.

    Between Phase 1 and Phase 2 - after I've booted with the Ubuntu kernel and the openSUSE user space, I do a lot of administration that isn't strictly necessary but makes life easier. For example, I add a normal user, change the root passwd, enable sshd (but prohibit root logins), install a ton of software (xfce pattern, base-devel pattern, emacs, etc.). I could have done this by downloading a xfce or KDE or whatever build, but I prefer specifically loading my own things from the barest JeOS install. None of this work is included in my list because it is how I like to have things set up, but it is not necessary for the bootstrap. However, I would not like for you to think that my list is a linear, scriptable effort.

    Another thing I forgot to say is that I never change the partition sizes or filesystem types as set up by Ubuntu. /dev/mmcblk0p1 (the true boot partition) remains a 128MB vfat filesystem, while /dev/mmcblk0p2, the root partition, stays at ext4 filling the rest of the space. This could probably be changed to btrfs or something else at the "wipe the user space" step, but I see that my pure Tumbleweed install on an ODROID-C2 also uses ext4, so I chose to leave it alone.

    All this said, I would love to see a truly 100% openSUSE install image for the N2. I'm hoping there is a U-Boot expert out there somewhere who can take care of that part of it and assemble everything into a properly supported image.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •