1 # --- T2-COPYRIGHT-NOTE-BEGIN ---
2 # T2 SDE: package/*/kboot/stone_mod_kboot.sh
3 # Copyright (C) 2004 - 2022 The T2 SDE Project
5 # This Copyright note is generated by scripts/Create-CopyPatch,
6 # more information can be found in the files COPYING and README.
8 # This program is free software; you can redistribute it and/or modify
9 # it under the terms of the GNU General Public License version 2.
10 # --- T2-COPYRIGHT-NOTE-END ---
12 # [MAIN] 70 kboot kBoot Loader Setup
15 cmdline
="console= $(< /proc/cmdline)"
16 cmdline
=${cmdline##*console=} cmdline
=${cmdline%%[ ,]*}
17 if [ -z "$cmdline" ]; then
18 cmdline
="`grep -a -H Y /sys/class/tty/*/console`"
19 cmdline
="${cmdline%%/console*}" cmdline
=${cmdline##*/}
22 create_kernel_list
() {
24 for x
in `(cd /boot/; ls vmlinux-* ) | sort -r`; do
25 if [ $first = 1 ]; then
28 label
=t2sde-
${x/vmlinux-/}
32 $label='$bootpath/$x initrd=$bootpath/initrd-${ver} root=$rootdev ${cmdline:+ console=}$cmdline'
39 mkdir
-p $etcpath/etc
/
40 create_kernel_list
> $etcpath/etc
/kboot.conf
42 gui_message
"This is the new $etcpath/etc/kboot.conf file:
44 $(< $etcpath/etc/kboot.conf)"
48 local dev
="`sed -n "s
,\
([^
]*\
) $1 .
*,\
1,p
" /proc/mounts | tail -n 1`"
49 if [ ! "$dev" ]; then # try the higher dentry
50 local try
="`dirname $1`"
51 dev
="`grep \" $try \" /proc/mounts | tail -n 1 | \
54 if [ -h "$dev" ]; then
55 echo "/dev/`readlink $dev`"
64 dir
="`dirname $dir`/`readlink $dir`"
65 dir
="`echo $dir | sed 's,[^/]*/\.\./,,g'`"
71 bootdev
="`device4 /boot`"
73 [ "$rootdev" != "$bootdev" ] && etcpath
=/boot || bootpath
=/boot
75 if [ ! -f /boot
/etc
/kboot.conf
]; then
76 if gui_yesno
"kBoot does not appear to be configured.
77 Automatically configure kboot now?"; then
84 gui_menu kboot
'kBoot Loader Setup' \
85 "Following settings only for expert use: (default)" ""\
86 "Root Device ........... $rootdev" "" \
87 "Boot Device ........... $bootdev" "" \
89 "(Re-)Create default $etcpath/etc/kboot.conf" 'create_kboot_conf' \
91 "Edit $etcpath/etc/kboot.conf (Config file)" \
92 "gui_edit 'kBoot Configuration' $etcpath/etc/kboot.conf"