diff options
author | Andrew Cady <d@jerkface.net> | 2020-05-30 00:48:35 -0400 |
---|---|---|
committer | Andrew Cady <d@jerkface.net> | 2020-05-30 00:48:35 -0400 |
commit | 41d5d8bfe3104f0a05bcb77999bac99f182d4eba (patch) | |
tree | de8286b7da3defc6b96df2c42fea5ca780fb0f89 /fsmgr.hs | |
parent | 8a4224d366a3560a1a8b9780016c1ae899904eb2 (diff) |
implement "apt-update" to install apt lists
presently this hard-codes stretch & amd64
Diffstat (limited to 'fsmgr.hs')
-rw-r--r-- | fsmgr.hs | 16 |
1 files changed, 15 insertions, 1 deletions
@@ -53,6 +53,19 @@ uname = unsafePerformIO $ do | |||
53 | Stdout out <- cmd "uname -r" | 53 | Stdout out <- cmd "uname -r" |
54 | return $ last . wordsBy '-' . head . lines $ out | 54 | return $ last . wordsBy '-' . head . lines $ out |
55 | 55 | ||
56 | aptListFiles :: [FilePath] | ||
57 | aptListFiles = ("/var/lib/apt/lists" </>) <$> observedCorrectListForStretch | ||
58 | where | ||
59 | observedCorrectListForStretch = | ||
60 | [ "httpredir.debian.org_debian_dists_stretch_main_binary-amd64_Packages" | ||
61 | , "httpredir.debian.org_debian_dists_stretch_main_i18n_Translation-en" | ||
62 | , "httpredir.debian.org_debian_dists_stretch_Release" | ||
63 | , "httpredir.debian.org_debian_dists_stretch_Release.gpg" | ||
64 | , "security.debian.org_dists_stretch_updates_InRelease" | ||
65 | , "security.debian.org_dists_stretch_updates_main_binary-amd64_Packages" | ||
66 | , "security.debian.org_dists_stretch_updates_main_i18n_Translation-en" | ||
67 | ] | ||
68 | |||
56 | buildRoot :: DiskImageConfig -> FilePath -> Action () | 69 | buildRoot :: DiskImageConfig -> FilePath -> Action () |
57 | buildRoot config@DiskImageConfig{..} finalOut = do | 70 | buildRoot config@DiskImageConfig{..} finalOut = do |
58 | let out = finalOut <.> "tmp" | 71 | let out = finalOut <.> "tmp" |
@@ -81,7 +94,8 @@ buildRoot config@DiskImageConfig{..} finalOut = do | |||
81 | cmd_ (AddEnv "DEBIAN_FRONTEND" "noninteractive") | 94 | cmd_ (AddEnv "DEBIAN_FRONTEND" "noninteractive") |
82 | ["dpkg"] [if unpackOnly then "--unpack" else "--install"] (dynamicNames <$> debs) | 95 | ["dpkg"] [if unpackOnly then "--unpack" else "--install"] (dynamicNames <$> debs) |
83 | {- 2.5. install apt package cache -} | 96 | {- 2.5. install apt package cache -} |
84 | -- TODO | 97 | when installAptLists $ do |
98 | cmd_ "rsync -Ra" (("/./" ++) <$> aptListFiles) (mountpoint ++ "/") | ||
85 | {- 3. binaries -} | 99 | {- 3. binaries -} |
86 | let go b = do | 100 | let go b = do |
87 | p <- fromMaybe (fail $ "not found in ${PATH}: " ++ b) <$> liftIO (pathLocate b) | 101 | p <- fromMaybe (fail $ "not found in ${PATH}: " ++ b) <$> liftIO (pathLocate b) |