]> git.plutz.net Git - blast/commitdiff
merged updates from master vhs-kurs
authorPaul Hänsch <paul@plutz.net>
Wed, 15 Jan 2020 15:07:05 +0000 (16:07 +0100)
committerPaul Hänsch <paul@plutz.net>
Wed, 15 Jan 2020 15:07:05 +0000 (16:07 +0100)
Makefile
modules/approx.mk
modules/autoresize.mk
modules/default.mk
modules/remo2hbo.mk

index 326d2b8af084e0ce4daf06e151028c3e7b502787..8da2961171dc795d65fbe15b80f4517561a26eba 100644 (file)
--- a/Makefile
+++ b/Makefile
@@ -43,6 +43,8 @@ deb   http://cdn.debian.net/debian ${release} main
 endef
 endif
 
+fstype := ext4
+
 ifdef disk
   VOLUME := ${disk}
   PBOOT := ${disk}1
@@ -139,7 +141,8 @@ else ifdef raspi
   deb  http://archive.raspberrypi.org/debian ${release} main
   endef
 
-  PACKAGES += firmware-brcm80211 libraspberrypi-bin libraspberrypi0 pi-bluetooth raspberrypi-bootloader raspberrypi-kernel
+  PACKAGES += firmware-brcm80211 libraspberrypi-bin libraspberrypi0 pi-bluetooth raspberrypi-bootloader raspberrypi-kernel initramfs-tools nilfs-tools
+  fstype := nilfs2
 
   _target: _umount _config
   
@@ -251,7 +254,7 @@ _copy: ${SYSROOT} ${CFGROOT}
 _config: ${CFGROOT}
        ln -sf /dev/null "$${CFGROOT}/etc/systemd/network/99-default.link"
        printf '\nsession       optional        pam_mkhomedir.so umask=0027\n' >>"$${CFGROOT}/etc/pam.d/common-session"
-       printf 'LABEL=FSROOT / ext4 auto,nofail,rw 0 0\nLABEL=BOOT /boot vfat auto,nofail,ro 0 0\n' \
+       printf 'LABEL=FSROOT / ${fstype} auto,nofail,rw 0 0\nLABEL=BOOT /boot vfat auto,nofail,ro 0 0\n' \
                >"$${CFGROOT}/etc/fstab"
        chroot "$${CFGROOT}" update-initramfs -u
 
@@ -296,9 +299,15 @@ _partition_gpt: ${VOLUME}
 
 _sparse: ${PBOOT} ${PROOT}
 
+ifdef raspi
+_format_root: ${PROOT}
+       -umount "$${CFGROOT}/boot" "$${CFGROOT}" "${PROOT}"
+       mkfs.nilfs2 -f -L FSROOT "$${PROOT}"
+else
 _format_root: ${PROOT}
        -umount "$${CFGROOT}/boot" "$${CFGROOT}" "${PROOT}"
        mkfs.ext4 -F -L FSROOT "$${PROOT}"
+endif
 
 _format_boot: ${PBOOT}
        -umount "$${CFGROOT}/boot" "${PBOOT}"
@@ -342,7 +351,7 @@ _grub_efi64: ${CFGROOT}
        grub-mkimage -p / -O x86_64-efi fat part_gpt normal linux all_video >"$${CFGROOT}/boot/EFI/BOOT/BOOTX64.EFI"
 
 ${CFGROOT}/boot/cmdline.txt: ${CFGROOT}
-       printf 'root=/dev/mmcblk0p2 rootfstype=ext4 fsck.repair=yes rootwait' >"$@"
+       printf 'root=/dev/mmcblk0p2 rootfstype=${fstype} fsck.repair=yes rootwait' >"$@"
 
 _bootloader_raspi: ${CFGROOT} ${CFGROOT}/boot/cmdline.txt
 
@@ -396,12 +405,14 @@ _partcopy: ${VOLUME} ${PROOT} ${PBOOT}
        dd conv=notrunc,sparse bs=1M seek=$$((2 + ${BOOT_MB})) if="$${PROOT}" of="$${VOLUME}"
 
 _mount_root: ${PROOT} ${CFGROOT}
-       mount -t ext4 "$${PROOT}" "$${CFGROOT}"
+       mountpoint "$${CFGROOT}" \
+       || mount -t ${fstype} "$${PROOT}" "$${CFGROOT}"
        chmod 755 "$${CFGROOT}"
 
 _mount_boot: ${PBOOT}
        mkdir -p -m 755 "$${CFGROOT}/boot"
-       mount -t vfat "$${PBOOT}" "$${CFGROOT}/boot"
+       mountpoint "$${CFGROOT}/boot" \
+       || mount -t vfat "$${PBOOT}" "$${CFGROOT}/boot"
 
 ifdef disk
   _mount_boot: _mount_root
@@ -410,12 +421,14 @@ endif
 _mount: _mount_root _mount_boot
 
 _img_mount: ${CFGROOT}
-       mount -o loop,offset="$$((${BOOT_MB} + 2))"M,sizelimit=${ROOT_MB}M \
-         -t ext4 "$${VOLUME}" "$${CFGROOT}"
+       mountpoint "$${CFGROOT}" \
+       || mount -o loop,offset="$$((${BOOT_MB} + 2))"M,sizelimit=${ROOT_MB}M \
+                -t ${fstype} "$${VOLUME}" "$${CFGROOT}"
        chmod 755 "$${CFGROOT}"
        mkdir -p -m 755 "$${CFGROOT}/boot"
