Inhaltsverzeichnis

KIWI

SDB:KIWI Cookbook Kiosk System
SDB:KIWI Cookbook ONebula Cloud
KIWI Cookbook

Kiwi einrichten

zypper ar http://download.opensuse.org/repositories/openSUSE:/Tools/openSUSE_11.2 openSUSE:Tools
zypper ar http://download.opensuse.org/repositories/openSUSE:/11.2:/Live/standard openSUSE:Live
zypper ref
zypper in kiwi kiwi-desc-oemboot kiwi-desc-usbboot kiwi-desc-isoboot createrepo yast2-add-on-creator syslinux kiwi-instsource kiwi-doc clicfs 

Umgebung zum Bauen einrichten

cd /daten/projekte/desktop4education
mkdir d4e2011-live
cp -av /usr/share/doc/packages/kiwi/examples/ .

SUSE Studio

Neuer d4e Live Stick - Nov. 2009

default d4e2010live
timeout  10
label d4e2010live
  kernel /boot/i386/loader/linux
  append initrd=/boot/i386/loader/initrd ramdisk_size=512000 ramdisk_blocksize=4096 splash=silent showopts

Installationsskript

#!/bin/bash

if [ -n "$1" ] ; then
        DISK=$1
else
        echo "Bitte die Laufwerksbezeichnung sdb, sdc, oder sdd, ... eingeben."
        echo "Mit 'fdisk -l' kann man die Bezeichnung vom entsprechenden Laufwerk finden."
	echo "Bei falscher Laufwerksbezeichnung droht Datenverlust!"
        exit
fi
echo "Möchtest du mit diesem Stick weitere Sticks erzeugen können? (j/n)" 
read antwort
#DISK=sdb 
DISK1=$DISK\1
DISK2=$DISK\2
DISK3=$DISK\3
DISK4=$DISK\4
echo "Benutze /dev/$DISK"
read -p "Weiter mit beliebiger Taste, Strg+C zum Abbrechen."

echo "Umount alle Paritionen"
umount /dev/$DISK1
umount /dev/$DISK2
umount /dev/$DISK3
umount /dev/$DISK4

echo "Partitionieren"
fdisk /dev/$DISK << EOF
d
1
d
2
d
3
d
4
n
p
1

+2G
n
p
2


t
1
b
a
2
w
EOF

echo "Formatieren"
umount /dev/$DISK1
umount /dev/$DISK2
umount /dev/$DISK3
umount /dev/$DISK4

sync

mkdosfs -n d4e-DATA /dev/$DISK1
mkfs.ext2 -L d4e2010-LIVE /dev/$DISK2
tune2fs -c 0 -i 0d /dev/$DISK2

echo "Installieren"
cat mbr.bin > /dev/$DISK
mkdir /mnt/$DISK2
mount /dev/$DISK2 /mnt/$DISK2
mkdir -p /mnt/$DISK2/boot/extlinux
chmod 755 extlinux
./extlinux --install /mnt/$DISK2/boot/extlinux
cp extlinux.conf /mnt/$DISK2/boot/extlinux/extlinux.conf
mkdir /mnt/iso
mount -o loop d4e2010live.i686-2010.1.0.iso /mnt/iso
rsync -av --progress /mnt/iso/ /mnt/$DISK2/.
cp initrdlive /mnt/$DISK2/boot/i386/loader/initrd
if [ "$antwort" = "j" ]; then
  mkdir /mnt/$DISK1
  mount /dev/$DISK1 /mnt/$DISK1
  mkdir /mnt/$DISK1/d4e-live
  rsync -av --progress ./ /mnt/$DISK1/d4e-live/.
fi
echo "Aufräumen"
sync
umount /mnt/iso
umount /dev/$DISK1
umount /dev/$DISK2
rmdir /mnt/iso
echo "Enjoy!"

initrd (harter Weg - alles selbst machen)

mkdir initrdud_entpackt
zcat ../initrdud | cpio -iv
mount /dev/sdb2 /mnt/sdb2
cd /mnt/sdb2/boot/i386/loader
mkdir work
cd work
zcat ../initrd | cpio -iv
cp /pfad/zu/initrdud/initrdud_entpackt/include include
find | cpio -o -H newc | gzip > ../initrdlive


AB HIER: ALTES KIWI SYSTEM

Umgebung einrichten

Internetverbindung herstellen
zypper ar  http://download.opensuse.org/repositories/openSUSE:/Tools/openSUSE_11.1 openSUSE:Tools 
zypper refresh
zypper in kiwi kiwi-desc-livesystem kiwi-desc-usbboot kiwi-desc-isoboot createrepo yast2-add-on-creator syslinux

Image vorbereiten

cd /d4e2010/live-usb

Neue Pakete hinzufügen

vi config/config.xml
  <package name="eclipse"/>
  ........

Startseite ändern

vi 01-kiwi.sh
#!/bin/bash

