LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Slackware (http://www.linuxquestions.org/questions/slackware-14/)
-   -   Running Slackware ARM on an $100 android netbook? (http://www.linuxquestions.org/questions/slackware-14/running-slackware-arm-on-an-%24100-android-netbook-4175448763/)

Darth Vader 02-05-2013 05:18 PM

Running Slackware ARM on an $100 android netbook?
 
I do not know if you know, but currently is sold on eBay and other sites with the same profile, some ARM netbooks, running Android, which costs very little, about $100.

A netbook model that caught my attention, has the following characteristics:

* 7" color TFT display
* VIA WM8850 processor at 1.5 GHz
* 1GB DDR3 RAM
* 4GB FLASH hardrive


Such netbook looks very promising in the ability to run a real Slackware with all options, for example KDE4, etc ...

If the processor speed and memory capacity are more than satisfactory, the fact that we only have 4G as disk space, I believe we need a solution diverse by a standard installation, in order to put as many applications. Because it is very clear, full installation will far surpass these 4GB in size.

Taking into account the fact that I doubt also that this flash hard drive is very fast, an idea would be to use a method similar to that used in LiveUSB's ...

In other words, to use a (LZMA) compressed SquashFS, with unionfs or a copy-on-write method, to get a worldwide writable system.

Because we have an internal hard drive, and I'm not sure how well unionfs or aufs works on ARM, I think the solution to that is to use only what provides the native kernel: squahfs and a COW with the help of DeviceMapper.

How does it work?

To use the DeviceMapper COW, we must fit a file system that is native RW, for example Ext2FS mounted read-only, using the COW file to get a RW "partition".

Therefore, we have a file with an appropriate size that is formatted Ext2FS, fore simplicity. For installing the Slackware, we mount it via loop.

After completing the installation and customization, we compress this file (system) in a SquashFS container.

Now, how do we get to boot this live system?

Using a suitable initrd. An example of some script that do this job:

Code:

init="/sbin/init"
root_ro=0
root_rw=0
root=""
rootflags=""
rootfstype=""

SQUASHED="/mnt/slackware.dat"

# Parse kernel commandline options
#
for o in `cat /proc/cmdline` ; do
    case $o in
    init=*)
        init=${o#init=}
        ;;
    ro)
        root_ro=1
        ;;
    rw)
        root_rw=1
        ;;
    *)
        continue
        ;;
    esac
done

