summaryrefslogtreecommitdiffstats
path: root/doc
diff options
context:
space:
mode:
author Eric Hameleers <alien@slackware.com>2013-03-22 16:47:17 -0700
committer Eric Hameleers <alien@slackware.com>2013-03-22 16:47:17 -0700
commit69dd99f961988fa15da8d7f0d63b62f3385419c3 (patch)
treed57eb3e85e1d08e7815787de26946ee42c398b66 /doc
downloadalienarm-69dd99f961988fa15da8d7f0d63b62f3385419c3.tar.gz
alienarm-69dd99f961988fa15da8d7f0d63b62f3385419c3.tar.xz
Initial commit of a Slackware cross-arch bootstrap framework.
Diffstat (limited to 'doc')
-rw-r--r--doc/bootstrap.txt67
-rw-r--r--doc/debuginfo.txt9
-rw-r--r--doc/distcc161
-rw-r--r--doc/trimslice/README22
-rw-r--r--doc/trimslice/bootcmd.sh2
-rw-r--r--doc/trimslice/bootcmd.txt6
-rw-r--r--doc/trimslice/slackarm_ftpboot3
7 files changed, 270 insertions, 0 deletions
diff --git a/doc/bootstrap.txt b/doc/bootstrap.txt
new file mode 100644
index 0000000..7004022
--- /dev/null
+++ b/doc/bootstrap.txt
@@ -0,0 +1,67 @@
+Inspiration and a lot of lines taken from:
+
+ http://fedorapeople.org/cgit/djdelorie/public_git/bootstrap.git
+
+Using my stage12.sh and stage2.sh :
+===================================
+
+Take any Slackware version as the cross-compiling host - a Slackware64 13.37
+virtual machine is what I am using since I use Slackware64 13.37 servers as
+distcc hosts. You will be compiling sources for the software releases which
+you are also running on the ARM target.
+
+As normal user (not root!) create a directory - any will do:
+
+ $ mkdir crossdev
+
+This is the directory where the stage1.sh script will create all its output.
+The ./install directory will eventually contain the cross-compiler suite which
+is meant to run on the host machine. You can copy that tree to a different
+Iocation and use it with distcc.
+The directory ./rootfs will be populated with binary code which has been
+cross-compiled for your target ARM architecture. It is meant to be used on
+the ARM target, either as a bootstrap boot or as a chroot environment on a
+different ARM distro which is already installed on the target.
+
+Be sure to have lots of space available in your work directory!
+
+ $ cd crossdev
+
+Next, create a symlink to the directory which has a Slackware source tree as
+subdirectory. Ideally this is filled with ARM compatible SlackBuild scripts.
+but initially we will have to start with a local stash of modified SlackBuild
+scripts. The stage1.sh script must know where to find that directory with
+modified sources, its location is defined in the variable "SLACKSOURCE_LOCAL".
+The stage1.sh script will always look for sources first in this "local source"
+directory and use the Slackware source tree only in case nothing was found in
+the "local source" directory.
+The name of the symlink which you are going to create must be identical to the
+"DISTRO" variable in the stage1.sh script.
+
+ $ ln -sf /mnt/nfs/sox/ftp/pub/Linux/Slackware/slackware64-14.0 slackware
+
+Now, run the stage1.sh script, it can be on any random location. In my case,
+this is a NFS-mounted directory:
+
+ $ sh /mnt/nfs/sox/store/ARM/slackware/bootstrap/stage1.sh
+
+This script will run for a long time, and compile your cross-compiler, target
+rootfs and prepare the stage2 step.
+Sources will be copied from their original locations into ./sources , and
+the compilation will take place in a subdirectory ./builds .
+Sources which have been compile and installed into ./install (which is the
+cross-compiler directory tree) are marked "done" by creating a file in the
+subdirectory ./done . Repeated invocations of the stage1.sh script will skip
+everything which has been marked "done" which allows for last-minute fixes to
+the compilation commands.
+
+The final step in the stage1.sh script is to invoke a "stage2" step which
+populates a "stage2" directory tree into the rootfs. After you have copied
+the rootfs to the target machine, you should run /stage2/stage2.sh in order
+to compile the remaining binaries for the rootfs. When that is done, your
+rootfs will be in good shape to build a complete ARM Slackware distro package
+tree from scratch.
+
+
+===============================================================================
+Eric Hameleers <alien@slackware.com> 08-nov-2012
diff --git a/doc/debuginfo.txt b/doc/debuginfo.txt
new file mode 100644
index 0000000..3631dc9
--- /dev/null
+++ b/doc/debuginfo.txt
@@ -0,0 +1,9 @@
+If libraries are built with debug information, you can remove this with 'strip'
+but perhaps even better would be to do:
+
+$ objcopy --only-keep-debug libfoo.so libfoo.so.debug
+$ objcopy --strip-debug libfoo.so
+$ objcopy --add-gnu-debuglink=libfoo.so.debug libfoo.so
+
+to separate the two.
+
diff --git a/doc/distcc b/doc/distcc
new file mode 100644
index 0000000..1afdfbe
--- /dev/null
+++ b/doc/distcc
@@ -0,0 +1,161 @@
+Online documentation:
+
+Using distcc and crosstool-ng for distributed cross-compilations:
+- http://archlinuxarm.org/developers/distcc-cross-compiling
+
+Setting up a distcc environment:
+- http://archlinuxarm.org/developers/distributed-compiling
+
+# ===========================================================================
+
+Setting up distcc on the host (the ARM computer):
+
+Add the following to /etc/profile.d/distcc.sh :
+
+#-----8<------------------------------------------
+# Explicitly set the ARCH since we are not natively compiling:
+export ARCH=armv7hl
+
+# Automatically determine the ARCH we are running distcc on:
+MARCH=$( uname -m )
+if [ -z "$ARCH" ]; then
+ case "$MARCH" in
+ i?86) export ARCH=i486 ;;
+ armv7hl) export ARCH=$MARCH ;;
+ arm*) export ARCH=arm ;;
+ # Unless $ARCH is already set, use uname -m for all other archs:
+ *) export ARCH=$MARCH ;;
+ esac
+fi
+
+case "$ARCH" in
+ arm*) TARGET=$ARCH-slackware-linux-gnueabi ;;
+ *) TARGET=$ARCH-slackware-linux ;;
+esac
+
+# Define the compilers with their full name, not just "gcc" - or else
+# we can not distribute the compilation to a distcc cross-compiler:
+export CC=${TARGET}-gcc
+export CXX=${TARGET}-g++
+export AS=${TARGET}-as
+
+# We need a private directory where we will create distcc symlinks:
+DISTCC_CPATH="/var/tmp/${UID}/distcc"
+
+# Create distcc compiler and assembler symlinks, for our host architecture:
+( mkdir -p $DISTCC_CPATH
+ cd $DISTCC_CPATH
+ ln -svf /usr/bin/distcc ${TARGET}-gcc
+ ln -svf /usr/bin/distcc ${TARGET}-g++
+ ln -svf /usr/bin/distcc ${TARGET}-c++
+ ln -svf /usr/bin/distcc ${TARGET}-as
+)
+# So that every compiler call will actually trigger distcc:
+export PATH="$DISTCC_CPATH:$PATH"
+
+# First priority is the localhost (the arm computer), note that this must
+# be the literal string "localhost" which is interpreted as "run a compilation
+# locally if only a single job must be run":
+export DISTCC_HOSTS="localhost 192.168.0.1"
+#-----8<------------------------------------------
+
+Setting up my own distcc server:
+
+In /etc/hosts.allow, define distccd hosts or network, otherwise the master
+won't be able to connect (distcc runs on port 3632):
+
+#-----8<------------------------------------------
+distccd: 192.168.0.0/24
+#-----8<------------------------------------------
+
+Create a file with defaults for the rc.distccd script which comes next:
+
+#-----8<------------------------------------------
+# Example /etc/default/distccd
+DISTCCD_USER=nobody
+DISTCCD_NUMJOBS=5
+DISTCCD_ALLOW="192.168.0.0/24"
+DISTCCD_PID="/var/run/distcc/distccd.pid"
+#-----8<------------------------------------------
+
+Create /etc/rc.d/rc.distccd as follows:
+
+#-----8<------------------------------------------
+# /etc/rc.d/rc.distccd
+#
+# Start/stop/restart the distcc daemon.
+#
+
+# Load defaults:
+if [ -f /etc/default/distccd ] ; then
+ . /etc/default/distccd
+fi
+
+DISTCCD_USER=${DISTCCD_USER:-nobody}
+DISTCCD_NUMJOBS=${DISTCCD_NUMJOBS:-5}
+DISTCCD_ALLOW=${DISTCCD_ALLOW:-"192.168.0.0/24"}
+DISTCCD_PID=${DISTCCD_PID:-/var/run/distcc/distccd.pid}
+
+# If we allow cross-compiling, then define the architecture(s) space-separated:
+DISTCCD_TARGET=${DISTCCD_TARGET:-"armv7hl"}
+
+# Determine the ARCH we are running the distcc daemon on:
+case "$( uname -m )" in
+ i?86) DISTCCARCH=i486 ;;
+ *) DISTCCARCH=$( uname -m ) ;;
+esac
+
+if [ -n "$DISTCCD_TARGET" ]; then
+ # Where will distcc find the crosscompiler:
+ DISTCC_BASEDIR=/tftpboot/crossdev/${DISTCCARCH}
+ for CARCH in $DISTCCD_TARGET ; do
+ DISTCC_PATH="${DISTCC_BASEDIR}/${CARCH}/bin:${DISTCC_PATH}"
+ done
+ echo "Distcc will look for crosscompilers in '$DISTCC_PATH'"
+fi
+
+distccd_start() {
+ echo "Starting distcc daemon: /usr/bin/distccd start"
+ mkdir -p /var/run/distcc
+ chown $DISTCCD_USER /var/run/distcc
+ touch /var/log/distccd.log
+ chown $DISTCCD_USER /var/log/distccd.log
+
+ DISTCCD_PATH=$DISTCC_PATH/bin \
+ /usr/bin/distccd --daemon -N 5 --user $DISTCCD_USER --allow $DISTCCD_ALLOW --jobs $DISTCCD_NUMJOBS --pid-file $DISTCCD_PID --log-file /var/log/distccd.log
+}
+
+distccd_stop() {
+ killall distccd
+}
+
+distccd_status() {
+ PIDS=$(cat $DISTCCD_PID 2>/dev/null)
+ if [ "$PIDS" == "" ]; then
+ echo "distccd is not running!"
+ else
+ echo "distccd is running at pid(s) ${PIDS}."
+ fi
+}
+
+case "$1" in
+ 'start')
+ distccd_start
+ ;;
+ 'stop')
+ distccd_stop
+ ;;
+ 'restart')
+ distccd_stop
+ sleep 1
+ distccd_start
+ ;;
+ 'status')
+ distccd_status
+ ;;
+ *)
+ echo "usage $0 start|stop|restart|status" ;;
+esac
+#-----8<------------------------------------------
+
+
diff --git a/doc/trimslice/README b/doc/trimslice/README
new file mode 100644
index 0000000..eb0c072
--- /dev/null
+++ b/doc/trimslice/README
@@ -0,0 +1,22 @@
+The trimslice will have serious issues with USB disconnects, killing any updates to the _first_ partition on the internal SSD if you have more than one partition (excluding swap).
+
+So, the only reliable way of installing Slackware is with this parition layout:
+
+root@trimslice:~# fdisk -l
+
+Disk /dev/sda: 32.0 GB, 32017045504 bytes
+64 heads, 32 sectors/track, 30533 cylinders, total 62533292 sectors
+Units = sectors of 1 * 512 = 512 bytes
+Sector size (logical/physical): 512 bytes / 512 bytes
+I/O size (minimum/optimal): 512 bytes / 512 bytes
+Disk identifier: 0xd8075aa2
+
+ Device Boot Start End Blocks Id System
+/dev/sda1 2048 42000383 20999168 83 Linux
+/dev/sda2 42000384 62533291 10266454 82 Linux swap
+
+Then, make sure you copy bootcmd.txt and bootcmd.sh into the /boot directory after installation finishes. Change directory to "/mnt/boot" and run:
+ # sh bootcmd.sh
+This will create a boot.scr file which the TrimSlice's U-boot is able to parse.
+U-boot is configured to look inside the _first_ partition for a file called "boot.scr". It will look first in the root '/' and then in '/boot'.
+
diff --git a/doc/trimslice/bootcmd.sh b/doc/trimslice/bootcmd.sh
new file mode 100644
index 0000000..88d9fbb
--- /dev/null
+++ b/doc/trimslice/bootcmd.sh
@@ -0,0 +1,2 @@
+mkimage -A arm -O linux -T script -C none -a 0 -e 0 -n "Trim Slice HD Boot" -d bootcmd.txt boot.scr
+
diff --git a/doc/trimslice/bootcmd.txt b/doc/trimslice/bootcmd.txt
new file mode 100644
index 0000000..0a7f811
--- /dev/null
+++ b/doc/trimslice/bootcmd.txt
@@ -0,0 +1,6 @@
+setenv bootargs 'root=/dev/sda1 waitforroot=3 rootfs=ext3 console=tty1 console=ttyS0,115200 mem=384M@0M mem=512M@512M nvmem=128M@384M vmalloc=248M video=tegrafb'
+usb reset 1
+ext2load usb 0:1 0x01100000 /boot/uinitrd-tegra
+ext2load usb 0:1 0x00800000 /boot/uImage-tegra
+bootm 0x00800000 0x01100000
+
diff --git a/doc/trimslice/slackarm_ftpboot b/doc/trimslice/slackarm_ftpboot
new file mode 100644
index 0000000..a8c467e
--- /dev/null
+++ b/doc/trimslice/slackarm_ftpboot
@@ -0,0 +1,3 @@
+dhcp
+setenv serverip 192.168.0.1
+tftpboot 0x01100000 slackwarearm-14.0/uinitrd-tegra.img ; tftpboot 0x00800000 slackwarearm-14.0/uImage-tegra ; setenv bootargs console=ttyS0,115200 nodhcp kbd=nl root=/dev/ram rw ; bootm 0x00800000 0x01100000