summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorP. J. McDermott <pj@pehjota.net>2014-07-13 23:28:14 (EDT)
committer P. J. McDermott <pj@pehjota.net>2014-07-13 23:28:14 (EDT)
commit24edce389201a9f29bd0f36197a7a4d348c41db9 (patch)
tree58529cd163242fad2b8bb48151f9a96ee91143d5
parentff10e62a8e02c2915d23a6ebef7ab4b7457dc0c5 (diff)
install-lilo: Add root parameter
-rw-r--r--install-lilo.sh8
1 files changed, 5 insertions, 3 deletions
diff --git a/install-lilo.sh b/install-lilo.sh
index 9880c58..e980baa 100644
--- a/install-lilo.sh
+++ b/install-lilo.sh
@@ -8,25 +8,27 @@ main()
[ "x$(id -u)" = 'x0' ] || error 'Must be run as the superuser'
- if [ ${#} -ne 1 ]; then
+ if [ ${#} -ne 2 ]; then
usage >&2
exit 1
fi
boot="${1}"
+ root="${2}"
[ -e "${boot}" ] || error 'Boot device not found'
[ -e /etc/lilo.conf.in ] || \
error '/etc/lilo.conf: No such file or directory'
[ -e /etc/lilo.conf ] && error '/etc/lilo.conf exists'
- sed "s|@BOOT@|${boot}|g" /etc/lilo.conf.in >/etc/lilo.conf
+ sed "s|@BOOT@|${boot}|g; s|@ROOT@|${root}|g;" /etc/lilo.conf.in \
+ >/etc/lilo.conf
/sbin/lilo
rm /etc/lilo.conf
}
usage()
{
- printf 'Usage: install-lilo <boot>\n'
+ printf 'Usage: install-lilo <boot> <root>\n'
}
error()