Browse Source

Benjamin Schieder:


			
			
				rocklinux
			
			
		
Benjamin Schieder 21 years ago
parent
commit
33ce139bcc
31 changed files with 368 additions and 248 deletions
  1. +8
    -0
      target/lvp/ChangeLog
  2. +17
    -17
      target/lvp/build.sh
  3. +21
    -11
      target/lvp/config.in
  4. +1
    -1
      target/lvp/download.txt
  5. +1
    -1
      target/lvp/dump/etc_lvp_00-setup.sh
  6. +3
    -3
      target/lvp/kernel.conf
  7. +23
    -6
      target/lvp/parse-config
  8. +1
    -1
      target/lvp/patches/etc_profile.patch
  9. +1
    -1
      target/lvp/pkg_linux24-src.conf
  10. +1
    -1
      target/lvp/pkg_linux24.conf
  11. +15
    -15
      target/lvp/pkg_mplayer.conf
  12. +1
    -1
      target/lvp/pkg_sysfiles.conf
  13. +3
    -3
      target/lvp/pkg_xfree86.conf
  14. +1
    -1
      target/lvp/preconfig.in
  15. +1
    -1
      target/lvp/x86/build.sh
  16. +1
    -1
      target/lvp/x86/help0.txt
  17. +1
    -1
      target/lvp/x86/initrd/keymap
  18. +2
    -2
      target/lvp/x86/initrd/linuxrc
  19. +36
    -32
      target/lvp/x86/initrd/linuxrc2
  20. +65
    -0
      target/lvp/x86/livesystem/etc_lvp_10-encryption.sh
  21. +18
    -10
      target/lvp/x86/livesystem/etc_lvp_80-xf86config.sh
  22. +0
    -41
      target/lvp/x86/livesystem/etc_lvp_encryption.sh
  23. +1
    -1
      target/lvp/x86/livesystem/etc_profile
  24. +8
    -7
      target/lvp/x86/livesystem/linuxrc
  25. +6
    -0
      target/lvp/x86/release_skeleton/ChangeLog
  26. +3
    -3
      target/lvp/x86/release_skeleton/scripts/cleanup
  27. +2
    -22
      target/lvp/x86/release_skeleton/scripts/create_lvp
  28. +30
    -18
      target/lvp/x86/release_skeleton/scripts/create_lvpxml
  29. +93
    -43
      target/lvp/x86/release_skeleton/scripts/encrypted
  30. +1
    -1
      target/lvp/x86/release_skeleton/scripts/functions
  31. +3
    -3
      target/lvp/x86/release_skeleton/scripts/plain

+ 8
- 0
target/lvp/ChangeLog

@ -1,4 +1,12 @@
Tue Sep 28 09:54:01 CEST 2004 Benjamin Schieder <blindcoder@scavenger.homeip.net>
* updated to use new ROCK Linux trunk (trunk 43xx)
* now use a linear RAID for encrypted LVPs. This was done in response to a lot of
wasted disk space due to the 2GB file size limit of iso9660.
* package updates all over the place (gcc, glibc, mplayer, you name it)
* V0.4.2: released, dubbed "Moving to Berlin"
Mon May 24 12:56:20 CEST 2004 Benjamin Schieder <bs1544@bingo-ev.de>
* preconfig.in: rename target to LVP

+ 17
- 17
target/lvp/build.sh

