tazlito view tazlito @ rev 12

pave the road to flavors. Download packages support
author Pascal Bellard <pascal.bellard@slitaz.org>
date Tue Dec 11 19:15:58 2007 +0100 (2007-12-11)
parents 6310380198f9
children 685b1188fff4
line source
1 #!/bin/sh
2 # TazLito - SliTaz Live Tool.
3 #
4 # Tazlito is a tool to help generating and configuring SliTaz LiveCD
5 # ISO images. You can creat a custom distro in one command from a list of
6 # packages, extract a existing ISO image to hack it, creat new initramfs
7 # and/or new ISO. Most commands must be run by root, expect the stats
8 # and the configuration file manipulation.
9 #
10 # (C) 2007 SliTaz - GNU General Public License.
11 # Initial author : <pankso@slitaz.org>
12 #
13 VERSION=1.2
15 # Tazlito configuration variables to be shorter
16 # and to use words rater than numbers.
17 COMMAND=$1
18 LIST_NAME=$2
19 TMP_DIR=/tmp/tazlito-$$-$RANDOM
20 TOP_DIR=`pwd`
21 INITRAMFS=rootfs.gz
22 LZMA_INITRAMFS=rootfs.lz
23 LOCALSTATE=/var/lib/tazpkg
24 INSTALLED=$LOCALSTATE/installed
25 CACHE_DIR=/var/cache/tazpkg
26 MIRROR=$LOCALSTATE/mirror
28 # Try to include config file, continue if command is gen-config or exit.
29 # The main config used by default is in /etc/tazlito.
30 if [ -f "/etc/tazlito/tazlito.conf" ] ; then
31 CONFIG_FILE="/etc/tazlito/tazlito.conf"
32 fi
33 # Specific distro config file can be put in a distro tree.
34 if [ -f "$TOP_DIR/tazlito.conf" ] ; then
35 CONFIG_FILE="$TOP_DIR/tazlito.conf"
36 fi
37 if [ ! "$CONFIG_FILE" = "" ] ; then
38 . $CONFIG_FILE
39 else
40 if [ "$COMMAND" = "gen-config" ] ; then
41 continue
42 else
43 echo "Unable to find any configuration file. Please read the doc"
44 echo "or run '`basename $0` gen-config' to get an empty config file."
45 exit 0
46 fi
47 fi
49 # Set the rootfs and rootcd path with $DISTRO
50 # configuration variable.
51 ROOTFS=$DISTRO/rootfs
52 ROOTCD=$DISTRO/rootcd
54 #####################
55 # Tazlito functions #
56 #####################
58 # Print the usage.
59 usage ()
60 {
61 echo -e "\nSliTaz Live Tool - Version: $VERSION\n
62 \033[1mUsage: \033[0m `basename $0` [command] [list|iso] [dir]
63 \033[1mCommands: \033[0m\n
64 usage Print this short usage.
65 stats View Tazlito and distro configuration statistics.
66 gen-config Generate a new configuration file for a distro.
67 configure Configure the main config file or a specific tazlito.conf.
68 gen-iso Generate a new ISO from a distro tree.
69 gen-initiso Generate a new initramfs and ISO from the distro tree.
70 extract-distro Extract and ISO to a directory and rebuild LiveCD tree.
71 gen-distro Generated a Live distro and ISO from a list of packages.
72 clean-distro Remove all files generated by gen-distro.
73 addhacker Add Linux User Hacker to the current distro.
74 check-distro Help to check if distro is ready to release.
75 burn-iso Burn ISO image to a cdrom using Wodim.\n"
76 }
78 # Status function.
79 status()
80 {
81 local CHECK=$?
82 echo -en "\\033[70G[ "
83 if [ $CHECK = 0 ]; then
84 echo -en "\\033[1;33mOK"
85 else
86 echo -en "\\033[1;31mFailed"
87 fi
88 echo -e "\\033[0;39m ]"
89 }
91 yesorno()
92 {
93 echo -n "$1"
94 case "$DEFAULT_ANSWER" in
95 Y|y) answer="y";;
96 N|n) answer="n";;
97 *) read answer;;
98 esac
99 }
101 todomsg()
102 {
103 echo -e "\\033[70G[ \\033[1;31mTODO\\033[0;39m ]"
104 }
106 # Download a file trying each mirror
107 download()
108 {
109 for i in $(cat $MIRROR); do
110 wget $i$@
111 done
112 }
114 # Check if user is root.
115 check_root()
116 {
117 if test $(id -u) != 0 ; then
118 echo -e "\nYou must be root to run `basename $0` with this option."
119 echo -e "Please type 'su' and root password to become super-user.\n"
120 exit 0
121 fi
122 }
124 # Check for the rootfs tree.
125 check_rootfs()
126 {
127 if [ ! -d "$ROOTFS" ] ; then
128 echo -e "\nUnable to find a distro rootfs to check.\n"
129 exit 0
130 fi
131 }
133 # Check for the boot dir into the root CD tree.
134 verify_rootcd()
135 {
136 if [ ! -d "$ROOTCD/boot" ] ; then
137 echo -e "\nUnable to find the rootcd boot directory...\n"
138 exit 0
139 fi
140 }
142 # Gen a new ISO image using isolinux.
143 gen_livecd_isolinux()
144 {
145 if [ ! -f "$ROOTCD/boot/isolinux/isolinux.bin" ] ; then
146 echo -e "\nUnable to find isolinux binary.\n"
147 exit 0
148 fi
149 cd $DISTRO
150 echo ""
151 echo -e "\033[1mGenerating ISO image\033[0m"
152 echo "================================================================================"
153 genisoimage -R -o $ISO_NAME.iso -b boot/isolinux/isolinux.bin \
154 -c boot/isolinux/boot.cat -no-emul-boot -boot-load-size 4 \
155 -V "$VOLUM_NAME" -p "$PREPARED" -input-charset iso8859-1 \
156 -boot-info-table $ROOTCD
157 echo "================================================================================"
158 }
160 # Gen a new initramfs from the root file system.
161 gen_initramfs()
162 {
163 cd $ROOTFS
164 echo ""
165 # Use lzma if installed
166 if [ -x /usr/bin/lzma ]; then
167 echo -n "Generating cpio archive... "
168 find . -print | cpio -o -H newc | lzma e -si -so > $DISTRO/$LZMA_INITRAMFS
169 cd $DISTRO
170 mv $LZMA_INITRAMFS $ROOTCD/boot
171 # Remove eventual gziped initramfs and sed isolinux.cfg for the path
172 # to lzma rootfs ($LZMA_INITRAMFS)
173 rm -f $ROOTCD/boot/$INITRAMFS
174 sed -i s/$INITRAMFS/$LZMA_INITRAMFS/g $ROOTCD/boot/isolinux/isolinux.cfg
175 else
176 echo -n "Generating gziped initramfs... "
177 find . -print | cpio -o -H newc | gzip -9 > $DISTRO/$INITRAMFS
178 cd $DISTRO
179 mv $INITRAMFS $ROOTCD/boot
180 fi
181 }
183 # Print ISO and rootfs size.
184 distro_stats()
185 {
186 echo ""
187 echo -e "\033[1mDistro statistics\033[0m"
188 echo "================================================================================"
189 echo "Build date : `date +%Y%m%d\ \at\ \%H:%M:%S`"
190 echo "Packages : `ls -1 $ROOTFS/var/lib/tazpkg/installed | wc -l`"
191 echo "Rootfs size : `du -sh $ROOTFS`"
192 if [ -f $LZMA_INITRAMFS ]; then
193 echo "Initramfs size : `du -sh $ROOTCD/boot/$LZMA_INITRAMFS`"
194 else
195 echo "Initramfs size : `du -sh $ROOTCD/boot/$INITRAMFS`"
196 fi
197 echo "ISO image size : `du -sh $ISO_NAME.iso`"
198 echo "================================================================================"
199 echo ""
200 }
202 # Creat an empty configuration file.
203 empty_config_file()
204 {
205 cat >> tazlito.conf << "EOF"
206 # tazlito.conf: Tazlito (SliTaz Live Tool)
207 # configuration file.
208 #
210 # Name of the ISO image to generate.
211 ISO_NAME=""
213 # ISO image volum name.
214 VOLUM_NAME="SliTaz"
216 # Name of the preparator.
217 PREPARED="$USER"
219 # Path to the packages repository and the packages.list.
220 PACKAGES_REPOSITORY=""
222 # Path to the distro tree to gen-distro from a
223 # list of packages.
224 DISTRO=""
226 # Path to the directory contening additional files
227 # to copy into the rootfs and rootcd of the LiveCD.
228 ADDFILES="$DISTRO/addfiles"
230 # Default answer for binary question (Y or N)
231 DEFAULT_ANSWER="ASK"
232 EOF
233 }
235 ####################
236 # Tazlito commands #
237 ####################
239 case "$COMMAND" in
240 stats)
241 # Tazlito general statistics from the config file.
242 #
243 echo ""
244 echo -e "\033[1mTazlito statistics\033[0m
245 ===============================================================================
246 Config file : $CONFIG_FILE
247 ISO name : $ISO_NAME.iso
248 Volum name : $VOLUM_NAME
249 Prepared : $PREPARED
250 Packages repository : $PACKAGES_REPOSITORY
251 Distro directory : $DISTRO"
252 if [ ! "$ADDFILES" = "" ] ; then
253 echo -e "Additional files : $ADDFILES"
254 fi
255 echo "================================================================================"
256 echo ""
257 ;;
258 gen-config)
259 # Gen a new config file in the current dir or the specified
260 # directory by $2.
261 #
262 if [ -n "$2" ] ; then
263 mkdir -p $2 && cd $2
264 fi
265 echo -n "Generating empty tazlito.conf..."
266 empty_config_file
267 status
268 echo ""
269 if [ -f "tazlito.conf" ] ; then
270 echo "Configuration file is ready to edit."
271 echo "File location : `pwd`/tazlito.conf"
272 echo ""
273 fi
274 ;;
275 configure)
276 # Configure a tazlito.conf config file. Start by getting
277 # a empty config file and sed it.
278 #
279 if [ -f "tazlito.conf" ] ; then
280 rm tazlito.conf
281 else
282 if test $(id -u) = 0 ; then
283 cd /etc
284 else
285 echo "You must be root to configure the main config file or in"
286 echo "the same directory of the file you want to configure."
287 exit 0
288 fi
289 fi
290 empty_config_file
291 echo""
292 echo -e "\033[1mConfiguring :\033[0m `pwd`/tazlito.conf"
293 echo "================================================================================"
294 # ISO name.
295 echo -n "ISO name : " ; read answer
296 sed -i s#'ISO_NAME=\"\"'#"ISO_NAME=\"$answer\""# tazlito.conf
297 # Volum name.
298 echo -n "Volum name : " ; read answer
299 sed -i s/'VOLUM_NAME=\"SliTaz\"'/"VOLUM_NAME=\"$answer\""/ tazlito.conf
300 # Packages repository.
301 echo -n "Packages repository : " ; read answer
302 sed -i s#'PACKAGES_REPOSITORY=\"\"'#"PACKAGES_REPOSITORY=\"$answer\""# tazlito.conf
303 # Distro path.
304 echo -n "Distro path : " ; read answer
305 sed -i s#'DISTRO=\"\"'#"DISTRO=\"$answer\""# tazlito.conf
306 echo "================================================================================"
307 echo "Config file is ready to use."
308 echo "You can now extract an ISO or generate a distro."
309 echo ""
310 ;;
311 gen-iso)
312 # Simply generated a new iso.
313 #
314 check_root
315 verify_rootcd
316 gen_livecd_isolinux
317 distro_stats
318 ;;
319 gen-initiso)
320 # Simply generated a new initramfs with a new iso.
321 #
322 check_root
323 verify_rootcd
324 gen_initramfs
325 gen_livecd_isolinux
326 distro_stats
327 ;;
328 extract-distro)
329 # Extract a ISO image to a directory and rebuild the LiveCD tree.
330 #
331 check_root
332 ISO_IMAGE=$2
333 if [ -z "$ISO_IMAGE" ] ; then
334 echo -e "\nPlease specify the path to the ISO image."
335 echo -e "Example : `basename $0` image.iso /path/target\n"
336 exit 0
337 fi
338 # Set the distro path by checking for $3 on cmdline.
339 if [ -n "$3" ] ; then
340 TARGET=$3
341 else
342 TARGET=$DISTRO
343 fi
344 # Exit if existing distro is found.
345 if [ -d "$TARGET/rootfs" ] ; then
346 echo -e "\nA rootfs exist in : $TARGET"
347 echo -e "Please clean the distro tree or change directory path.\n"
348 exit 0
349 fi
350 echo ""
351 echo -e "\033[1mTazlito extracting :\033[0m $ISO_IMAGE"
352 echo "================================================================================"
353 # Start to mount the ISO.
354 echo ""
355 echo "Mounting ISO image..."
356 mkdir -p $TMP_DIR
357 # Get ISO file size.
358 isosize=`du -sh $ISO_IMAGE`
359 mount -o loop $ISO_IMAGE $TMP_DIR
360 sleep 2
361 # Prepare target dir, copy the kernel and the rootfs.
362 mkdir -p $TARGET/rootfs
363 mkdir -p $TARGET/rootcd/boot
364 echo -n "Copying the Linux kernel..."
365 cp $TMP_DIR/boot/bzImage $TARGET/rootcd/boot
366 status
367 echo -n "Copying isolinux files..."
368 cp -a $TMP_DIR/boot/isolinux $TARGET/rootcd/boot
369 status
370 echo -n "Copying the rootfs..."
371 cp $TMP_DIR/boot/rootfs.?z $TARGET/rootcd/boot
372 status
373 # Exract initramfs.
374 cd $TARGET/rootfs
375 echo -n "Extracting the rootfs... "
376 ( zcat ../rootcd/boot/rootfs.gz 2>/dev/null || \
377 lzma d ../rootcd/boot/rootfs.lz -so ) | cpio -id
378 # Umount and remove temp directory and cd to $TARGET to get stats.
379 umount $TMP_DIR && rm -rf $TMP_DIR
380 cd ..
381 echo ""
382 echo "================================================================================"
383 echo "Extracted : $ISO_IMAGE ($isosize)"
384 echo "Distro tree : `pwd`"
385 echo "Rootfs size : `du -sh rootfs`"
386 echo "Rootcd size : `du -sh rootcd`"
387 echo "================================================================================"
388 echo ""
389 ;;
390 gen-distro)
391 # Generate a live distro tree with a set of packages.
392 #
393 check_root
394 if [ -d $ROOTFS ] ; then
395 echo "A rootfs exist in : $DISTRO"
396 echo -e "Please clean the distro tree or change directory path.\n"
397 exit 0
398 fi
399 # First check for the main packages list then
400 # for a distro-packages.list in the current directory
401 # if none, check if a package list was specified on cmdline.
402 if [ -f "/etc/slitaz-tools/distro-packages.list" ] ; then
403 LIST_NAME="distro-packages.list"
404 fi
405 if [ -f "distro-packages.list" ] ; then
406 LIST_NAME="distro-packages.list"
407 fi
408 if [ -n "$2" ] ; then
409 if [ ! -f "$2" ] ; then
410 echo -e "\nUnable to find the specified packages list."
411 echo -e "List name : $2\n"
412 exit 0
413 else
414 LIST_NAME=$2
415 fi
416 fi
417 # Exit if no list name.
418 if [ "$LIST_NAME" = "" ] ; then
419 echo -e "\nNo packages list found or specified. Please read the doc.\n"
420 exit 0
421 fi
422 # Start generation.
423 echo ""
424 echo -e "\033[1mTazlito generating a distro\033[0m"
425 echo "================================================================================"
426 # Get the list of packages using cat for a file list.
427 LIST=`cat $LIST_NAME`
428 # Verify if all packages in list are presents in $PACKAGES_REPOSITORY.
429 for pkg in $LIST
430 do
431 pkg=${pkg%.tazpkg}
432 if [ ! -f $PACKAGES_REPOSITORY/$pkg.tazpkg ] ; then
433 echo -e "\nUnable to find $pkg in the repository."
434 echo -e "Path : $PACKAGES_REPOSITORY\n"
435 if [ -f $MIRROR ]; then
436 yesorno "Download packages from mirror (Y/n) ? "
437 [ "$answer" = "n" ] || break
438 fi
439 exit 1
440 fi
441 done
442 # Root fs stuff.
443 echo "Preparing the rootfs directory..."
444 mkdir -p $ROOTFS
445 sleep 2
446 for pkg in $LIST
447 do
448 local here=`pwd`
449 # First copy and extract the package in tmp dir.
450 pkg=${pkg%.tazpkg}
451 mkdir -p $TMP_DIR
452 if [ ! -f $PACKAGES_REPOSITORY/$pkg.tazpkg ]; then
453 # look for package in cache
454 if [ -f $CACHE_DIR/$pkg.tazpkg ]; then
455 ln -s $CACHE_DIR/$pkg.tazpkg $PACKAGES_REPOSITORY
456 else
457 # get package from mirror
458 download $pkg.tazpkg && mv $pkg.tazpkg $PACKAGE_REPOSITORY
459 fi
460 fi
461 if [ ! -f $PACKAGES_REPOSITORY/$pkg.tazpkg ]; then
462 echo "Missing package $pkg."
463 exit 1
464 fi
465 cp $PACKAGES_REPOSITORY/$pkg.tazpkg $TMP_DIR && cd $TMP_DIR
466 echo ""
467 echo -n "Installing $PACKAGE... "
468 cpio -id < $pkg.tazpkg && rm -f $pkg.tazpkg
469 echo -n "Extracting the file system... "
470 zcat fs.cpio.gz | cpio -id && rm fs.cpio.gz
471 # Copy all packages fs and receipt to the rootfs.
472 echo -n "Copying files to the rootfs..."
473 cp -a fs/* $ROOTFS
474 . $PWD/receipt
475 mkdir -p $ROOTFS$INSTALLED/$PACKAGE
476 # Copy the receipt, list of files and description if exist.
477 cp receipt $ROOTFS$INSTALLED/$PACKAGE
478 cp files.list $ROOTFS$INSTALLED/$PACKAGE
479 if [ -f "description.txt" ] ; then
480 cp description.txt $ROOTFS$INSTALLED/$PACKAGE
481 fi
482 status
483 cd $here
484 # Remove tmp dir to get a empty one for the next package.
485 rm -rf $TMP_DIR
486 done
487 echo ""
488 cd $DISTRO
489 # Copy all files from $ADDFILES/rootfs to the rootfs.
490 if [ -d "$ADDFILES/rootfs" ] ; then
491 echo -n "Copying addfiles content to the rootfs... "
492 cp -a $ADDFILES/rootfs/* $ROOTFS
493 status
494 fi
495 echo "Root file system is generated..."
496 # Root CD part.
497 echo -n "Preparing the rootcd directory..."
498 mkdir -p $ROOTCD
499 status
500 # Move the boot dir with the Linux kernel from rootfs.
501 # The boot dir goes directly on the CD.
502 if [ -d "$ROOTFS/boot" ] ; then
503 echo -n "Moving the boot directory..."
504 mv $ROOTFS/boot $ROOTCD
505 cd $ROOTCD/boot
506 ln vmlinuz-* bzImage
507 status
508 fi
509 cd $DISTRO
510 # Copy all files from $ADDFILES/rootcd to the rootcd.
511 if [ -d "$ADDFILES/rootcd" ] ; then
512 echo -n "Copying addfiles content to the rootcd... "
513 cp -a $ADDFILES/rootcd/* $ROOTCD
514 status
515 fi
516 # Initramfs and ISO image stuff.
517 gen_initramfs
518 gen_livecd_isolinux
519 distro_stats
520 ;;
521 clean-distro)
522 # Remove old distro tree.
523 #
524 check_root
525 echo ""
526 echo -e "\033[1mCleaning :\033[0m $DISTRO"
527 echo "================================================================================"
528 if [ -d "$DISTRO" ] ; then
529 if [ -d "$ROOTFS" ] ; then
530 echo -n "Removing the rootfs..."
531 rm -f $DISTRO/$INITRAMFS
532 rm -f $DISTRO/$LZMA_INITRAMFS
533 rm -rf $ROOTFS
534 status
535 fi
536 if [ -d "$ROOTCD" ] ; then
537 echo -n "Removing the rootcd..."
538 rm -rf $ROOTCD
539 status
540 fi
541 echo -n "Removing eventual ISO image..."
542 rm -f $DISTRO/$ISO_NAME.iso
543 status
544 fi
545 echo "================================================================================"
546 echo ""
547 ;;
548 addhacker)
549 # Without /etc/passwd...
550 #
551 check_root
552 echo ""
553 echo -e "\033[1mAdduser hacker to :\033[0m $ROOTFS"
554 echo "================================================================================"
555 if [ ! -d "$ROOTFS/etc" ] ; then
556 echo -e "\nUnable to find : $ROOTFS/etc"
557 echo -e "Users and passwords config files will not be found.\n"
558 exit 0
559 fi
560 # Go for echoing on configuration files if any hacker was found.
561 #
562 if [ ! "`cat $ROOTFS/etc/passwd | grep hacker`" ] ; then
563 echo -n "Configuring $ROOTFS/etc..."
564 echo 'hacker:x:500:500:Linux User,,,:/home/hacker:/bin/ash' >> $ROOTFS/etc/passwd
565 echo 'hacker::13646:0:99999:7:::' >> $ROOTFS/etc/shadow
566 echo 'hacker:x:500:' >> $ROOTFS/etc/group
567 echo 'hacker:!::' >> $ROOTFS/etc/gshadow
568 status
569 else
570 echo "Hacker is already in : $ROOTFS/etc/passwd"
571 fi
572 # Hacker can listen to music
573 #
574 if grep -q audio $ROOTFS/etc/group; then
575 sed -i s/'audio:x:20:'/'audio:x:20:hacker'/ $ROOTFS/etc/group
576 fi
577 # /home/hacker files.
578 #
579 echo -n "Creating default directories... "
580 mkdir -p $ROOTFS/home/hacker/Documents \
581 $ROOTFS/home/hacker/Downloads \
582 $ROOTFS/home/hacker/Images \
583 $ROOTFS/home/hacker/Public \
584 $ROOTFS/home/hacker/Templates
585 status
586 # Change permissions.
587 #
588 echo -n "Chmodig all files in /home/hacker..."
589 chown -R 500.500 $ROOTFS/home/hacker
590 status
591 echo "================================================================================"
592 echo "Linux User Hacker have an account in the distro."
593 echo ""
594 ;;
595 check-distro)
596 # Check for a few LiveCD needed files not installed by packages.
597 #
598 check_rootfs
599 echo ""
600 echo -e "\033[1mChecking distro :\033[0m $ROOTFS"
601 echo "================================================================================"
602 # SliTaz release info.
603 if [ ! -f "$ROOTFS/etc/slitaz-release" ]; then
604 echo "Missing release info : /etc/slitaz-release"
605 else
606 release=`cat $ROOTFS/etc/slitaz-release`
607 echo -n "Release : $release"
608 status
609 fi
610 # Tazpkg mirror.
611 if [ ! -f "$ROOTFS/var/lib/tazpkg/mirror" ]; then
612 echo -n "Mirror URL : Missing /var/lib/tazpkg/mirror"
613 todomsg
614 else
615 echo -n "Mirror configuration exist..."
616 status
617 fi
618 # Isolinux msg
619 if grep -q "cooking-XXXXXXXX" /$ROOTCD/boot/isolinux/isolinux.msg; then
620 echo -n "Isolinux msg : Missing cooking date XXXXXXXX (ex `date +%Y%m%d`)"
621 todomsg
622 else
623 echo -n "Isolinux message seems good..."
624 status
625 fi
626 echo "================================================================================"
627 echo ""
628 ;;
629 burn-iso)
630 # Guess cdrom device, ask user and burn the ISO.
631 #
632 check_root
633 DRIVE_NAME=`cat /proc/sys/dev/cdrom/info | grep "drive name" | cut -f 3`
634 DRIVE_SPEED=`cat /proc/sys/dev/cdrom/info | grep "drive speed" | cut -f 3`
635 # We can specify an alternative ISO from the cmdline.
636 if [ -n "$2" ] ; then
637 iso=$2
638 else
639 iso=$DISTRO/$ISO_NAME.iso
640 fi
641 if [ ! -f "$iso" ]; then
642 echo -e "\nUnable to find ISO : $iso\n"
643 exit 0
644 fi
645 echo ""
646 echo -e "\033[1mTazlito burn ISO\033[0m "
647 echo "================================================================================"
648 echo "Cdrom device : /dev/$DRIVE_NAME"
649 echo "Drive speed : $DRIVE_SPEED"
650 echo "ISO image : $iso"
651 echo "================================================================================"
652 echo ""
653 yesorno "Burn ISO image (y/N) ? "
654 if [ "$answer" == "y" ]; then
655 echo ""
656 echo "Starting Wodim to burn the iso..." && sleep 2
657 echo "================================================================================"
658 wodim speed=$DRIVE_SPEED dev=/dev/$DRIVE_NAME $DISTRO/$ISO_NAME.iso
659 echo "================================================================================"
660 echo "ISO image is burned to cdrom."
661 else
662 echo -e "\nExiting. No ISO burned."
663 fi
664 echo ""
665 ;;
666 usage|*)
667 # Clear and print usage also for all unknow commands.
668 #
669 clear
670 usage
671 ;;
673 esac
675 exit 0