-       mount -o loop,offset=2M,sizelimit=${BOOT_MB}M \
-         -t vfat "$${VOLUME}" "$${CFGROOT}/boot"
+       mountpoint "$${CFGROOT}/boot" \
+       || mount -o loop,offset=2M,sizelimit=${BOOT_MB}M \
+                -t vfat "$${VOLUME}" "$${CFGROOT}/boot"
 
 _umount_boot: ${CFGROOT}
        -umount "$${CFGROOT}/boot"
index 1c2e9a9112c963847c27daf6c5470cf6e9229531..05bda84badab938ea853b98b93fb71e69c260b17 100644 (file)
@@ -3,6 +3,10 @@ ${SOURCES}
 endef
 export approx_original_sources
 
+ifndef approxhost
+  approxhost := localhost
+endif
+
 ifdef approx
   BOOTSTRAP := ${approx}
   define SOURCES =
@@ -11,15 +15,15 @@ ifdef approx
 else ifdef raspi
   BOOTSTRAP := http://localhost/raspbian
   define SOURCES :=
-  deb http://localhost/raspbian  stretch main non-free firmware rpi
-  deb http://localhost/rpidebian stretch main
-  deb http://localhost/raspbian  buster main non-free firmware rpi
-  deb http://localhost/rpidebian buster main
+  deb http://${approxhost}/raspbian  stretch main non-free firmware rpi
+  deb http://${approxhost}/rpidebian stretch main
+  deb http://${approxhost}/raspbian  buster main non-free firmware rpi
+  deb http://${approxhost}/rpidebian buster main
   endef
 else
   BOOTSTRAP := http://localhost/debian
   define SOURCES :=
-  deb http://localhost/debian ${release} main
+  deb http://${approxhost}/debian ${release} main
   endef
 endif
 
index fba31eb441765cd850cdb4f309df728a17240b24..ee00f52ab57edc726a11bd8df308a010ac058716 100644 (file)
@@ -4,6 +4,7 @@ define autoresize :=
 #!/bin/sh
 
 rootfs="$$(mount |grep -w / |cut -d' ' -f1)"
+roottype="$$(mount |grep -w / |cut -d' ' -f5)"
 
 case $$rootfs in
   /dev/mmcblk?p2) rootdev="$${rootfs%p2}";;
@@ -20,7 +21,11 @@ after="$$(sfdisk --dump "$$rootdev")"
 
 if [ "$$before" = "$$after" ]; then
   # second stage
-  resize2fs "$$rootfs"
+  case $$roottype in
+    ext[234]) resize2fs "$$rootfs";;
+    btrfs) btrfs filesystem resize max /;;
+    nilfs2) nilfs-resize -y "$$rootfs";;
+  esac
   systemctl disable autoresize
 else
   # finish first stage
@@ -31,7 +36,7 @@ endef
 
 define autoresize_unit :=
 [Unit]
-Description=Resize root filesystem at boot
+Description=Resize root filesystem during first boot
 
 [Service]
 ExecStart=/opt/autoresize.sh
index 7c3133f913fa182f348e591fdc135ee282f21971..f93fd24797b87a45d81e1129823f01435183be12 100644 (file)
@@ -35,11 +35,18 @@ _keyboard: ${CFGROOT}
        -sed -Ei 's;^XKBLAYOUT=.*$$;XKBLAYOUT="${keyboard}";;' "$${CFGROOT}/etc/default/keyboard"
 
 ifdef raspi
-  _config: _raspberry_config
+  _config: _raspberry_config _raspberry_initrd
 endif
+
 _raspberry_config: ${CFGROOT}
        printf '%s\n' "$${RPICONFIG}" >>"$${CFGROOT}/boot/config.txt"
 
+_raspberry_initrd: ${CFGROOT}
+       printf 'nilfs2\n' >>"$${CFGROOT}/etc/initramfs-tools/modules"
+       k="$$(echo "$${CFGROOT}"/lib/modules/*-v7+)"; \
+       chroot $${CFGROOT} update-initramfs -c -k "$${k##*/}"; \
+       printf 'initramfs initrd.img-%s\n' "$${k##*/}" >>"$${CFGROOT}/boot/config.txt"
+
 .PHONY: _timezone _locales
 
 ifdef timezone
@@ -115,6 +122,6 @@ ifdef wifi
     export wifi
     ${CFGROOT}/etc/network/interfaces.d/wifi: ${CFGROOT}
        printf 'auto wlan0\nallow-hotplug wlan0\n\niface wlan0 inet dhcp\n' >$@
-       printf '  wireless-ssid "%s"\n' "$$wifi" >>$@
+       printf '  wireless-essid "%s"\n' "$$wifi" >>$@
   endif
 endif
index d82278e7410220122a592e5315b960e615d4f44d..510186079fdefac826bc1095b6f50ac65e83dfa1 100644 (file)
@@ -93,6 +93,7 @@ ${CFGROOT}/usr/local/bin/teesock: teesock/teesock.arm ${CFGROOT}
 
 ${CFGROOT}/srv/gummikraken: gummikraken/ ${CFGROOT}
        cp -au "$</." "$@"
+       sed -i 's;http://141.45.146.235:8200;http://oktopus:8200;' "$@/oktopus_frontend/dist/bundle.js"
 
 .PHONY: gummikraken_clone
 gummikraken_clone: