[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

[patch] casper: configure gksu+kdesu to use sudo



Daniel,
>> ...stop me :-)
>>     
> that's an easy one: send patches *scnr*
>   
if I could have done, I would have done :-) *scnr*

One idea free for you (you may take it or leave it):

lh_chroot_xnest : useful for easy customizations, this new live-helper
component simply starts an Xnest window for you to do your Debian live
Cd customizations: you can add software, configure installed packages,
change gnome/kde themes, add your media or documentation...and when you
are done, just close the Xnest windows and the build process will
continue and finish.

If I've been a programmer I would do this 1st. Together with a
step-by-step tutorials and a debian-live-user ml it would increase
project dissemination x10.

I just attach the basic code we had three years ago in Mediainlinux 3,
for you to review it. In a way it is _very_ primitive but hey! it was
three years ago :-)

Ciao, Marco

p.s. by the way my Saturday night with live-helper has become a Sunday
afternoon as I'm making ArtistX 0.3 at this moment. It's working flawlessly.
-------------- next part --------------
#!/bin/bash

# MediaInLinux Script - Copyright (C) 2003-4 bakunin - Andrea Marchesini 
#                                                <bakunin@autistici.org>
#
# This source code is free software; you can redistribute it and/or
# modify it under the terms of the GNU Public License as published 
# by the Free Software Foundation; either version 2 of the License,
# or (at your option) any later version.
#
# This source code is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
# Please refer to the GNU Public License for more details.
#
# You should have received a copy of the GNU Public License along with
# this source code; if not, write to:
# Free Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
#

NORMAL="\033[0m"
BOLD="\033[1m"

RED="\033[1;31m"
GREEN="\033[1;32m"
YELLOW="\033[1;33m"

trap ":" INT QUIT TSTP

## CHECK FUNCTIONS ###########################################################
check() {
  echo -e -n " ${YELLOW}-${NORMAL} Testing '$1' program... "

  if test -f /bin/$1;            then ok; return 0; fi
  if test -f /sbin/$1;           then ok; return 0; fi
  if test -f /usr/bin/$1;        then ok; return 0; fi
  if test -f /usr/sbin/$1;       then ok; return 0; fi
  if test -f /usr/local/bin/$1;  then ok; return 0; fi
  if test -f /usr/local/sbin/$1; then ok; return 0; fi

  echo -e "${RED}failed!${NORMAL}"
  return 1
}

check_dir() {
  echo -e -n " ${YELLOW}-${NORMAL} Testing '$1' directory... "

  if test -d $1; then ok; return 0; fi

  echo -e "${RED}failed!${NORMAL}"
  return 1
}

check_file() {
  echo -e -n " ${YELLOW}-${NORMAL} Testing '$1' file... "

  if test -e $1; then ok; return 0; fi

  echo -e "${RED}failed!${NORMAL}"
  return 1
}

quit () {
  echo -e "${RED}failed!${NORMAL}"
  exit 1
}

ok () {
  echo -e "${GREEN}ok!${NORMAL}"
}

## START! ####################################################################
echo -e "${BOLD}Welcome to ${YELLOW}MediaInLinux ${NORMAL}${BOLD}script!${NORMAL}\n\n"

echo -e "${BOLD}System checking...${NORMAL}"
check mv                             || exit 1
check cp                             || exit 1
check rm                             || exit 1
check mkdir                          || exit 1
check chmod                          || exit 1
check mount                          || exit 1
check mksquashfs                     || exit 1
check mkisofs                        || exit 1
check mkfs.ext2                      || exit 1
check cat                            || exit 1
check sed                            || exit 1
check id                             || exit 1
check_dir source                     || exit 1
check_dir mil                        || exit 1
check_dir mil/isolinux               || exit 1
check_file mil/isolinux/isolinux.cfg || exit 1
check_file /dev/null                 || exit 1

## CHECK ID ##################################################################
if ! test "`id -u`" = "0"; then
  echo -e "${RED}\n\nError: you must be root!!${NORMAL}"
  exit
fi

