packages feed

haskus-system-build 1.0 → 1.1

raw patch · 2 files changed

+62/−56 lines, 2 filesdep ~basedep ~conduitdep ~directory

Dependency ranges changed: base, conduit, directory, filepath, hashable, haskus-utils, http-conduit, optparse-applicative, optparse-simple, process, temporary, text, yaml

Files

haskus-system-build.cabal view
@@ -1,52 +1,54 @@-cabal-version: >=1.20-name: haskus-system-build-version: 1.0-license: BSD3-license-file: LICENSE-copyright: Sylvain Henry 2018-maintainer: sylvain@haskus.fr-author: Sylvain Henry-homepage: http://www.haskus.org/system-synopsis: Haskus system build tool+name:                haskus-system-build+version:             1.1+synopsis:            Haskus system build tool+license:             BSD3+license-file:        LICENSE+author:              Sylvain Henry+maintainer:          sylvain@haskus.fr+homepage:            http://www.haskus.org/system+copyright:           Sylvain Henry 2018+category:            System+build-type:          Simple+cabal-version:       1.20+ description:-    Build tool to use with haskus-system.-category: System-build-type: Simple+   Build tool to use with haskus-system.  source-repository head-    type: git-    location: git://github.com/haskus/haskus-system-build.git+  type: git+  location: git://github.com/haskus/haskus-system-build.git  executable haskus-system-build-    main-is: Haskus/Apps/System/Build/Main.hs-    hs-source-dirs: src/apps-    other-modules:-        Haskus.Apps.System.Build.Config-        Haskus.Apps.System.Build.Linux-        Haskus.Apps.System.Build.Ramdisk-        Haskus.Apps.System.Build.Syslinux-        Haskus.Apps.System.Build.Stack-        Haskus.Apps.System.Build.CmdLine-        Haskus.Apps.System.Build.Utils-        Haskus.Apps.System.Build.GMP-        Haskus.Apps.System.Build.QEMU-        Haskus.Apps.System.Build.ISO-        Haskus.Apps.System.Build.Disk-        Haskus.Apps.System.Build.Download-        Paths_haskus_system_build-    default-language: Haskell2010-    ghc-options: -Wall -threaded-    build-depends:-        base >=4.9 && <4.12,-        process >=1.4 && <1.7,-        yaml ==0.8.*,-        text ==1.2.*,-        haskus-utils >=0.7 && <1.1,-        optparse-simple >=0.0 && <0.2,-        optparse-applicative >=0.13 && <0.15,-        temporary >=1.2 && <1.4,-        directory >=1.2 && <1.4,-        filepath ==1.4.*,-        hashable ==1.2.*,-        http-conduit >=2.3.2 && <2.4,-        conduit >=1.3.0.3 && <1.4+   main-is: Haskus/Apps/System/Build/Main.hs+   hs-source-dirs: src/apps+   other-modules:+      Haskus.Apps.System.Build.Config+      Haskus.Apps.System.Build.Linux+      Haskus.Apps.System.Build.Ramdisk+      Haskus.Apps.System.Build.Syslinux+      Haskus.Apps.System.Build.Stack+      Haskus.Apps.System.Build.CmdLine+      Haskus.Apps.System.Build.Utils+      Haskus.Apps.System.Build.GMP+      Haskus.Apps.System.Build.QEMU+      Haskus.Apps.System.Build.ISO+      Haskus.Apps.System.Build.Disk+      Haskus.Apps.System.Build.Download+      Paths_haskus_system_build+   build-depends:+         base                    >= 4.9 && < 5.0+      ,  process                 >= 1.4+      ,  yaml                    >= 0.8+      ,  text                    >= 1.2+      ,  haskus-utils            >= 0.7+      ,  optparse-simple         >= 0.0+      ,  optparse-applicative    >= 0.13+      ,  temporary               >= 1.2+      ,  directory               >= 1.2+      ,  filepath                >= 1.4+      ,  hashable                >= 1.2+      ,  http-conduit+      ,  conduit++   default-language:    Haskell2010+   ghc-options:         -Wall -threaded
src/apps/Haskus/Apps/System/Build/Linux.hs view
@@ -37,7 +37,6 @@          let             tgtmod  = tgtfp </> "modules"             tgtmod' = tgtfp </> "modules_tmp"-            tgtfw   = tgtfp </> "firmwares"           -- check if we already have the built kernel          unlessM (doesFileExist tgtker) $ do@@ -69,7 +68,6 @@                linuxBuild config fp2                 createDirectoryIfMissing True tgtmod'-               createDirectoryIfMissing True tgtfw                 -- copy the kernel, modules and firmwares                showStep "Copying kernel..."@@ -78,18 +76,24 @@                showStep "Copying modules..."                shellInErr fp2 ("make modules_install INSTALL_MOD_PATH="++tgtmod') $                   failWith "Cannot copy Linux modules"-               renameDirectory-                  (tgtmod' </> "lib" </> "modules" </> Text.unpack version)-                  tgtmod+               -- modules are usually in lib/modules/<kernel_version> but for some+               -- versions the path is incorrect+               --    e.g. "5.0" => "/lib/modules/5.0.0"+               -- So we try to find the only directory in "/lib/modules" instead+               let+                  modPathPrefix = tgtmod' </> "lib" </> "modules"+                  tgtModPath   = modPathPrefix </> Text.unpack version+               doesDirectoryExist tgtModPath >>= \case+                  True  -> renameDirectory tgtModPath tgtmod+                  False -> listDirectory modPathPrefix >>= \case+                     [r] -> renameDirectory (modPathPrefix </> r) tgtmod+                     []  -> return ()+                     rs  -> putStrLn $ "Warning: found several module directories!?\n" ++ show rs                removeDirectory (tgtmod' </> "lib" </> "modules")                removeDirectory (tgtmod' </> "lib")                removeDirectory tgtmod'                removeFile (tgtmod </> "source")                removeFile (tgtmod </> "build")--               showStep "Copying firmwares..."-               shellInErr fp2 ("make firmware_install INSTALL_FW_PATH="++tgtfw) $-                  failWith "Cannot copy Linux firmwares"                 showStep "Copying .config file..."                copyFile (fp2 </> ".config") (tgtfp </> ".config")