# Users can override rootfs target on the kernel commandline
#
for o in `cat /proc/cmdline` ; do
    case $o in
    root=*)
        root=${o#root=}
        ;;
    rootflags=*)
        rootflags=${o#rootflags=}
        ;;
    rootfstype=*)
        rootfstype=${o#rootfstype=}
        ;;
    esac
done

waitforsymlink=0
# generate udev rules to generate /dev/root symlink
if [ -z $root ] ; then
    root=/dev/something
else
    case $root in
        /dev/disk/by-label/*)
            LABEL=${root#/dev/disk/by-label/}
            echo "SUBSYSTEM==\"block\", PROGRAM=\"/lib/udev/vol_id -l %N\", RESULT==\"$LABEL\", SYMLINK+=\"root\"" > /etc/udev/rules.d/00-label.rules
            if [ "$quiet" != "1" ] ; then
                echo "Added udev rule 00-label.rules:"
                cat /etc/udev/rules.d/00-label.rules
            fi
            waitforsymlink=1
            thingtomount=/dev/root
            ;;
        CDLABEL=*)
            CDLABEL=${root#CDLABEL=}
            echo "KERNEL==\"hd[a-z]\", BUS==\"ide\", SYSFS{removable}==\"1\", ATTRS{media}==\"cdrom\", PROGRAM=\"/lib/udev/vol_id -l %N\", RESULT==\"$CDLABEL\", SYMLINK+=\"root\"" > /etc/udev/rules.d/00-cdlabel.rules
            echo "KERNEL==\"sr[0-9]\", PROGRAM=\"/lib/udev/vol_id -l %N\", RESULT==\"$CDLABEL\", SYMLINK+=\"root\"" >> /etc/udev/rules.d/00-cdlabel.rules
            echo "KERNEL==\"scd[0-9]\", PROGRAM=\"/lib/udev/vol_id -l %N\", RESULT==\"$CDLABEL\", SYMLINK+=\"root\"" >> /etc/udev/rules.d/00-cdlabel.rules
            echo "KERNEL==\"pcd[0-9]\", PROGRAM=\"/lib/udev/vol_id -l %N\", RESULT==\"$CDLABEL\", SYMLINK+=\"root\"" >> /etc/udev/rules.d/00-cdlabel.rules
            if [ "$quiet" != "1" ] ; then
                echo "Added udev rule 00-cdlabel.rules:"
                cat /etc/udev/rules.d/00-cdlabel.rules
            fi
            waitforsymlink=1
            thingtomount=/dev/root
            ;;
        LABEL=*)
            LABEL=${root#LABEL=}
            echo "SUBSYSTEM==\"block\", PROGRAM=\"/lib/udev/vol_id -l %N\", RESULT==\"$LABEL\", SYMLINK+=\"root\"" > /etc/udev/rules.d/00-label.rules
            if [ "$quiet" != "1" ] ; then
                echo "Added udev rule 00-label.rules:"
                cat /etc/udev/rules.d/00-label.rules
            fi
            waitforsymlink=1
            thingtomount=/dev/root
            ;;
        /dev/disk/by-id/*)
            UUID=${root#/dev/disk/by-id/}
            echo "SUBSYSTEM==\"block\", PROGRAM=\"/lib/udev/vol_id -u %N\", RESULT==\"$UUID\", SYMLINK+=\"root\"" > /etc/udev/rules.d/01-uuid.rules
            if [ "$quiet" != "1" ] ; then
                echo "Added udev rule 01-uuid.rules:"
                cat /etc/udev/rules.d/01-uuid.rules
            fi
            waitforsymlink=1
            thingtomount=/dev/root
            ;;
        UUID=*)
            UUID=${root#UUID=}
            echo "SUBSYSTEM==\"block\", PROGRAM=\"/lib/udev/vol_id -u %N\", RESULT==\"$UUID\", SYMLINK+=\"root\"" > /etc/udev/rules.d/01-uuid.rules
            if [ "$quiet" != "1" ] ; then
                echo "Added udev rule 01-uuid.rules:"
                cat /etc/udev/rules.d/01-uuid.rules
            fi
            waitforsymlink=1
            thingtomount=/dev/root
            ;;
        /dev/*)
            ln -s $root /dev/root
            thingtomount=$root
            ;;
        *)
            thingtomount=$root
            ;;
    esac
fi

echo "udev_log=\"error\"" >> /etc/udev/udev.conf

# rules for device-mapper
#
echo "KERNEL==\"device-mapper\", NAME=\"mapper/control\"" >> /etc/udev/rules.d/64-device-mapper.rules

/sbin/udevd --daemon

/sbin/udevadm trigger

/sbin/udevadm settle --timeout=30 || :

LIVE_BOOTDEV=`readlink /dev/root`

if [ "$quiet" != "1" ] ; then
  echo "mounting /dev/root"
  ls -l /dev/root
fi

if [ -z $rootfstype ] ; then
  rootfstype=auto
fi

if [ "x$root_ro" == "x1" ] ; then
  if [ -z $rootflags ] ; then
      rootflags="ro"
  else
      rootflags="$rootflags,ro"
  fi
fi

if [ "x$root_rw" == "x1" ] ; then
  if [ -z $rootflags ] ; then
      rootflags="rw"
  else
      rootflags="$rootflags,rw"
  fi
fi

if [ -z $rootflags ] ; then
    mountoptions=""
else
    mountoptions=" -o$rootflags"
fi

mount -n -t $rootfstype $mountoptions $thingtomount /mnt

SQUASHED_LOOPDEV=$( losetup -f )

losetup $SQUASHED_LOOPDEV $SQUASHED
mkdir -p /system
mount -n -t squashfs -o ro $SQUASHED_LOOPDEV /system

BASE_LOOPDEV=$( losetup -f )

losetup $BASE_LOOPDEV /system/slackware.ext2fs

# prepare an overlay file if not found
if [ ! -e /mnt/slackware.cow ]; then
    # create a sparse file for the overlay (512MB)
    dd if=/dev/null of=/mnt/slackware.cow bs=1024 count=1 seek=$((512*1024)) 2> /dev/null
fi

umount -l /system
umount -l /mnt

OVERLAY_LOOPDEV=$( losetup -f )

losetup $OVERLAY_LOOPDEV /mnt/slackware.cow

# set up the snapshot
echo 0 `blockdev --getsize $BASE_LOOPDEV` snapshot $BASE_LOOPDEV $OVERLAY_LOOPDEV p 8 | dmsetup create live-rw

# set up new /dev/root symlink
rm -f /dev/root
ln -s /dev/mapper/live-rw /dev/root

mount -n -t ext2 /dev/mapper/live-rw /mnt

# here you can modify the rw ext2 fs for testing if you don't want to respin the entire rootfs (which takes ages).
# Example
#
#  echo foo > /mnt/etc/bar.conf
#

# create rule so udev creates /dev/live symlink on real rootfs
if [ -d /mnt/lib/udev/rules.d ] ;then
  udevrulefn=$( ls /mnt/lib/udev/rules.d/50-udev* )
else
  udevrulefn=$( ls /mnt/etc/udev/rules.d/50-udev* )
fi

# add rules for loop devices created by this mkinitramfs generated init
# i.e /dev/live, /dev/live-osimage, /dev/live-overlay and /dev/live-squash
echo "KERNEL==\"$LIVE_BOOTDEV\" SYMLINK+=\"live\"" >> $udevrulefn
echo "KERNEL==\"${SQUASHED_LOOPDEV#/dev/}\" SYMLINK+=\"live-squash\"" >> $udevrulefn
echo "KERNEL==\"${BASE_LOOPDEV#/dev/}\" SYMLINK+=\"live-osimage\"" >> $udevrulefn
echo "KERNEL==\"${OVERLAY_LOOPDEV#/dev/}\" SYMLINK+=\"live-overlay\"" >> $udevrulefn

# Add the device-mapper nodes to real /dev:
cp -af /dev/mapper /dev/root /mnt/lib/udev/devices

mount -n -o ro,remount /mnt

if [ -x /mnt$init ] ; then

    # Leave initramfs and transition to rootfs
    killall udevd

    # Wait for UDEV exit
    sleep 1

    echo "switching root and transfering control to $init"

    echo 0x0100 > /proc/sys/kernel/real-root-dev

    unset ERR

    umount /sys
    umount -l /dev/pts
    umount -l /dev
    umount /proc 2> /dev/null

    echo "${INITRD}:  Transfering control to Real System"
    exec switch_root /mnt $init
else
    echo "---------------------------------------------------------"
    echo "WARNING: Requested $init binary does not exist on rootfs."
    echo "---------------------------------------------------------"
    echo
    echo "Dropping to a shell. Good luck!"
    echo
    exec /bin/sh
fi

Ideas? Opinions?

MS3FGX 02-05-2013 08:44 PM

I wonder if you aren't getting ahead of yourself a bit here.

What details do you have on the bootloader? Do you know how to boot another OS on it? Has anyone ported a vanilla Linux kernel to it? Has the manufacturer at least released the kernel tree from their Android build?

drmozes 02-06-2013 07:56 AM

Quote:

Originally Posted by MS3FGX (Post 4885166)
I wonder if you aren't getting ahead of yourself a bit here.

What details do you have on the bootloader? Do you know how to boot another OS on it? Has anyone ported a vanilla Linux kernel to it? Has the manufacturer at least released the kernel tree from their Android build?


Yep - do your home work before getting too excited about an ARM machine. If the support for it isn't upstream and the community is not large and active, the chances are that support for the Kernel patches will suffer bit rot and eventually be unmaintainable and the same deal with any graphics drivers it may require -- leaving you with a machine that can't be upgraded to the latest OS. This is why I'm personally very cautious about purchasing new ARM hardware. I have a strict vetting criteria which starts with the above. Slackware ARM had to drop two of the original supported machines because of kernel driver bit rot and lack of upstream merging.

TobiSGD 02-06-2013 08:06 AM

Don't forget that Android does not use X for displaying, so you also have to check if a videodriver exists for the hardware in question that works with X.

piratesmack 02-06-2013 09:13 AM

I've seen some ARM netbooks on Aliexpress based on the Allwinner A10.
Those can usually boot Linux from an sdcard
http://linux-sunxi.org/FirstSteps

Here's one running Ubuntu
http://youtu.be/AeWgQo2xZOQ

ottavio 02-06-2013 04:48 PM

Quote:

Originally Posted by drmozes (Post 4885497)
Yep - do your home work before getting too excited about an ARM machine.

With your permission, Stuart, yes and no.

Excited, no. But curious, why not? Especially if you are willing to pay the price of breaking the machine (incidentally I gave up installing Slackware on the Samsung Chromebook but that's a different story).

To the OP, the guys at the xda-developers forums seem to be able to install Ubuntu on almost all Android devices. Ask there and if it works, report it back. Please.

breakbeat 02-10-2013 11:46 AM

I'd been looking at these cheap notebooks, and I had the same idea, but its investigating the hardware...

I eventually bought a used Asus EeePC 901, 7 inch notebook on Ebay, 70 all in. Its an Atom, but its supported, and so are all the other components.

drmozes 02-11-2013 09:42 AM

Quote:

Originally Posted by ottavio (Post 4885838)
With your permission, Stuart, yes and no.

Excited, no. But curious, why not? Especially if you are willing to pay the price of breaking the machine (incidentally I gave up installing Slackware on the Samsung Chromebook but that's a different story).

I always plan for the future - so whilst I may be curious about something, if I don't see support for it making it upstream then it'll end up being stuck at a stage in history. I have a couple of what are actually pretty good ARM machines that cannot now be used with anything more recent than Linux 2.4. This way, it saves *me* spending valuable time and money on something that has no future. Obviously since I'm maintaining the distribution, these are at the fore front of my mind.

It's just some advice to be taken or left.

chelovek84 04-10-2013 02:04 PM

Quote:

Originally Posted by MS3FGX (Post 4885166)
I wonder if you aren't getting ahead of yourself a bit here.

What details do you have on the bootloader? Do you know how to boot another OS on it? Has anyone ported a vanilla Linux kernel to it? Has the manufacturer at least released the kernel tree from their Android build?

Kernel tree: https://github.com/wondermedia/wm8850

Ahau 04-10-2013 04:30 PM

**warning: shameless self-promotion ahead**

Take a look at Porteus-ARM: http://forum.porteus.org/viewforum.php?f=112

I have a slimmed-down slackwarearm which is installed in xz-compressed squashfs modules. It's under 200 MB and runs LXDE and Xfce. You do need aufs support built into the kernel, which requires patching. I'm running this on a tegra2 (1ghz dual core cortex 9 ARM processor with 1GB RAM). I think there will be some efficiency gains by moving to lzo compression rather than xz (because xz is rather processor intensive for decompression) but I haven't started playing with that as of yet.

Changes are written to an aufs writeable branch which can be in RAM (so all changes are lost on reboot) or on a physical disk (so changes persist).

I'd still categorize it as a work in progress, but I think it covers at least some of the mentioned objectives. So yes, it is possible to do something similar to what the OP is talking about, subject to kernel/bootloader support. On my device, the bootloader is locked, so I have to use 'dd' to flash a kernel+initrd image. It's kind of a pain, but it works.

enine 04-12-2013 06:03 AM

Quote:

Originally Posted by breakbeat (Post 4888540)
I'd been looking at these cheap notebooks, and I had the same idea, but its investigating the hardware...

I eventually bought a used Asus EeePC 901, 7 inch notebook on Ebay, 70 all in. Its an Atom, but its supported, and so are all the other components.

The 901 would be a 9", the 7" would be the 701 model. I have the 900A 9", its been my main system for 2-3 years now.

chelovek84 04-24-2013 04:32 AM

Quote:

Originally Posted by chelovek84 (Post 4929180)

Assembly source files missing in kernel tree. Search for some assembly source files brought me here: https://github.com/apc-io/apc-8950

wkt 06-04-2013 11:43 AM

Slackware boots successfully on the wm8850 7 inch netbook ( I have ).

See here for the details of the whole process and state of running
all kinds of Linux distros available for ARM Cortex A9 processors
on the wm8850 from SD card ( with Android installed in the NAND flash ) :

Linux on Wondermedia wm8850 - the current state

Just now the kernel I compiled allows no sound, no internal WiFi and no LAN.
WiFi runs with an USB WLAN stick from Logilink on my device though...

dwblas 06-06-2013 11:26 AM

I am waiting for Vivaldi which will be more expensive than $100 (and a tablet), but the OS should be open source so __should__ run on most ARM processors http://www.linuxtoday.com/upload/viv...530065007.html

Darth Vader 06-06-2013 02:40 PM

Quote:

Originally Posted by dwblas (Post 4966680)
I am waiting for Vivaldi which will be more expensive than $100 (and a tablet), but the OS should be open source so __should__ run on most ARM processors http://www.linuxtoday.com/upload/viv...530065007.html

I seriously doubt that you have ever contact with packaging something for a ARM platform, if you say that... ;)

The fact that an OS is Open-Source, not guarantee that it will works in any platform. First, as I known, there is no generic platform for ARM, like for x86(_64) and, second, the great problem is not the operating system but the hardware and the kernel drivers...

BTW, you known that Android is Open-Source and use an (patched) Linux kernel? Yet, even you have a tablet or netbook where Android run OK, still is very posible that the bare Linux will not run, or will run without essential support for drivers (i.e. no sound, no wi-fi, etc).


All times are GMT -5. The time now is 05:43 AM.