## CHECK PREVIUS ABNORMAL SESSIONS ###########################################
echo -e "${BOLD}\n\nChecking previus abnormal sessions... ${GREEN}failed is good!${NORMAL}"
check_file f1.msg_tmp && mv -f f1.msg_tmp mil/isolinux/f1.msg
check_dir source/src && mv -f source/src source/usr
check_dir source/tmp/lib && mv -f source/tmp/lib source/var
check_dir source/tmp/cache && mv -f source/tmp/cache source/var
check_dir initrd && rm -rf initrd
check_file initrd && rm -rf initrd
check_file initrd.img && rm -rf initrd.img
for i in `ls source/lib/modules/`; do
  check_dir source/tmp/$i/drivers && mv -f source/tmp/$i/drivers source/lib/modules/$i/kernel
  check_dir source/tmp/$i/fs && mv -f source/tmp/$i/fs source/lib/modules/$i/kernel
  check_file source/etc/kernels/$i 
  if test "$?" = "0"; then
    rm -r source/lib/modules/$i/modules.* >/dev/null 2>&1
    mv -f source/etc/kernels/$i/modules.* source/lib/modules/$i/
  fi
done
check_dir source/etc/kernels && rm -rf source/etc/kernels

## IMAGES ####################################################################

rm -rf source/tmp/* 

mkdir source/etc/kernels
for i in `ls source/lib/modules/`; do
  mkdir source/etc/kernels/$i
  for k in `cd source/lib/modules/$i; ls modules.*`; do
    mv -f source/lib/modules/$i/$k source/etc/kernels/$i
    ln -s /etc/kernels/$i/$k source/lib/modules/$i
    touch -a source/etc/kernels/$i
  done
done

echo -n -e "${BOLD}\n\nSquashfs usr... ${NORMAL}"
mv -f source/usr/src source/src    > /dev/null 2>&1
mksquashfs source/usr mil/fs/usrfs > /dev/null 2>&1 || quit
mv -f source/src/ source/usr       > /dev/null 2>&1
ok

echo -n -e "${BOLD}\n\nSquashfs modules... ${NORMAL}"
mksquashfs source/lib/modules mil/fs/modulesfs > /dev/null 2>&1 || quit
ok

echo -n -e "${BOLD}\n\nDump home... ${NORMAL}"
cd source
rm -f home/mediainlinux/.bash_history
tar cvfz ../mil/fs/homedump home >/dev/null 2>&1 || quit
cd ..
ok

for i in `/bin/ls --color=no source/var/log`; do 
  if test -f source/var/log/$i; then 
    echo > source/var/log/$i
  fi
done

if test -d source/var/log/ksymoops; then 
  rm -rf source/var/log/ksymoops/*
fi

echo -n -e "${BOLD}\n\nSquashfs varfs... ${NORMAL}"
mksquashfs source/var/lib mil/fs/varfs1 > /dev/null 2>&1 || quit
mksquashfs source/var/cache mil/fs/varfs2 > /dev/null 2>&1 || quit
ok

## INITRD ####################################################################
for i in `ls source/lib/modules/`; do
  echo -e "${BOLD}\n\nMaking initrd image ($i)... ${NORMAL}"
  mkdir initrd > /dev/null 2>&1
  echo -n -e " ${YELLOW}-${NORMAL} Copy: bin"
  cp -rp source/bin initrd
  echo -n " sbin"
  cp -rp source/sbin initrd
  echo -n " etc"
  cp -rp source/etc initrd
  echo -n " lib"
  mkdir source/tmp/$i
  mv -f source/lib/modules/$i/kernel source/tmp/$i
  if test -d source/lib/modules/$i/pcmcia; then
    mv -f source/lib/modules/$i/pcmcia source/tmp/$i
  fi
  mkdir -p source/lib/modules/$i/kernel/drivers
  cp -rfp source/tmp/$i/kernel/drivers/ide source/lib/modules/$i/kernel/drivers/      2>/dev/null
  cp -rfp source/tmp/$i/kernel/drivers/scsi source/lib/modules/$i/kernel/drivers/     2>/dev/null
  cp -rfp source/tmp/$i/kernel/drivers/usb source/lib/modules/$i/kernel/drivers/      2>/dev/null
  cp -rfp source/tmp/$i/kernel/drivers/ieee1394 source/lib/modules/$i/kernel/drivers/ 2>/dev/null
  mkdir source/lib/modules/$i/kernel/fs
  cp -rfp source/tmp/$i/kernel/fs/nls source/lib/modules/$i/kernel/fs                 2>/dev/null
  cp -rfp source/tmp/$i/kernel/fs/ext3 source/lib/modules/$i/kernel/fs                2>/dev/null
  cp -rfp source/tmp/$i/kernel/fs/squashfs source/lib/modules/$i/kernel/fs            2>/dev/null

  cp -rp source/lib initrd
  for k in `ls source/lib/modules/`; do
    if ! test "$k" = "$i"; then
      rm -rf initrd/lib/modules/$k
    fi
  done

  rm -rf source/lib/modules/$i/kernel
  if test -d source/tmp/$i/pcmcia; then
    mv -f source/tmp/$i/pcmcia source/lib/modules/$i/
  fi
  mv -f source/tmp/$i/kernel source/lib/modules/$i/

  echo -n " var"
  mv -f source/var/cache source/tmp
  mv -f source/var/lib source/tmp
  cp -rp source/var initrd
  mkdir initrd/var/cache
  mkdir initrd/var/lib
  mv -f source/tmp/cache source/var
  mv -f source/tmp/lib source/var
  echo

  echo -n -e " ${YELLOW}-${NORMAL} Create: boot"
  mkdir initrd/boot 
  echo -n " dev"
  mkdir initrd/dev
  echo -n " floppy"
  mkdir initrd/floppy
  echo -n " cdrom"
  mkdir initrd/cdrom
  echo -n " home"
  mkdir initrd/home
  echo -n " mnt"
  mkdir initrd/mnt
  echo -n " proc"
  mkdir initrd/proc
  echo -n " root"
  mkdir initrd/root
  cp source/home/mediainlinux/.bashrc initrd/root/
  cp source/home/mediainlinux/.bash_profile initrd/root/
  echo -n " sys"
  mkdir initrd/sys
  echo -n " tmp"
  mkdir initrd/tmp
  echo -n " usr"
  mkdir initrd/usr
  echo -n " mfs"
  mkdir initrd/mfs
  echo
  
  rm -f source/lib/modules/$i/modules.*
  mv -f source/etc/kernels/$i/* source/lib/modules/$i/

  SIZE_REAL=`du initrd | tail -n 1 | cut -f1`
  SIZE=`expr $SIZE_REAL + 1024`
  echo -e " ${YELLOW}-${NORMAL} Making the initrd image (size ${SIZE_REAL})...${NORMAL}"

  echo -e "   ${GREEN}*${NORMAL} Creating file size ${SIZE}... "
  dd if=/dev/zero of=initrd.img bs=${SIZE}k count=1 > /dev/null 2>&1
  echo -e "   ${GREEN}*${NORMAL} Making ext2 filesystem... "
  mkfs.ext2 -m0 -F initrd.img > /dev/null 2>&1
  
  echo -e "   ${GREEN}*${NORMAL} Mounting on loopback... "
  mkdir tmp
  mount -o loop initrd.img tmp
  echo -e "   ${GREEN}*${NORMAL} Copying data..."
  cp -rp initrd/* tmp/
  
  echo -e "   ${GREEN}*${NORMAL} Umounting initrd..."
  umount tmp
  
  echo -e "   ${GREEN}*${NORMAL} Removing work directories..."
  rm -rf initrd
  rm -rf tmp
  
  echo -e "   ${GREEN}*${NORMAL} Compressing initrd image..."
  mv -f initrd.img initrd
  gzip -9 initrd
  
  echo -e "   ${GREEN}*${NORMAL} Set bootsplash image..."
  chroot source /sbin/splash -s -f usr/share/splash/config/bootsplash-1024x768.cfg >> initrd.gz

  echo -e "   ${GREEN}*${NORMAL} Copying to isolinux path... "
  if ! test "`echo "$i" | grep "2.4"`" = ""; then mv initrd.gz mil/isolinux/initrd24.gz; fi
  if ! test "`echo "$i" | grep "2.6"`" = ""; then mv initrd.gz mil/isolinux/initrd26.gz; fi

  rm -f initrd.gz

done

rm -rf source/etc/kernels

## MAKE ISO ##################################################################
DATE=`date +%G%m%d`
cp -f mil/isolinux/f1.msg f1.msg_tmp
cat f1.msg_tmp | sed "s/XXX/${DATE}/g" > mil/isolinux/f1.msg

echo $DATE > mil/MediaInLinux
mkdir mil/scripts    >/dev/null 2>&1
cp -f $0 mil/scripts >/dev/null 2>&1

echo -n -e "${BOLD}\n\nWriting MANIFEST... ${NORMAL}"
cd mil
rm -f MANIFEST            >/dev/null 2>&1
ls --color=never -S -R -1 > ./MANIFEST
cd ..
ok

echo -e "${BOLD}\n\nMaking the iso...${NORMAL}"
mkisofs -o mediainlinux-${DATE}.iso \
	-R -r -J -V "MediaInLinux LiveCD" \
	-hide-rr-moved -l -no-emul-boot -boot-load-size 4 -boot-info-table \
	-b isolinux/isolinux.bin -c isolinux/boot.cat \
	-A "MediaInLinux LiveCD" mil

mv -f f1.msg_tmp mil/isolinux/f1.msg
rm -f mil/MediaInLinux
rm -f mil/MANIFEST
rm -f mil/fs/homedump
rm -f mil/fs/modulesfs
rm -f mil/fs/usrfs
rm -f mil/fs/varfs1
rm -f mil/fs/varfs2
rm -f mil/isolinux/initrd24.gz
rm -f mil/isolinux/initrd26.gz 

echo -n -e "${BOLD}\n\nSyncing... ${NORMAL}"
sync
ok

echo -e "${GREEN}\n\nBye :)${NORMAL}"
exit 0

# EOF #
-------------- next part --------------
#!/bin/bash

# MediaInLinux Script - Copyright (C) 2003-4 bakunin - Andrea Marchesini 
#                                                <bakunin@autistici.org>
#
# This source code is free software; you can redistribute it and/or
# modify it under the terms of the GNU Public License as published 
# by the Free Software Foundation; either version 2 of the License,
# or (at your option) any later version.
#
# This source code is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
# Please refer to the GNU Public License for more details.
#
# You should have received a copy of the GNU Public License along with
# this source code; if not, write to:
# Free Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
#

NORMAL="\033[0m"
BOLD="\033[1m"

RED="\033[1;31m"
GREEN="\033[1;32m"
YELLOW="\033[1;33m"

## CHECK FUNCTIONS ###########################################################
check() {
  echo -e -n " ${YELLOW}-${NORMAL} Testing '$1' program... "

  if test -f /bin/$1;            then ok; return 0; fi
  if test -f /sbin/$1;           then ok; return 0; fi
  if test -f /usr/bin/$1;        then ok; return 0; fi
  if test -f /usr/sbin/$1;       then ok; return 0; fi
  if test -f /usr/local/bin/$1;  then ok; return 0; fi
  if test -f /usr/local/sbin/$1; then ok; return 0; fi

  echo -e "${RED}failed!${NORMAL}"
  return 1
}

check_dir() {
  echo -e -n " ${YELLOW}-${NORMAL} Testing '$1' directory... "

  if test -d $1; then ok; return 0; fi

  echo -e "${RED}failed!${NORMAL}"
  return 1
}

check_file() {
  echo -e -n " ${YELLOW}-${NORMAL} Testing '$1' file... "

  if test -e $1; then ok; return 0; fi

  echo -e "${RED}failed!${NORMAL}"
  return 1
}

quit () {
  echo -e "${RED}failed!${NORMAL}"
  exit 1
}

ok () {
  echo -e "${GREEN}ok!${NORMAL}"
}

## START! ####################################################################
echo -e "${BOLD}Welcome to ${YELLOW}MediaInLinux ${NORMAL}${BOLD}script!${NORMAL}\n\n"

if ! test "`id -u`" = "0"; then
  echo -e "\n\n${RED}Error: You must be root!${NORMAL}"
  exit
fi

echo -e "${BOLD}System checking...${NORMAL}"
check mv             || exit 1
check cp             || exit 1
check rm             || exit 1
check mkdir          || exit 1
check chmod          || exit 1
check mount          || exit 1
check cat            || exit 1
check sed            || exit 1
check_file /dev/null || exit 1

if test -e ./MediaInLinux; then
  SRC=`pwd`/
elif test -e ../MediaInLinux; then
  SRC=`pwd`/../
else 
  echo -n -e "\n\n${BOLD}Give me the LiveCD directory: ${NORMAL}"
  read SRC
  if ! test -e $SRC/MediaInLinux; then
    echo -e "${RED}I can't find $SRC/MediaInLinux!${NORMAL}"
    exit 1
  fi
fi

echo -n -e "\n\n${BOLD}Give me the work directory [Default: $HOME/MediaInLinux/]: ${NORMAL}"
read DST

if test "$DST" = ""; then DST="$HOME/MediaInLinux"; fi

echo -n -e "\n\n${BOLD}Checking source directory: ${NORMAL}"
if ! test "`cat $SRC/MANIFEST | grep -v MANIFEST`" = "$(cd $SRC; ls --color=never -S -R -1 | grep -v MANIFEST)"; then
  echo -e "${RED}MANIFEST file check error!${NORMAL}"
  exit 1
fi
ok

if test -d "$DST"; then
  echo -n -e "\n\n${BOLD}Your work directory exists! Remove it? [y/N] ${NORMAL}"
  read RET
  
  if ! test "$RET" = "y" && ! test "$RET" = "Y"; then
    echo -e "${GREEN}Bye :)${NORMAL}"
    exit 1
  fi
fi
 
trap ":" INT QUIT TSTP

echo -e -n "\n\n${YELLOW}MediaInLinux `cat $SRC/MediaInLinux`${GREEN} - ${NORMAL}"
echo -e "${BOLD}Waiting for, please... ${NORMAL}"

echo -e -n "${YELLOW} - ${NORMAL}Creating tree directories... ${NORMAL}"
mkdir  $DST                                  >/dev/null 2>&1
rm -rf $DST/*                                >/dev/null 2>&1
mkdir  $DST/mil                              >/dev/null 2>&1
mkdir  $DST/mil/fs                           >/dev/null 2>&1
mkdir  $DST/mil/scripts                      >/dev/null 2>&1
mkdir  $DST/mil/extra                        >/dev/null 2>&1
mkdir  $DST/source                           >/dev/null 2>&1
ok
echo -e -n "${YELLOW} - ${NORMAL}Copying extra... ${NORMAL}"
cp -rf $SRC/extra/* $DST/mil/extra/          >/dev/null 2>&1
ok
echo -e -n "${YELLOW} - ${NORMAL}Copying scripts... ${NORMAL}"
cp -rf $SRC/scripts/* $DST/mil/scripts/      >/dev/null 2>&1
cp -rf $SRC/scripts/MediaInLinux.create $DST >/dev/null 2>&1
ok
echo -e -n "${YELLOW} - ${NORMAL}Copying isolinux... ${NORMAL}"
cp -rf $SRC/isolinux $DST/mil                >/dev/null 2>&1
mv -f  $DST/mil/isolinux/initrd24.gz $DST    >/dev/null 2>&1
ok

echo -e -n "${YELLOW} - ${NORMAL}Gunzip initrd24.gz... ${NORMAL}"
gunzip $DST/initrd24.gz                      >/dev/null 2>&1
ok

echo -e -n "${YELLOW} - ${NORMAL}Mounting and copying initrd... ${NORMAL}"
mkdir    $DST/tmp                            >/dev/null 2>&1
mount -o loop $DST/initrd* $DST/tmp          >/dev/null 2>&1
cp -rf   $DST/tmp/* $DST/source              >/dev/null 2>&1
umount   $DST/tmp
rm -rf   $DST/tmp
rm -rf   $DST/initrd*
ok

echo -e -n "${YELLOW} - ${NORMAL}Building home... ${NORMAL}"
rm -rf   $DST/home
cp -f    $SRC/fs/homedump $DST/source
(cd $DST/source; tar xvfz homedump >/dev/null 2>&1)
rm       $DST/source/homedump
ok

echo -e -n "${YELLOW} - ${NORMAL}Copying modules... ${NORMAL}"
mkdir    $DST/tmp                            >/dev/null 2>&1
mount -o loop $SRC/fs/modulesfs $DST/tmp     >/dev/null 2>&1
rm -rf   $DST/source/lib/modules/*           >/dev/null 2>&1
cp -rf   $DST/tmp/* $DST/source/lib/modules  >/dev/null 2>&1
umount   $DST/tmp
rm -rf   $DST/tmp
ok
echo -e -n "${YELLOW} - ${NORMAL}Building dependences... ${NORMAL}"
for i in `ls $DST/source/lib/modules`; do
  rm $DST/source/lib/modules/$i/modules.*                    >/dev/null 2>&1
  mv $DST/source/etc/kernels/$i/* $DST/source/lib/modules/$i >/dev/null 2>&1
done
rm -rf $DST/source/etc/kernels               >/dev/null 2>&1
ok

echo -e -n "${YELLOW} - ${NORMAL}Copying var... ${NORMAL}"
mkdir    $DST/tmp                            >/dev/null 2>&1
mount -o loop $SRC/fs/varfs1 $DST/tmp        >/dev/null 2>&1
cp -rf   $DST/tmp/* $DST/source/var/lib/     >/dev/null 2>&1
umount   $DST/tmp
mount -o loop $SRC/fs/varfs2 $DST/tmp        >/dev/null 2>&1
cp -rf   $DST/tmp/* $DST/source/var/cache    >/dev/null 2>&1
umount   $DST/tmp
rm -rf   $DST/tmp
ok

echo -e -n "${YELLOW} - ${NORMAL}Copying usr... ${NORMAL}"
mkdir    $DST/tmp                            >/dev/null 2>&1
mount -o loop $SRC/fs/usrfs $DST/tmp         >/dev/null 2>&1
cp -rf   $DST/tmp/* $DST/source/usr          >/dev/null 2>&1
umount   $DST/tmp                            >/dev/null 2>&1
rm -rf   $DST/tmp                            >/dev/null 2>&1
mkdir    $DST/source/usr/src                 >/dev/null 2>&1
ok

echo -e -n "${YELLOW} - ${NORMAL}Syncing... ${NORMAL}"
sync
ok

echo -e -n "${YELLOW} - ${NORMAL}Mounting file system proc and devfs... ${NORMAL}"
mount -t devfs devfs $DST/source/dev
mount -t proc proc $DST/source/proc
ok

echo -e -n "${YELLOW} - ${NORMAL}Search X server... ${NORMAL}"
if test "$DISPLAY" != ""; then
ok

cat > $DST/source/tmp/xnest.script <<EOF
#!/bin/bash

NORMAL="\\033[0m"
BOLD="\\033[1m"

RED="\\033[1;31m"
GREEN="\\033[1;32m"
YELLOW="\\033[1;33m"

start_graphic() {
  echo -e "\${YELLOW} - \${NORMAL}Choose you desktop manager:\${NORMAL}"
  echo -e "\${RED}*\${BOLD} kde\${NORMAL}"
  echo -e "\${RED}*\${BOLD} gnome\${NORMAL}"
  echo -e "\${RED}*\${BOLD} xfce\${NORMAL}"
  echo -e "\${RED}*\${BOLD} xfce4\${NORMAL}"
  echo -e "\${RED}*\${BOLD} enlightenment\${NORMAL}"
  echo -e "\${RED}*\${BOLD} larswm\${NORMAL}"
  echo -e "\${RED}*\${BOLD} windowmaker\${NORMAL}"
  echo -e "\${RED}*\${BOLD} icewm\${NORMAL}"
  echo -e "\${RED}*\${BOLD} fluxbox\${NORMAL}"
  echo -e "\${RED}*\${BOLD} twm\${NORMAL}"
  echo -e "\${RED}*\${BOLD} installer\${NORMAL}"
  echo -e "\${RED}*\${BOLD} pekwm\${NORMAL}"
  echo -e "\${RED}*\${BOLD} exit\${NORMAL}"
  
  echo -e -n "\${YELLOW} - \${NORMAL}Choose: \${NORMAL}"
  read CHOOSE
  
  if test \$CHOOSE = "kde"; then
    START=startkde
  
  elif test \$CHOOSE = "gnome"; then
    START=startgnome
  
  elif test \$CHOOSE = "enlightenment"; then
    START=enlightenment
  
  elif test \$CHOOSE = "larswm"; then
    START=larswm
  
  elif test \$CHOOSE = "xfce"; then
    START=xfwm
  
  elif test \$CHOOSE = "xfce4"; then
    GDK_USE_XFT=1
    export GDK_USE_XFT
    DISPLAY=":1" su mediainlinux -c xfbd4 >/dev/null 2>&1 &
    DISPLAY=":1" su mediainlinux -c xfce-mcs-manager >/dev/null 2>&1 &
    DISPLAY=":1" su mediainlinux -c xfwm4 >/dev/null 2>&1 &
    DISPLAY=":1" su mediainlinux -c "xfwm4 --daemon" >/dev/null 2>&1 &
    DISPLAY=":1" su mediainlinux -c xftaskbar4 >/dev/null 2>&1 &
    DISPLAY=":1" su mediainlinux -c "xfdeskmenu -button=3" >/dev/null 2>&1 &
    DISPLAY=":1" su mediainlinux -c xfdesktop >/dev/null 2>&1 &
    DISPLAY=":1" su mediainlinux -c xfce4-iconbox >/dev/null 2>&1 &
    START=xfce4-panel
  
  elif test \$CHOOSE = "windowmaker"; then
    START=wmaker
  
  elif test \$CHOOSE = "icewm"; then
    START=icewm
  
  elif test \$CHOOSE = "fluxbox"; then
    START=fluxbox
  
  elif test \$CHOOSE = "twm"; then
    START=twm
  
  elif test \$CHOOSE = "installer"; then
    START=installer
  
  elif test \$CHOOSE = "shell"; then
    bash -login
    return 0
  
  elif test \$CHOOSE = "exit"; then
    return 1
  
  else
    START=pekwm
  fi
  
  chmod 777 /tmp
  DISPLAY="localhost$DISPLAY" Xnest :1 &
  DISPLAY=":1" su mediainlinux -c \$START >/dev/null 2>&1

  return 0
}

for ((i=0;\$i<1;i=0)); do
  start_graphic
  if "\$?" = "1"; then
    exit 0
  fi
done

EOF
  SCRIPT="/tmp/xnest.script"
  chmod +x $DST/source/tmp/xnest.script

else
  failed
  SCRIPT="/bin/bash"
fi

echo -e "${YELLOW} - ${NORMAL}Chrooting... ${NORMAL}"
chroot $DST/source "$SCRIPT"

rm -rf $DST/source/tmp/xnest.script >/dev/null 2>&1

echo -e -n "${YELLOW} - ${NORMAL}Umounting file system proc and devfs... ${NORMAL}"
umount $DST/source/dev	>/dev/null 2>&1
umount $DST/source/proc	>/dev/null 2>&1
ok

echo -e "${GREEN}Bye :)${NORMAL}"

exit 0

# EOF #

Reply to: