* updated firefox (133.0.3 -> 134.0.2)
[t2sde.git] / package / boot / arcload / stone_mod_arcload.sh
blobf92399d9e7ba3c5f93bf7e62849ff0c0eedf9a52
1 # --- T2-COPYRIGHT-NOTE-BEGIN ---
2 # T2 SDE: package/*/arcload/stone_mod_arcload.sh
3 # Copyright (C) 2004 - 2025 The T2 SDE Project
4 #
5 # This Copyright note is generated by scripts/Create-CopyPatch,
6 # more information can be found in the files COPYING and README.
7 #
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 arcload Arcload Setup
13 # [SETUP] 90 arcload
15 install_arcload() {
16 dvhtool -d "${bootdev%[0-9]*}" --unix-to-vh /boot/arcload.ecoff sash
17 dvhtool -d "${bootdev%[0-9]*}" --unix-to-vh /boot/arcload sash64
20 create_kernel_list() {
21 local first=1
22 for x in `(cd /boot/; ls vmlinux-*) | sort -Vr`; do
23 if [ $first = 1 ]; then
24 label=t2sde first=0
25 else
26 label=t2sde-${x/vmlinux-/}
28 ver=${x/vmlinux-}
29 cat << EOT
30 $label {
31 image system "$bootpath/$x";
32 #initrd system "$bootpath/initrd-${ver}";
33 append "root=$rootdev";
35 EOT
36 done
39 create_arcload_conf() {
40 create_kernel_list > $bootpath/arc.cf
42 gui_message "This is the new $bootpath/arc.cf file:
44 $(< $bootpath/arc.cf)"
47 device4() {
48 local dev="`sed -n "s,\([^ ]*\) $1 .*,\1,p" /etc/fstab | tail -n 1`"
49 if [ ! "$dev" ]; then # try the higher dentry
50 local try="`dirname $1`"
51 dev="`grep \" $try \" /etc/fstab | tail -n 1 | \
52 cut -d ' ' -f 1`"
54 if [ -h "$dev" ]; then
55 echo "/dev/`readlink $dev`"
56 else
57 echo $dev
61 realpath() {
62 dir="`dirname $1`"
63 file="`basename $1`"
64 dir="`dirname $dir`/`readlink $dir`"
65 dir="`echo $dir | sed 's,[^/]*/\.\./,,g'`"
66 echo $dir/$file
69 main() {
70 rootdev="`device4 /`"
71 bootdev="`device4 /boot`"
73 [ "$rootdev" = "$bootdev" ] && bootpath="/boot"
75 if [ ! -f $bootpath/arc.cf ]; then
76 if gui_yesno "Arcload does not appear to be configured.
77 Automatically configure Arcload now?"; then
78 create_arcload_conf && install_arcload
82 while
84 gui_menu arcload 'Arcload Setup' \
85 "Following settings only for expert use: (default)" "" \
86 "Root Device ........... $rootdev" "" \
87 "Boot Device ........... $bootdev" "" \
88 '' '' \
89 "(Re-)Create default $bootpath/arc.cf" 'create_arcload_conf' \
90 '(Re-)Install Arcload into the VH' 'install_arcload' \
91 '' '' \
92 "Edit $bootpath/arc.cf (Config file)" \
93 "gui_edit 'Arcload Configuration' $bootpath/arc.cf"
94 do : ; done