LinuxQuestions.org
Review your favorite Linux distribution.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Distributions > Slackware
User Name
Password
Slackware This Forum is for the discussion of Slackware Linux.

Notices

Reply
 
Search this Thread
Old 02-05-2013, 05:18 PM   #1
Darth Vader
Member
 
Registered: May 2008
Location: Romania
Distribution: DARKSTAR Linux 2008.1
Posts: 607

Rep: Reputation: 109Reputation: 109
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?

Last edited by Darth Vader; 02-05-2013 at 05:22 PM.
 
Old 02-05-2013, 08:44 PM   #2
MS3FGX
Guru
 
Registered: Jan 2004
Location: NJ, USA
Distribution: Slackware, Debian
Posts: 5,852

Rep: Reputation: 351Reputation: 351Reputation: 351Reputation: 351
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?
 
Old 02-06-2013, 07:56 AM   #3
drmozes
Slackware Contributor
 
Registered: Apr 2008
Location: Surrey, England
Distribution: Slackware
Posts: 150

Rep: Reputation: 114Reputation: 114
Quote:
Originally Posted by MS3FGX View Post
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.
 
2 members found this post helpful.
Old 02-06-2013, 08:06 AM   #4
TobiSGD
Moderator
 
Registered: Dec 2009
Location: Hanover, Germany
Distribution: Main: Gentoo Others: What fits the task
Posts: 15,592
Blog Entries: 2

Rep: Reputation: 4046Reputation: 4046Reputation: 4046Reputation: 4046Reputation: 4046Reputation: 4046Reputation: 4046Reputation: 4046Reputation: 4046Reputation: 4046Reputation: 4046
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.
 
Old 02-06-2013, 09:13 AM   #5
piratesmack
Member
 
Registered: Feb 2009
Distribution: Slackware, Arch
Posts: 518

Rep: Reputation: 133Reputation: 133
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
 
1 members found this post helpful.
Old 02-06-2013, 04:48 PM   #6
ottavio
Member
 
Registered: Nov 2007
Posts: 312

Rep: Reputation: 46
Quote:
Originally Posted by drmozes View Post
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.
 
Old 02-10-2013, 11:46 AM   #7
breakbeat
LQ Newbie
 
Registered: Feb 2013
Posts: 4

Rep: Reputation: Disabled
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.
 
Old 02-11-2013, 09:42 AM   #8
drmozes
Slackware Contributor
 
Registered: Apr 2008
Location: Surrey, England
Distribution: Slackware
Posts: 150

Rep: Reputation: 114Reputation: 114
Quote:
Originally Posted by ottavio View Post
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.
 
Old 04-10-2013, 02:04 PM   #9
chelovek84
LQ Newbie
 
Registered: Sep 2010
Posts: 4

Rep: Reputation: 0
Quote:
Originally Posted by MS3FGX View Post
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
 
Old 04-10-2013, 04:30 PM   #10
Ahau
Member
 
Registered: Jun 2011
Location: USA
Distribution: Porteus, Slackware
Posts: 58

Rep: Reputation: 19
**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.
 
Old 04-12-2013, 06:03 AM   #11
enine
Member
 
Registered: Nov 2003
Distribution: Slackware 14.1
Posts: 791
Blog Entries: 3

Rep: Reputation: 84
Quote:
Originally Posted by breakbeat View Post
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.
 
Old 04-24-2013, 04:32 AM   #12
chelovek84
LQ Newbie
 
Registered: Sep 2010
Posts: 4

Rep: Reputation: 0
Quote:
Originally Posted by chelovek84 View Post
Assembly source files missing in kernel tree. Search for some assembly source files brought me here: https://github.com/apc-io/apc-8950
 
Old 06-04-2013, 11:43 AM   #13
wkt
LQ Newbie
 
Registered: Jun 2013
Posts: 2

Rep: Reputation: Disabled
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...
 
Old 06-06-2013, 11:26 AM   #14
dwblas
Member
 
Registered: Jun 2011
Posts: 54

Rep: Reputation: Disabled
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

Last edited by dwblas; 06-06-2013 at 11:28 AM.
 
Old 06-06-2013, 02:40 PM   #15
Darth Vader
Member
 
Registered: May 2008
Location: Romania
Distribution: DARKSTAR Linux 2008.1
Posts: 607

Original Poster
Rep: Reputation: 109Reputation: 109
Cool

Quote:
Originally Posted by dwblas View Post
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).
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
LXer: Turn Your Netbook into an Android Device with Android x86 LXer Syndicated Linux News 0 03-03-2012 06:00 PM
LXer: $100 netbook switches to Android LXer Syndicated Linux News 0 05-12-2010 04:40 PM
No audio, HDA intel sound card on a toshiba netbook running slackware 13 thenewguy24 Linux - Newbie 16 02-01-2010 04:24 PM
LXer: Android-x86 - run Google Android on a netbook LXer Syndicated Linux News 0 12-06-2009 01:30 PM
LXer: ARM netbook with Android undercuts Atom models LXer Syndicated Linux News 0 04-28-2009 09:31 PM


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

Main Menu
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
identi.ca: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration