init
authorlace <>
Wed, 24 Mar 2010 14:50:06 +0000 (14:50 +0000)
committerlace <>
Wed, 24 Mar 2010 14:50:06 +0000 (14:50 +0000)
src/OOo-LiveCD.ks [new file with mode: 0644]
src/OOo-LiveCD.sh [new file with mode: 0755]

diff --git a/src/OOo-LiveCD.ks b/src/OOo-LiveCD.ks
new file mode 100644 (file)
index 0000000..1546e9f
--- /dev/null
@@ -0,0 +1,69 @@
+# $Id$
+
+%include /usr/share/spin-kickstarts/fedora-livecd-desktop.ks
+#%include /usr/share/rpmfusion-nonfree-remix-kickstarts/rpmfusion-nonfree-livecd-desktop.ks
+
+timezone Europe/Prague
+selinux --disabled
+
+%packages --excludedocs
+
+# selinux toolchain of policycoreutils, libsemanage, ustr
+-policycoreutils
+-checkpolicy
+-selinux-policy*
+-libselinux-python
+-libselinux
+-setroubleshoot*
+
+# office
+evince
+openoffice.org-base
+openoffice.org-calc
+openoffice.org-impress
+openoffice.org-math
+openoffice.org-writer
+openoffice.org-extendedPDF
+-abiword
+
+# graphics
+gimp
+inkscape
+
+# misc
+twinkle
+gdb
+powertop
+acpitool
+wget
+pidgin
+mutt
+youtube-dl
+thunderbird
+qemu-img
+qemu-kvm
+qemu-system-x86
+
+# non-free
+#mplayer
+
+%end
+
+%post
+
+cat >> /etc/rc.d/init.d/livesys << EOF
+
+# set up timed auto-login for after 60 seconds
+cat >> /etc/gdm/custom.conf << FOE
+[daemon]
+AutomaticLoginEnable=true
+AutomaticLogin=liveuser
+[security]
+DisallowTCP=false
+[greeter]
+SoundOnLogin=false
+FOE
+
+EOF
+
+%end
diff --git a/src/OOo-LiveCD.sh b/src/OOo-LiveCD.sh
new file mode 100755 (executable)
index 0000000..1195796
--- /dev/null
@@ -0,0 +1,143 @@
+#! /bin/bash
+# $Id$
+
+set -ex
+SIZE=2021654528
+BASE=OOo-LiveCD
+BIN=$BASE.bin
+ISO64=$BASE-x86_64.iso
+ISO32=$BASE-i686.iso
+ISO=$BASE.iso
+KS=$BASE.ks
+SELF=$BASE.sh
+# $PWD: rpm: arguments to --root (-r) must begin with a /
+MNT=$PWD/$BASE.mnt
+# Cheat livecd-iso-to-disk getdisk():
+LOOPDEV=/dev/loop-$BASE.dev
+LOOPDEVMK="mknod $LOOPDEV b 7 0"
+LOOPDEV1=/dev/loop-$BASE.dev1
+LOOPDEV1MK="mknod $LOOPDEV1 b 7 1"
+
+set -o pipefail
+renice +19 -p $$
+ionice -c3 -p $$
+test "`uname -m`" = "x86_64"
+test ! -e $BIN
+test ! -e $ISO
+test ! -e $LOOPDEV
+test ! -e $LOOPDEV1
+test ! -e $MNT
+test -f $SELF
+
+if [ ! -e $ISO64 ];then
+  test -f $KS
+  livecd-creator --config=$KS --fslabel=$BASE --cache=/var/cache/live
+  test -e $ISO
+  mv -f $ISO $ISO64
+fi
+if [ ! -e $ISO32 ];then
+  test -f $KS
+  setarch i686 livecd-creator --config=$KS --fslabel=$BASE --cache=/var/cache/live
+  test -e $ISO
+  mv -f $ISO $ISO32
+fi
+
+$LOOPDEVMK
+test "`losetup $LOOPDEV 2>&1|tee /proc/self/fd/2`" = "loop: can't get info on device $LOOPDEV: No such device or address"
+$LOOPDEV1MK
+test "`losetup $LOOPDEV1 2>&1|tee /proc/self/fd/2`" = "loop: can't get info on device $LOOPDEV1: No such device or address"
+
+dd if=/dev/zero of=$BIN bs=1 seek=$[SIZE-1] count=1
+losetup $LOOPDEV $BIN
+losetup -o $[34*512] $LOOPDEV1 $LOOPDEV
+# --overlay-size-mb 100 --home-size-mb 100
+echo | livecd-iso-to-disk --unencrypted-home --livedir $BASE-i686 --format --reset-mbr $ISO32 $LOOPDEV
+mkdir $MNT
+mount $LOOPDEV1 $MNT
+UUID1="$(sed <$MNT/syslinux/syslinux.cfg -n 's/^.* root=live:UUID=\([0-9A-Z]*-[0-9A-Z]*\) .*$/\1/p'|uniq)"
+test -n "$UUID1"
+mv $MNT/syslinux/initrd0.img $MNT/syslinux/initrd1.img
+mv $MNT/syslinux/vmlinuz0 $MNT/syslinux/vmlinuz1
+umount $MNT
+rmdir $MNT
+livecd-iso-to-disk --unencrypted-home --livedir $BASE-x86_64 $ISO64 $LOOPDEV1
+mkdir $MNT
+mount $LOOPDEV1 $MNT
+UUID0="$(sed <$MNT/syslinux/syslinux.cfg -n 's/^.* root=live:UUID=\([0-9A-Z]*-[0-9A-Z]*\) .*$/\1/p'|uniq)"
+test -n "$UUID0"
+cp -p /usr/share/syslinux/ifcpu64.c32 $MNT/syslinux/
+cat >$MNT/syslinux/syslinux.cfg <<EOH
+
+default vesamenu.c32
+timeout 100
+
+menu background splash.jpg
+menu title Welcome to OOo-LiveCD!
+menu color border 0 #ffffffff #00000000
+menu color sel 7 #ffffffff #ff000000
+menu color title 0 #ffffffff #00000000
+menu color tabmsg 0 #ffffffff #00000000
+menu color unsel 0 #ffffffff #00000000
+menu color hotsel 0 #ff000000 #ffffffff
+menu color hotkey 7 #ffffffff #ff000000
+menu color timeout_msg 0 #ffffffff #00000000
+menu color timeout 0 #ffffffff #00000000
+menu color cmdline 0 #ffffffff #00000000
+menu hidden
+menu hiddenrow 5
+label detect
+  menu label Autoselect x86_64 / i686 Boot
+  kernel ifcpu64.c32
+  append linux0 -- linux1
+menu default
+label linux0
+  menu label Boot x86_64
+  kernel vmlinuz0
+  append initrd=initrd0.img root=live:UUID=$UUID0 rootfstype=vfat ro liveimg live_dir=OOo-LiveCD-x86_64 quiet  rhgb rd_NO_LUKS rd_NO_MD noiswmd 
+label check0
+  menu label Verify and Boot x86_64
+  kernel vmlinuz0
+  append initrd=initrd0.img root=live:UUID=$UUID0 rootfstype=vfat ro liveimg live_dir=OOo-LiveCD-x86_64 quiet  rhgb check
+label linux1
+  menu label Boot i686
+  kernel vmlinuz1
+  append initrd=initrd1.img root=live:UUID=$UUID1 rootfstype=vfat ro liveimg live_dir=OOo-LiveCD-i686 quiet  rhgb rd_NO_LUKS rd_NO_MD noiswmd 
+label check1
+  menu label Verify and Boot i686
+  kernel vmlinuz1
+  append initrd=initrd1.img root=live:UUID=$UUID1 rootfstype=vfat ro liveimg live_dir=OOo-LiveCD-i686 quiet  rhgb check
+label memtest
+  menu label Memory Test
+  kernel memtest
+label local
+  menu label Boot from local drive
+  localboot 0xffff
+EOH
+cp -p $SELF $MNT/
+if [ -e $KS ];then
+  cp -p $KS $MNT/
+fi
+umount $MNT
+
+mkdir $MNT/{a,b,c}
+mount    -o loop $LOOPDEV1 $MNT/a
+mount -r -o loop $MNT/a/$BASE-x86_64/squashfs.img $MNT/b
+mount -r -o loop $MNT/b/LiveOS/ext3fs.img $MNT/c
+rpm -r $MNT/c -qa|sort >$MNT/a/$BASE-x86_64/rpm-qa
+umount $MNT/{c,b}
+mount -r -o loop $MNT/a/$BASE-i686/squashfs.img $MNT/b
+mount -r -o loop $MNT/b/LiveOS/ext3fs.img $MNT/c
+rpm -r $MNT/c -qa|sort >$MNT/a/$BASE-i686/rpm-qa
+umount $MNT/{c,b}
+diff -u <(sed 's/\.x86_64$//' <$MNT/a/$BASE-x86_64/rpm-qa) <(sed 's/\.i686$//' <$MNT/a/$BASE-i686/rpm-qa) || :
+umount $MNT/a
+rmdir $MNT/{c,b,a}
+
+rmdir $MNT
+losetup -d $LOOPDEV1
+rm -f $LOOPDEV1
+losetup -d $LOOPDEV
+rm -f $LOOPDEV
+# livecd-iso-to-disk resetMBR does not work due to /dev/loop*.
+dd bs=1 if=/usr/share/syslinux/mbr.bin of=$BIN conv=notrunc
+echo OK