You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
76 lines
2.1 KiB
76 lines
2.1 KiB
#!/bin/sh |
|
# --- SDE-COPYRIGHT-NOTE-BEGIN --- |
|
# This copyright note is auto-generated by ./scripts/Create-CopyPatch. |
|
# |
|
# Filename: package/.../aboot/aboot.setup |
|
# Copyright (C) 2006 The OpenSDE Project |
|
# Copyright (C) 2006 The T2 SDE Project |
|
# |
|
# More information can be found in the files COPYING and README. |
|
# |
|
# This program is free software; you can redistribute it and/or modify |
|
# it under the terms of the GNU General Public License as published by |
|
# the Free Software Foundation; version 2 of the License. A copy of the |
|
# GNU General Public License can be found in the file COPYING. |
|
# --- SDE-COPYRIGHT-NOTE-END --- |
|
|
|
# |
|
# ROCK Linux: /etc/setup.d/10-aboot |
|
# |
|
# Read /etc/setup.d/00-general for details about ROCK Linux setup scripts. |
|
# |
|
|
|
case "$1" in |
|
setup) |
|
;; |
|
[a-z]*) |
|
exit 0 ;; |
|
*) |
|
echo "Usage: $0 setup" ; exit 1 ;; |
|
esac |
|
|
|
echo -n 'WARNING: This script is for testing purposes only! No guarantee of correct work!\n\n' |
|
echo -n 'YOU HAVE BEEN WARNED!!!\n\n' |
|
|
|
echo -n 'Would you like to run the aboot setup script now? (YES/no) ' |
|
read in ; [[ "$in" == [nN]* ]] && exit 0 ; unset in |
|
|
|
echo -e '\n==> ABOOT configuration <==' |
|
|
|
echo -n 'Would you like me to create a /etc/aboot.conf file? (YES/no) ' |
|
read in |
|
case "$in" in |
|
[nN]*) echo ; exit ;; |
|
*) |
|
rootdev="`grep '^/dev/.* / ' /etc/mtab | tr ' ' '\t' | cut -f1`" |
|
bootdev="`grep '^/dev/.* /boot ' /etc/mtab | tr ' ' '\t' | cut -f1`" |
|
|
|
|
|
# check, ob rootdev != bootdev |
|
if [ $rootdev != $bootdev ] ; then |
|
notice="# NOTICE: You have a /boot partition. This means\ |
|
that\n# all kernel paths are relative to /boot/" |
|
kernelpath="1:`echo -e $bootdev | sed 's/.*part//;'`/vmlinux" |
|
fi |
|
|
|
|
|
echo |
|
{ echo -e '# aboot configuration file' |
|
echo -e $notice'\n' |
|
echo -e $kernelpath' root='$rootdev'\n' |
|
|
|
} | tee /etc/aboot.conf.test | sed 's,^,> ,' |
|
esac |
|
|
|
echo -n 'Would you like me to install ABOOT now in the MBR? (YES/no) ' |
|
read in ; echo |
|
case "$in" in |
|
[nN]*) ;; |
|
*) |
|
bootdisc=`echo -e $bootdev | sed 's/part[0-9]$//;'`"disc" |
|
|
|
switeboot -c`echo -e $bootdev | sed 's/.*part//;'` $bootdisc bootlx |
|
abootconf $bootdisc |
|
;; |
|
esac |
|
|
|
|