second step
This commit is contained in:
@@ -98,6 +98,12 @@ class Operation:
|
||||
if display_scale: display_scale()
|
||||
return ret
|
||||
|
||||
def getarch(self):
|
||||
cmd='uname -m'
|
||||
result = subprocess.Popen(cmd,stdout=subprocess.PIPE,shell=True)
|
||||
arch = result.stdout.readline().rstrip()
|
||||
return arch
|
||||
|
||||
def sigpipe_handle(self):
|
||||
signal.signal(signal.SIGPIPE,signal.SIG_DFL)
|
||||
|
||||
@@ -310,8 +316,12 @@ class BootLoader(Operation):
|
||||
self.return_value[127]=("No tool to bootloader. E.g grub",u"没有安装引导程序的工具。如grub等")
|
||||
|
||||
def get_arguments(self):
|
||||
# only grub?
|
||||
return ["-t grub"]
|
||||
if self.getarch() == "ppc64":
|
||||
pass
|
||||
elif self.getarch() == "ia64":
|
||||
return ["-t elilo"]
|
||||
else:
|
||||
return ["-t grub"]
|
||||
|
||||
class ConfigureBootloader(Operation):
|
||||
"""class for configure bootloader file"""
|
||||
@@ -323,7 +333,13 @@ class ConfigureBootloader(Operation):
|
||||
|
||||
def get_arguments(self):
|
||||
list=[]
|
||||
tp="grub"
|
||||
|
||||
if self.getarch() == "ppc64":
|
||||
pass
|
||||
elif self.getarch() == "ia64":
|
||||
tp = "elilo"
|
||||
else:
|
||||
tp = "grub"
|
||||
# FIXME if tag file format is error?
|
||||
if os.path.isfile("/tag"):
|
||||
fd = open("/tag","r")
|
||||
|
||||
@@ -60,6 +60,14 @@ options:
|
||||
return $ret
|
||||
}
|
||||
|
||||
|
||||
configure_elilo_cnf()
|
||||
{
|
||||
local root_dev
|
||||
root_dev="/dev/$ROOT_PARTITION"
|
||||
sed -i "s@root=@root=$root_dev@g" /mnt/boot/efi/boot/elilo.conf
|
||||
}
|
||||
|
||||
configure_grub_cnf ()
|
||||
{
|
||||
|
||||
@@ -186,6 +194,14 @@ main ()
|
||||
configure_grub_cnf
|
||||
erv
|
||||
;;
|
||||
elilo)
|
||||
if [ -z "$ROOT_PARTITION" ]; then
|
||||
err "configure grub configuration file root partition can't be empty"
|
||||
exit 1
|
||||
fi
|
||||
configure_elilo_cnf
|
||||
erv
|
||||
;;
|
||||
*)
|
||||
err "$TYPE bootloader no implement yet !"
|
||||
exit 3
|
||||
|
||||
@@ -45,21 +45,31 @@ main ()
|
||||
exit 1
|
||||
fi
|
||||
|
||||
info "copy $INITRD/initrd.gz to $TARGET/boot/initrd.gz.old"
|
||||
if [ -e "$INITRD/initrd.gz" ];then
|
||||
cp "$INITRD/initrd.gz" "$TARGET/boot/initrd.gz.old" 2>>$DEV_LOG
|
||||
else
|
||||
err "$INITRD/initrd.gz doesn't exist "
|
||||
exit 1
|
||||
fi
|
||||
case `uname -m` in
|
||||
x86_64 | i686)
|
||||
info "copy $INITRD/initrd.gz to $TARGET/boot/initrd.gz.old"
|
||||
if [ -e "$INITRD/initrd.gz" ];then
|
||||
cp "$INITRD/initrd.gz" "$TARGET/boot/initrd.gz.old" 2>>$DEV_LOG
|
||||
else
|
||||
err "$INITRD/initrd.gz doesn't exist "
|
||||
exit 1
|
||||
fi
|
||||
|
||||
info "runing makeinitrd"
|
||||
if [ -e ./makeinitrd ];then
|
||||
./makeinitrd 2>>$DEV_LOG
|
||||
else
|
||||
err "makeinitrd doesn't exist "
|
||||
info "runing makeinitrd"
|
||||
if [ -e ./makeinitrd ];then
|
||||
./makeinitrd 2>>$DEV_LOG
|
||||
else
|
||||
err "makeinitrd doesn't exist "
|
||||
exit 1
|
||||
fi
|
||||
;;
|
||||
ia64)
|
||||
;;
|
||||
*)
|
||||
err "architecture is not allowing"
|
||||
exit 1
|
||||
fi
|
||||
;;
|
||||
esac
|
||||
}
|
||||
|
||||
KERNELS="/Rocky/kernels"
|
||||
|
||||
@@ -78,7 +78,7 @@ format_partition ()
|
||||
swap)
|
||||
mkswap -f "$devname" 1>>"$DEV_LOG" 2>&1
|
||||
;;
|
||||
fat)
|
||||
vfat)
|
||||
mkfs.vfat "$devname" 1>>"$DEV_LOG" 2>&1
|
||||
;;
|
||||
*)
|
||||
|
||||
@@ -102,7 +102,12 @@ main ()
|
||||
install_grub
|
||||
erv
|
||||
;;
|
||||
elilo)
|
||||
echo "install elilo";
|
||||
sed -i '/boot/d' $TARGET/etc/fstab
|
||||
;;
|
||||
*)
|
||||
|
||||
err "$type bootloader no implement yet !"
|
||||
exit 3
|
||||
;;
|
||||
|
||||
@@ -872,7 +872,7 @@ row 4 | |
|
||||
<widget type='Listbox' name='mp_top_fs'>
|
||||
<widget_attribute listvariable='mp_top_fs'/>
|
||||
<grid_location row='4' column='1' sticky='W'/>
|
||||
<variable name='mp_top_fs' type='StringVar' value='ext2 ext3 reiserfs xfs jfs swap'/>
|
||||
<variable name='mp_top_fs' type='StringVar' value='ext2 ext3 reiserfs xfs jfs swap vfat'/>
|
||||
</widget>
|
||||
|
||||
<widget type='Button'>
|
||||
|
||||
Reference in New Issue
Block a user