diff options
| author | Joey Hess <joeyh@joeyh.name> | 2016-09-24 14:36:15 -0400 |
|---|---|---|
| committer | Joey Hess <joeyh@joeyh.name> | 2016-09-24 14:36:15 -0400 |
| commit | ab2a1fb3c0422405a3bd1d5c991f5f28044a500e (patch) | |
| tree | a0e12d9458b1fd7adf4765bbabec501440526a8f /src | |
| parent | 19074b8c23c82bfb743d46c804cc70afae5d66ac (diff) | |
Simplify Debootstrap.sourceInstall since #770217 was fixed.
Diffstat (limited to 'src')
| -rw-r--r-- | src/Propellor/Property/Debootstrap.hs | 39 |
1 files changed, 1 insertions, 38 deletions
diff --git a/src/Propellor/Property/Debootstrap.hs b/src/Propellor/Property/Debootstrap.hs index c0226b7e..59850c4c 100644 --- a/src/Propellor/Property/Debootstrap.hs +++ b/src/Propellor/Property/Debootstrap.hs @@ -74,9 +74,7 @@ built' installprop target system@(System _ arch) config = cmd <- fromMaybe "debootstrap" <$> programPath de <- standardPathEnv ifM (boolSystemEnv cmd params (Just de)) - ( do - fixForeignDev target - return MadeChange + ( return MadeChange , return FailedChange ) @@ -165,7 +163,6 @@ sourceInstall' = withTmpDir "debootstrap" $ \tmpd -> do case l of (subdir:[]) -> do changeWorkingDirectory subdir - makeDevicesTarball makeWrapperScript (localInstallDir </> subdir) return MadeChange _ -> errorMessage "debootstrap tar file did not contain exactly one directory" @@ -206,40 +203,6 @@ makeWrapperScript dir = do ] modifyFileMode wrapperScript (addModes $ readModes ++ executeModes) --- Work around for <http://bugs.debian.org/770217> -makeDevicesTarball :: IO () -makeDevicesTarball = do - -- TODO append to tarball; avoid writing to /dev - writeFile foreignDevFlag "1" - ok <- boolSystem "sh" [Param "-c", Param tarcmd] - nukeFile foreignDevFlag - unless ok $ - errorMessage "Failed to tar up /dev to generate devices.tar.gz" - where - tarcmd = "(cd / && tar cf - dev) | gzip > devices.tar.gz" - -fixForeignDev :: FilePath -> IO () -fixForeignDev target = whenM (doesFileExist (target ++ foreignDevFlag)) $ do - de <- standardPathEnv - void $ boolSystemEnv "chroot" - [ File target - , Param "sh" - , Param "-c" - , Param $ intercalate " && " - [ "apt-get update" - , "apt-get -y install makedev" - , "rm -rf /dev" - , "mkdir /dev" - , "cd /dev" - , "mount -t proc proc /proc" - , "/sbin/MAKEDEV std ptmx fd consoleonly" - ] - ] - (Just de) - -foreignDevFlag :: FilePath -foreignDevFlag = "/dev/.propellor-foreign-dev" - localInstallDir :: FilePath localInstallDir = "/usr/local/debootstrap" |