echo "desktop4education 2010 Live System Creator "
echo "Cleaning up the system..."
rm -rf /tmp/kiwi*
rm -rf /var/cache/kiwi/*

mkdir /tmp/kiwi /tmp/kiwi/d4e2010 /tmp/kiwi/tools /tmp/kiwi/d4e-source /tmp/kiwi/d4e-iso /tmp/kiwi/openSUSE111
mount -o loop d4e2010.iso /tmp/kiwi/d4e2010
mount -o loop openSUSE111.iso /tmp/kiwi/openSUSE111
cp -a tools /tmp/kiwi

#64 Bit System:
#linux32 kiwi --prepare config --root /tmp/kiwi/d4e-source --logfile terminal 
kiwi --prepare config --root /tmp/kiwi/d4e-source --logfile terminal 

#cp -a eclipse.ini /tmp/kiwi/d4e-source/usr/share/eclipse
rm -rf /tmp/kiwi/d4e-source/var/lib/d4e/desktop-profil/.eclipse
rm -rf /tmp/kiwi/d4e-source/var/lib/d4e/desktop-profil/Desktop/05_gemeinsam.desktop
rm -rf /tmp/kiwi/d4e-source/usr/share/dist/desktop-files/*
echo "#" > /tmp/kiwi/d4e-source/usr/lib/GConf/2/gconf-sanity-check-2
sed 's/s4e/www.d4e.at/' /tmp/kiwi/d4e-source/var/lib/d4e/desktop-profil/.mozilla/firefox/nrgzduvs.default/prefs.js > /tmp/kiwi/firefox
mv /tmp/kiwi/firefox /tmp/kiwi/d4e-source/var/lib/d4e/desktop-profil/.mozilla/firefox/nrgzduvs.default/prefs.js
sed '3s#./geogebra#java -jar geogebra.jar#' /tmp/kiwi/d4e-source/usr/bin/geogebra > /tmp/kiwi/geogebra
mv /tmp/kiwi/geogebra /tmp/kiwi/d4e-source/usr/bin/geogebra
chmod 755 /tmp/kiwi/d4e-source/usr/bin/geogebra
rpm --nodeps --root /tmp/kiwi/d4e-source -e java-1_6_0-openjdk java-1_6_0-openjdk-devel

#64 Bit System:
#linux32 kiwi --type iso --create /tmp/kiwi/d4e-source -d /tmp/kiwi/d4e-iso  --logfile terminal 
kiwi --type iso --create /tmp/kiwi/d4e-source -d /tmp/kiwi/d4e-iso  --logfile terminal 


umount /tmp/kiwi/d4e2010
umount /tmp/kiwi/openSUSE111

mv /tmp/kiwi/d4e-iso/* .
rm -rf /tmp/kiwi*

echo "Done."

Image bauen

./01-kiwi.sh
Im Verzeichnis /tmp sollten 10 GB frei sein

Image auf Stick kopieren

#!/bin/bash
if [ "$1" != "" ] && [ "$2" != "" ] && [ -d "$1" ]; then
        echo "Copy d4e-live-iso to usb-stick"
	rm -rf /tmp/kiwi*
	mkdir /tmp/kiwi /tmp/kiwi/d4e-iso
	mount -o loop d4e2010-live-$2.iso /tmp/kiwi/d4e-iso
	rsync -av --progress /tmp/kiwi/d4e-iso/ $1
        sync
	umount /tmp/kiwi/d4e-iso
	rm -rf /tmp/kiwi*
	echo "Done."
else
	echo "02-iso2stick.sh mountpoint d4e-modul"
fi
Kingston DataTraveler 2GB um 5.99 Euro
  1. Stick kaufen bei Peluga
  2. fdisk → Auf FAT16 + Bootflag einstellen
  3. mkdosfs -n d4e-live /dev/sdb1
  4. sfdisk -A1 /dev/sdb
  5. ms-sys -s /dev/sdb
  6. syslinux /dev/sdb1
  7. Und dann erst mein Skript 02-iso2stick.sh /media/d4e-live aps

Automatisch Paritionieren per Skript

fdisk ${1} <<EOF
o
n
p
1

t
c
w
EOF

mkfs.vfat -F 32 ${1}1
#!/bin/bash

cat <<EOF >test.txt
halloag
a
gwe
ga
g
ahg
EOF

Automatisch Paritionieren per Skript

$ echo "c
p
1
1
+1024M
t
b
a
1
w
" | fdisk /dev/sdg

susestudio.com Sprachpakete

Wished packages

initrd

      fdisk -l /dev/sdb
      syslinux /dev/sdb1
      mount openSUSE-GNOME-LiveCD-Build0201-i686.iso /mnt -o loop
      cp -R /mnt/* /media/SANDISK
      cp -R /mnt/boot/i386/loader/* /media/SANDISK
      mkdir opensuse
      cd opensuse
      gzip -dc /mnt/boot/i386/loader/initrd | cpio -i
      sed -i -e "s/\$cddev;do/\"\/dev\/sdb1\";do/" include
      find . | cpio -o -H newc | gzip -9 > /media/SANDISK/boot/i386/loader/initrdud
echo `dd if=/dev/sdb bs=1 count=4 skip=$((0x1b8)) 2>/dev/null |hexdump -n4 -e '"0x%x"' `

#!/bin/bash
 
rm -rf /tmp/kiwi*
rm -rf /var/cache/kiwi/*
 
mount -o loop /media/disk/iso/d4e2010.iso /mnt/d4e2010
mount -o loop /media/disk/iso/openSUSE111.iso /mnt/openSUSE111
 
kiwi --prepare /usr/share/kiwi/image/gnome/suse-11.1 --root /tmp/kiwi-source --logfile terminal
kiwi --type iso --create /tmp/kiwi-source -d /tmp/kiwi-iso  --logfile terminal
 
umount /mnt/d4e2010
umount /mnt/openSUSE111