~xnox/debian-cd/s390x

« back to all changes in this revision

Viewing changes to data/vivid/pegasos/pegasos

  • Committer: Colin Watson
  • Date: 2014-10-24 20:13:50 UTC
  • Revision ID: cjwatson@canonical.com-20141024201350-2vscksr5chvjhgyy
add CONF.sh bits for vivid; copy utopic → vivid elsewhere

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
\ FORTH is identifed by a forth comment at first line
 
2
\
 
3
\ terminal control stuff
 
4
\
 
5
: TTY.CSI d# 27 EMIT ASCII [ EMIT ;
 
6
: TTY.HOME    TTY.CSI ASCII H EMIT ;
 
7
: TTY.CLR_EOS TTY.CSI ASCII J EMIT ;
 
8
: TTY.HOME_CLR TTY.HOME TTY.CLR_EOS ;
 
9
\
 
10
\ boot menu stuff
 
11
\
 
12
: my-max-boot-num 3 ;
 
13
: my-boot-default 1 ;
 
14
: my-boot-delay d# 300 ; \ unit = 100 ms
 
15
: my-print-menu ( -- )
 
16
  TTY.HOME_CLR
 
17
  ."  "                                                         cr
 
18
  ." Welcome to Ubuntu ${DEBIAN_VERSION}!"                      cr
 
19
  ." "                                                          cr
 
20
  ." This is an Ubuntu installation ${MEDIA_TYPE},"             cr
 
21
  ." built on ${BUILD_DATE}."                                   cr
 
22
  ." "                                                          cr
 
23
  ." The default option is (1) 'install'."                      cr
 
24
  ." "                                                          cr
 
25
  ." ************************************"                      cr
 
26
  ." If in doubt, just choose (1) 'install'"                    cr
 
27
  ." ************************************"                      cr
 
28
  ."  "                                                         cr
 
29
  ." 1: install"                                                cr
 
30
  ." 2: return to OF prompt"                                    cr
 
31
  ."  "                                                         cr
 
32
;
 
33
: my-boot-case ( num -- )
 
34
  ."  " cr
 
35
  case
 
36
    1 of " cd install/powerpc/vmlinuz-chrp.initrd --" endof
 
37
    2 of " none" endof
 
38
  endcase
 
39
  $boot
 
40
;
 
41
: my-input-num ( wait-period max-boot-num default-num -- boot-num )
 
42
  1 \ loop-inc = 1
 
43
  3 pick 0 do
 
44
    0d emit
 
45
    ." press 1-"
 
46
    ( wait-period max-boot-num default-num loop-inc )
 
47
    2 pick ascii 0 + emit
 
48
    dup 1 = if
 
49
      ."  within "
 
50
      3 pick i - d# 10 / .d
 
51
      ."  seconds"
 
52
    then
 
53
    ."  (default: "
 
54
    over ascii 0 + emit
 
55
    ." ) :                   "
 
56
    d# 100 ms
 
57
    key? if
 
58
       key
 
59
       ( wait-period max-boot-num default-num loop-inc key )
 
60
       dup 0d = if \ return pressed
 
61
         drop leave
 
62
       then
 
63
 
 
64
       ascii 0 -
 
65
       ( wait-period max-boot-num default-num loop-inc num )
 
66
       dup 1 5 pick
 
67
       ( wait-period max-boot-num default-num loop-inc num num 1 max-boot-num )
 
68
       between if
 
69
         rot drop swap leave
 
70
       then
 
71
 
 
72
       ( wait-period max-boot-num default-num loop-inc num )
 
73
       2drop 0  \ loop-inc = 0
 
74
    then
 
75
  dup +loop
 
76
  drop
 
77
  ( wait-period max-boot-num boot-num )
 
78
  nip nip
 
79
;
 
80
 
 
81
 
 
82
my-print-menu
 
83
my-boot-delay my-max-boot-num my-boot-default my-input-num
 
84
my-boot-case