propellor spin
This commit is contained in:
parent
61766ff027
commit
c57a423883
|
@ -76,7 +76,7 @@ cleanInstallOnce confirmation = check (not <$> doesFileExist flagfile) $
|
||||||
Debootstrap.built newOSDir targetos Debootstrap.DefaultConfig
|
Debootstrap.built newOSDir targetos Debootstrap.DefaultConfig
|
||||||
|
|
||||||
umountall = property "mount points unmounted" $ liftIO $ do
|
umountall = property "mount points unmounted" $ liftIO $ do
|
||||||
mnts <- filter (`notElem` ["/", "/proc"]) <$> mountPoints
|
mnts <- filter (`notElem` ("/": trickydirs)) <$> mountPoints
|
||||||
-- reverse so that deeper mount points come first
|
-- reverse so that deeper mount points come first
|
||||||
forM_ (reverse mnts) umountLazy
|
forM_ (reverse mnts) umountLazy
|
||||||
return $ if null mnts then NoChange else MadeChange
|
return $ if null mnts then NoChange else MadeChange
|
||||||
|
@ -85,7 +85,7 @@ cleanInstallOnce confirmation = check (not <$> doesFileExist flagfile) $
|
||||||
createDirectoryIfMissing True oldOSDir
|
createDirectoryIfMissing True oldOSDir
|
||||||
rootcontents <- dirContents "/"
|
rootcontents <- dirContents "/"
|
||||||
forM_ rootcontents $ \d ->
|
forM_ rootcontents $ \d ->
|
||||||
when (d `notElem` [oldOSDir, newOSDir, "/proc"]) $
|
when (d `notElem` (oldOSDir:newOSDir:trickydirs)) $
|
||||||
renameDirectory d (oldOSDir ++ d)
|
renameDirectory d (oldOSDir ++ d)
|
||||||
newrootcontents <- dirContents newOSDir
|
newrootcontents <- dirContents newOSDir
|
||||||
forM_ newrootcontents $ \d -> do
|
forM_ newrootcontents $ \d -> do
|
||||||
|
@ -95,6 +95,14 @@ cleanInstallOnce confirmation = check (not <$> doesFileExist flagfile) $
|
||||||
removeDirectory newOSDir
|
removeDirectory newOSDir
|
||||||
return MadeChange
|
return MadeChange
|
||||||
|
|
||||||
|
trickydirs =
|
||||||
|
-- /tmp can contain X's sockets, which prevent moving it
|
||||||
|
-- so it's left as-is.
|
||||||
|
[ "/tmp"
|
||||||
|
-- /proc is left mounted
|
||||||
|
, "/proc"
|
||||||
|
]
|
||||||
|
|
||||||
propellorbootstrapped = property "propellor re-debootstrapped in new os" $
|
propellorbootstrapped = property "propellor re-debootstrapped in new os" $
|
||||||
return NoChange
|
return NoChange
|
||||||
-- re-bootstrap propellor in /usr/local/propellor,
|
-- re-bootstrap propellor in /usr/local/propellor,
|
||||||
|
|
Loading…
Reference in New Issue