Skip to content

Instantly share code, notes, and snippets.

@Nokius
Last active June 29, 2023 18:40
Show Gist options
  • Save Nokius/81cd46405b537931a472e0a55abb7ccd to your computer and use it in GitHub Desktop.
Save Nokius/81cd46405b537931a472e0a55abb7ccd to your computer and use it in GitHub Desktop.
ARCH LINUX WITH MAINLINE KERNEL FOR TOSHIBA AC100 [paz00 / dynabookaz]

ARCH LINUX WITH MAINLINE KERNEL FOR TOSHIBA AC100

all u need

  • 1-2 hours of your life
  • build envirment for the Kernel
  • device with Ubuntu and nvflash
  • AC100
  • mini-usb cabel
  • usb-stick >512MB

build the kernel

  1. setup the build enviorment

    • create the work directory:

      mkdir -p ~/ac100/output_files

  2. get the kernel source

    • get the sources:

      curl -LO https://cdn.kernel.org/pub/linux/kernel/v4.x/linux-4.5.2.tar.xz

      cd linux-4.5.2

  3. build the kernel

    • genrate the config

      make tegra_defconfig ARCH=arm

    • adjust the config for:

      1. Kernel low-level debugging options

        in Kernel hacking

        to OFF

      2. USB Video Class

        in Device drivers --> Multimedia support --> Media USB Adapters

        to MODULE

      3. USB NETWORK Device [only if like to use anadapter] you will find the availbe Modules under

        in Device drivers --> Network device support --> USB Network Adapters

        to MODULE

      make menuconfig ARCH=arm

    • build zIMAGE, modules, dtb

      make zImage modules dtbs INSTALL_MOD_STRIP=1 ARCH=arm CROSS_COMPILE=arm-linux-gnueabihf-

    • build install-modules

      make modules_install INSTALL_MOD_PATH=../output_files INSTALL_MOD_STRIP=1 ARCH=arm CROSS_COMPILE=arm-linux-gnueabihf-

    • copy dtb and zImage to the output_files directory

      cp arch/arm/boot/dts/tegra20-paz00.dtb ../output_files

      cp arch/arm/boot/zImage ../output_files

  4. make output flashable

    • change into output_files directory

      cd ../output_files

    • create needed folders

      mkdir boot usr

    • move lib into usr [to avoid breaks of arch]

      mv lib usr

    • move zImage and dtb into boot

      mv zImage boot

      mv tegra20-paz00.dtb boot

    • create boot.cmd

      
        cat <<'EOF' > ~/ac100/output_files/boot/boot.cmd
        setenv bootargs 'root=/dev/mmcblk0p1 rootfstype=ext4 rootwait'
        ext2load mmc 0:1 0x1000000 /boot/zImage
        ext2load mmc 0:1 0x2000000 /boot/tegra20-paz00.dtb
        bootz 0x1000000 - 0x2000000
        EOF
        
    • create directory etc

      mkdir etc

    • add fstab

      
        cat <<'EOF' > ~/ac100/output_files/etc/fstab
        /dev/mmcblk0p1  /   ext4    rw,noatime,commit=30,barrier=1,data=ordered    0    0
        EOF
        
    • pack the files

      tar cf kernel.tar boot usr etc

  5. prepare pen drive

    • copy kernel.tar to pen drive

      cp ~/ac100/output_files/kernel.tar < mountpoint of the pen drive >

    • get Arch Linux filesystem for Tegra systems

      curl -o < mountpoint of the pen drive > http://archlinuxarm.org/os/ArchLinuxARM-trimslice-latest.tar.gz

  6. boot AC100 into recovery mode

    • press ctrl + esc + Power
  7. install on the flash host nvflash

    curl -O /tmp https://phablet-paz00.googlecode.com/files/nvflash_20110628-2_all.deb ; sudo dpkg -i nvflash_20110628-2_all.deb

  8. connect AC100 with your flash Host

  9. get and boot a minimal SOSUBOOT

    • on the flash Host

      curl -O /tmp https://dl.dropboxusercontent.com/u/40761340/Test/sos-uboot-r5-2013-11-10.bin nvflash --bl sos-uboot-r5-2013-11-10.bin --go

    • on the AC100

      ./switch-to-uboot

  10. prepare the AC100

    • create one new partions [maybe u like to backup the old once]

      
        parted /dev/mmcblk0 mklabel gpt
        parted /dev/mmcblk0 -s mkpart primary 7168s '100%'
        parted /dev/mmcblk0 -s name 1 UDB
        
    • create filesystem

      mkfs.ext4 /dev/mmcblk0p1

  11. Install Kernel and OS

    • create mount point

      mkdir /target mkdir /source

    • mount the emmc

      mount -t ext4 /dev/mmcblk0p1 /target

    • inserte the stick and mount it

      mount -t vfat /dev/sda1 /source

    • change into directory /target

      cd /target

    • extract the ARCH Linux filesystem

      gzip -dc /source/ArchLinuxARM-trimslice-latest.tar.gz | tar xp

    • erase /boot to add new builded kernel for the AC100

      rm -rf boot/*

    • unpack kernel.tar

      tar xf /source/kern.tar

    • change into the /boot directory

      cd /target/boot

    • make the kernel bootable

      mkimage -A arm -O linux -T script -C none -a 0 -e 0 -n "ubootscript" -d boot.cmd boot.scr

    • sync for safety

      sync

    • unmount the pen drive and the emmc

      cd /; umount /target; umount /source

enjoy Arch Linux and the mainline kernel on your AC100 \o/

Source:

AC100 wiki
dev.cutecolors.jp.net
UNicksDaemon
ddevnet.net

@emulti
Copy link

emulti commented Aug 13, 2020

franzy3kk: Well done getting this running, though even Xfce is quite heavy for a 1Ghz machine with 512MB RAM, it doesn't leave much memory for applications. On a small screen like this the need for a 'windowing desktop environment' is not obvious. By the way, it's better to add a user (make them a member of 'wheel' group so they can install packages via sudo) instead of running Xorg as 'root'.
You are right to suspect video drivers, but the reason for Chromium/Firefox etc. crashes could also be that they are built expecting the Arm NEON instruction set extensions, which the Tegra250 Cortex-A9 CPU unfortunately does not support. They are also likely to take all the available memory.
There is an accelerated video driver ('grate-driver') under development for Tegra, but it is far from complete. Video playback information is here: https://github.com/grate-driver/libvdpau-tegra MPV is the recommended video playback application- it does work, but not all H.264 encodings are supported by the VDPAU driver yet.
Instructions for building and installing the driver stack are here: https://github.com/grate-driver/grate/wiki/Grate-driver It's not a beginner's process to install, and the end results are variable. My advice would be to stick with the standard modesetting driver.
In mind of all the above limitations I chose to make the Userland as lightweight as possible, with i3 as Window Manager. Disk space is precious too. I even dumped NetworkManager in favout of the 'netctl' tools available in Arch. This provides a fast graphical UI using only 60-70MB of RAM. I still haven't found a browser that works reliably on most sites, though for 'basic' pages Netsurf works fine for me.
Mail: Claws-mail works well
Documents: Libreoffice actually runs well, in not much more RAM than Abiword/Gnumeric, so I use LO.
Audio player: Deadbeef
Podcast downloader: gPodder
Internet radio/TV player: tuner-git (from AUR). This can play video (TV channels) as well as audio, using Gstreamer as backend.
When building AUR packages you will find that they are often 'not available for the armv7h architecture'. But you can add 'armv7h' to the PKGBUILD platforms list and they will compile fine in most cases, even if it takes a while.
If you are familiar with Arch Linux you will find that 90% of the Archwiki documentation on https://wiki.archlinux.org applies to ARM platforms too, and that should be your first reference point if you are stuck. But if you are new to the distribution, then you will find it a bit of a struggle at first. However, the end result is worth the effort.

@franzy3kk
Copy link

Mpv Is running quite good also with xfce4, and also netsurf.
I've at the moment no audio output, alasamixer Is installed....but without effect.
Is It possibile to make the webcam working.
Best regards.

@franzy3kk
Copy link

IMG_20200814_185358_copy_800x598

@emulti
Copy link

emulti commented Aug 14, 2020

@franzy3kk
Copy link

Audio mixer settings: https://ac100.grandou.net/mixer_settings

.......Ok, tanks! Now I can play MP3 with Cmus!!

@Mutex6
Copy link

Mutex6 commented Dec 11, 2020

Hi to all!
A few days ago I found this topic and tried to install Arch on my AC100-117 (8Gb).
Took the latest rootfs and compiled kernels from emulti, but it didn't work for me.
Kernel 4.19 don't boot, kernels 5.1.1 boot to light black screen

@franzy3kk
Copy link

Hi to all
Need some help to install the RTL8812au driver. (Alfa Wifi dualband AC1200).
Best regards.

@martin-ac100
Copy link

Hi to all!
A few days ago I found this topic and tried to install Arch on my AC100-117 (8Gb).
Took the latest rootfs and compiled kernels from emulti, but it didn't work for me.
Kernel 4.19 don't boot, kernels 5.1.1 boot to light black screen
You can try my 5.10 kernel:

https://drive.google.com/file/d/1fD2dYlH77K3Y3nSWH88U-dfK37MfPv19/view?usp=sharing

@pryg-skok
Copy link

Hi! Can anybody provide nvflash deb package? All links that I've found was dead or 404.

@minimec
Copy link

minimec commented Apr 18, 2021

Hi! Can anybody provide nvflash deb package? All links that I've found was dead or 404.

There you are. (Edited, as previous linked file was actually not a deb package... See comment below)
https://www.dropbox.com/s/89ju1toh0ig8z4w/nvflash_20110628-2_all.deb?dl=0

@pryg-skok
Copy link

@minimec Thanks! But it seems that it's not an actual deb packet, but a web page that contains description about it:

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
  "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en" dir="ltr">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>debian_nvflash_nvflash_20110628-2_all.deb - AC100 Wiki</title>
<meta name="generator" content="DokuWiki"/>
<meta name="robots" content="noindex,follow"/>
<meta name="keywords" content="debian_nvflash_nvflash_20110628-2_all.deb"/>
<link rel="search" type="application/opensearchdescription+xml" href="/lib/exe/opensearch.php" title="AC100 Wiki"/>
<link rel="start" href="/"/>
<link rel="contents" href="/debian_nvflash_nvflash_20110628-2_all.deb?do=index" title="Sitemap"/>
<link rel="manifest" href="/lib/exe/manifest.php"/>
<link rel="alternate" type="application/rss+xml" title="Recent Changes" href="/feed.php"/>
..... etc

@minimec
Copy link

minimec commented Apr 19, 2021

@minimec Thanks! But it seems that it's not an actual deb packet, but a web page that contains description about it:

Sorry about that. I should have tested the deb file first. This one should work...
https://www.dropbox.com/s/89ju1toh0ig8z4w/nvflash_20110628-2_all.deb?dl=0

Cheers

@pryg-skok
Copy link

Thanks! Now it works!
Getting started with ac100-116 flashing to archlinux :)

@pryg-skok
Copy link

Well, everything were fine except:

  1. bootargs 'root=/dev/mmcblk0p1 rootfstype=ext4 rootwait' should be root=/dev/mmcblk1p1 (at least on ac100-116)
  2. there are no wpa_supplicant and iw on latest http://os.archlinuxarm.org/os/ArchLinuxARM-armv7-latest.tar.gz ; is there any easy way to install it with pacman?

@pryg-skok
Copy link

And another problem is USB drives can't be mounted, I mean there is no /dev/sd* device when I plug in usb drive into ac100. Same usb drive works fine with uboot flashed with nvflash. Does anyone encounter the same problem on this archlinux setup?
Dmesg shows:
Снимок экрана 2021-04-21 в 11 53 38

@minimec
Copy link

minimec commented Apr 21, 2021

@pryg-skok: Nice to hear that you got your basic installation working.

This is what I can tell you about the issue you faced.

  1. I do remember that I also had to use "root=/dev/mmcblk1p1".

  2. I don't remember whether or not I had wpa_supplicant available after the initial installation. The easiest way is probably to create an open Wlan network temporally and install the wpa_supplicant package with its dependencies. Afterwards you should be able to connect to a WPA2 protected network. With an Android phone you should be able to create a hotspot without security (I have that option in Android10). Normal LAN/WLAN routers nowadays also have the option to create a so called 'guest network'. That should also allow you to temporally create an open Wlan network. To connect your ac100 to an open wlan network with arch linux, have a look here... https://wiki.archlinux.org/index.php/Network_configuration/Wireless#iw

  3. I do not have any problems with USB sticks. The sticks are auto mounted by the system. Can you mount them manually? It might be that auto mount is only 'available' once you have a desktop environment installed. Maybe that is installed as a dependency (Don't hang me on that). In my case I have 'enlightenment' and 'i3' installed.

@pryg-skok
Copy link

  1. There are neither iw nor wpa_supplicant. So I should connect to wifi (even if it's open) somehow without this utilities :)
  2. I can't mount them manually because there are no devices created in /dev. I'll try to investigate it. It seems it's dbus issue.

@minimec
Copy link

minimec commented Apr 22, 2021

@pryg-skok

Looking at my ac100 folder on my desktop computer I realized, that I actually had to transfer some software packages to my ac100 to get wifi working. Looks that you need the following packages: 'dhclient, dhcpcd, iw, openresolv, run-parts, wpa_supplicant'. Obviously you need the 'armv7h' versions. You can find them here... https://archlinuxarm.org/packages

As your USB stick is not recognized by the arch installation right now, you will have to do the transfer of the files within uboot. That shouldn't be a problem, as the 'cp' command is available in uboot.

Local installation of the packages can then be done with 'sudo pacman -U'

I hope you get it working...

@pryg-skok
Copy link

@minimec

Yes, I've already done that. Using uboot mount usb, transferrred all necessary packages (actually wpa_supplicant was enough), install via pacman -U and getting wifi working.
I've also compiled kernel 5.10.32.

I install xfce4 and everything I need. But it seems ac100 actually quite useless :) To do some work you want make some internet search, and it can't be done there: I found that midori can open only google.com and maybe first result page, that's it. Other sites can't be opened (oops something went wrong). Because of low memory (I guess). I've tried to setup 1gb zram swap, but i'ts not helped.
It seems that you should let some things go...

But still, tmux + ssh works pretty fine :)

What experience do you have with it?

@minimec
Copy link

minimec commented Apr 22, 2021

@pryg-skok

I found that midori can open only google.com and maybe first result page, that's it.

Give the Falkon Browser a try. It works surprisingly well!

I've tried to setup 1gb zram swap, but i'ts not helped.

I personally went for zswap and am pretty happy with it. But you will have to compile your kernel again to make it work.

What experience do you have with it?

Obviously the ac100 nowadays is more a toy than an actual computer/laptop. But it is a toy that still puts a smile on my face using it. I still love that little device.
I run the enlightenment desktop on it and go for the i3 tiling window manager from time to time.
Also I did some basic RTL-SDR stuff with an old DVB-T dongle, mainly with terminal applications. Arch Linux ARM comes handy there, as you normally have access to the full AUR repository. You just have to edit the 'pkgconfig' file and add the 'armv7h' platform.

There is still active development going on for the device. You can fin the community in #ac100 on irc.freenode.net

So... in summary: It's a toy, and I like playing with it from time to time

@ScrapJack
Copy link

@martin-ac100 did you ever manage to fix the shutdown issues on recent kernels? Or did you stick with the older ones?

@martin-ac100
Copy link

@martin-ac100 did you ever manage to fix the shutdown issues on recent kernels? Or did you stick with the older ones?

Hi,
I use 5.12.4 kernel now and manually edit kernel/exit.c reverting changes before the patch.
Poweroff seems to be functional now - all LEDs go off, but I have a suspicion that the battery is still loosing power a bit..

Except that everything is working OK - playing videos from youtube in 480p, zram makes a great job for compiling larger projects, web browsing with otter-browser is quite usable too.

@ScrapJack
Copy link

Hi, thanks for the reply. I still have a couple of question for you.

manually edit kernel/exit.c reverting changes before the patch

Does this mean that you replace the file with an older version from "working" kernels?
Also did you change anything else in the config when building the kernel other than the three things mentioned by Nokius?

Personally I'm still at kernel 5.11.2, I've stopped updating it since it's a long process and I have no issues other than the poweroff. To be fair though I just use the shell. Thanks again.

@martin-ac100
Copy link

Does this mean that you replace the file with an older version from "working" kernels?

NO, I don't think it would work. I just add lines, that were removed (-) and remove line that were added by the patch (+)

--- a/kernel/exit.c
+++ b/kernel/exit.c
@@ -577,10 +577,6 @@ static struct task_struct *find_child_re
        }

        write_unlock_irq(&tasklist_lock);
-       if (unlikely(pid_ns == &init_pid_ns)) {
-               panic("Attempted to kill init! exitcode=0x%08x\n",
-                       father->signal->group_exit_code ?: father->exit_code);
-       }

        list_for_each_entry_safe(p, n, dead, ptrace_entry) {
                list_del_init(&p->ptrace_entry);
@@ -823,6 +819,14 @@ void __noreturn do_exit(long code)
        acct_update_integrals(tsk);
        group_dead = atomic_dec_and_test(&tsk->signal->live);
        if (group_dead) {
+               /*
+                * If the last thread of global init has exited, panic
+                * immediately to get a useable coredump.
+                */
+               if (unlikely(is_global_init(tsk)))
+                       panic("Attempted to kill init! exitcode=0x%08x\n",
+                               tsk->signal->group_exit_code ?: (int)code);
+
 #ifdef CONFIG_POSIX_TIMERS
                hrtimer_cancel(&tsk->signal->real_timer);
                exit_itimers(tsk->signal);

Also did you change anything else in the config when building the kernel other than the three things mentioned by Nokius?

You can download my config file here
https://drive.google.com/file/d/1acxVstwBeb6yaodeEKEXbMPwLHmASQTf/view?usp=sharing

and my kernel here
https://drive.google.com/file/d/1gCJOGRRA-zVC5KFSZoA5BjUqAMR_nI29/view?usp=sharing

@ScrapJack
Copy link

@martin-ac100 Thanks a lot! And good job on spotting the issue too.

@ibisal
Copy link

ibisal commented Dec 19, 2021

@martin-ac100 seems like your compilation use IPv6 only. How can I change it for IPv4 only (disable IPv6/enable IPv4)?

@franzy3kk
Copy link

Good morning,
After some time, I tried to update the system.
I have locked the linux-armv7, libdrm and mesa packages in the pacman.conf file.....but every time I run Syu, the update always results in: kernel panic.
Am I forgetting some steps or? Does anyone have a stable image to share?

Greetings in advantage.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment