From 74b1a3c79056b624af20c512e8ade0e923827bee Mon Sep 17 00:00:00 2001 From: Alexey Gladkov Date: Thu, 1 Mar 2007 14:38:41 +0300 Subject: [PATCH] backend3/lilo.in: - Set boottable flag. bin/install2.in: - Add fbdev driver. data/lilo.conf.template: - Add panic=30 in common boot params. ui/install2/basesystem.scm: - Remove obsolete code. Signed-off-by: Alexey Gladkov --- alterator-install2.spec | 2 +- backend3/lilo.in | 62 +++++++++++++++++++++++++++++++++++++++----- bin/install2.in | 2 +- data/lilo.conf.template | 2 +- ui/install2/basesystem.scm | 5 +-- 5 files changed, 60 insertions(+), 13 deletions(-) diff --git a/alterator-install2.spec b/alterator-install2.spec index 95c43cd..97e85b1 100644 --- a/alterator-install2.spec +++ b/alterator-install2.spec @@ -35,7 +35,7 @@ Conflicts: alterator-install2 Requires: alterator-install-common #install3 modules -Requires: evms fdisk mdadm +Requires: evms mdadm Requires: alterator-users Requires: alterator-apt Requires: alterator-net-tcp dhcpcd diff --git a/backend3/lilo.in b/backend3/lilo.in index ac9cd66..70cbc38 100755 --- a/backend3/lilo.in +++ b/backend3/lilo.in @@ -6,6 +6,7 @@ PROG="alterator-lilo" destdir="@DESTROOTDIR@" lilo_template="@INSTALL3_DATA@/lilo.conf.template" lilo_conf_new="/tmp/lilo.conf" +blkid_args="-c /dev/null -w /dev/null" workdir= sections= @@ -77,7 +78,7 @@ convert_bootdev() { device_exists "$bootdev" || return 1 fi - if ! boot_uuid="UUID=$(/sbin/blkid -o value -s UUID "$bootdev" 2>/dev/null)"; then + if ! boot_uuid="UUID=$(/sbin/blkid $blkid_args -o value -s UUID "$bootdev" 2>/dev/null)"; then error "$bootdev: Unable to get UUID" return 1 fi @@ -89,7 +90,58 @@ convert_bootdev() { sed -i -e "s#^boot=.*#boot=\"$bootdev\"#" "$lilo_conf" } +partitions_list() { + sfdisk -l 2>/dev/null | + sed -r -e '\#^/dev/#!d' \ + -e 's#[[:space:]]+# #g' \ + -e 's#^(/dev/[^[:space:]]+) ([[:digit:]])#\1 x \2#' +} + +set_bootable() { + local boot="$1" + + if [ -z "$boot" ]; then + debug "$fn: Something wrong! first argument is emply" + return 0 + fi + device_exists "$boot" || return 0 + + local dev= num= + + dev="$(printf %s "$boot" |sed -r -e 's,^(/dev/.*[^0-9])[0-9]+$,\1,')" + device_exists "$dev" || return 0 + + num="$(printf %s "$boot" |sed -r -e 's,^/dev/.*[^0-9]([0-9]+)$,\1,')" + [ -n "$num" ] || return 0 + + debug "set_bootable(): set bootable flag on '$boot' partittion (dev='$dev', num='$num')" + sfdisk "$dev" -A "$num" +} + +bootable_flag() { + local bootdev="/dev/${1#/dev/}" + + if sfdisk -s |cut -d: -f1 |grep -xqs "$bootdev"; then + local firstdev= plist= + + plist="`partitions_list |grep "^$bootdev" |cut -d\ -f1,2`" + printf %s "$plist" |grep -qs '[[:space:]]\*$' && + return 0 + + firstdev="`printf %s "$plist" cut -d\ -f1 |head -1`" + + set_bootable "$firstdev" + fi + + sfdisk -l 2>/dev/null |grep -qs "^$bootdev[[:space:]]" || + return 0 + + set_bootable "$bootdev" +} + write_liloconf() { + local bootdev="$(sed -r -n -e 's,^boot=\"([^\"]+)\",\1,p' "$lilo_conf_new")" + convert_bootdev "$lilo_conf_new" || return 1 if ! out="$(lilo -t -C "$lilo_conf_new" 2>&1 >/dev/null)"; then @@ -99,7 +151,7 @@ write_liloconf() { debug "write_liloconf(): lilo test passed" [ ! -f /etc/lilo.conf ] || mv -f -- /etc/lilo.conf /etc/lilo.conf.save mv -f -- "$lilo_conf_new" /etc/lilo.conf - lilo >/dev/null 2>&1 + lilo >/dev/null 2>&1 && bootable_flag "$bootdev" } write_section() { @@ -291,11 +343,7 @@ find_others() { done < /proc/mounts debug "exclude='$exclude'" - fdisk -l 2>/dev/null | - sed -r \ - -e '\#^/dev/#!d' \ - -e 's#[[:space:]]+# #g' \ - -e 's#^(/dev/[^[:space:]]+) ([[:digit:]])#\1 x \2#' | + partitions_list | while read dev boot start end blocks id system; do # We need only bootable partitions [ "$boot" = "*" ] || continue diff --git a/bin/install2.in b/bin/install2.in index 2f370cd..b0524b2 100755 --- a/bin/install2.in +++ b/bin/install2.in @@ -148,7 +148,7 @@ rc=0 printf "Starting Xorg server...\n" cmd="xinit /usr/sbin/alterator-install2 -- vt7 -dpms -ac -dpi 80 -logfile /tmp/x11.log" if ! $cmd >/tmp/install2.log 2>&1; then - for drv in vesa vga; do + for drv in fbdev vesa vga; do video_setup "$drv" /etc/X11/xorg.conf $cmd >/tmp/install2.log 2>&1 && break || rc=$? done diff --git a/data/lilo.conf.template b/data/lilo.conf.template index 6966367..076bbb6 100644 --- a/data/lilo.conf.template +++ b/data/lilo.conf.template @@ -6,7 +6,7 @@ prompt timeout="100" install="menu" default="ALTLinux" -append="" +append="panic=30" image="/boot/vmlinuz" label="ALTLinux" diff --git a/ui/install2/basesystem.scm b/ui/install2/basesystem.scm index 20d1786..0e7187c 100644 --- a/ui/install2/basesystem.scm +++ b/ui/install2/basesystem.scm @@ -22,9 +22,8 @@ ((stage) (case (cond-plistq 'stage msg "") - ((download-pkgs) (progress text (_ "Downloading packages ..."))) - ((install-pkgs) (progress text (_ "Installing packages ..."))) - ((install-kern) (progress text (_ "Installing kernel ...")))) + ((download-pkgs) (progress text (_ "Getting packages ..."))) + ((install-pkgs) (progress text (_ "Installing packages ...")))) (progress maximum (cond-plistq 'max msg 0))) ) ) -- 1.5.5.5.GIT