Scripts for Grml

 Script download

 Remaster Grml

#! /bin/bash
#----------------------------------------------------------------------
# rg_remaster.sh (V 0.2-5)
# Description: remaster grml using HD installation
# Author: Werner P. Schulz <Diese E-Mail-Adresse ist vor Spambots geschützt! Zur Anzeige muss JavaScript eingeschaltet sein!>
# Created at: Sat 20 Sep 2014 09:22:34 AM UTC
# License: This file is licensed under the GPL v3.
#----------------------------------------------------------------------
# Last change Sa 10 Jan 2015 16:23:14 UTC [wps]

first_run() {
source $USG/rg_firstrun.sh
}

decompr_fs() {
mkdir /opt/grml/loop_squashfs $OGR
mount $LLMM/live/grml32-full/grml32-full.squashfs \
    /opt/grml/loop_squashfs -o loop -t squashfs > /dev/null
rsync -aH /opt/grml/loop_squashfs/* $OGR
umount /opt/grml/loop_squashfs
rm -R /opt/grml/loop_squashfs
}

fknrsc() {
$RSCMD /bin $OGR
$RSCMD /etc $OGR --exclude=/etc/fstab \
  --exclude=/etc/resolv.conf --exclude=/etc/X11/xorg.conf
$RSCMD /home $OGR --exclude=*/.ssh/* --exclude=*/.gnupg/* \
  --exclude=*/.mozilla/* --exclude=*/.mc/history \
  --exclude=*/.thumbnails/* --exclude=*/.cache/* \
  --exclude=/home/grml/.local/share/applications/rg_remaster.desktop
$RSCMD /lib $OGR --exclude=/lib/live/*
$RSCMD /opt $OGR --exclude=/opt/grml --exclude=/opt/debhelp
$RSCMD /root $OGR --exclude=/root/.ssh/* \
  --exclude=/root/.gnupg/* --exclude=/root/.mc/history
$RSCMD /sbin $OGR --exclude=/sbin/rg_remaster.sh
$RSCMD /usr $OGR --exclude=$USG/* --exclude=/usr/src/* \
  --exclude=/usr/sbin/rg_remaster.sh \
  --exclude=/usr/share/applications/rg_remaster.desktop
$RSCMD /var $OGR --exclude=/var/log/* --exclude=/var/tmp/* \
  --exclude=/var/backups/*.gz --exclude=/var/cache/apt/archives/* \
  --exclude=/var/cache/man/* --exclude=/var/cache/locate/* \
  --exclude=/var/cache/cups/* --exclude=/var/lib/apt/lists/* \
  --exclude=/var/lib/mlocate/*
}

calculate() {
S_REM="$(du -sb $OGR/ | awk '{print $1}')"
# measured values by the tests of new squashfs and new ISO
if [ "$(cat /root/vers.rg)" = "grml32" ]; then
  FAKT=38.774
  OVER=35050000
else
  FAKT=39.213
  OVER=480000000
fi
# calculate size
CFS_NEW=`echo "$S_REM *$FAKT /100" | bc`
ISO_NEW=`echo "$CFS_NEW + $OVER" | bc`
NEW_CFS=`echo "$CFS_NEW /1024 /1024" | bc`
NEW_ISO=`echo "$ISO_NEW /1024 /1024" | bc`
if [ $NEW_ISO -ge 700 ]; then
  HINT1="The ISO exceeds the capactiy of a CD with 700 MB."
else
  HINT1="The ISO may fit on a CD of 700 MB."
fi
}

calcul_2() {
# some calculations needed for 'fkncalcul()'
S_REM="$(du -sb $OGR/ | awk '{print $1}')"
S_SQFS="$(du -sb $LLMM/live/grml32-full/grml32-full.squashfs | awk '{print $1}')"
FAKTOR=`echo "scale=4; $S_SQFS *100 / $S_REM" | bc`
S_ISO="$(du -sb /opt/grml/iso/$KF | awk '{print $1}')"
OVER=`echo "$S_ISO - $S_SQFS" | bc`
CFS_NEW=`echo "$S_REM *$FAKTOR /100" | bc`
ISO_NEW=`echo "$CFS_NEW + $OVER" | bc`
NEW_CFS=`echo "$CFS_NEW /1024 /1024" | bc`
NEW_ISO=`echo "$ISO_NEW /1024 /1024" | bc`
$DGCMD --msgbox "Overhead gemessen: $OVER\nFaktor gemessen: $FAKTOR \
\nwirkliche ISO-Groesse: $S_ISO \nund berechnet: $ISO_NEW ($NEW_ISO)" 0 0
}

new_iso() {
if [ "$(cat /root/vers.rg)" = "grml96" ]; then
  if ! [ -e /lib/live/mount/medium/grml/grml64-full/md5sums_orig ]; then
    mv /lib/live/mount/medium/grml/grml64-full/md5sums \
      /lib/live/mount/medium/grml/grml64-full/md5sums_orig
  fi
  cd /lib/live/mount/medium/grml/grml32-full/
else
  cd /lib/live/mount/medium/GRML/grml32-full/
fi
find ../.. -type f -not -name md5sums -not -name isolinux.bin \
  -exec md5sum {} \; | sort -k 2 > md5sums
genisoimage -l -r -quiet -J -V "grml-remastered" \
  -no-emul-boot -boot-load-size 4 -boot-info-table \
  -b boot/isolinux/isolinux.bin -c boot/isolinux/boot.cat \
  -o /opt/grml/iso/$KF $LLMM
cd /opt/grml/iso
md5sum $KF > $KF.md5 && touch -r $KF $KF.md5
}

progress() {
echo ; echo -n "Please wait..."
while true
do
  echo -n "."
  sleep 4
done && echo -n "..done"
}

#--------------------- Main functions ---------------------------------
askprepare() {
# really destroy old stuff of remaster  
TLP="Prepare remaster enviroment"
START=$(date +'%s')
if [ -d $OGR ]; then
  $DGCMD --defaultno --yesno \
    "\nCaution! This will destroy your allready \
\nexisting remaster enviroment. Shall wo go on?" 0 0
  if [ $? = 0 ]; then
    $DGCMD --infobox "\nDestroy old remaster enviroment." 0 0
    progress &
    PGPID=$!
    rm -R /opt/grml
    disown $PGPID; kill $PGPID
    cp -f $USG/grml32-full.squashfs $LLMM/live/grml32-full/
    cp -f $USG/initrd.img $LLMM/boot/grml32full/
    fknprepare
  fi
else
  fknprepare
fi
}

#----------------------------------------------------------------------
fknprepare() {
$DGCMD --infobox "\nDecompress squashfs" 0 0
# decompress init ramdisk
mkdir -p /opt/grml/init_rd32 /opt/grml/iso
cd /opt/grml/init_rd32/
xz -dc $LLMM/boot/grml32full/initrd.img | cpio -i -d --no-absolute-filenames
# decompress compressed filesystem (squashfs)
lsmod | grep loop || modprobe loop
if [ -d /opt/grml/loop_squashfs ]; then
  umount /opt/grml/loop_squashfs
  rm -R /opt/grml/loop_squashfs
fi
progress &
PGPID=$!
decompr_fs
disown $PGPID; kill $PGPID
cp -f $OGR/etc/inittab /etc/
touch $OGR/etc/rg_grml_cd
TT="\nFinished 'Prepare enviroment'! \
\nUsed time: $(expr $(expr $(date +'%s') - $START) / 60) min. \
and $(expr $(expr $(date +'%s') - $START) % 60) sec."
$DGCMD --msgbox "$TT\n\nYou can find the remaster enviroment \
\nwithin the directory '/opt/grml'." 0 0
}

#----------------------------------------------------------------------
fknrsync() {
# RSync with modifications of HD Installation  
RSCMD="rsync -aH --quiet --delete --log-file=/tmp/rsync.log"
[ -e /tmp/rsync.log ] && rm /tmp/rsync.log
progress &
PGPID=$!
fknrsc
disown $PGPID; kill $PGPID
mkdir -p $OGR/var/cache/apt/archives/partial $OGR/var/lib/apt/lists/partial
$DGCMD --msgbox "Finished 'RSync with modifications'! \
\nYou can find your new grml filesystem \
\nwithin the directory '$OGR'." 0 0
}

#----------------------------------------------------------------------
fkncalcul() {
# calculate size of new squashfs and new ISO
$DGCMD --infobox "\nCalculate approximate sizes" 0 0
progress &
PGPID=$!
calculate
disown $PGPID; kill $PGPID
HINT="Calculated size for the new compressed filesystem \
\nsquashfs: $NEW_CFS MB and for for whole new ISO: $NEW_ISO MB"
$DGCMD --msgbox "\n$HINT\n\n$HINT1" 0 0
}

#----------------------------------------------------------------------
fknfinal() {
START=$(date +'%s')
# append datetime-item
RM_VERSION=$(date "+%y%m%d-%H%M")
RM_VSHORT=$(date "+%F")
KF="rg-grml_$RM_VERSION.iso"
[ -e $OGR/etc/grml_version.rescue ] && rm $OGR/etc/grml_version.rescue
echo "`cat $OGR/etc/grml_version |awk '{print $1 $2}'` \
  | remastered version: $KF" > $OGR/etc/grml_version.rescue
# check whether there is enough space for a new ISO
if [ "$(cat /root/vers.rg)" = "grml32" ]; then
  MIN_FREE=700000
  CUT_STRING=$(sed -ne'4p' $LLMMI/default.cfg | awk '{print $4}')
  sed -i "s/$CUT_STRING/(rg-grml_$RM_VSHORT)/" $LLMMI/default.cfg
else
  MIN_FREE=1100000
  CUT_STRING=$(sed -ne'4p' $LLMMI/grml32_full_default.cfg | awk '{print $4}')
  sed -i "s/$CUT_STRING/(rg-grml_$RM_VSHORT)/" $LLMMI/grml32_full_default.cfg
fi
HD_FREE=$(df / | tail -n1 | awk '{print $4}')
if [ $MIN_FREE -ge $HD_FREE ]; then
  $DGCMD --msgbox "\nNot enough free space to build a \
\nnew ISO! Make some removals in\nthe directory '/opt/grml/iso'" 0 0
  exit 1
fi
CUT_STRING=$(sed -ne'1p' $LLMM/boot/grub/grml32full_default.cfg | awk '{print $3}')
sed -i "s/$CUT_STRING/(rg-grml_$RM_VSHORT)\"/" $LLMM/boot/grub/grml32full_default.cfg
$DGCMD --infobox "\nStart creation of $KF \
\nBuilding of new initial RAM-disk \nand compressed filesystem." 0 0
# build new Initial RAM-disk
rm $LLMM/boot/grml32full/initrd.img
cd /opt/grml/init_rd32/
progress &
PGPID=$!
find . | cpio -oH newc \
  | xz -8 --check=crc32 > $LLMM/boot/grml32full/initrd.img
disown $PGPID; kill $PGPID
# build new Filesystem-Image
[ -e $LLMM/live/grml32-full/grml32-full.squashfs ] \
  && rm $LLMM/live/grml32-full/grml32-full.squashfs
progress &
PGPID=$!
mksquashfs $OGR $LLMM/live/grml32-full/grml32-full.squashfs \
  -comp gzip -b 256k -no-progress > /dev/null
disown $PGPID; kill $PGPID
$DGCMD --infobox "\nBuild new ISO" 0 0
# build new ISO
progress &
PGPID=$!
new_iso
disown $PGPID; kill $PGPID
update-grub
HINT="\n\nAfter reboot you can see the new ISO within \
\nthe Grub2 bootmenue as 'Grml Rescue System'."
# calcul_2
TT="\nFinished 'Build new ISO'! \
\nUsed time: $(expr $(expr $(date +'%s') - $START) / 60) min. \
and $(expr $(expr $(date +'%s') - $START) % 60) sec."
$DGCMD --msgbox "$TT $HINT" 0 0
}

#----------------------------------------------------------------------
fknusb() {
source $USG/rg_iso2usb.sh
}

#----------------------------------------------------------------------
fknadd() {
HINT="\ngnome-nettool gnome-system-monitor hardinfo \
\nncdu mlocate xfce4-screenshooter transmission \
\nvim-gtk diffuse geany info"
  $DGCMD --defaultno --yesno "\nThis will install some usefull \
\ntools to your Rescue_grml:$HINT\n\nShall wo go on?" 0 0
if [ $? = 0 ]; then
  echo 
  aptitude install ncdu mlocate xfce4-screenshooter gnome-nettool info \
    gnome-system-monitor hardinfo vim-gtk transmission geany diffuse
  cp /usr/share/rg-grml/rescue_add/* \
    /home/grml/.local/share/applications/
  chown -R grml:grml /home/grml/
fi
}

#------------------------  main  --------------------------------------
# can we use this script
DGCMD="dialog --aspect 12 --colors"
if [ "$(id -u)" != 0 ]; then
  $DGCMD --infobox "\nYou must be root to use this script!" 0 0
  exit 1
fi
if [ -r /etc/grml_cd ]; then
  $DGCMDHINT --infoboy "\nYou can use this script \
\nonly within a HD installation!" 0 0
  exit 1
fi
if [ -r /etc/rg_grml_cd ]; then
  $DGCMD --infobox "Please don't use an already remastered ISO" 0 0
  exit 1
fi
OGR=/opt/grml/remaster
USG=/usr/share/rg-grml
LLMM=/lib/live/mount/medium
LLMMI=$LLMM/boot/isolinux
# change something at first run
if ! [ -e /root/firstrun.rg ]; then
  first_run
fi
# show main menu
W1="Prepare enviroment within HD Installation"
W2="RSync with modifications of HD Installation"
W3="Calculate size of new squashfs and new ISO"
W4="Build new ISO from remastered Rescue_grml"
W5="Install new ISO to USB device"
W6="Add some other usefull tools for Rescue_grml"
while true; do
  if [ -d $OGR ]; then # prepare done
    W1="Do remaster from the beginning"
    if [ -e /root/add.rg ]; then # add tools done
      WAHL=`$DGCMD --menu "What to do?" 0 0 0 \
      "$W2" "" "$W3" "" "$W4" "" "$W5" "" "$W1" "" 3>&1 1>&2 2>&3`
    else
      WAHL=`$DGCMD --menu "What to do?" 0 0 0 \
      "$W2" "" "$W3" "" "$W4" "" "$W5" "" "$W6" "" "$W1" "" 3>&1 1>&2 2>&3`
    fi
  else
    WAHL=`$DGCMD --menu "What to do?" 0 0 0 \
    "$W1" "" "$W2" "" "$W3" "" "$W4" "" "$W5" "" "$W6" "" 3>&1 1>&2 2>&3`
  fi
  case "$WAHL" in
    $W1) askprepare;;
    $W2) fknrsync;;
    $W3) fkncalcul;;
    $W4) fknfinal;;
    $W5) fknusb;;
    $W6) fknadd;;
    *) break
  esac
done

Top

 First run

#----------------------------------------------------------------------
# rg_firstrun.sh is part of the remaster-script
# rg_remaster.sh (V 0.2-5)
# Author: Werner P. Schulz <Diese E-Mail-Adresse ist vor Spambots geschützt! Zur Anzeige muss JavaScript eingeschaltet sein!>
# License: This file is licensed under the GPL v3.
#----------------------------------------------------------------------
# Last change Sa 06 Dez 2014 11:38:16 CET [wps]

# for remaster we can only use grml32 or grml96
# within a 32 bit HD installation
if [ "`uname -r|grep 586`" = "" ]; then
  $DGCMD --infobox "Error! This is not a \
\n32 bit HD installation." 0 0
  exit 1
fi
if [ -d $LLMM/boot/grml32full -a -d $LLMM/boot/grml64full ]; then
  echo "grml96" > /root/vers.rg
  LLMMG=$LLMM/grml/grml32-full
elif [ -d $LLMM/boot/grml32full ]; then
  echo "grml32" > /root/vers.rg
  LLMMG=$LLMM/GRML/grml32-full
else
  $DGCMD --msgbox "Error! Please use either 'grml32-full' \
\nor 'grml96-full' version" 0 0
  exit 1
fi
# use LXDE as window manager
$DGCMD --title "$TLK" --defaultno --yesno \
  "\nCaution! You cannot use this script without the\
\ninstallation of LXDE metapackage. \nShall wo go on?" 0 0
if [ $? = 0 ]; then
  $DGCMD --title "$TLP" --infobox \
    "\nUpdate of package list and \ninstallation of LXDE." 0 0
  aptitude update
  aptitude install lxde tango-icon-theme gksu anacron grml-rescueboot
else
  exit 1
fi
# new menu 'Rescue CD' and 'GRML'
mkdir /etc/xdg/menus/applications-merged/
cp $USG/*.menu /etc/xdg/menus/applications-merged/
cp $USG/*.directory /usr/share/desktop-directories/
cp $USG/rg_halt $USG/rg_halt-reboot $USG/rg_what \
  $USG/rg_startx /usr/bin/
mkdir -p /home/grml/.local/share/applications/
cp $USG/rescue/* /home/grml/.local/share/applications/
mkdir -p /home/grml/.config/lxpanel/LXDE/panels/
cp $USG/panel /home/grml/.config/lxpanel/LXDE/panels/
mkdir /home/grml/.config/lxterminal/
cp $USG/lxterminal.conf /home/grml/.config/lxterminal/
mkdir /root/.config/lxterminal/
cp $USG/lxterminal.conf /root/.config/lxterminal/
cp -f $USG/sudoers /etc/
# change bootid
BID="$(cat $LLMM/conf/bootid.txt)"
CUT_STRING=$(sed -ne'4p' $USG/grml32full_default.cfg \
  | awk '{print $6}')
sed -i "s/$CUT_STRING/bootid=$BID/" $USG/grml32full_default.cfg
cp -f $USG/grml32full_default.cfg $LLMM/boot/grub/
if [ "$(cat /root/vers.rg)" = "grml96" ]; then
  CUT_STRING=$(sed -ne'6p' $USG/slx/grml32_full_default.cfg \
    | awk '{print $4}')
  sed -i "s/$CUT_STRING/bootid=$BID/" $USG/slx/grml32_full_default.cfg
  cp $USG/slx/grml32_full_default.cfg $USG/slx/grml.png \
    $USG/slx/vesamenu.cfg $LLMMI
  sed -i "s/menu DEFAULT//" $LLMMI/grml64_full_default.cfg
else
  CUT_STRING=$(sed -ne'6p' $USG/slx/default.cfg | awk '{print $5}')
  sed -i "s/$CUT_STRING/bootid=$BID/" $USG/slx/default.cfg
  cp $USG/slx/default.cfg $USG/slx/grml.png \
    $USG/slx/vesamenu.cfg $LLMMI
fi
# changes for start of Rescue_grml
cd /etc/init.d/
sed -e '/main grml-autoconfig/r /usr/share/rg-grml/ad_init' \
  grml-autoconfig > grml-autoconfig_1
mv -f grml-autoconfig_1 grml-autoconfig
chmod 755 grml-autoconfig
update-alternatives --set x-window-manager /usr/bin/startfluxbox
cp -f $USG/rg_inittab /etc/inittab
cp /home/grml/.xinitrc /home/grml/.xinitrc.orig
cp $USG/xinitrc.rescue /home/grml/.xinitrc.rescue
chown -R grml:grml /home/grml/
sed -i "s+timeout 300+timeout 0+" $LLMMI/isolinux.cfg
sed -i "s+quiet+quiet rgrescue startup=/usr/bin/rg_startx+" \
  /etc/default/grub
update-grub
cat << EOF >> /etc/default/grml-rescueboot
ISO_LOCATION="/opt/grml/iso/"
EOF
cat << EOF > /home/grml/.zshrc.local
alias su='sudo su'
EOF
# save origin files
cp $LLMM/live/grml32-full/grml32-full.squashfs $USG
cp $LLMM/boot/grml32full/initrd.img $USG
# eliminate bugs
logrotate /etc/logrotate.conf
mkdir -p /usr/share/app-install/desktop
cp -f $USG/desktop.conf /etc/xdg/lxsession/LXDE/
HINT="\n\nTip: To get root access within a terminal \
\ntype 'su'; otherwise you can use \
\n'Root Terminal' from the menu Rescue-CD. \
\n\nHave also a look at tty2-tty6 and tty11-tty12."
echo "done" > /root/firstrun.rg
$DGCMD --infobox "Reboot and use 'Remaster Grml' \
\nwithin the menu 'Rescue CD'.$HINT" 0 0
exit 0

Top

ISO to USB

#----------------------------------------------------------------------
# rg_iso2usb.sh is part of the remaster-script
# rg_remaster.sh (V 0.2-5)
# Author: Werner P. Schulz <Diese E-Mail-Adresse ist vor Spambots geschützt! Zur Anzeige muss JavaScript eingeschaltet sein!>
# License: This file is licensed under the GPL v3.
#----------------------------------------------------------------------
# Last change Sa 10 Jan 2015 16:27:04 UTC [wps]

# prepare USB device
driveselect() {
LIST=$(ls /dev/disk/by-id/usb-* 2> /dev/null | grep -v '\-part[0-9]')
if [ "$LIST" == "" ]; then
  $DGCMD --msgbox "Error! No USB device available." 0 0
  exit 1
fi
if ! [ -n "${DRIVELIST[*]}" ]; then
  for j in $LIST; do
  # for j in $(ls /dev/disk/by-id/usb-* 2> /dev/null | grep -v '\-part[0-9]'); do
    i=$(readlink -f $j | sed 's,/dev/,,')
    drive="${i##}"
    DRIVELIST[$((count++))]="$drive"
    DRIVELIST[$((count++))]="`echo "$(fdisk -l /dev/$i | grep "Disk /dev" \
      | awk '{print $5}')/(1024*1024)" | bc` "MB" $(cat /sys/block/$i/device/vendor)"
  done
fi
SEL=`$DGCMD --menu "$1" 0 0 0 "${DRIVELIST[@]}" 3>&1 1>&2 2>&3`
if [ $? = 1 ]; then
  exit 1
fi
}

TM="\nSelect an USB device (minimal size 4GB) \
\nto store your remastered MX version"
DRIVELIST=()
LIST=""
count=0
driveselect "$TM"
USB=/dev/$SEL
if [ -d $LLMM/boot/grml32full -a -d $LLMM/boot/grml64full ]; then
  HINT="\nCreate a 1st partition with at least 1200 MB formatted \
\nwith FAT32 and a 2nd partition formatted with ext4."
else
  HINT="\nCreate a 1st partition with at least 800 MB formatted \
\nwith FAT32 and a 2nd partition formatted with ext4."
fi
$DGCMD --defaultno --yesno "\nYou've selected a flash device at '$USB'. \
$HINT\n\nTake care not to format a wrong device! \
\nShall we go on with GParted?" 0 0
if [ $? = 0 ]; then
  START=$(date +'%s')
  gparted $USB
  $DGCMD --defaultno --yesno "\nShall we go on to copy all to USB?" 0 0
  if ! [ $? = 0 ]; then
    exit 1
  fi
  parted $USB set 1 boot on
  tune2fs -L persistence "$USB"2
  # copy filesystem et al to 1st partition
  MOUNT1=/media/"$SEL"1
  [ -d $MOUNT1 ] || mkdir $MOUNT1
  mount -o rw "$USB"1 $MOUNT1
  mkdir $MOUNT1/boot/ $MOUNT1/conf $MOUNT1/live
  rsync -aH $LLMM/boot/ $MOUNT1/boot/
  mv $MOUNT1/boot/isolinux/isolinux.bin $MOUNT1/boot/isolinux/syslinux.bin
  mv -f $MOUNT1/boot/isolinux/isolinux.cfg $MOUNT1/boot/isolinux/syslinux.cfg
  if [ "$(cat /root/vers.rg)" = "grml96" ]; then
    mkdir $MOUNT1/grml/
    rsync -aH $LLMM/grml/ $MOUNT1/grml/
    sed -i "s/rg_startx/rg_startx persistence/" \
      $MOUNT1/boot/isolinux/grml32_full_default.cfg
  else
    mkdir $MOUNT1/GRML/
    rsync -aH $LLMM/GRML/ $MOUNT1/GRML/
    sed -i "s/rg_startx/rg_startx persistence/" \
      $MOUNT1/boot/isolinux/default.cfg
  fi
  mv $MOUNT1/boot/isolinux $MOUNT1/boot/syslinux
  rsync -aH $LLMM/conf/ $MOUNT1/conf/
  [ -d $LLMM/efi ] && rsync -ah $LLMM/efi/ $MOUNT1/efi/
  rsync -aH --progress $LLMM/live/ $MOUNT1/live/
  # prepare persistence to 2nd parttion
  $DGCMD --infobox "\nMake USB device bootable." 0 0
  progress &
  PGPID=$!
  MOUNT2=/media/"$SEL"2
  [ -d $MOUNT2 ] || mkdir $MOUNT2
  mount -o rw "$USB"2 $MOUNT2
  echo "/ union" > $MOUNT2/persistence.conf
  syslinux -i "$USB"1
  dd conv=notrunc bs=440 count=1 \
    if=/usr/lib/SYSLINUX/mbr.bin of=$USB
  disown $PGPID; kill $PGPID
  umount $MOUNT1
  umount $MOUNT2
HINT="\nYou can unplug the USB stick"
TT="\nFinished! Used time: $(expr $(expr $(date +'%s') - $START) / 60) min. \
and $(expr $(expr $(date +'%s') - $START) % 60) sec."
$DGCMD --msgbox "$TT $HINT" 0 0
fi

Top