File: Aboot.hs

package info (click to toggle)
dfsbuild 0.99.3
  • links: PTS
  • area: main
  • in suites: etch, etch-m68k
  • size: 308 kB
  • ctags: 6
  • sloc: haskell: 815; sh: 197; makefile: 99
file content (30 lines) | stat: -rw-r--r-- 1,041 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
{- dfsbuild: CD image builder
Copyright (c) 2006 John Goerzen
Please see COPYRIGHT for more details
-}

module Bootloader.Aboot where
import Utils
import MissingH.Cmd
import MissingH.Path
import System.Posix.Files
import System.Posix.Directory
import MissingH.Path.Glob
import MissingH.ConfigParser
import MissingH.Path.FilePath
import Text.Printf

aboot env =
    do safeSystem "cp" ["/boot/bootlx", targetdir env ++ "/boot/"]
       newkerns <- glob $ targetdir env ++ "/boot/vmlinu*"
       rdparam <- getrdparam env
       writeFile (targetdir env ++ "/etc/aboot.conf") 
                 (concat . map (kline rdparam) $ zip newkerns [(0::Int)..])
       return ([],
               \isoname -> safeSystem "isomarkboot" 
                             [isoname, "/boot/bootlx", "/boot/initrd.dfs"]
              )
    where kline rdparam (kname, count) =
              printf "%d:boot/%s initrd=boot/initrd.dfs root=/dev/ram0 ide=nodma %s\n" count (fst . splitFileName $ kname) rdparam