about summary refs log blame commit diff stats
path: root/linux/scripts/chroot.sh
blob: 00fbd78139de150c555da333b5bbe4267cd4d4ab (plain) (tree)
1
2
3
4
5
6
7
8
9








                                          
#!/bin/bash

CHROOT=/mnt

chroot $CHROOT /usr/bin/env -i \
  HOME=/root TERM="$TERM" PS1='\u:\w\$ ' \
  PATH=/bin:/usr/bin:/sbin:/usr/sbin \
  /bin/bash --login
v>
   
                                                 
                   
                                          

        
               
                      
 
# example program: reading events from keyboard or mouse
#
# Keeps printing 'a' until you press a key or click on the mouse.

def main [
  local-scope
  open-console
  {
    e:event, found?:bool <- check-for-interaction
    break-if found?
    print-character-to-display 97, 7/white
    loop
  }
  close-console
  $print e, 10/newline
]