- Timestamp:
- 02/13/09 19:26:14 (3 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
main/linuxmuster-linbo/branches/testing/linbo/linbo_cmd.sh
r416 r448 440 440 441 441 # mkgrubmenu partition [kernel initrd server append] 442 # Creates/updates menu.lst with given partition 442 # Creates/updates menu.lst and device.map with given partition/disk 443 # installs grub in mbr of disk 443 444 # /cache is already mounted when this is called. 444 445 mkgrubmenu(){ 445 local menu="/cache/boot/grub/menu.lst" 446 local grubdir="/cache/boot/grub" 447 [ -e "$grubdir" ] || mkdir -p "$grubdir" 448 local menu="$grubdir/menu.lst" 446 449 local grubdisk="hd0" 447 case "$1" in 448 *[hs]da) grubdisk=hd0 ;; 449 *[hs]db) grubdisk=hd1 ;; 450 *[hs]dc) grubdisk=hd2 ;; 451 *[hs]dd) grubdisk=hd3 ;; 450 local disk="${1%%[1-9]*}" 451 local grubpart="${1##*[hsv]d[a-z]}" 452 grubpart="$((grubpart - 1))" 453 case "$disk" in 454 *[hsv]da) grubdisk=hd0 ;; 455 *[hsv]db) grubdisk=hd1 ;; 456 *[hsv]dc) grubdisk=hd2 ;; 457 *[hsv]dd) grubdisk=hd3 ;; 452 458 esac 453 local grubpart="${1##*[hs]d[a-z]}"454 grubpart="$((grubpart - 1))"455 459 local root="root ($grubdisk,$grubpart)" 456 echo 460 echo "($grubdisk) $disk" > /cache/boot/grub/device.map 457 461 case "$(cat $menu 2>/dev/null)" in 458 462 *$root*) true ;; # Entry for this partition is already present … … 477 481 } 478 482 479 # tschmitt: mk menulstbootpart bootfile480 # Creates menu.lst with givenpartition483 # tschmitt: mkgrldr bootpart bootfile 484 # Creates menu.lst on given windows partition 481 485 # /cache and /mnt is already mounted when this is called. 482 486 mkgrldr(){ … … 486 490 local driveid="0x80" 487 491 case "$1" in 488 *[hs ]da) grubdisk=hd0; driveid="0x80" ;;489 *[hs ]db) grubdisk=hd1; driveid="0x81" ;;490 *[hs ]dc) grubdisk=hd2; driveid="0x82" ;;491 *[hs ]dd) grubdisk=hd3; driveid="0x83" ;;492 *[hsv]da) grubdisk=hd0; driveid="0x80" ;; 493 *[hsv]db) grubdisk=hd1; driveid="0x81" ;; 494 *[hsv]dc) grubdisk=hd2; driveid="0x82" ;; 495 *[hsv]dd) grubdisk=hd3; driveid="0x83" ;; 492 496 esac 493 local grubpart="${1##*[hs ]d[a-z]}"497 local grubpart="${1##*[hsv]d[a-z]}" 494 498 grubpart="$((grubpart - 1))" 495 bootlace.com --"$(fstype "$1")" --floppy="$driveid" "$1"499 bootlace.com --"$(fstype_startconf "$1")" --floppy="$driveid" "$1" 496 500 echo -e "default 0\ntimeout 0\nhiddenmenu\n\ntitle Windows\nroot ($grubdisk,$grubpart)\nchainloader ($grubdisk,$grubpart)/$bootfile" > $menu 497 501 cp /usr/lib/grub/grldr /mnt … … 543 547 # tschmitt: repairing grub mbr on every start 544 548 if mountcache "$6" && cache_writable ; then 545 [ -e /cache/boot/grub ] || mkdir -p /cache/boot/grub549 mkgrubmenu "$1" 546 550 grub-install --root-directory=/cache $disk 547 551 fi … … 560 564 # tschmitt: needed for local boot here 561 565 if [ -e /cache/boot/grub ] && cache_writable; then 562 mkgrubmenu "$1"563 566 grub-set-default --root-directory=/cache 1 564 567 fi … … 677 680 # mk_cloop type inputdev imagename baseimage [timestamp] 678 681 mk_cloop(){ 682 echo "## $(date) : Starte Erstellung von $1." | tee -a /tmp/image.log 679 683 echo -n "mk_cloop " ; printargs "$@" | tee -a /tmp/image.log 680 684 local RC=1 … … 762 766 ;; 763 767 esac 768 echo "## $(date) : Beende Erstellung von $1." | tee -a /tmp/image.log 764 769 return "$RC" 765 770 } … … 796 801 # cp_cloop imagefile targetdev 797 802 cp_cloop(){ 803 echo "## $(date) : Starte Komplettrestore von $1." | tee -a /tmp/image.log 798 804 echo -n "cp_cloop " ; printargs "$@" | tee -a /tmp/image.log 799 805 local RC=1 … … 839 845 fi 840 846 [ "$RC" = "0" ] && update_status "$2" "$1" 847 echo "## $(date) : Beende Komplettrestore von $1." | tee -a /tmp/image.log 841 848 return "$RC" 842 849 } … … 845 852 # sync_cloop imagefile targetdev 846 853 sync_cloop(){ 854 echo "## $(date) : Starte Synchronisation von $1." | tee -a /tmp/image.log 847 855 # echo -n "sync_cloop " ; printargs "$@" 848 856 local RC=1 … … 905 913 fi 906 914 [ "$RC" = "0" ] && update_status "$2" "$1" 915 echo "## $(date) : Beende Synchronisation von $1." | tee -a /tmp/image.log 907 916 return "$RC" 908 917 }
Note: See TracChangeset
for help on using the changeset viewer.
