1 # --- T2-COPYRIGHT-NOTE-BEGIN ---
2 # This copyright note is auto-generated by scripts/Create-CopyPatch.
4 # T2 SDE: package/*/kboot/stone_mod_kboot.sh
5 # Copyright (C) 2004 - 2021 The T2 SDE Project
7 # More information can be found in the files COPYING and README.
9 # This program is free software; you can redistribute it and/or modify
10 # it under the terms of the GNU General Public License as published by
11 # the Free Software Foundation; version 2 of the License. A copy of the
12 # GNU General Public License can be found in the file COPYING.
13 # --- T2-COPYRIGHT-NOTE-END ---
15 # [MAIN] 70 kboot kBoot Loader Setup
18 create_kernel_list
() {
20 for x
in `(cd /boot/; ls vmlinux-* ) | sort -r`; do
21 if [ $first = 1 ]; then
24 label
=t2sde-
${x/vmlinux-/}
28 $label='$bootpath/$x initrd=$bootpath/initrd-${ver} root=$rootdev' # video=ps3fb:mode:13
34 mkdir
-p $etcpath/etc
/
35 create_kernel_list
> $etcpath/etc
/kboot.conf
37 gui_message
"This is the new $etcpath/etc/kboot.conf file:
39 $(< $etcpath/etc/kboot.conf)"
43 local dev
="`sed -n "s
,\
([^
]*\
) $1 .
*,\
1,p
" /proc/mounts | tail -n 1`"
44 if [ ! "$dev" ]; then # try the higher dentry
45 local try
="`dirname $1`"
46 dev
="`grep \" $try \" /proc/mounts | tail -n 1 | \
49 if [ -h "$dev" ]; then
50 echo "/dev/`readlink $dev`"
59 dir
="`dirname $dir`/`readlink $dir`"
60 dir
="`echo $dir | sed 's,[^/]*/\.\./,,g'`"
66 bootdev
="`device4 /boot`"
68 [ "$rootdev" != "$bootdev" ] && etcpath
=/boot || bootpath
=/boot
70 if [ ! -f /boot
/etc
/kboot.conf
]; then
71 if gui_yesno
"kBoot does not appear to be configured.
72 Automatically configure kboot now?"; then
79 gui_menu kboot
'kBoot Loader Setup' \
80 "Following settings only for expert use: (default)" ""\
81 "Root Device ........... $rootdev" "" \
82 "Boot Device ........... $bootdev" "" \
84 "(Re-)Create default $etcpath/etc/kboot.conf" 'create_kboot_conf' \
86 "Edit $etcpath/etc/kboot.conf (Config file)" \
87 "gui_edit 'kBoot Configuration' $etcpath/etc/kboot.conf"