SlackwareThis Forum is for the discussion of Slackware Linux.
Notices
Welcome to LinuxQuestions.org, a friendly and active Linux Community.
You are currently viewing LQ as a guest. By joining our community you will have the ability to post topics, receive our newsletter, use the advanced search, subscribe to threads and access many other special features. Registration is quick, simple and absolutely free. Join our community today!
Note that registered members see fewer ads, and ContentLink is completely disabled once you log in.
If you have any problems with the registration process or your account login, please contact us. If you need to reset your password, click here.
Having a problem logging in? Please visit this page to clear all LQ-related cookies.
Get a virtual cloud desktop with the Linux distro that you want in less than five minutes with Shells! With over 10 pre-installed distros to choose from, the worry-free installation life is here! Whether you are a digital nomad or just looking for flexibility, Shells can put your Linux machine on the device that you want to use.
Exclusive for LQ members, get up to 45% off per month. Click here for more info.
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.
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?
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.
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.
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.
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.
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?
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.
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 ) :
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).
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.