- Timestamp:
- Dec 14, 2005, 12:12:15 AM (19 years ago)
- Location:
- trunk
- Files:
-
- 18 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/mindi/CHANGES
r158 r197 9 9 - USB keyboard support (Bruno Cornec) 10 10 - -p should now work with ISO/PXE/NFS modes (Bruno Cornec) 11 - relocate what was under /usr/share to /usr/lib (FHS compliance) 12 (Bruno Cornec/Andree Leidenfrost) 13 - manage non ambiguous delivery under /usr (packages) or /usr/local (tar ball) 14 (Bruno Cornec) 15 - use parted2fdisk everywhere (Bruno Cornec) 11 16 12 17 1.05 (2005-11-19) -
trunk/mindi/README.ia64
r194 r197 3 3 Linux distributions on ia64 uses a different file table format than on i386, called GPT instead of MBR. The fdisk command used by mindi/mondo to determine all aspects related to the disc hasn't been adapted yet to handle GPT. Only the parted command is able to do it. 4 4 5 So I've written a perl script called parted2fdisk.pl that will take as input all the order that mindi/mondo pass to fdisk, translate them to be given to parted and print the result in fdisk format. So this is a filter allowing fdisk replacement.5 So a perl script called parted2fdisk.pl was written that will take as input all the order that mindi/mondo pass to fdisk, translate them to be given to parted and print the result in fdisk format. So this is a filter allowing fdisk replacement. It's only used on ia64. On other archs, parted2fdisk is a link to fdisk. 6 6 7 To use it on the system to backup, please do the following as root: 8 9 mv /sbin/fdisk /usr/local/bin/fdisk 10 ln -sf /sbin/parted2fdisk.pl /sbin/fdisk 11 Verify that /usr/local/bin is in your path or add it. 12 13 The mindi.rpm package will do that automatically for you. 14 15 Thus mindi/mondo launched by root will smoothly pass all their call to parted2fdisk.pl instead of the real fdisk, and be able to support the GPT format. 16 The existing fdisk command on your system needs to remain accessible in your path as parted2fdisk.pl uses it. 7 Thus mindi/mondo launched by root will pass all their call to parted2fdisk instead of the real fdisk, and be able to support the GPT format. It will call fdisk and parted for its work. 17 8 18 9 To get it on the system to restore, please do the following as root: … … 22 13 mv rootfs/sbin/parted2fdisk-ia64 rootfs/sbin/parted2fdisk 23 14 24 This will produce a binary version that will be used by mondorestore during the restoration process on ia64 to handle the GPT format. (Note that on ia32 parte2fdisk is in fact a link to fdisk to avoid any compatibility issue) 25 So in the restoration environment on ia64, /sbin/fdisk is in fact the result of the compilation of parted2fdisk, and the real ia64 fdisk is placed under /usr/local/bin (result of the previous setup on the machine to backup) 15 This will produce a binary version that will be used by mondorestore during the restoration process on ia64 to handle the GPT format. (Note again that on ia32 parte2fdisk is in fact a link to fdisk to avoid any compatibility issue) 26 16 27 Again the mindi.rpm package will do that automatically for you.17 The install.sh script will setup everything correctly for you. 28 18 29 19 Note that parted2fdisk.pl supports currently only the -l and -s options as well as the commands p,n,d,w,t,a,q 30 20 31 Please report any problem around that tool to b runo.cornec@hp.com21 Please report any problem around that tool to bcornec@users.berlios.de 32 22 Bruno. 33 23 24 2005-12-12 parted2fdisk used everywhere 34 25 2005-03-23 Explain compilation and backup/restore split 35 26 2004-09-16 Initial file -
trunk/mindi/aux-tools/sbin/calc-disk-size
r30 r197 6 6 CalcDiskSize() { 7 7 local res cylinders sectorsize disksize i curr stub out 8 res=` fdisk -l $1 2> /dev/null | grep -i "cylinders of"`8 res=`parted2fdisk -l $1 2> /dev/null | grep -i "cylinders of"` 9 9 cylinders=`echo "$res" | cut -d' ' -f5` 10 10 sectorsize=`echo "$res" | cut -d' ' -f7` 11 cylindermod=` fdisk -l $1 2> /dev/null | grep -i $1:`; # note colon at end to make sure it's not the /dev/sda# partition info11 cylindermod=`parted2fdisk -l $1 2> /dev/null | grep -i $1:`; # note colon at end to make sure it's not the /dev/sda# partition info 12 12 cylnum=`echo "$cylindermod" | cut -d' ' -f7` 13 13 predisksize=$(($cylinders*$sectorsize/1024)) -
trunk/mindi/aux-tools/sbin/format-and-kludge-vfat
r86 r197 28 28 device=$1 29 29 drive=$2 30 ftype=` fdisk -l $drive | grep $device | tr '*' ' ' | tr -s '\t' ' ' | cut -d' ' -f5`30 ftype=`parted2fdisk -l $drive | grep $device | tr '*' ' ' | tr -s '\t' ' ' | cut -d' ' -f5` 31 31 case $ftype in 32 32 # "b" | "c") -
trunk/mindi/deplist.txt
r30 r197 45 45 ping devfsd burnBX burnK6 burnK7 burnMMX burnP5 burnP6 lucifer tiobench tiotest bonnie++ mprime ide-smart 46 46 47 # For ia6448 /usr/local/bin/fdisk49 50 47 # ------------------------------- for X (Hugo) -------------------------------- 51 48 #tar -
trunk/mindi/install.sh
r186 r197 71 71 72 72 if [ "$ARCH" = "i386" ] ; then 73 (cd $local/sbin && ln -s fdisk parted2fdisk) 73 74 if [ -f $local/lib/mindi/rootfs/bin/busybox-$ARCH.net ]; then 74 75 echo "Installing busybox.net ..." … … 80 81 81 82 if [ "$ARCH" = "ia64" ] ; then 83 (cd $local/sbin && ln -s parted2fdisk.pl parted2fdisk) 82 84 make -f Makefile.parted2fdisk DEST=$local/lib/mindi install 83 85 if [ -f $local/lib/mindi/rootfs/sbin/parted2fdisk-$ARCH ]; then -
trunk/mindi/mindi
r181 r197 132 132 which afio > /dev/null 2> /dev/null || LogIt "afio not found... mindi doesn't need afio but Mondo does... Be aware...\n" 133 133 [ ! -e "/etc/issue.net" ] && > /etc/issue.net 134 FDISK=$MINDI_SBIN/parted2fdisk .pl134 FDISK=$MINDI_SBIN/parted2fdisk 135 135 FDISKLOG=/tmp/parted2fdisk.log 136 136 touch $FDISKLOG … … 1207 1207 AddFileToCfgIfExists $MONDO_TMP/NFS-CLIENT-IPADDR nfs-client-ipaddr $outfile 1208 1208 AddFileToCfgIfExists $MONDO_TMP/NFS-CLIENT-NETMASK nfs-client-netmask $outfile 1209 AddFileToCfgIfExists $MONDO_TMP/NFS-CLIENT-BROADCAST nfs-client-broadcast $outfile 1209 1210 AddFileToCfgIfExists $MONDO_TMP/NFS-CLIENT-DEFGW nfs-client-defgw $outfile 1210 1211 AddFileToCfgIfExists $MONDO_TMP/NFS-SERVER-MOUNT nfs-server-mount $outfile … … 1327 1328 all_partitions="" 1328 1329 1329 # Workaround until fdisk2parted.pl is fixed1330 [ "$ARCH" != "ia64" ] && FDISK=`which fdisk`1331 # End workaround - Hugo, 06/20/20041332 1333 1330 if [ -d "/proc/lvm" ] || [ -d "/dev/mapper" ]; then 1334 1331 echo -en "\rAnalyzing LVM...\r" -
trunk/mindi/mindi.spec
r190 r197 78 78 echo "WARNING: /usr/local/sbin/mindi exists. You should probably remove your manual mindi installation !" 79 79 fi 80 81 %ifarch ia6482 %{__mkdir_p} /usr/local/bin83 if [ "`file /sbin/fdisk |grep 'LF 64-bit LSB executable'`" ] ; then84 %{__cp} /sbin/fdisk /sbin/fdisk.mondosav85 %{__mv} /sbin/fdisk /usr/local/bin/fdisk86 %{__ln_s} -f /usr/sbin/parted2fdisk.pl /sbin/fdisk87 echo "Warning: you fdisk binary is now under /usr/local/bin"88 fi89 %endif90 80 91 81 %files -
trunk/mindi/parted2fdisk.pl
r91 r197 306 306 my $cmd = shift; 307 307 my $basename = basename($cmd); 308 my $mindifdisk="/usr/local/bin/fdisk"; 309 310 if ($cmd =~ /fdisk/) { 311 if ($arch =~ /^ia64/) { 312 if (-l $cmd) { 313 print FLOG "Your system is ready for mondo-archive on ia64\n"; 314 } else { 315 print FLOG "Your system is ready for mondo-restore on ia64\n"; 316 } 317 if (-x $mindifdisk) { 318 $cmd = $mindifdisk; 319 } else { 320 print FLOG "Your system doesn't provide $mindifdisk\n"; 321 print FLOG "Please use mindi-x.yz-ia64.rpm on the system to backup\n"; 322 myexit(-1); 323 } 324 } 325 } 308 326 309 if (not (-x $cmd)) { 327 310 print FLOG "Your system is not LSB/mondo compliant: $basename was not found as $cmd\n"; -
trunk/mindi/rootfs/sbin/init
r181 r197 678 678 cp -af /dev/md2 /dev/md/2 2> /dev/null 679 679 fi 680 # As described in the README.ia64 we replaced on the native system681 # /sbin/fdisk by parted2fdisk.pl now we need the reverse for mindi's682 # boot environment683 680 export ARCH=`/bin/arch` 684 if [ "$ARCH" = "ia64" ] ; then685 rm -f /sbin/fdisk686 ln /sbin/parted2fdisk /sbin/fdisk687 fi688 681 WelcomeMessage 689 682 # SpaceTests; # Mandrake Linux 8.1 doesn't like this -
trunk/mondo/ChangeLog
r173 r197 22 22 - Quadrupled ARBITRARY_MAXIMUM from 500 to 2000 for mondorestore's filebrowser 23 23 (Andree Leidenfrost) 24 - remove the renice of mondoarchive (Hugo Rabson) 25 - relocate what was under /usr/share to /usr/lib (FHS compliance) 26 (Bruno Cornec/Andree Leidenfrost) 27 - manage non ambiguous delivery under /usr (packages) or /usr/local (tar ball) 28 (Bruno Cornec) 29 - disable x11 build by default (Bruno Cornec) 30 - remove sbminst (Bruno Cornec/Andree Leidenfrost) 31 - use parted2fdisk everywhere (Bruno Cornec) 24 32 25 33 v2.05 (2005-11-19) -
trunk/mondo/mondo/common/libmondo-devices.c
r171 r197 2264 2264 assert(which_device != NULL); 2265 2265 asprintf(&list_drives_cmd, 2266 // "parted2fdisk 2267 "fdisk -l 2>/dev/null | grep \"/dev/.*:\" | tr -s ':' ' ' | tr -s ' ' '\n' | grep /dev/; echo %s", 2266 "parted2fdisk -l 2>/dev/null | grep \"/dev/.*:\" | tr -s ':' ' ' | tr -s ' ' '\n' | grep /dev/; echo %s", 2268 2267 where_is_root_mounted()); 2269 2268 log_it("list_drives_cmd = %s", list_drives_cmd); … … 2419 2418 2420 2419 log_msg(0, "Looking for partition table format type"); 2421 // BERLIOS: Do that temporarily: we need to put back parted2fdisk everywhere 2422 #ifdef __IA64__ 2423 struct stat buf; 2424 2425 asprintf(&fdisk, "/usr/local/bin/fdisk"); 2426 if (stat(fdisk, &buf) != 0) { 2427 paranoid_free(fdisk); 2428 #endif 2429 asprintf(&fdisk, "/sbin/fdisk"); 2430 #ifdef __IA64__ 2431 } 2432 #endif 2420 asprintf(&fdisk, "/sbin/parted2fdisk"); 2433 2421 log_msg(1, "Using %s", fdisk); 2434 2422 asprintf(&command, "%s -l %s | grep 'EFI GPT'", fdisk, drive); -
trunk/mondo/mondo/common/libmondo-files.c
r194 r197 1038 1038 char *nfs_client_ipaddr; 1039 1039 char *nfs_client_netmask; 1040 char *nfs_client_broadcast;; 1040 1041 char *nfs_client_defgw; 1041 1042 char *nfs_server_ipaddr; … … 1079 1080 1080 1081 asprintf(&command, 1082 "ifconfig | tr '\n' '#' | sed s/##// | tr '#' ' ' | tr '' '\\n' | head -n1 | tr -s '\t' ' ' | cut -d' ' -f8 | cut -d':' -f2"); 1083 strcpy(nfs_client_broadcast, 1084 call_program_and_get_last_line_of_output(command)); 1085 sprintf(command, 1081 1086 "route -n | grep '^0.0.0.0' | awk '{printf $2}'"); 1082 1087 asprintf(&nfs_client_defgw, … … 1104 1109 } 1105 1110 fprintf(fout, "ifconfig lo 127.0.0.1 # config loopback\n"); 1106 fprintf(fout, "ifconfig %s %s netmask %s # config client\n", nfs_dev,1107 nfs_client_ipaddr, nfs_client_netmask );1111 fprintf(fout, "ifconfig %s %s netmask %s broadcast %s # config client\n", nfs_dev, 1112 nfs_client_ipaddr, nfs_client_netmask, nfs_client_broadcast); 1108 1113 fprintf(fout, "route add default gw %s # default route\n", nfs_client_defgw); 1109 1114 fprintf(fout, "ping -c 1 %s # ping server\n", nfs_server_ipaddr); … … 1141 1146 write_one_liner_data_file(tmp, nfs_client_defgw); 1142 1147 paranoid_free(nfs_client_defgw); 1148 paranoid_free(tmp); 1149 1150 asprintf(&tmp, "%s/NFS-CLIENT-BROADCAST", bkpinfo->tmpdir); 1151 write_one_liner_data_file(tmp, nfs_client_broadcast); 1152 paranoid_free(nfs_client_broadcast); 1143 1153 paranoid_free(tmp); 1144 1154 -
trunk/mondo/mondo/common/libmondo-tools.c
r183 r197 993 993 } 994 994 995 if (!run_program_and_log_output(" fdisk -l | grep -i raid", 1)995 if (!run_program_and_log_output("parted2fdisk -l | grep -i raid", 1) 996 996 && !does_file_exist("/etc/raidtab")) { 997 997 log_to_screen -
trunk/mondo/mondo/mondoarchive/main.c
r171 r197 188 188 register_pid(g_main_pid, "mondo"); 189 189 set_signals(TRUE); // catch SIGTERM, etc. 190 nice(10);191 190 run_program_and_log_output("date", 1); 192 191 run_program_and_log_output("dmesg -n1", TRUE); -
trunk/mondo/mondo/mondorestore/mondo-prep.c
r146 r197 1525 1525 #else 1526 1526 make_hole_for_file(FDISK_LOG); 1527 #ifdef __IA64__ 1528 sprintf(tmp, "parted2fdisk %s >> %s 2>> %s", drivename, FDISK_LOG, 1529 FDISK_LOG); 1530 #else 1531 sprintf(tmp, "fdisk %s >> %s 2>> %s", drivename, FDISK_LOG, FDISK_LOG); 1532 #endif 1527 sprintf(tmp, "parted2fdisk %s >> %s 2>> %s", drivename, FDISK_LOG, FDISK_LOG); 1533 1528 pout_to_fdisk = popen(tmp, "w"); 1534 1529 if (!pout_to_fdisk) { 1535 log_to_screen("Cannot call fdisk to configure %s", drivename);1530 log_to_screen("Cannot call parted2fdisk to configure %s", drivename); 1536 1531 paranoid_free(device_str); 1537 1532 paranoid_free(format); -
trunk/mondo/mondo/restore-scripts/mondo/grub-MR
r140 r197 166 166 line=`cat /proc/mdstat | grep $base | head -n1` 167 167 echo "mbrpart was $mbrpart" 168 mbrpart=` fdisk -l | grep /dev/ | head -n1 | tr ':' ' ' \168 mbrpart=`parted2fdisk -l | grep /dev/ | head -n1 | tr ':' ' ' \ 169 169 | cut -d' ' -f2` 170 170 echo "mbrpart is $mbrpart" -
trunk/mondo/mondo/restore-scripts/mondo/make-me-bootable
r30 r197 31 31 boot_drv=$drive 32 32 boot_part=$partno 33 # if [ "$mountpt" = "/" ] || [ "$mountpt" = "/boot" ] || [ "$format" = "vfat" ] ; then34 # LogIt "Making $i bootable (drive=$drive, partno=$partno)"35 # echo -e -n "a\n$partno\nw\n" | fdisk $drive >> $LOGFILE 2>> $LOGFILE36 # HAVE_ACTIVE="true"37 33 fi 38 34 fi
Note:
See TracChangeset
for help on using the changeset viewer.