From 4d55eedf4bc077bfb08b38e1752eb8747db6347a Mon Sep 17 00:00:00 2001 From: Joey Hess Date: Mon, 5 Feb 2018 18:57:20 -0400 Subject: propellor spin --- src/Propellor/Property/SiteSpecific/JoeySites.hs | 32 +++++++++++++++++++++++- 1 file changed, 31 insertions(+), 1 deletion(-) (limited to 'src/Propellor') diff --git a/src/Propellor/Property/SiteSpecific/JoeySites.hs b/src/Propellor/Property/SiteSpecific/JoeySites.hs index 0a1982c1..93e2d733 100644 --- a/src/Propellor/Property/SiteSpecific/JoeySites.hs +++ b/src/Propellor/Property/SiteSpecific/JoeySites.hs @@ -22,6 +22,7 @@ import qualified Propellor.Property.Systemd as Systemd import qualified Propellor.Property.Network as Network import qualified Propellor.Property.Fail2Ban as Fail2Ban import qualified Propellor.Property.LetsEncrypt as LetsEncrypt +import qualified Propellor.Property.FlashKernel as FlashKernel import Utility.FileMode import Utility.Split @@ -1048,7 +1049,7 @@ laptopSoftware = Apt.installed , "ttf-bitstream-vera" , "mairix", "offlineimap", "mutt" , "nmap", "whois", "wireshark", "tcpdump", "iftop" - , "udevil", "pmount", "tree" + , "udevil", "pmount", "tree", "pv" , "arbtt", "hledger", "bc" , "apache2", "ikiwiki", "libhighlight-perl" , "pal" @@ -1079,3 +1080,32 @@ devSoftware = Apt.installed , "gdb", "dpkg-repack", "lintian" , "pristine-tar", "github-backup" ] + +cubieTruckOneWire :: Property DebianLike +cubieTruckOneWire = + File.hasContent "/etc/easy-peasy-devicetree-squeezy/my.dts" mydts + `onChange` FlashKernel.flashKernel + `requires` utilityinstalled + where + utilityinstalled = Git.cloned (User "root") "https://git.joeyh.name/git/easy-peasy-devicetree-squeezy.git" "/usr/local/easy-peasy-devicetree-squeezy" Nothing + `onChange` File.isSymlinkedTo "/usr/local/bin/easy-peasy-devicetree-squeezy" (File.LinkTarget "/usr/local/easy-peasy-devicetree-squeezy/easy-peasy-devicetree-squeezy") + mydts = + [ "/* Device tree addition enabling onewire sensors on CubieTruck GPIO pin PG8 */" + , "#include " + , "" + , "/ {" + , "\tonewire_device {" + , "\t\tcompatible = \"w1-gpio\";" + , "\t\tgpios = <&pio 6 8 GPIO_ACTIVE_HIGH>; /* PG8 */" + , "\t\tpinctrl-names = \"default\";" + , "\t\tpinctrl-0 = <&my_w1_pin>;" + , "\t};" + , "};" + , "" + , "&pio {" + , "\tmy_w1_pin: my_w1_pin@0 {" + , "\t\tallwinner,pins = \"PG8\";" + , "\t\tallwinner,function = \"gpio_in\";" + , "\t};" + , "};" + ] -- cgit v1.2.3 From a5aac4e331c3131fc3748212a0f36d88fbf4a03f Mon Sep 17 00:00:00 2001 From: Joey Hess Date: Mon, 5 Feb 2018 19:14:10 -0400 Subject: propellor spin --- src/Propellor/Property/SiteSpecific/JoeySites.hs | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) (limited to 'src/Propellor') diff --git a/src/Propellor/Property/SiteSpecific/JoeySites.hs b/src/Propellor/Property/SiteSpecific/JoeySites.hs index 93e2d733..23d17e8a 100644 --- a/src/Propellor/Property/SiteSpecific/JoeySites.hs +++ b/src/Propellor/Property/SiteSpecific/JoeySites.hs @@ -22,7 +22,6 @@ import qualified Propellor.Property.Systemd as Systemd import qualified Propellor.Property.Network as Network import qualified Propellor.Property.Fail2Ban as Fail2Ban import qualified Propellor.Property.LetsEncrypt as LetsEncrypt -import qualified Propellor.Property.FlashKernel as FlashKernel import Utility.FileMode import Utility.Split @@ -1084,11 +1083,14 @@ devSoftware = Apt.installed cubieTruckOneWire :: Property DebianLike cubieTruckOneWire = File.hasContent "/etc/easy-peasy-devicetree-squeezy/my.dts" mydts - `onChange` FlashKernel.flashKernel + `onChange` utilitysetup `requires` utilityinstalled where utilityinstalled = Git.cloned (User "root") "https://git.joeyh.name/git/easy-peasy-devicetree-squeezy.git" "/usr/local/easy-peasy-devicetree-squeezy" Nothing `onChange` File.isSymlinkedTo "/usr/local/bin/easy-peasy-devicetree-squeezy" (File.LinkTarget "/usr/local/easy-peasy-devicetree-squeezy/easy-peasy-devicetree-squeezy") + utilitysetup = cmdProperty "easy-peasy-devicetree-squeezy" + ["--debian", "sun7i-a20-cubietruck"] + `assume` MadeChange mydts = [ "/* Device tree addition enabling onewire sensors on CubieTruck GPIO pin PG8 */" , "#include " -- cgit v1.2.3