1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 247 248 249 250 251 252 253 254 255 256 257 258 259 260 261 262 263 264 265 266 267 268 269 270 271 272 273 274 275 276 277 278 279 280 281 282 283 284 285 286 287 288 289 290 291 292 293 294 295 296 297 298 299 300 301 302 303 304 305 306 307 308 309 310 311 312 313 314 315 316 317 318 319 320 321 322 323 324 325 326 327 328 329 330 331 332 333 334 335 336 337 338 339 340 341 342 343 344 345 346 347 348 349 350 351 352 353 354 355 356 357 358 359 360 361 362 363 364 365 366 367 368 369 370 371 372 373 374 375 376 377 378 379 380 381 382 383 384 385 386 387 388 389 390 391 392 393 394 395 396 397 398 399 400 401 402 403 404 405 406 407 408 409 410 411 412 413 414 415 416 417 418 419 420 421 422 423 424 425 426 427 428 429 430 431 432 433 434 435 436 437 438 439 440 441 442 443 444 445 446 447 448 449 450 451 452 453 454 455 456 457 458 459 460 461 462 463 464 465 466 467 468 469 470 471 472 473 474 475 476 477 478 479 480 481 482 483 484 485 486 487 488 489 490 491 492 493 494 495 496 497 498 499 500 501 502 503 504 505 506 507 508 509 510 511 512 513 514 515 516 517 518 519 520 521 522 523 524 525 526 527 528 529 530 531 532 533 534 535 536 537 538 539 540 541 542 543 544 545 546 547 548 549 550 551 552 553 554 555 556 557 558 559 560 561 562 563 564 565 566 567 568 569 570 571 572 573 574 575 576 577 578 579 580 581 582 583 584 585 586 587 588 589 590 591 592 593 594 595 596 597 598 599 600 601 602 603 604 605 606 607 608 609 610 611 612 613 614 615 616 617 618 619 620 621 622 623 624 625 626 627 628 629 630 631 632 633 634 635 636 637 638 639 640 641 642 643 644 645 646 647 648 649 650 651
|
# bootcd-check.lib
# vim: set filetype=sh :
warn_user()
{
A=""
while [ "$A" != "y" -a "$A" != "n" ]
do
[ "$CLEAN_VAR" = "yes" ] &&
echo " /var/cache/apt will be cleaned (apt-get clean) !" | tee -a $ERRLOG
echo ""
if [ ! "$SCRIPT" ]; then
echo -n "Ok to continue? (y/n) " | tee -a $ERRLOG
read A; echo "$A" >> $ERRLOG
else
A="y"
fi
done
if [ "$A" = "n" ]; then
exit 1
fi
echo ""
}
check_config()
{
echo "--- CONFVARS from Config ---" >>$ERRLOG
for i in $CONFVARS; do
eval "echo $i \$$i"
done | sort >>$ERRLOG
PROBLEM="The image destination $VAR/cdimage.iso exists.
Delete $VAR/cdimage.iso and try again!"
if [ -e $VAR/cdimage.iso ] ; then
err "$PROBLEM"
fi
SRCDISK=$(realpath $SRCDISK)
[ $? -ne 0 ] && err "Wrong Definition of SRCDISK: See $ERRLOG"
SRCDI=$SRCDISK; [ "$SRCDI" = "/" ] && SRCDI=""
CONFVARS="$CONFVARS SRCDI"
# if [ "$ONLY_FLOPPY" ]; then
# err "You have called bootcdwrite with option -only_floppy.
# This makes only sence if you define FLOPPY_CREATE_DEV in conffile."
# fi
nn=""
for j in $NOT_TO_CD; do
aa=$(realpath -s $j)
if [ $? -ne 0 ];then
warn "Wrong Definition of NOT_TO_CD (\"$j\"): See $ERRLOG"
else
[ "$nn" ] && nn="$nn $aa" || nn=$aa
fi
done
NOT_TO_CD=$nn
PROBLEM="
Defining /home, /var, /etc, tmp, /dev, /root or /mnt in config variable
NOT_TO_CD does not work with bootcdwrite. Please use subdirectories
instead. For example /home/user1 will work."
for j in $NOT_TO_CD; do
for i in /home /var /etc /tmp /dev /root /mnt; do
[ "$j" = "$i" ] && err "NOT_TO_CD contains \"$i\".$PROBLEM"
done
done
nn=""
for j in $NOT_TO_RAM; do
aa=$(realpath -s $j)
if [ $? -ne 0 ];then
warn "Wrong Definition of NOT_TO_RAM (\"$j\"): See $ERRLOG"
else
[ "$nn" ] && nn="$nn $aa" || nn=$aa
fi
done
NOT_TO_RAM=$nn
KERNEL=$(realpath $KERNEL)
[ $? -ne 0 ] && err "Wrong Definition of KERNEL: See $ERRLOG"
[ ! -f "$KERNEL" ] && err "No Kernel <$KERNEL>"
KCONF=$(echo $KERNEL | sed "s/vmlinu./config/")
[ "$KCONF" = "$KERNEL" -o ! -f "$KCONF" ] && KCONF=""
A="hppa|i386|ia64|auto"
if [ ! "$(echo "$A" | grep "\<$ARCH\>")" ]; then
warn "ARCH=\"$ARCH\" is not defined as \"$A\"." \
'It will be treated as "auto".'
ARCH="auto"
fi
REL_KERNEL=$(echo "$KERNEL" | sed "s|^$SRCDI||")
CONFVARS="$CONFVARS REL_KERNEL"
if [ "$ARCH" = "auto" ]; then
F="$(file $KERNEL)"
[ "$(echo "$F" | grep "compressed")" ] && F=$(zcat $KERNEL | file -)
if [ "$(echo "$F" | grep "PA-RISC")" ]; then
ARCH="hppa"
elif [ "$(echo "$F" | grep "IA-64")" ]; then
ARCH="ia64"
else
ARCH="i386"
fi
fi
if [ "$ISOLINUX" != "no" -a "$ISOLINUX" != "yes" -a "$ISOLINUX" != "auto" ]
then
warn 'ISOLINUX is not defined as "yes", "no" or "auto".' \
'It will be treated as "auto".'
ISOLINUX="auto"
fi
if [ "$ISOLINUX" = "auto" ]; then
if [ -f /usr/lib/syslinux/isolinux.bin ]; then
ISOLINUX="yes"
else
ISOLINUX="no"
fi
fi
if [ "$INITRD" != "" ]; then
INITRD=$(realpath $INITRD)
if [ $? -ne 0 -o ! -f "$INITRD" ]; then
warn "No file \"$INITRD\" INITRD will be set to \"\""
INITRD=""
fi
fi
REL_INITRD=$(echo "$INITRD" | sed "s|^$SRCDI||")
CONFVARS="$CONFVARS REL_INITRD"
if [ "$INITRD" -a ! -f /var/lib/dpkg/info/bootcd-mkinitramfs.list ]; then
warn "You have configured INITRD. You probably should install " \
"bootcd-mkinitramfs."
fi
if [ "$INITRD" != "" -a "$ISOLINUX" = "no" ]; then
warn "INITRD \"$INITRD\" may be to big " \
"without ISOLINUX."
fi
[ "$DISPLAY" ] && [ ! -f $DISPLAY ] && warn "DISPLAY ($DISPLAY) not found."
if [ "$BOOTCDMODPROBE" != "standard" -a "$BOOTCDMODPROBE" != "bootcd" -a "$BOOTCDMODPROBE" != "auto" ]
then
warn 'BOOTCDMODPROBE is not defined as "standard", "bootcd" or "auto".' \
'It will be treated as "auto".'
BOOTCDMODPROBE="auto"
fi
if [ "$BOOTCDMODPROBE" = "auto" ]; then
if [ -f /sbin/discover -o -f /bin/discover -o -f /usr/bin/discover ]; then
BOOTCDMODPROBE="bootcd"
else
BOOTCDMODPROBE="standard"
fi
elif [ "$BOOTCDMODPROBE" = "bootcd" ]; then
if [ ! -f /sbin/discover -a ! -f /bin/discover -a ! -f /usr/bin/discover ]; then
warn "BOOTCDMODPROBE=bootcd is defined, but discover is not installed."
fi
fi
if [ "$DEVFS" != "no" -a "$DEVFS" != "yes" ]
then
DEVFS=no
warn 'DEVFS is not defined as "yes" or "no".' \
'It will be treated as "no".'
fi
CDDEV1=$(echo $CDDEV | awk '{print $1}')
CDDEVR=$(echo $CDDEV | awk '{$1=""; print}')
CONFVARS="$CONFVARS CDDEV1 CDDEVR"
if [ "$DO_CHECK" != "no" -a "$DO_CHECK" != "yes" ]; then
DO_CHECK=yes
warn 'DO_CHECK is not defined as "yes" or "no".' \
'It will be treated as "yes".'
fi
[ "$DO_CHECK" = "yes" ] &&
echo "--- Checking for possible Problems ---" | tee -a $ERRLOG
if [ "$TYP" != "CD" -a "$TYP" != "DVD" ]; then
err "TYP must be defined as \"CD\" or \"DVD\" (not \"$TYP\")."
fi
CHANGES=$VAR/changes
CONFVARS="$CONFVARS CHANGES"
VERSION=$(COLUMNS=200 dpkg -l bootcd | tail -1 | awk '{print $3}')
CONFVARS="$CONFVARS VERSION"
echo "--- CONFVARS checked by check_config ---" >>$ERRLOG
for i in $CONFVARS; do
eval "echo $i \$$i"
done | sort >>$ERRLOG
}
get_sizes()
{
[ "$DO_CHECK" = "no" ] && return
S_NOT_TO_CD=0
[ "$NOT_TO_CD" ] && S_NOT_TO_CD=$(du_dir $NOT_TO_CD $ERRLOG $SRCDI/tmp)
echo "S_NOT_TO_CD=<$S_NOT_TO_CD>" >> $ERRLOG
S_CD_ALL=$(du_dir $SRCDISK $NOT_TO_CD $ERRLOG $SRCDI/tmp)
echo "S_CD_ALL=<$S_CD_ALL>" >> $ERRLOG
S_NEED_CD=$(expr $S_CD_ALL - $S_NOT_TO_CD)
S_VAR=$(df_file $VAR)
echo "S_VAR=<$S_VAR>" >> $ERRLOG
S_NEED_COMPRESS=$(expr $S_NEED_CD \* 2)
echo "S_NEED_COMPRESS=<$S_NEED_COMPRESS>" >> $ERRLOG
if [ "$TYP" = "DVD" ]; then
S_CD="4700000"
else
S_CD=$(expr 1024 \* 650)
fi
echo "S_CD=<$S_CD>" >> $ERRLOG
S_NOT_TO_RAMCD=0
[ "$NOT_TO_RAM$NOT_TO_CD" ] && S_NOT_TO_RAMCD=$(du_dir $NOT_TO_RAM $NOT_TO_CD)
echo "S_NOT_TO_RAMCD=<$S_NOT_TO_RAMCD>" >> $ERRLOG
S_RAM_ALL=$(du_dir $SRCDI/etc $SRCDI/home $SRCDI/root $NOT_TO_RAM $NOT_TO_CD)
echo "S_RAM_ALL=<$S_RAM_ALL>" >> $ERRLOG
S_NEED_RAM=$(expr $S_RAM_ALL - $S_NOT_TO_RAMCD)
echo "S_NEED_RAM=<$S_NEED_RAM>" >> $ERRLOG
S_RAM=$(expr $RAMDISK_SIZE \* 9 / 10)
echo "S_RAM=<$S_RAM>" >> $ERRLOG
}
check_file_rc()
{
PROBLEM="
you have installed the debian package file-rc on the system you want to
copy on cd. The file-rc package provides an alternative mechanism to boot the
system, to shut it down and to change runlevels. The /etc/rc?.d/* links
will be converted into one single configuration file /etc/runlevel.conf...
Therefore scripts in /etc/rcS.d added by bootcdwrite are not executed during
booting from CD.
To slolve the problem, please deinstall file-rc on the system you want to
copy on cd."
F="$SRCDI/var/lib/dpkg/info/file-rc.list"
[ -f $F ] && warn "Found $F. This means $PROBLEM"
}
check_compress()
{
[ "$COMPRESS" = "no" ] && return
if [ "$COMPRESS" != "yes" -a "$COMPRESS" != "auto" ]; then
warn 'COMPRESS is not defined as "yes", "no"' 'or "auto".' \
'It will be treated as "auto".'
COMPRESS="auto"
fi
PROBLEM="
If COMPRESS=auto then bootcdwrite tries to check if compression is
possible and also makes sence automatically. This can only be done
if bootcdwrite is able to make some tests. To enable this tests
you have to configure DO_CHECK=yes."
if [ "$COMPRESS" = "auto" -a "$DO_CHECK" = "no" ]; then
err "COMPRESS=auto and DO_CHECK=no.$PROBLEM"
fi
# PROBLEM="
#If compression is enabled (COMPRESS=yes) the files on CD/DVD will be
#encrypted on the fly but this needs extra CPU work. It seems that there
#is enough space available without compression. So it could be better to not
#use compression. If you really want compression feel free to ignore this
#message."
# if [ "$DO_CHECK" = "yes" ]; then
# if [ $S_NEED_CD -le $S_CD ]; then
# if [ "$COMPRESS" = "yes" ]; then
# warn "S_NEED_CD <= S_CD ($S_NEED_CD <= $S_CD) $PROBLEM"
# else
# echo "S_NEED_CD <= S_CD ($S_NEED_CD <= $S_CD) $PROBLEM" \
# " => COMPRESS=no" >>$ERRLOG
# COMPRESS=no
# return
# fi
# fi
# fi
PROBLEM="
to create a compressed filesystem we need the command mkzftree.
this command is included in the debian package mkisofs since
Version 4:2.0-2."
if [ ! -f /usr/bin/mkzftree ]; then
if [ "$COMPRESS" = "yes" ]; then
warn "command mkzftree not found.$PROBLEM"
else
echo "command mkzftree not found.$PROBLEM" \
" => COMPRESS=no" >>$ERRLOG
COMPRESS=no
return
fi
fi
PROBLEM="
To enable compression (COMPRESS=yes) there must be much space (S_VAR)
available in $VAR to hold extra space for compression.
We need double as much space (S_NEED_COMPRESS) as will be copied to CD.
but the space available is not enough"
if [ "$DO_CHECK" = "yes" ]; then
if [ "$S_VAR" == "" ]; then
warn "Couldn't guess size of \"$VAR\" with df so assume enought space is available! (Press \"i\")"
elif [ $S_NEED_COMPRESS -gt $S_VAR ]; then
if [ "$COMPRESS" = "yes" ]; then
warn "S_NEED_COMPRESS > S_VAR ($S_NEED_COMPRESS ) $S_VAR) $PROBLEM"
else
echo "S_NEED_COMPRESS > S_VAR ($S_NEED_COMPRESS ) $S_VAR) $PROBLEM" \
" => COMPRESS=no" >>$ERRLOG
COMPRESS=no
return
fi
fi
fi
PROBLEM="
To enable compression (COMPRESS=yes) some options have to be compiled in the
kernel. Only with the necessary options the kernel is able to boot from the
compressed CD/DVD."
if [ "$KCONF" ]; then
for i in \
"CONFIG_ZISOFS_FS=$([ "$INITRD" ] && echo "[m|y]" || echo y)"
do
grep -q "^$i" $KCONF
if [ $? != 0 ]; then
if [ "$COMPRESS" = "yes" ]; then
warn "$i seems not to be configured in $KERNEL$PROBLEM"
else
echo "$i seems not to be configured in $KERNEL$PROBLEM" \
" => COMPRESS=no" >>$ERRLOG
COMPRESS=no
return
fi
fi
done
fi
[ "$COMPRESS" = "auto" ] && COMPRESS="yes"
}
#
# check_not2ram - Check Variable NOT_TO_RAM
#
check_not2ram()
{
[ "$DO_CHECK" = "no" ] && return
PROBLEM="
Only files from $SRCDI/home, $SRCDI/var, $SRCDI/etc,
$SRCDI/dev, $SRCDI/tmp or $SRCDI/root will be copied
to ram. It makes only sence to exclude files from that directories."
for i in $NOT_TO_RAM; do
echo "$i" | grep -q \
-e "^$SRCDI/home\>" -e "^$SRCDI/var\>" \
-e "^$SRCDI/etc\>" -e "^$SRCDI/dev\>" \
-e "^$SRCDI/tmp\>" -e "^$SRCDI/root\>"
[ $? = 0 ] || warn "NOT_TO_RAM consists of $i.$PROBLEM"
done
}
check_cdfiles()
{
[ "$DO_CHECK" = "no" ] && return
PROBLEM="
This file or directory will be created in the next step by bootcdwrite.
Please remove the actual file. You are probably trying to use bootcdwrite
on a system created with bootcd2disk."
for i in cdboot.img cdboot.catalog usr/bin/bootcd2disk \
usr/bin/bootcdflopcp usr/bin/bootcdflopcp etc/rcS.d/S13bootcdflop.sh \
etc/bootcd/bootcd2disk.conf rr_moved ram1.cpio.gz ram2.cpio.gz \
isolinux
do
[ -e $SRCDI/$i ] && warn "found $SRCDI/$i$PROBLEM"
done
}
# check_kernel - Try to make some kernel checks
check_kernel()
{
[ "$DO_CHECK" = "no" ] && return
PROBLEM="
If you install a kernel from a .deb package the kernel will be named
/boot/vmlinuz<version> and there will be a kernel config file named
/boot/config<version>. Bootcdwrite could not find the config file and
therefore no further kernel checks could be done. This is not critical
but you could build your kernel with make-kpkg to solve the problem.
Please read the FAQ to check if you have build erverything necessary in
your kernel."
if [ ! "$KCONF" ]; then
warn "Could not calculate Kernelconfig to make further checks.$PROBLEM"
return
fi
PROBLEM="
To run bootcd some features have to be compiled in the kernel.
Please read the FAQ and check if all necessary features are enabled."
for i in \
"CONFIG_BLK_DEV_RAM=y" \
"CONFIG_BLK_DEV_LOOP=[m|y]"
do
grep -q "^$i" $KCONF
[ $? != 0 ] && warn "$i seems not to be configured in $KERNEL$PROBLEM"
done
if [ "$BOOTFLOPPY" = "yes" ]; then
PROBLEM="
You have configured BOOTFLOPPY=yes.
To boot from floppy with syslinux you need some additional features
compiled in the kernel. Please read the FAQ and check if all necessary
features are enabled."
for i in \
"CONFIG_FAT_FS=y" \
"CONFIG_MSDOS_FS=y" \
"CONFIG_VFAT_FS=y"
do
grep -q "^$i" $KCONF
[ $? != 0 ] && warn "$i seems not to be configured in $KERNEL$PROBLEM"
done
fi
# PROBLEM="
#The KERNEL has to be in SRCDISK subdir. Please edit bootcdwrite.conf."
# [ "$(echo "$KERNEL" | grep "^$SRCDI/")" ] ||
# warn "$KERNEL is not in $SRCDI/ subdir.$PROBLEM"
#
# A=$(chnglist -no_mnt -rel "$SRCDISK" "$KERNEL")
# B="$SRCDI/vmlinuz"
# PROBLEM="
#There should be a symbolic link
#$B -> /$A.
#Bootcd2disk can later use this link to automatically install
#the kernel to the new disk. Please create the link with
#\"ln -sf /$A $B\"."
# [ "$(/bin/ls -l $B 2>&1 | grep -e "-> /\?$A$")" ] || warn "$PROBLEM"
if [ "$INITRD" = "" ]; then
PROBLEM="
To run bootcd (without INITRD) some features have to be compiled in the
kernel. Please read the FAQ and check if all necessary features are enabled."
for i in \
"CONFIG_ISO9660_FS=y" \
"CONFIG_EXT2_FS=y" \
"CONFIG_BLK_DEV_LOOP=[m|y]"
do
grep -q "^$i" $KCONF
[ $? != 0 ] && warn "$i seems not to be configured in $KERNEL$PROBLEM"
done
else
PROBLEM="
You have configured INITRD=\"$INITRD\".
The kernel has to be configured for this to work."
for i in \
"CONFIG_ISO9660_FS=[m|y]" \
"CONFIG_EXT2_FS=[m|y]" \
"CONFIG_BLK_DEV_INITRD=y"
do
grep -q "^$i" $KCONF
[ $? != 0 ] && warn "$i seems not to be configured in $KERNEL$PROBLEM"
done
fi
if [ "$DEVFS" = "yes" ]; then
PROBLEM="
To run bootcd with DEVFS some features have to be compiled in the
kernel. Please read the FAQ and check if all necessary features are enabled."
for i in \
"CONFIG_DEVFS_FS=y" \
"CONFIG_DEVFS_MOUNT=y"
do
grep -q "^$i" $KCONF
[ $? != 0 ] && warn "$i seems not to be configured in $KERNEL$PROBLEM"
done
fi
}
check_initrd()
{
[ "$DO_CHECK" = "no" ] && return
[ ! "$INITRD" ] && return
PROBLEM="
The initrd file is no compressed ROM File System and it is
no compressed cpio archive.
It can not be checked by bootcdwrite"
if [ "$(file $INITRD | grep "Compressed ROM File System")" ]; then
PROBLEM="
You have to make sure, that the module \"isofs.o\" is loaded from
the initrd system. Please read the FAQ or install bootcd-mkinitramfs."
run mkdir -p $VAR/mnt
run mount -o loop $INITRD $VAR/mnt -t cramfs
if ! grep -q "modprobe.*\<isofs\>" $VAR/mnt/loadmodules; then
warn "$PROBLEM"
fi
run umount $VAR/mnt
losetup -d /dev/loop0 2>/dev/null
elif [ "$(zcat $INITRD | file - | grep "cpio archive")" ]; then
PROBLEM="
You are using a compressed cpio file for initrd. You have to
make sure, that all modules needed to boot from cd are in this
file. At least the isofs-module is missing.
If this initrd was built by yaird, you also have to make sure that the
init script within the initrd will try to boot from cd.
Another option is to use initrd_tools instead of yaird. Then the
neccessary modifications can be automatically done with intalling
bootcd-mkinitramfs.
"
if [ ! "$(zcat $INITRD | cpio -it | grep "/modules/.*isofs.k*o")" -a \
! "$(grep -q "^CONFIG_ISO9660_FS=y" $KCONF)" ]; then
warn "$PROBLEM"
fi
else
warn "$PROBLEM"
fi
# PROBLEM="
#The INITRD has to be in SRCDISK subdir. Please edit bootcdwrite.conf."
# [ "$(echo "$INITRD" | grep "^$SRCDI/")" ] ||
# warn "$INITRD is not in $SRCDI/ subdir.$PROBLEM"
#
# A=$(chnglist -no_mnt -rel "$SRCDISK" "$INITRD")
# B="$SRCDI/initrd.img"
# PROBLEM="
#There should be a symbolic link
#$B -> /$A.
#Bootcd2disk can later use this link to automatically install the initrd
#image to the new disk. Please create the link with
#\"ln -sf /$A $B\"."
# [ "$(/bin/ls -l $B 2>&1 | grep -e "-> /\?$A$")" ] || warn "$PROBLEM"
}
check_sizes()
{
[ "$DO_CHECK" = "no" ] && return
echo "--- Sizes in KByte (du -klsc ) ---" | tee -a $ERRLOG
echo -n "NOT_TO_CD = . . . . . . . . . . . . . . . . . . " | tee -a $ERRLOG
echo ". . . . . . . . . $S_NOT_TO_CD" | tee -a $ERRLOG
echo -n "CD_ALL (SRCDISK v NOT_TO_CD) = . . . . . . . . . " | tee -a $ERRLOG
echo ". . . . . . . . . $S_CD_ALL" | tee -a $ERRLOG
echo -n "Needed = CD_ALL - NOT_TO_CD . . . . . . . . . . " | tee -a $ERRLOG
echo ". . . . . . . . . $S_NEED_CD" | tee -a $ERRLOG
if [ "$TYP" = "DVD" ]; then
echo -n "DVD+ (4.7 billion bytes) = . . . . . . . . . . . " | tee -a $ERRLOG
echo ". . . . . . . . . $S_CD" | tee -a $ERRLOG
else
echo -n "CD (650 MB) = . . . . . . . . . . . . . . . . " | tee -a $ERRLOG
echo ". . . . . . . . . . $S_CD" | tee -a $ERRLOG
fi
if [ "$COMPRESS" = "yes" ]; then
S_CD=$(expr $S_CD \* 2)
echo -n "because of compression perhaps double size = . " | tee -a $ERRLOG
echo ". . . . . . . . . . $S_CD" | tee -a $ERRLOG
fi
PROBLEM="SRCDISK does not fit on $TYP (Needed > $TYP)"
if [ "$TYP" = "CD" ]; then
PROBLEM="$PROBLEM
You can specify TYP=DVD instead of TYP=CD in bootcdwrite.conf."
fi
PROBLEM="$PROBLEM
You can exclude files/dirs in NOT_TO_CD in bootcdwrite.conf.
You can try to ignore this problem, if you only want an iso image."
if [ $S_NEED_CD -gt $S_CD ]; then
warn "$PROBLEM"
else
echo "OK - SRCDISK does fit on $TYP (Needed <= $TYP)" | tee -a $ERRLOG
fi
echo -n "VAR = . . . . . . . . . . . . . . . . . . . . . " | tee -a $ERRLOG
echo ". . . . . . . . . $S_VAR" | tee -a $ERRLOG
if [ "$S_VAR" == "" ]; then
warn "Could not guess the size of \"$VAR\" with df so assume enought space is available!"
elif [ $S_NEED_CD -gt $S_VAR ]; then
warn "Not enough space in $VAR (Needed > VAR)"
else
echo "OK - enough space in $VAR (Needed <= VAR)" | tee -a $ERRLOG
fi
echo -n "NOT_TO_RAMCD (NOT_TO_RAM v NOT_TO_CD) = . . . . " | tee -a $ERRLOG
echo ". . . . . . . . . $S_NOT_TO_RAMCD"| tee -a $ERRLOG
echo -n "RAM_ALL (etc v home v root v NOT_TO_RAM v NOT_TO_" | tee -a $ERRLOG
echo "CD) = . . . . . . $S_RAM_ALL" | tee -a $ERRLOG
echo -n "Needed RAM (RAM_ALL - NOT_TO_RAMCD) = . . . . . " | tee -a $ERRLOG
echo ". . . . . . . . . $S_NEED_RAM" | tee -a $ERRLOG
echo -n "90 % of RAM = . . . . . . . . . . . . . . . . . " | tee -a $ERRLOG
echo ". . . . . . . . . $S_RAM" | tee -a $ERRLOG
PROBLEM="Not enough RAM (Needed RAM > 90 % of RAM)
You can specify a higer number for RAMDISK_SIZE in bootcdwrite.conf.
You can exclude files/dirs in NOT_TO_CD or NOT_TO_RAM in bootcdwrite.conf."
if [ $S_NEED_RAM -gt $S_RAM ]; then
warn "$PROBLEM"
else
echo "OK - enough RAM (Needed RAM <= 90 % of RAM)" | tee -a $ERRLOG
fi
}
check_locatedb()
{
LOCATEDB=""
for i in $SRCDISK/var/cache/locate/locatedb \
$SRCDISK/var/lib/locate/locatedb \
$SRCDISK/var/lib/locate/slocatedb
do
if [ -f $i ]; then
LOCATEDB="$i"
break
fi
done
}
|