]> git.plutz.net Git - blast/commitdiff
MBR partitioning for Raspberry, working password generation
authorPaul Hänsch <paul@plutz.net>
Tue, 16 Jul 2019 02:02:49 +0000 (04:02 +0200)
committerPaul Hänsch <paul@plutz.net>
Tue, 16 Jul 2019 02:02:49 +0000 (04:02 +0200)
Makefile
modules/default.mk

index da5d3e44ef0330c777212c3641f3ca6a1f590180..8caf61890cdf54ef119be15c5c92acc3196a9556 100644 (file)
--- a/Makefile
+++ b/Makefile
@@ -5,6 +5,7 @@ comma_:=,
 space_:=${nul_} ${nul_}
 
 .PHONY: clean .FORCE
+.PHONY: _config_raspi _partition_raspi
 .PHONY: _qemu _bootstrap _install _copy _config_raspi _config _bootloader _squash
 .PHONY: _target _partition _format _mount _sparse _umount _partcopy _mbr
 
@@ -110,8 +111,8 @@ _copy: _install _mount
 _config_raspi: _copy _mount
 _config: _copy _mount _config_raspi
 _umount: _mount _config
-_partition:
-_partcopy: _partition _umount
+_partition_raspi:
+_partcopy: _partition_raspi _umount
 
 else
 _target:
@@ -223,6 +224,10 @@ ${PROOT}: .FORCE
        dd count=0 of="$${PROOT}"  # truncate
        dd bs=1M count=0 seek=${ROOT_MB} of="$${PROOT}"
 
+_partition_raspi: ${VOLUME}
+       printf 'label: dos\n\n: start=2MiB, size=%iMiB, type=c\n: start=%iMiB, size=%iMiB, type=83\n' \
+               ${BOOT_MB} "$$((${BOOT_MB} + 2))" ${ROOT_MB} | sfdisk "$${VOLUME}"
+
 _partition: ${VOLUME}
        printf 'label: gpt\n\n: start=2MiB, size=%iMiB, type=1, attrs="LegacyBIOSBootable"\n: size=%iMiB, type=20\n' \
                ${BOOT_MB} ${ROOT_MB} | sfdisk "$${VOLUME}"
index f52cd604246e9f523b0384bacc826db5c4c631dd..71ec8640e5374537fe331a3e18dc762a4aa28b35 100644 (file)
@@ -7,7 +7,7 @@ export rootpass
 .PHONY: _rootpass
 _config: _rootpass
 _rootpass: ${CFGROOT}
-       chroot "$${CFGROOT}" usermod -p "$$(openssl passwd -salt "x$${RANDOM}" "$${rootpass}")" root
+       chroot "$${CFGROOT}" usermod -p "$$(openssl passwd -salt "$$(($${RANDOM-0} + 10))" "$${rootpass}")" root
 endif
 
 ifdef wifi