@ -1,21 +1,21 @@
lvp_ver="0.4.1"
lvp_ver="0.4.2"
rootdir="${base}/build/${ROCKCFG_ID}"
ROCKdir="${rootdir}/ROCK"
releasedir="${ROCKdir}/lvp_${lvp_ver}_${ROCKCFG_X86_OPT}"
syslinux_ver="`sed -n 's,.*syslinux-\(.*\).tar.*,\1,p' ${base}/target/${target}/download.txt`"
kernelversion="`grep '\[V\]' ${base}/package/base/linux24/linux24.desc | cut -f2 -d' '`"
kernelversion="`grep '\[V\]' ${base}/package/base/linux/linux.desc | head -n 2 | tail -n 1 | cut -f2 -d' '`"
pkgloop
. scripts/parse-config
PATH="${base}/build/${ROCKCFG_ID}/${toolsdir}/diet-bin:${PATH}"
PATH="${rootdir}/${toolsdir}/diet-bin:${PATH}"
echo_header "Creating LVP ..."
echo_header "Checking for *.err files ..."
if [ `find "${rootdir}/var/adm/logs/" -name '*err' 2>/dev/null | wc -l` -gt 0 ] ; then
echo_status "Found some. This is bad :-("
echo_error "Found some. This is bad :-("
else
echo_status "None found. Good :-)"
@ -38,11 +38,11 @@ else
ln -sf . usr
cd etc
ln -sf /proc/mounts mtab
ln -sf /proc/mounts fstab
cd ..
echo_status "Copying programs"
for x in \
bin/bash2 \
bin/bash \
bin/cat \
bin/grep \
@ -56,7 +56,7 @@ else
bin/find \
bin/gawk \
bin/loadkeys \
lib/modules/${kernelversion}-rock/block \
lib/modules/${kernelversion}-rock \
sbin/agetty \
sbin/hwscan \
usr/bin/eject \
@ -85,15 +85,12 @@ else
ln -sf /sbin/insmod ${releasedir}/initrd/sbin/${x}
done
echo_status "Copying kernel modules to initrd"
cd ${releasedir}/initrd
tar --use-compress-program=bzip2 -xf ${ROCKdir}/pkgs/linux24.tar.bz2 lib/
echo_status "Creating the livesystem"
echo_status "Creating directory structure"
mkdir -p ${releasedir}/livesystem
cd ${releasedir}/livesystem
tar --use-compress-program=bzip2 -xf ${ROCKdir}/pkgs/00-dirtree.tar.bz2
rm -rf var/adm
cd usr/
rm -rf X11 X11R6
mkdir X11R6
@ -103,6 +100,7 @@ else
echo_status "Copying programs"
for x in \
bin/bash2 \
bin/bash \
bin/cat \
bin/find \
@ -130,6 +128,7 @@ else
usr/bin/tail \
usr/sbin/lspci \
sbin/losetup \
sbin/mdadm \
; do
mkdir -p ${x%/*}
@ -143,6 +142,7 @@ else
cd etc/
ln -sf /proc/mounts mtab
ln -sf /proc/mounts fstab
cd ../usr/share/mplayer
mv font-arial-24-iso-8859-1 font
cd ../../..
@ -167,16 +167,16 @@ else
echo "LVP v${lvp_ver}" >>${releasedir}/livesystem/etc/VERSION
echo_status "Compressing binaries ... "
${rootdir}/usr/bin/upx --best --crp-ms=999999 --nrv2d `find ${releasedir}/livesystem -type f | xargs file | grep "statically linked" | grep -v bin/bash | grep -v bin/mount | cut -f1 -d:` `find ${releasedir}/initrd -type f | xargs file | grep "statically linked" | grep -v bin/bash | grep -v bin/mount | cut -f1 -d:` >/proc/$$/fd/1 2>/proc/$$/fd/2 </proc/$$/fd/0
${rootdir}/usr/bin/upx --best --crp-ms=999999 --nrv2d `find ${releasedir}/livesystem -type f | xargs file | grep "statically linked" | grep -v bin/bash | grep -v bin/mount | cut -f1 -d:` `find ${releasedir}/initrd -type f | xargs file | grep "statically linked" | grep -v bin/bash | grep -v bin/mount | cut -f1 -d:` >/proc/${$}/fd/1 2>/proc/${$}/fd/2 </proc/${$}/fd/0
echo_status "Creating initrd.img"
dd if=/dev/zero of=${releasedir}/isolinux/initrd bs=1k count=8192
dd if=/dev/zero of=${releasedir}/isolinux/initrd bs=1k count=8192 >/dev/null 2>&1
mkfs.ext2 -m 0 -F ${releasedir}/isolinux/initrd >/dev/null 2>&1
mkdir ${releasedir}/initrd.tmp.$$
mount -o loop ${releasedir}/isolinux/initrd ${releasedir}/initrd.tmp.$$
mv ${releasedir}/initrd/* ${releasedir}/initrd.tmp.$$
umount -d ${releasedir}/initrd.tmp.$$
rm -rf ${releasedir}/initrd.tmp.$$ ${releasedir}/initrd
mkdir ${releasedir}/initrd.tmp.${$}
mount -o loop ${releasedir}/isolinux/initrd ${releasedir}/initrd.tmp.${$}
mv ${releasedir}/initrd/* ${releasedir}/initrd.tmp.${$}
umount ${releasedir}/initrd.tmp.${$}
rm -rf ${releasedir}/initrd.tmp.${$} ${releasedir}/initrd
echo_status "LVP v${lvp_ver} built for ${ROCKCFG_X86_OPT} is now ready in ${releasedir}."
fi

+ 21
- 11
target/lvp/config.in

@ -26,8 +26,8 @@ pkgfilter sed '
/ 00-dirtree / { p; d; };
/ autoconf / { p; d; };
/ automake / { p; d; };
/ bash=bash2 / { p; d; };
/ automake=automake18 / { p; d; };
/ bash / { p; d; };
/ bin86 / { p; d; };
/ binutils / { p; d; };
/ bison / { p; d; };
@ -37,13 +37,15 @@ pkgfilter sed '
/ diffutils / { p; d; };
/ ed / { p; d; };
/ eject / { p; d; };
/ expat / { p; d; };
/ findutils / { p; d; };
/ flex / { p; d; };
/ freeglut / { p; d; };
/ gawk / { p; d; };
/ gcc3 / { p; d; };
/ glibc23 / { p; d; };
/ gcc / { p; d; };
/ glibc / { p; d; };
/ grep / { p; d; };
/ groff / { p; d; };
/ gzip / { p; d; };
/ kbd / { p; d; };
/ less / { p; d; };
@ -55,13 +57,12 @@ pkgfilter sed '
/ libtiff / { p; d; };
/ libtool / { p; d; };
/ libungif / { p; d; };
/ linux24 / { p; d; };
/ linux24-header / { p; d; };
/ linux24-src / { p; d; };
/ linux / { p; d; };
/ loop-aes / { p ; d; };
/ lvp / { p; d; };
/ m4 / { p; d; };
/ make / { p; d; };
/ mdadm / { p; d; };
/ mktemp / { p; d; };
/ modutils / { p; d; };
/ mplayer / { p; d; };
@ -76,6 +77,7 @@ pkgfilter sed '
/ syslinux / { p; d; };
/ tar / { p; d; };
/ termcap / { p; d; };
/ texinfo / { p; d; };
/ ucl / { p; d; };
/ upx / { p; d; };
/ util-linux / { p; d; };
@ -85,18 +87,22 @@ pkgfilter sed '
# Disable all other packages
/.*/ { s/^X /O /p; d; };'
pkgenable freeglut
pkgenable lvp
ROCKCFGSET_CREATE_TARBZ2=1
ROCKCFGSET_CREATE_GEM=0
ROCKCFGSET_PKGFILE_VER=0
ROCKCFGSET_PKG_TERMCAP_USEIT=1
ROCKCFGSET_PKG_LOOP_AES_USEIT=1
ROCKCFGSET_PKG_GCC3_NO_JAVA=1
ROCKCFGSET_PKG_GCC32_NO_JAVA=1
ROCKCFGSET_PKG_GCC33_NO_JAVA=1
ROCKCFGSET_PKG_GCC34_NO_JAVA=1
ROCKCFGSET_PKG_BASH_PROGCOMP=0
ROCKCFGSET_PKG_BASH_INST_RLL=0
ROCKCFGSET_PKG_BASH_DEFAULT='bash2'
ROCKCFGSET_PKG_LINUX_SRC26=0
ROCKCFGSET_PKG_LINUX_IMG26=0
ROCKCFGSET_SPLIT_DOC=0
ROCKCFGSET_SPLIT_DEV=0
ROCKCFGSET_DO_REBUILD_STAGE=0
ROCKCFGSET_CREATE_DOCS=0
@ -106,3 +112,7 @@ ROCKCFGSET_CREATE_CACHE=0
ROCKCFGSET_PKGSEL_TPL=none
ROCKCFGSET_PKG_BASH_HELP_CMD=0
pkgenable freeglut
pkgenable lvp
pkgenable bash=bash2
ROCKCFGSET_DEBUG=0

+ 1
- 1
target/lvp/download.txt

@ -1 +1 @@
2125465292 syslinux-2.11.tar.bz2 http://www.kernel.org/pub/linux/utils/boot/syslinux/
4279863212 syslinux-2.08.tar.bz2 http://www.kernel.org/pub/linux/utils/boot/syslinux/

+ 1
- 1
target/lvp/dump/etc_lvp_00-setup.sh

@ -1,7 +1,7 @@
#!/bin/bash
for x in `cat /proc/cmdline` ; do
if [[ $x = *keymap* ]] ; then
if [[ ${x} = *keymap* ]] ; then
keymap=`find /usr/share/kbd/keymaps -name "${x##*=}.map*" 2>/dev/null`
if [ -f "${keymap}" ] ; then
cd ${keymap%/*}

+ 3
- 3
target/lvp/kernel.conf

@ -160,9 +160,9 @@ CONFIG_BLK_DEV_INITRD=y
#
# Multi-device support (RAID and LVM)
#
# CONFIG_MD is not set
# CONFIG_BLK_DEV_MD is not set
# CONFIG_MD_LINEAR is not set
CONFIG_MD=y
CONFIG_BLK_DEV_MD=y
CONFIG_MD_LINEAR=y
# CONFIG_MD_RAID0 is not set
# CONFIG_MD_RAID1 is not set
# CONFIG_MD_RAID5 is not set

+ 23
- 6
target/lvp/parse-config

@ -1,26 +1,43 @@
static=0
for x in upx gzip sed kbd mplayer pciutils grep coreutils util-linux libgli lvp gawk bash findutils eject xfree86 flex ; do
[ "$pkg" == "$x" ] && static=1
for x in upx gzip sed kbd mplayer pciutils grep coreutils libgli lvp gawk findutils eject xfree86 flex ; do
[ "${pkg}" == "${x}" ] && static=1
done
if [ $static -eq 1 ] ; then
if [ ${static} -eq 1 ] ; then
echo_status "Building this package statically for LVP"
var_append GCC_WRAPPER_APPEND " " "-static"
fi
if [ "$pkg" == "modutils" ] ; then
if [ "${pkg}" == "bash" ] ; then
echo_status "Building this package statically for LVP"
var_append extraconfopt " " "--enable-static-link"
fi
if [ "${pkg}" == "util-linux" ] ; then
echo_status "Building this package statically for LVP"
hook_add preconf 4 "export LDFLAGS=-static"
hook_add postinstall 4 "unset LDFLAGS"
fi
if [ "${pkg}" == "modutils" ] ; then
echo_status "Building this package statically for LVP"
var_append confopt " " "--enable-combined"
fi
if [ "${pkg}" == "mdadm" ] ; then
echo_status "Building this package statically for LVP"
var_append makeopt " " "LDFLAGS=-static"
var_append makeinstopt " " "LDFLAGS=-static"
fi
for x in mplayer freeglut ; do
if [ "$pkg" == "$x" ] ; then
if [ "${pkg}" == "${x}" ] ; then
echo_status "Building this package statically for LVP"
var_append confopt " " "--enable-static"
fi
done
install_init () {
echo_status "stub called: install_init $@"
echo_status "stub called: install_init ${@}"
}

+ 1
- 1
target/lvp/patches/etc_profile.patch

@ -8,6 +8,6 @@ we don't want to source that one
#
for x in /etc/profile.d/* /etc/conf/profile ; do
+ [ "${x##*/}" = "TRANS.TBL" ] && continue
[ -f $x ] && . $x
[ -f ${x} ] && . ${x}
done
unset x

+ 1
- 1
target/lvp/pkg_linux24-src.conf

@ -1,3 +1,3 @@
[ -e $confdir/$pkg.conf ] && . $confdir/$pkg.conf
[ -e ${confdir}/${pkg}.conf ] && . ${confdir}/${pkg}.conf
var_append patchfiles " " "${targetdir}/patches/linux24_quiet.patch"

+ 1
- 1
target/lvp/pkg_linux24.conf

@ -1,3 +1,3 @@
[ -e $confdir/$pkg.conf ] && . $confdir/$pkg.conf
[ -e ${confdir}/${pkg}.conf ] && . ${confdir}/${pkg}.conf
var_append patchfiles " " "${targetdir}/patches/linux24_quiet.patch"

+ 15
- 15
target/lvp/pkg_mplayer.conf

@ -1,35 +1,35 @@
mplayer_postmake() {
mkdir -p $datadir/$pkg
mkdir -p ${datadir}/${pkg}
echo "extracting the default font ..."
tar $taropt $archdir/font-arial-iso-8859-1.tar.bz2 -C $datadir/$pkg
rm -rf $datadir/$pkg/font
ln -sf font-arial-24-iso-8859-1 $datadir/$pkg/font
tar ${taropt} ${archdir}/font-arial-iso-8859-1.tar.bz2 -C ${datadir}/${pkg}
rm -rf ${datadir}/${pkg}/font
ln -sf font-arial-24-iso-8859-1 ${datadir}/${pkg}/font
echo "create a default configuration ..."
cat <<- EOT > $sysconfdir/mplayer.conf
cat <<- EOT > ${sysconfdir}/mplayer.conf
framedrop=yes
menu=yes
font=/usr/share/mplayer/font/font.desc
EOT
cp -f etc/{input,menu,codecs}.conf $sysconfdir
echo "TAB menu up" >> $sysconfdir/input.conf
rm -f $sysconfdir/*.older
cp -f etc/{input,menu,codecs}.conf ${sysconfdir}
echo "TAB menu up" >> ${sysconfdir}/input.conf
rm -f ${sysconfdir}/*.older
echo "correcting permissions and ownership ..."
chown -R root.root $datadir/$pkg $docdir $sysconfdir
find $datadir/$pkg $docdir $sysconfdir -type d | xargs -r chmod 0755
find $datadir/$pkg $docdir $sysconfdir -type f | xargs -r chmod 0644
chown -R root.root ${datadir}/${pkg} ${docdir} ${sysconfdir}
find ${datadir}/${pkg} ${docdir} ${sysconfdir} -type d | xargs -r chmod 0755
find ${datadir}/${pkg} ${docdir} ${sysconfdir} -type f | xargs -r chmod 0644
}
var_append confopt " " "--enable-static"
sysconfdir="$sysconfdir/mplayer"
var_append confopt " " "--prefix=$root/$prefix --confdir=$sysconfdir --enable-menu"
sysconfdir="${sysconfdir}/mplayer"
var_append confopt " " "--prefix=${root}/${prefix} --confdir=${sysconfdir} --enable-menu"
var_append confopt " " "--enable-linux-devfs --with-extraincdir=/usr/include/libpng"
var_append confopt " " "--enable-fbdev --enable-largefiles"
if [ $arch = x86 ] ; then
var_append confopt " " "--with-win32libdir=$root/$prefix/lib/win32"
if [ ${arch} = x86 ] ; then
var_append confopt " " "--with-win32libdir=${root}/${prefix}/lib/win32"
fi
var_append confopt " " "--enable-runtime-cpudetection"

+ 1
- 1
target/lvp/pkg_sysfiles.conf

@ -1,4 +1,4 @@
[ -e $confdir/$pkg.conf ] && . $confdir/$pkg.conf
[ -e ${confdir}/${pkg}.conf ] && . ${confdir}/${pkg}.conf
sysfiles_postmake_lvp () {
cd ${root}/etc

+ 3
- 3
target/lvp/pkg_xfree86.conf

@ -1,10 +1,10 @@
[ -e $confdir/$pkg.conf ] && . $confdir/$pkg.conf
[ -e ${confdir}/${pkg}.conf ] && . ${confdir}/${pkg}.conf
var_append patchfiles " " "${targetdir}/patches/xfree86_hotfixes.patch"
# configure the World for LVP
xf_config() {
echo "Configuring XFree ..."
echo "Configuring XFree for LVP ..."
if pkginstalled expat ; then
cat >> config/cf/host.def << EOT
/* Disable the internal expat library to use the system installed one */
@ -33,7 +33,7 @@ EOT
EOT
if [ $arch == "x86" ] ; then
if [ ${arch} == "x86" ] ; then
echo "Enabling Matrox HALlib (since this is x86) ..."
cat >> config/cf/host.def << EOT

+ 1
- 1
target/lvp/preconfig.in

@ -20,5 +20,5 @@
#
# --- ROCK-COPYRIGHT-NOTE-END ---
CFGTEMP_TARGETLIST="$CFGTEMP_TARGETLIST `
CFGTEMP_TARGETLIST="${CFGTEMP_TARGETLIST} `
`lvp LVP"

+ 1
- 1
target/lvp/x86/build.sh

@ -34,7 +34,7 @@ find ${releasedir} -name .svn -exec rm -rf {} \; 2>/dev/null
echo_status "Extracting isolinux boot loader."
mkdir -p isolinux
tar --use-compress-program=bzip2 \
-xf ${base}/download/${target}/syslinux-${syslinux_ver}.tar.bz2 \
-xf ${base}/download/mirror/s/syslinux-${syslinux_ver}.tar.bz2 \
syslinux-${syslinux_ver}/isolinux.bin -O > ${releasedir}/isolinux/isolinux.bin
echo_status "Creating isolinux config file."

+ 1
- 1
target/lvp/x86/help0.txt

@ -5,7 +5,7 @@
| / /__| |/ / ____/ |
| /_____/___/_/ |
| [===================================================================] |
| V 0.4.1 "This program contains software from the XFree86 project." |
| V 0.4.2 "Moving to Berlin" |
| |
| Kernel Images: |
| lvp Start LVP |

+ 1
- 1
target/lvp/x86/initrd/keymap

@ -1,7 +1,7 @@
#!/bin/bash
for x in `cat /proc/cmdline` ; do
if [[ $x = *keymap* ]] ; then
if [[ ${x} = *keymap* ]] ; then
keymap=`find /usr/share/kbd/keymaps -name "${x##*=}.map*" 2>/dev/null`
if [ -f "${keymap}" ] ; then
cd ${keymap%/*}

+ 2
- 2
target/lvp/x86/initrd/linuxrc

@ -28,8 +28,8 @@ EOF
ttydevs="vc/2 vc/3"
for x in $ttydevs ; do
( ( while : ; do agetty -i 38400 $x -n -l /bin/login-shell ; done ) & )
for x in ${ttydevs} ; do
( ( while : ; do agetty -i 38400 ${x} -n -l /bin/login-shell ; done ) & )
done
/bin/keymap

+ 36
- 32
target/lvp/x86/initrd/linuxrc2

@ -21,50 +21,54 @@ if [ ! -e /dev/cdroms/cdrom0 ] ; then
echo
echo "Press -<enter>- to shut down"
read
echo o >/proc/sysrq-trigger
echo -n o >/proc/sysrq-trigger
fi
first_pass=1
while : ; do
scan_for_lvp
echo "Found ${num_found} LVP Disks. Please choose one:"
choice=0
for x in ${lvp_drives} ; do
choice=$(( ${choice} + 1 ))
echo "${choice} ${x}"
done
echo
echo "r rescan devices"
echo "0 shut down"
echo -n "> "
read s
if [ "${s}" == "0" ] ; then
echo "Ejecting LVP Disks"
if [ ${num_found} -ne 1 -o ${first_pass} -eq 0 ] ; then
echo "Found ${num_found} LVP Disks. Please choose one:"
choice=0
for x in ${lvp_drives} ; do
eject -p ${x}
choice=$(( ${choice} + 1 ))
echo "${choice} ${x}"
eval "choice_${choice}=${x}"
done
echo
echo "Press -<enter>- to turn off the machine."
read
echo o >/proc/sysrq-trigger
while : ; do echo -n ; done
echo "r rescan devices"
echo "0 shut down"
read -p "> " s
if [ "${s}" == "0" ] ; then
echo "Ejecting LVP Disks"
for x in ${lvp_drives} ; do
eject -p ${x}
done
echo
echo "Press -<enter>- to turn off the machine."
read
echo -n o >/proc/sysrq-trigger
while : ; do echo -n ; done
fi
else
s=1
choice_1=${lvp_drives}
echo "Found LVP Disk in ${choice_1}. Starting ..."
fi
first_pass=0
exec 2>/dev/null
if [ ${s} -gt 0 -a ${s} -le ${num_found} ] ; then
choice=0
for x in ${lvp_drives} ; do
choice=$(( ${choice} + 1 ))
if [ ${choice} -eq ${s} ] ; then
mount ${x} /mnt
chroot /mnt /linuxrc
# man, this sucks
# sometimes the livesystem's linuxrc seems to be unable to umount everything...
for x in 1 2 3 4 5 6 7 8 9 0 ; do
umount /mnt/*
done
umount /mnt
fi
eval "x=\${choice_${s}}"
mount -n ${x} /mnt
chroot /mnt /linuxrc
# man, this sucks
# sometimes the livesystem's linuxrc seems to be unable to umount everything...
for x in 1 2 3 4 5 6 7 8 9 0 ; do
umount /mnt/* >/dev/null 2>&1
done
umount /mnt
eject ${x}
fi
exec 2>&1
done

+ 65
- 0
target/lvp/x86/livesystem/etc_lvp_10-encryption.sh

@ -0,0 +1,65 @@
#!/bin/bash
encryption_start() {
if [ -e /lvp.data1 ] ; then
numfiles=0
files=""
echo -n "Found "
for x in /lvp.data* ; do
echo -n "${x} "
numfiles=$(( ${numfiles} + 1 ))
files="${files} /dev/loop/${numfiles}"
done
echo
echo "Starting crypto-subroutine"
echo "Please choose which encryption you want to use:"
echo -e "\t1\tblowfish"
echo -e "\t2\ttwofish"
echo -e "\t3\tserpent"
echo
unset thisenc
while [ -z "${thisenc}" ] ; do
read -p "Please enter your choice: " rthisenc
[ "${rthisenc}" == "1" ] && thisenc="blowfish256"
[ "${rthisenc}" == "2" ] && thisenc="twofish256"
[ "${rthisenc}" == "3" ] && thisenc="serpent256"
done
echo "Using ${thisenc%256} encryption."
exec 2>/dev/null
while [ ! -e /mnt1/lvp.xml ] ; do
read -p "Please enter passphrase: " -s passphrase
echo
for x in /lvp.data* ; do
echo "${passphrase}" | losetup -e ${thisenc} -p 0 /dev/loop/${x#/lvp.data} ${x}
done
mdadm --build /dev/md/0 -l linear -n ${numfiles} ${files}
mount /dev/md/0 /mnt1
if [ ! -e /mnt1/lvp.xml ] ; then
echo "Wrong Passphrase!"
mdadm /dev/md/0 -S
for x in /lvp.data* ; do
losetup -d /dev/loop/${x#/lvp.data}
done
fi
done
exec 2>&1
fi
}
encryption_stop(){
exec 2>/dev/null
umount /mnt1
mdadm /dev/md/0 -S
for x in /lvp.data* ; do
losetup -d /dev/loop/${x#/lvp.data}
done
exec 2>&1
}
encryption_(){
echo "Uh-Oh"
}
eval "encryption_${1}"

target/lvp/x86/livesystem/etc_lvp_xf86config.sh → target/lvp/x86/livesystem/etc_lvp_80-xf86config.sh

@ -31,13 +31,21 @@ detect_card_old() {
return 0
}
if [ `grep -c oldxconfig /proc/cmdline` -eq 1 ] ; then
echo "Running old X-Config"
detect_card_old
cat /etc/X11/XF86Config | sed "s,LVPDEVICE,${driver},g" >/tmp/XF86Config
else
echo -n "Running integrated XFree86-Autoconfiguration ... "
HOME="/tmp" /usr/X11/bin/X -configure -logfile /dev/null >/dev/null 2>&1
mv /tmp/XF86Config.new /tmp/XF86Config
echo "done"
fi
xf86config_start(){
if [ `grep -c oldxconfig /proc/cmdline` -eq 1 ] ; then
echo "Running old X-Config"
detect_card_old
cat /etc/X11/XF86Config | sed "s,LVPDEVICE,${driver},g" >/tmp/XF86Config
else
echo -n "Running integrated XFree86-Autoconfiguration ... "
HOME="/tmp" /usr/X11/bin/X -configure -logfile /dev/null >/dev/null 2>&1
mv /tmp/XF86Config.new /tmp/XF86Config
echo "done"
fi
}
xf86config_stop(){
echo -n
}
eval "xf86config_${1}"

+ 0
- 41
target/lvp/x86/livesystem/etc_lvp_encryption.sh

@ -1,41 +0,0 @@
#!/bin/bash
if [ -e /lvp.data1 ] ; then
echo -n "Found "
for x in /lvp.data* ; do
echo -n "$x "
done
echo
echo "Starting crypto-subroutine"
echo "Please choose which encryption you want to use:"
echo -e "\t1\tblowfish"
echo -e "\t2\ttwofish"
echo -e "\t3\tserpent"
echo
unset thisenc
while [ -z "${thisenc}" ] ; do
read -p "Please enter your choice: " rthisenc
[ "${rthisenc}" == "1" ] && thisenc="blowfish256"
[ "${rthisenc}" == "2" ] && thisenc="twofish256"
[ "${rthisenc}" == "3" ] && thisenc="serpent256"
done
echo "Using ${thisenc%256} encryption."
while [ ! -e /mnt1/lvp.xml ] ; do
read -p "Please enter passphrase: " -s passphrase
echo
exec 2>/dev/null
for x in /lvp.data* ; do
echo "${passphrase}" | losetup -e ${thisenc} -p 0 /dev/loop/${x#/lvp.data} ${x}
mount /dev/loop/${x#/lvp.data} /mnt${x#/lvp.data} 2>&1
done
if [ ! -e /mnt1/lvp.xml ] ; then
echo "Wrong Passphrase!"
for x in /lvp.data* ; do
losetup -d /dev/loop/${x#/lvp.data}
done
fi
exec 2>&1
done
fi

+ 1
- 1
target/lvp/x86/livesystem/etc_profile

@ -1 +1 @@
export PATH="$PATH:/usr/X11/bin"
export PATH="${PATH}:/usr/X11/bin"

+ 8
- 7
target/lvp/x86/livesystem/linuxrc

@ -17,18 +17,19 @@ exec < /dev/console > /dev/console 2> /dev/console ; cd /
export PATH="/sbin:/bin:/usr/sbin:/usr/bin"
for x in /etc/lvp/*.sh ; do
if [ -f "$x" ] ; then
echo ; echo "Running $x ..." ; sh $x
echo "Setup script $x finished."
if [ -f "${x}" ] ; then
echo ; echo "Starting ${x##*/} ..." ; sh ${x} start
echo "Setup script ${x##*/} finished."
fi
done
/sbin/startlvp
exec 2>/dev/null
for x in /mnt* ; do
umount ${x}
losetup -d /dev/loop/${x#/mnt}
for x in /etc/lvp/*.sh ; do
if [ -f "${x}" ] ; then
echo ; echo "Stopping ${x##*/} ..." ; sh ${x} stop
echo "Setup script ${x##*/} finished."
fi
done
umount /proc

+ 6
- 0
target/lvp/x86/release_skeleton/ChangeLog

@ -1,3 +1,9 @@
binary_release 0.4.2
Benjamin Schieder:
* we now use a linear RAID for better disc usage
* add detection of more than one title per LVP
binary_release 0.3.0-1 - binary_release 0.4.0
Benjamin Schieder:

+ 3
- 3
target/lvp/x86/release_skeleton/scripts/cleanup

@ -2,14 +2,14 @@
echo "Warning: This will delete all video files in the directory livesystem/"
read -p "Are you sure [yes/no] ? " sure
[ "$sure" != "yes" ] && exit
[ "${sure}" != "yes" ] && exit
for x in livesystem/* ; do
found=0
for y in bin boot dev etc home lib linuxrc opt proc root sbin sys tmp usr var ; do
[ "${x#livesystem/}" == "$y" ] && found=1
[ "${x#livesystem/}" == "${y}" ] && found=1
done
[ $found -eq 1 ]&& continue
[ ${found} -eq 1 ] && continue
echo -n "removing ${x#livesystem/} ... "
rm -rf livesystem/${x#livesystem/}
echo "done"

+ 2
- 22
target/lvp/x86/release_skeleton/scripts/create_lvp

@ -4,7 +4,7 @@
if [ ! -e .config ] ; then
echo "${bold}${red}No configuration found!${normal}"
echo "run ./config.sh first!"
echo "Run ./config.sh first!"
exit 1
fi
@ -14,7 +14,7 @@ for x in create_lvpxml encrypted plain ; do
. scripts/${x}
done
moviefiles="/tmp/lvp_moviefiles.$$"
moviefiles="/tmp/lvp_moviefiles.${$}"
trap "rm -f ${moviefiles}" EXIT
trap "exit 1" INT
@ -55,24 +55,4 @@ if [ ${error} -gt 0 ] ; then
[ ${?} -eq 1 ] && exit 1
fi
for module in twofish blowfish serpent ; do
eval "encryption_${module}=0"
modprobe loop_${module} >/dev/null 2>&1 && eval "encryption_${module}=1"
done
encryption_available=0
[ ${encryption_twofish} -eq 1 -o ${encryption_blowfish} -eq 1 -o ${encryption_serpent} -eq 1 ] && encryption_available=1
if [ ${encryption_available} -eq 0 ] ; then
echo "Sorry, you do not have loop-aes on your system. Please have a look at"
echo "http://loop-aes.sourceforge.net"
exit 1
fi
eval "avail=\${encryption_${LVP_ENCRYPTION}}"
if [ "${avail}" == "0" ] ; then
echo "Sorry, ${LVP_ENCRYPTION} is not available on your system."
exit 1
fi
eval "process_${LVP_TYPE}"

+ 30
- 18
target/lvp/x86/release_skeleton/scripts/create_lvpxml

@ -7,13 +7,13 @@ usage_create_lvpxml() {
process_create_lvpxml() {
unset files
unset title
unset titleold
offset=0
for x in `printenv | grep ^file_ | cut -f1 -d=` ; do
[ ! -z "${files}" ] && files="${files}\n"
files="${files}${x}"
[ -z "${title}" ] && eval "title=\${${x}}"
done
title=${title##*/}
title=${title%% -*}
files=`echo -e ${files} | sort`
@ -21,38 +21,50 @@ process_create_lvpxml() {
touch ${lvpxml}
echo "Creating lvp.xml file"
read -p "Enter title of this LVP [${title}]: " tmp
[ ! -z "${tmp}" ] && title="${tmp}"
cat > ${lvpxml} << EOF
<lvp>
<item type="text">
<position x="0" y="90">
<size w="5" h="5">
<text>${title}</text>
</item>
EOF
echo "<lvp>" >${lvpxml}
item=0
for file in ${files} ; do
eval "file=\${${file}}" # dereference the variable to get the real file
title=${file##*/}
title=${title%% -*}
if [ "${title}" != "${titleold}" ] ; then
titleold=${title}
echo "Found possible new title \"${title}\""
confirm "Do you want to start a new headline?"
if [ ${?} -eq 0 ] ; then
[ ${offset} -gt 0 ] && offset=$(( ${offset} + 2 ))
[ $(( ${item} % 4 )) -gt 0 ] && item=$(( ${item} + ( 4 - ( ${item} % 4 ) ) ))
read -p "Please enter new title [${title}]: " tmp
[ ! -z "${tmp}" ] && title="${tmp}"
cat >> ${lvpxml} <<-EOF
<item type="text">
<position x="0" y="$(( 95 - ((${item} - (${item} % 4)) / 4) * 15 - ${offset} ))">
<size w="5" h="5">
<text>${title}</text>
</item>
EOF
offset=$(( ${offset} + 10 ))
fi
fi
button_text=${file%.*}
button_text=${button_text##*- }
read -p "Enter button text for ${file} [${button_text}]: " tmp
[ ! -z "${tmp}" ] && button_text=${tmp}
cat >> ${lvpxml} << EOF
<item type="button">
<position x="$(( (${item} % 4) * 50 - 75 ))" y="$(( 80 - ((${item} - (${item} % 4)) / 4) * 15))" />
<position x="$(( (${item} % 4) * 50 - 75 ))" y="$(( 95 - ((${item} - (${item} % 4)) / 4) * 15 - ${offset} ))" />
<action>/usr/bin/mplayer -fs -zoom ${mplayer_param} '${file}'</action>
<size w="40" h="10" />
<text>${button_text}</text>
</item>
EOF
# a little "special" for multi-language anime
#if [ "${file##*.}" == "ogm" ] ; then
#if [ "${file##*.}" == "avi" ] ; then
#cat >> ${lvpxml} << EOF
#<item type="button">
#<position x="$(( (${item} % 4) * 50 - 75 ))" y="$(( 80 - ((${item} - (${item} % 4)) / 4) * 15 - 7))" />
#<position x="$(( (${item} % 4) * 50 - 75 ))" y="$(( 95 - ((${item} - (${item} % 4)) / 4) * 15 - 7 - ${offset} ))" />
#<action>/usr/bin/mplayer -aid 2 -sid 3 -fs -zoom '${file}'</action>
#<size w="40" h="4" />
#<text>jap</text>

+ 93
- 43
target/lvp/x86/release_skeleton/scripts/encrypted

@ -6,6 +6,38 @@ entrosource="${LVP_ENTROPY_SOURCE}"
process_encrypted(){
target="livesystem"
for module in twofish blowfish serpent ; do
eval "encryption_${module}=0"
modprobe loop_${module} >/dev/null 2>&1 # fails for kernel >= 2.5.48 if module already loaded
[ `lsmod | grep -c "loop_${module}"` -eq 1 ] && eval "encryption_${module}=1"
done
encryption_available=0
[ ${encryption_twofish} -eq 1 -o ${encryption_blowfish} -eq 1 -o ${encryption_serpent} -eq 1 ] && \
encryption_available=1
if [ ${encryption_available} -eq 0 ] ; then
echo "Sorry, you do not have loop-aes on your system. Please have a look at"
echo "http://loop-aes.sourceforge.net"
exit 1
fi
eval "avail=\${encryption_${LVP_ENCRYPTION}}"
if [ "${avail}" == "0" ] ; then
echo "Sorry, ${LVP_ENCRYPTION} is not available on your system."
echo "Please check your kernel configuration."
exit 1
fi
echo "Loading kernel module for linear mode"
modprobe linear 2>&1 >/dev/null || true
if ! grep -q linear /proc/mdstat ; then
echo "Sorry, you don't have linear RAID support in your kernel."
echo "Since V0.4.2 this is required for encrypted LVPs to use"
echo "available disk space more efficiently."
exit 1
fi
echo -n "Checking necessary filesystem size ... "
filesize=0
@ -19,12 +51,13 @@ process_encrypted(){
echo -n "Checking Livesystem size ... "
livesize=`du -sb ${target} --exclude=lvp.data? | cut -f1`
livesize=$(( ${livesize} + `du -sb isolinux | cut -f1` ))
echo "`human_readable ${livesize}`"
filesize=$(( $filesize + $livesize ))
filesize=$(( ${filesize} + ${livesize} ))
echo
echo "Total space needed: $(( ${filesize} / 1024 / 1024 )) MB"
if [ $(( ${filesize} / 1024 / 1024 )) -gt $size ] ; then
if [ $(( ${filesize} / 1024 / 1024 )) -gt ${size} ] ; then
echo
echo "This may be more than fits onto your medium."
echo "You specified ${size} MB to fit onto your medium."
@ -51,12 +84,22 @@ process_encrypted(){
fi
done
if [ ${needed_loopdevices} -gt 0 ] ; then
echo "Not enough free loop-devices found!"
echo "Please either free ${needed_loopdevices} more loop-devices"
echo "(check with losetup -a) or increase the"
echo "number of available loop-devices."
exit 1
fi
echo "Okay, Now creating files that will hold the pseudo filesystems"
unset ddparam
[ `dd --help | grep -c stat` -eq 1 ] && ddparam="conv=stat"
unset cpparam
cp -D ${moviefiles} /dev/null 2>&1 >/dev/null && cpparam="-D"
if [ -e livesystem/lvp.data1 ] ; then
for x in livesystem/lvp.data* ; do
if [ -e ${target}/lvp.data1 ] ; then
for x in ${target}/lvp.data* ; do
if [ ${x##*lvp.data} -gt ${needed_pseudofs} ] ; then\
echo "Found ${x##*/}, but we don't need it. Deleting it."
rm -f ${x}
@ -68,7 +111,7 @@ process_encrypted(){
while [ ${filesystem} -lt ${needed_pseudofs} ] ; do
filesystem=$(( ${filesystem} + 1 ))
echo "Filesystem ${filesystem} of ${needed_pseudofs}"
file="livesystem/lvp.data${filesystem}"
file="${target}/lvp.data${filesystem}"
if [ ${filesystem} -lt ${needed_pseudofs} ] ; then
size=2147481600
@ -83,21 +126,17 @@ process_encrypted(){
echo "lvp.data${filesystem} already exists and has correct filesize. Using it."
else
echo "lvp.data${filesystem} already exists but has wrong filesize. Deleting it"
rm -f livesystem/lvp.data${filesystem}
rm -f ${target}/lvp.data${filesystem}
fi
fi
[ -f livesystem/lvp.data${filesystem} ] && continue
dd if=/dev/${entrosource} of=livesystem/lvp.data${filesystem} \
bs=2k count=$(( $size / 2048 )) ${ddparam}
[ -f ${target}/lvp.data${filesystem} ] && continue
dd if=/dev/${entrosource} of=${target}/lvp.data${filesystem} \
bs=2k count=$(( ${size} / 2048 )) ${ddparam}
done
echo "Creating mountpoints"
rm -rf livesystem/mnt*
filesystem=1
while [ ${filesystem} -le ${needed_pseudofs} ] ; do
mkdir -p livesystem/mnt${filesystem}
filesystem=$(( ${filesystem} + 1 ))
done
echo "Creating mountpoint"
rm -rf ${target}/mnt*
mkdir ${target}/mnt1
echo "Using ${LVP_ENCRYPTION} encryption."
@ -107,13 +146,14 @@ process_encrypted(){
while [ "${passphrase}" != "${passphrase_confirm}" ] ; do
read -p "Enter passphrase: " -s passphrase
echo
read -p "Confirm: " -s passphrase_confirm
echo
if [ "${passphrase:20}" = "" ] ; then
echo "The Passphrase must be at lest 20 characters!"
echo "The Passphrase must be at least 20 characters!"
passphrase="MEEP"
passphrase_confirm="MOOP"
continue
fi
read -p "Confirm: " -s passphrase_confirm
echo
if [ "${passphrase}" != "${passphrase_confirm}" ] ; then
echo "The passphrases do not match."
fi
@ -123,59 +163,69 @@ process_encrypted(){
lvpdata=1
while [ ${lvpdata} -le ${needed_pseudofs} ] ; do
eval "lodev=\${loopdevice_${lvpdata}}"
file="livesystem/lvp.data${lvpdata}"
file="${target}/lvp.data${lvpdata}"
echo "Setting up loopdevice ${lvpdata}"
echo "${passphrase}" | losetup -p 0 -e ${LVP_ENCRYPTION}256 ${lodev} ${file}
lvpdata=$(( ${lvpdata} + 1 ))
done
echo "Creating Filesystem ${lvpdata}"
mkfs.ext2 -m 0 ${lodev} >/dev/null 2>&1
echo "Mounting Filesystem ${lvpdata}"
mount ${lodev} livesystem/mnt${lvpdata}
rm -rf livesystem/mnt${lvpdata}/*
echo "Setting up linear device"
mddev=""
for x in /dev/md/* ; do
[ ! -z "${mddev}" ] && break
[ `mdadm --misc -Q ${x} | grep -c "not active"` -eq 1 ] && mddev="${x}"
done
mdloopdevs=""
lvpdata=1
while [ ${lvpdata} -le ${needed_pseudofs} ] ; do
eval "mdloopdevs=\"\${mdloopdevs} \${loopdevice_${lvpdata}}\""
lvpdata=$(( ${lvpdata} + 1 ))
done
${target}/sbin/mdadm --build ${mddev} -l linear -n ${needed_pseudofs} ${mdloopdevs}
echo "Creating filesystem on ${mddev}"
mkfs.ext2 -m 0 ${mddev} >/dev/null 2>&1
echo "Mounting filesystem ${mddev}"
mount ${mddev} ${target}/mnt1
rm -rf ${target}/mnt1/*
continue=0
while read file ; do
[ ! -f "${file}" ] && continue
[ ${continue} -eq 1 ] && continue
[ ${continue} -eq 1 ] && break
unset target
unset targetdir
thisfile=`ls -l "${file}" | sed 's, *, ,g' | cut -f5 -d' '`
for dir in livesystem/mnt? ; do
for dir in ${target}/mnt? ; do # I leave this here for historical reasons, maybe we need it again some day
avail=`df -P ${dir} | grep / | sed 's, *, ,g' | cut -f4 -d' '`
avail=$(( ${avail} * 1024 ))
[ -z "${target}" -a ${avail} -gt ${thisfile} ] && target=${dir}
[ -z "${targetdir}" -a ${avail} -gt ${thisfile} ] && targetdir=${dir}
done
if [ -z "${target}" ] ; then
if [ -z "${targetdir}" ] ; then
echo "Not enough space available for ${file}. Skipping remaining files." >&2
continue=1
fi
[ ${continue} -eq 1 ] && continue
echo "Copying ${file} to ${target}/${file##*/}"
if [ -z "${ddparam}" ] ; then
cp "${file}" "${target}/${file##*/}"
else
dd "if=${file}" "of=${target}/${file##*/}" bs=1k ${ddparam}
fi
echo "Copying ${file} to ${targetdir}/${file##*/}"
cp ${cpparam} "${file}" "${targetdir}/${file##*/}"
environment="`echo ${file} | tr '[. \-!]' '_'`"
eval "export file_${environment##*/}=\"${target#*livesystem}/${file##*/}\""
eval "export file_${environment##*/}=\"${targetdir#*${target}}/${file##*/}\""
done < ${moviefiles}
lvpxml=livesystem/mnt1/lvp.xml
lvpxml=${target}/mnt1/lvp.xml
process_create_lvpxml
echo "Umounting filesystem ${mddev}"
umount ${mddev}
echo "Shutting down ${mddev}"
mdadm ${mddev} -S
lvpdata=${needed_pseudofs}
while [ ${lvpdata} -ge 1 ] ; do
echo "Umounting Filesystem ${lvpdata}"
umount livesystem/mnt${lvpdata}
eval "lodev=\${loopdevice_${lvpdata}}"
echo "Shutting down loopdevice ${lodev}"
losetup -d ${lodev}

+ 1
- 1
target/lvp/x86/release_skeleton/scripts/functions

@ -47,7 +47,7 @@ menu_init () {
# {{{ block_start
block_start () {
block_level=$(( ${block_level} + 2 ))
echo "$@"
echo "${@}"
}
# }}}
# {{{ block_end

+ 3
- 3
target/lvp/x86/release_skeleton/scripts/plain

@ -4,7 +4,7 @@ type_plain="plain"
usage_plain(){
cat >&2 <<EOF
Usage: $0 -type plain
Usage: ${0} -type plain
This will save the files in plain view on the medium.
This way you can view the content on any OS without the
need to boot the LVP. Of course, you can still do so :)
@ -45,11 +45,11 @@ process_plain(){
echo -n "Checking Livesystem size ... "
livesize=`du -sb ${target} | cut -f1`
echo "`human_readable ${livesize}`"
filesize=$(( $filesize + $livesize ))
filesize=$(( ${filesize} + ${livesize} ))
echo
echo "Total space needed: $(( ${filesize} / 1024 / 1024 )) MB"
if [ $(( ${filesize} / 1024 / 1024 )) -gt $size ] ; then
if [ $(( ${filesize} / 1024 / 1024 )) -gt ${size} ] ; then
echo
echo "This may be more than fits onto your medium."
echo "You specified ${size} MB to fit onto your medium."

Loading…
Cancel
Save