summaryrefslogtreecommitdiff
path: root/lx-trainer-vm
diff options
context:
space:
mode:
authorManuel Traut <manut@linutronix.de>2015-02-05 10:18:34 +0100
committerManuel Traut <manut@linutronix.de>2015-02-05 10:18:34 +0100
commit81aec52914ec6d604b624c0e169a8b75d960bb8d (patch)
treec9f2e78d9af4c2569fc33de8c7c110c4baf4b7b0 /lx-trainer-vm
parentd5e6d7167ddd31529a2c05bddc77f25f740ee03c (diff)
lx-trainer: add documentation and scripts
this moves also the elbe-xml into a lx-trainer directory. Signed-off-by: Manuel Traut <manut@linutronix.de>
Diffstat (limited to 'lx-trainer-vm')
-rw-r--r--lx-trainer-vm/README30
-rwxr-xr-xlx-trainer-vm/dd-dual.sh40
-rwxr-xr-xlx-trainer-vm/dd-single.sh14
-rw-r--r--lx-trainer-vm/lx-trainer-vm.xml214
-rwxr-xr-xlx-trainer-vm/update-home.sh23
5 files changed, 321 insertions, 0 deletions
diff --git a/lx-trainer-vm/README b/lx-trainer-vm/README
new file mode 100644
index 0000000..f1c255e
--- /dev/null
+++ b/lx-trainer-vm/README
@@ -0,0 +1,30 @@
+lx-trainer
+==========
+v2015-02-05
+Manuel Traut <manut@linutronix.de>
+
+lx-trainer is our disk image for all trainings.
+
+To build the image, a modified elbe initvm is needed.
+The default disk-size of 20GB is not enough!
+
+ELBE generates just the first partition. However the
+system is configured that there is a second partition
+mounted by label 'home' on '/home'. This was made to
+reduce the time needed to 'dd' the image to the disks.
+
+E.g. i added the following content for the yocto training:
+----
+ % ls home-overlay/devel/yocto/
+ downloads pres_lx-trainer-vm.pdf pres_yocto-basic.pdf
+ meta-mini pres_yocto-advanced.pdf pres_yocto-intro.pdf
+----
+
+The dd scirpts provided here are just examples how to put
+the image on (multiple) usb hard-drives and add the home
+partition. They should be used as templates and need modifications
+to fit on your environment.
+
+The update-home script is used to update just the '/home'
+partition. E.g. collect the disks after the first training
+day, and add some stuff for the 2nd day.
diff --git a/lx-trainer-vm/dd-dual.sh b/lx-trainer-vm/dd-dual.sh
new file mode 100755
index 0000000..606ba17
--- /dev/null
+++ b/lx-trainer-vm/dd-dual.sh
@@ -0,0 +1,40 @@
+#!/bin/bash
+
+# delete mbr
+dd if=/dev/zero of=/dev/sdb bs=512 count=1
+dd if=/dev/zero of=/dev/sdc bs=512 count=1
+dd if=/dev/zero of=/dev/sdd bs=512 count=1
+
+cat build-dm/lx-trainer.img | tee \
+ >(dd of=/dev/sdb) \
+ >(dd of=/dev/sdc) \
+ | dd of=/dev/sdd
+
+sync
+
+echo -e "n\np\n\n\n\nw" | fdisk /dev/sdb
+echo -e "n\np\n\n\n\nw" | fdisk /dev/sdc
+echo -e "n\np\n\n\n\nw" | fdisk /dev/sdd
+partprobe
+
+mkfs.ext4 -F -L lxhome /dev/sdb2
+mkfs.ext4 -F -L lxhome /dev/sdc2
+mkfs.ext4 -F -L lxhome /dev/sdd2
+
+mount /dev/sdb2 /mnt
+mkdir /mnt/devel
+chown 1000:1000 /mnt/devel
+cp -a home-overlay/* /mnt/
+umount /mnt
+
+mount /dev/sdc2 /mnt
+mkdir /mnt/devel
+chown 1000:1000 /mnt/devel
+cp -a home-overlay/* /mnt/
+umount /mnt
+
+mount /dev/sdd2 /mnt
+mkdir /mnt/devel
+chown 1000:1000 /mnt/devel
+cp -a home-overlay/* /mnt/
+umount /mnt
diff --git a/lx-trainer-vm/dd-single.sh b/lx-trainer-vm/dd-single.sh
new file mode 100755
index 0000000..fb66814
--- /dev/null
+++ b/lx-trainer-vm/dd-single.sh
@@ -0,0 +1,14 @@
+#!/bin/bash
+
+dd if=build/lx-trainer.img of=/dev/sdb
+
+echo -e "n\np\n\n\n\nw" | fdisk /dev/sdb
+partprobe
+
+mkfs.ext4 -F -L lxhome /dev/sdb2
+
+mount /dev/sdb2 /mnt
+mkdir /mnt/devel
+chown 1000:1000 /mnt/devel
+cp -a home-overlay/* /mnt/
+umount /mnt
diff --git a/lx-trainer-vm/lx-trainer-vm.xml b/lx-trainer-vm/lx-trainer-vm.xml
new file mode 100644
index 0000000..1746a8b
--- /dev/null
+++ b/lx-trainer-vm/lx-trainer-vm.xml
@@ -0,0 +1,214 @@
+<ns0:RootFileSystem xmlns:ns0="https://www.linutronix.de/projects/Elbe" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" created="2009-05-20T08:50:56" revision="6" xsi:schemaLocation="https://www.linutronix.de/projects/Elbe dbsfed.xsd">
+ <initvm>
+ <buildtype>amd64</buildtype>
+ <mirror>
+ <primary_host>ftp.de.debian.org</primary_host>
+ <primary_path>/debian</primary_path>
+ <primary_proto>http</primary_proto>
+ <url-list>
+ <url>
+ <binary>
+ http://debian.linutronix.de/elbe-testing wheezy main
+ </binary>
+ <source>
+ http://debian.linutronix.de/elbe-testing wheezy main
+ </source>
+ </url>
+ </url-list>
+ </mirror>
+ <noauth/>
+ <suite>wheezy</suite>
+ </initvm>
+ <project>
+ <name>lx-training</name>
+ <version>1</version>
+ <description>
+ can be used for linutronix trainigs. use as usb hd or
+ use this command to generate a vmware image:
+ qemu-img convert -O vmdk lx-trainer.img lx-trainer.vmdk
+ </description>
+ <buildtype>amd64</buildtype>
+ <mirror>
+ <primary_host>ftp.de.debian.org</primary_host>
+ <primary_path>/debian</primary_path>
+ <primary_proto>http</primary_proto>
+ <url-list>
+ <url>
+ <binary>
+ http://192.168.0.153/debian jessie contrib non-free
+ </binary>
+ <source>
+ http://192.168.0.153/debian jessie contrib non-free
+ </source>
+ </url>
+ <url>
+ <binary>
+ http://debian.linutronix.de/elbe-testing jessie main
+ </binary>
+ <source>
+ http://debian.linutronix.de/elbe-testing jessie main
+ </source>
+ </url>
+ </url-list>
+ </mirror>
+ <noauth/>
+ <suite>jessie</suite>
+ </project>
+ <target>
+ <hostname>lx-training</hostname>
+ <domain>tec.linutronix.de</domain>
+ <passwd>root</passwd>
+ <console>ttyS0,115200</console>
+ <images>
+ <msdoshd>
+ <name>lx-trainer.img</name>
+ <size>16GiB</size>
+ <grub-install/>
+ <partition>
+ <size>remain</size>
+ <label>rfs</label>
+ <bootable/>
+ </partition>
+ </msdoshd>
+ </images>
+ <fstab>
+ <bylabel>
+ <label>rfs</label>
+ <mountpoint>/</mountpoint>
+ <fs>
+ <type>ext4</type>
+ <tune2fs>-i 0</tune2fs>
+ </fs>
+ </bylabel>
+ <bylabel>
+ <label>lxhome</label>
+ <mountpoint>/home</mountpoint>
+ <fs>
+ <type>ext4</type>
+ <tune2fs>-i 0</tune2fs>
+ </fs>
+ </bylabel>
+ <bydev>
+ <source>none</source>
+ <mountpoint>/sys/kernel/debug</mountpoint>
+ <fs>
+ <type>debugfs</type>
+ </fs>
+ </bydev>
+ </fstab>
+ <finetuning>
+ <rm>var/cache/apt/archives/*.deb</rm>
+ <command>wget http://releases.linaro.org/14.11/components/toolchain/binaries/arm-linux-gnueabi/gcc-linaro-4.9-2014.11-x86_64_arm-linux-gnueabi.tar.xz</command>
+ <command>tar xJf gcc-linaro-4.9-2014.11-x86_64_arm-linux-gnueabi.tar.xz -C /opt</command>
+ <command>rm gcc-linaro-*.tar.xz</command>
+ <command>wget http://ftp.halifax.rwth-aachen.de/eclipse//technology/epp/downloads/release/kepler/SR2/eclipse-cpp-kepler-SR2-linux-gtk-x86_64.tar.gz</command>
+ <command>tar xzf eclipse-cpp-*.tar.gz -C /opt</command>
+ <command>rm eclipse-cpp-*.tar.gz</command>
+ <mkdir>/opt/yocto</mkdir>
+ <command>git clone -b daisy git://git.yoctoproject.org/poky.git /opt/yocto/poky.git</command>
+ <command>git clone -b daisy git://git.yoctoproject.org/meta-ti /opt/yocto/meta-ti.git</command>
+ <adduser passwd="devel" shell="/bin/bash" groups="sudo">devel</adduser>
+ </finetuning>
+ <pkg-list>
+ <pkg>grub-pc</pkg>
+ <pkg>linux-image-amd64</pkg>
+ <pkg>linux-image-amd64-dbg</pkg>
+ <pkg>linux-headers-amd64</pkg>
+ <pkg>linux-tools</pkg>
+ <pkg>firmware-linux</pkg>
+
+ <!-- basics -->
+ <pkg>openssh-client</pkg>
+ <pkg>openssh-server</pkg>
+ <pkg>less</pkg>
+ <pkg>bash</pkg>
+ <pkg>vim-nox</pkg>
+ <pkg>emacs-nox</pkg>
+ <pkg>mc</pkg>
+ <pkg>diffstat</pkg>
+ <pkg>quilt</pkg>
+ <pkg>git</pkg>
+ <pkg>gedit</pkg>
+ <pkg>gksu</pkg>
+
+ <!-- fastboot training -->
+ <pkg>bootchart2</pkg>
+ <pkg>pybootchartgui</pkg>
+ <pkg>kexec-tools</pkg>
+ <!-- fastboot: we need some tool for SVG -->
+ <pkg>inkscape</pkg>
+
+ <!-- linux training -->
+ <pkg>mtd-utils</pkg>
+ <pkg>qemu-system</pkg>
+ <pkg>qemu-user</pkg>
+ <pkg>build-essential</pkg>
+ <pkg>autoconf</pkg>
+ <pkg>automake</pkg>
+ <pkg>u-boot-tools</pkg>
+ <pkg>libncurses5-dev</pkg>
+ <pkg>bc</pkg>
+ <pkg>nfs-kernel-server</pkg>
+ <pkg>tftpd-hpa</pkg>
+ <pkg>duma</pkg>
+ <pkg>strace</pkg>
+ <pkg>ltrace</pkg>
+ <pkg>gdb</pkg>
+
+ <!-- elbe training -->
+ <pkg>elbe</pkg>
+ <pkg>elbe-doc</pkg>
+ <pkg>elbe-control</pkg>
+ <pkg>qemu-kvm</pkg>
+ <pkg>reprepro</pkg>
+ <pkg>debmirror</pkg>
+ <pkg>apache2</pkg>
+ <pkg>devscripts</pkg>
+ <pkg>dh-make</pkg>
+ <pkg>minicom</pkg>
+ <pkg>sudo</pkg>
+ <pkg>screen</pkg>
+ <pkg>rsync</pkg>
+
+ <!-- security training -->
+ <pkg>acl</pkg>
+ <pkg>attr</pkg>
+ <pkg>tomoyo-tools</pkg>
+ <pkg>selinux-basics</pkg>
+ <pkg>selinux-utils</pkg>
+ <pkg>selinux-policy-default</pkg>
+ <pkg>selinux-policy-dev</pkg>
+ <pkg>openvpn</pkg>
+ <pkg>easy-rsa</pkg>
+
+ <!-- needed by eclipse -->
+ <pkg>openjdk-7-jdk</pkg>
+
+ <!-- needed by yocto / toaster -->
+ <pkg>python-django</pkg>
+ <pkg>python-django-south</pkg>
+ <pkg>unzip</pkg>
+ <pkg>texinfo</pkg>
+ <pkg>chrpath</pkg>
+ <pkg>libsdl1.2-dev</pkg>
+
+ <!-- desktop -->
+ <pkg>lightdm</pkg>
+ <pkg>mate-desktop-environment-extras</pkg>
+ <pkg>mate-gnome-main-menu-applet</pkg>
+ <pkg>mate-themes</pkg>
+ <pkg>pluma</pkg>
+ <pkg>xterm</pkg>
+ <pkg>xinit</pkg>
+ <pkg>locales</pkg>
+ <pkg>xserver-xorg</pkg>
+ <pkg>network-manager-gnome</pkg>
+ <pkg>wireshark</pkg>
+ <pkg>xxxterm</pkg>
+ <pkg>gitk</pkg>
+
+ <!-- for the trainer -->
+ <pkg>evince</pkg>
+ </pkg-list>
+ </target>
+</ns0:RootFileSystem>
diff --git a/lx-trainer-vm/update-home.sh b/lx-trainer-vm/update-home.sh
new file mode 100755
index 0000000..2bdbf37
--- /dev/null
+++ b/lx-trainer-vm/update-home.sh
@@ -0,0 +1,23 @@
+#!/bin/bash
+
+mkfs.ext4 -F -L lxhome /dev/sde2
+mkfs.ext4 -F -L lxhome /dev/sdc2
+mkfs.ext4 -F -L lxhome /dev/sdd2
+
+mount /dev/sde2 /mnt
+mkdir /mnt/devel
+chown 1000:1000 /mnt/devel
+cp -a home-overlay/* /mnt/
+umount /mnt
+
+mount /dev/sdc2 /mnt
+mkdir /mnt/devel
+chown 1000:1000 /mnt/devel
+cp -a home-overlay/* /mnt/
+umount /mnt
+
+mount /dev/sdd2 /mnt
+mkdir /mnt/devel
+chown 1000:1000 /mnt/devel
+cp -a home-overlay/* /mnt/
+umount /mnt