]> git.plutz.net Git - blast/commitdiff
Merge branch 'master' into raspi-elok
authorPaul Hänsch <paul@plutz.net>
Wed, 18 Dec 2019 07:56:54 +0000 (08:56 +0100)
committerPaul Hänsch <paul@plutz.net>
Wed, 18 Dec 2019 07:56:54 +0000 (08:56 +0100)
Makefile
config.example
modules/approx.mk
modules/autoresize.mk
modules/default.mk
modules/nodm.mk
modules/remo2hbo.mk
modules/smb_nis.mk
modules/xfce/etc/gtk-3.0/settings.ini [new file with mode: 0644]

index 274d1c7c79d35764edbc2b3dc630a0ed05979122..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,11 +254,11 @@ _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
 
-${SQUASH}: ${CFGROOT} .FORCE
+${SQUASH}: ${CFGROOT}
        -rm "$${SQUASH}"
        mksquashfs "$${CFGROOT}" "$${SQUASH}" -comp xz
 
@@ -267,7 +270,8 @@ _squash: ${SQUASH} _squash_modules
 _isosquash: ${ISOROOT}/live/live.squashfs
 ${ISOROOT}/live/live.squashfs: ${CFGROOT} ${ISOROOT} .FORCE
        -rm "$@"
-       printf '%s\n' boot |mksquashfs "$${CFGROOT}" "$@" -comp xz -ef /dev/stdin
+       { cd "$${CFGROOT}"; printf '%s\n' boot/*; } \
+       | mksquashfs "$${CFGROOT}" "$@" -comp xz -ef /dev/stdin
 
 ${VOLUME}: .FORCE
        ! printf '%s\n' "$${VOLUME}" |grep -q '^/dev/'  # abort if volume should be real device
@@ -295,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}"
@@ -305,11 +315,8 @@ _format_boot: ${PBOOT}
 
 _format: _format_root _format_boot
 
-_iso_image: ${ISOROOT} # _efi_iso _efi_umount
-       xorriso -as mkisofs -o "$${ISO}" -isohybrid-mbr /usr/lib/ISOLINUX/isohdpfx.bin \
-               -b isolinux.bin -c boot.cat -no-emul-boot -boot-load-size 4 -boot-info-table \
-               "$${ISOROOT}"
-               # -eltorito-alt-boot -e efi.img -no-emul-boot -isohybrid-gpt-basdat \
+_iso_image: ${ISOROOT}
+       grub-mkrescue -o "$${ISO}" "$${ISOROOT}"
 
 .PHONY: _syslinux_efi32 _syslinux_efi64 _syslinux_bios
 .PHONY: _grub_efi32 _grub_efi64
@@ -344,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
 
@@ -363,17 +370,16 @@ _bootloader_pc: ${CFGROOT} _grub_efi32 _grub_efi64 _syslinux_bios #_syslinux_efi
                "$$k" "$$i" >>"$${CFGROOT}/boot/grub.cfg"
 
 _bootloader_iso: ${CFGROOT} ${ISOROOT}
-       # grub-mkimage -p / -O i386-pc-eltorito biosdisk iso9660 normal linux all_video >"$${ISOROOT}/grub.bin"
+       mkdir -p "$${ISOROOT}/boot/grub/"
        cp -L "$${CFGROOT}/vmlinuz" "$${CFGROOT}/initrd.img" "$${ISOROOT}"
-       cp /usr/lib/ISOLINUX/isolinux.bin $(addprefix /usr/lib/syslinux/modules/bios/, ldlinux.c32 menu.c32 libutil.c32) "$${ISOROOT}"
-       # printf '%s\n' "set timeout=10" "default=buster" \
-       #       "menuentry 'Debian Buster' --id 'buster' {" \
-       #       "linux '/vmlinuz' boot=live" "initrd '/initrd.img'" "}" \
-       #       >"$${ISOROOT}/grub.cfg"
-       printf '%s\n' "UI menu.c32" "DEFAULT buster" "TIMEOUT 100" \
-               "LABEL buster" "  MENU LABEL Debian Buster 64bit" \
-               "  KERNEL /vmlinuz" "  APPEND initrd=/initrd.img boot=live" \
-               >"$${ISOROOT}/syslinux.cfg"
+       printf '%s\n' "set timeout=10" "default=buster" \
+               "menuentry 'Debian Buster' --id 'buster' {" \
+               "linux '/vmlinuz' boot=live" "initrd '/initrd.img'" "}" \
+               >"$${ISOROOT}/boot/grub/grub.cfg"
+       -[ -f "$${ISOROOT}/install/initrd.gz" -a -f "$${ISOROOT}/install/linux" ] && \
+       printf '%s\n' "menuentry 'Install Debian' --id 'install' {" \
+               "linux '/install/linux'" "initrd '/install/initrd.gz'" "}" \
+               >>"$${ISOROOT}/boot/grub/grub.cfg"
 
 _efi_mount: ${PBOOT}
        -umount "efi/"
@@ -383,9 +389,6 @@ _efi_mount: ${PBOOT}
 _efi_umount: _efi_mount
        umount efi/ && rmdir efi/
 
-_efi_iso: _efi_mount _grub_efi32 _grub_efi64
-       cp -r "$${CFGROOT}/boot/EFI/." "efi/EFI/"
-
 .PHONY: _syslinux_mbr _grub_mbr
 
 _syslinux_mbr: ${VOLUME}
@@ -402,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
@@ -415,13 +420,15 @@ endif
 
 _mount: _mount_root _mount_boot
 
-_img_mount:
-       mount -o loop,offset="$$((${BOOT_MB} + 2))"M,sizelimit=${ROOT_MB}M \
-         -t ext4 "$${VOLUME}" "$${CFGROOT}"
+_img_mount: ${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 33064de9736f2e64d27a259ba6a1396f8595ffcd..faf448586e8940bccce5f2f05dfec4080a3302db 100644 (file)
 ## Comma separated list of locales, first one will become default locale
 # locales=de_DE.UTF-8,en_US.UTF-8
 
+## Keyboard as used in debconfs keyboard-configuration/variant
+## Use debconf-get-selections to find out the exact string
+# keyboard=German
+
 ## If nodm is installed, you can choose a user to login automatically
 ## If no user is given here, then nodm will default to root
 # nodm_user=adam
 ## In nodm, use full screen chromium web browser as session
 # webui=http://localhost/
 
-## When using NIS modules the directory server should be given
+## When using NIS modules the directory server and NIS domain should be given
 # nis_server=nismaster
+# nis_domain=example.com
+
+## also when using SMB the main server must be given
+# smb_server=smbmaster
 
 ## If the approxmodule is enabled, then one (and only one) apt-source
 ## can be choosen to install packages from
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..012aec9d4ea2a0757c5337d621f10223a35cdba1 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 "$$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 6282070a5f4cb19fe95687fab62988204884ee77..ec3f2f43caabb1f4ba97585d42fd1452bf845ee8 100644 (file)
@@ -23,17 +23,30 @@ ${RPICONFIG}
 dtoverlay=vc4-fkms-v3d,cma-256
 endef
 
-.PHONY: _debconf_selections _raspberry_config
+.PHONY: _debconf_selections _raspberry_config _keyboard
 _install: _debconf_selections
 _debconf_selections: ${SYSROOT}
        printf '%s\n' "$${DEBCONF}" |chroot "$${SYSROOT}" debconf-set-selections
 
+ifdef keyboard
+  _config: _keyboard
+endif
+_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
@@ -96,6 +109,7 @@ _users: ${CFGROOT}
 
 _hostname: ${CFGROOT}
        printf '%s\n' "$${hostname}" >"$${CFGROOT}/etc/hostname"
+       sed -Ei "s;^127\.0\.0\.1.*$$;&  $${hostname};" "$${CFGROOT}/etc/hosts"
 
 ifdef wifi
   _config: ${CFGROOT}/etc/network/interfaces.d/wifi
index 2d3b6ee12c4f46693939f346ba86c782ed3fc9d1..6d8d760ccd27cc343b75fa01f58a67ffb346329b 100644 (file)
@@ -35,6 +35,7 @@ endif
 .PHONY: _nodm_user _nodm_cfg
 
 _nodm_cfg: ${CFGROOT}
+       sed -Ei 's;^TimeoutStopSec=.*$$;TimeoutStopSec=1;' "$${CFGROOT}/lib/systemd/system/nodm.service"
        rm "$${CFGROOT}/etc/default/nodm"
        chroot "$${CFGROOT}" dpkg-reconfigure --default-priority -u nodm
 
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:
index a940d1de0737ed42dedefcb570cf9ce644b05fe2..d11d00b9a14a5416743ce3e9e34c52a1f656b13d 100644 (file)
@@ -1,12 +1,18 @@
-PACKAGES += cifs-utils libpam-mount libpam-script lxdm nis nscd samba-common-bin usermode
+PACKAGES += cifs-utils libpam-mount libpam-script lightdm nis nscd samba-common-bin usermode
 
 ifndef nis_server
   nis_server := nismaster
 endif
+ifndef nis_domain
+  nis_domain := ${nis_server}
+endif
+ifndef smb_server
+  smb_server := ${nis_server}
+endif
 
 define DEBCONF +=
 
-nis    nis/domain      string  .${nis_server}
+nis    nis/domain      string  ${nis_domain}
 endef
 
 export smb_nis_pamscript smb_nis_pammount
@@ -14,9 +20,10 @@ export smb_nis_pamscript smb_nis_pammount
 define smb_nis_pamscript :=
 #!/bin/sh
 
+# forced through bash, to hide euid from smbpasswd
 /bin/bash -c '
   printf "%s\n" "$$PAM_OLDAUTHTOK" "$$PAM_AUTHTOK" "$$PAM_AUTHTOK" \
-  | smbpasswd -sr ${nis_server} -U "$$PAM_USER"
+  | smbpasswd -sr ${smb_server} -U "$$PAM_USER"
 '
 
 exit $?
@@ -26,7 +33,7 @@ endef
 define smb_nis_pammount :=
 <pam_mount> <debug enable="0" />
   <!-- Volume definitions -->
-  <volume options="user=%(USER)" fstype="cifs" server="${nis_server}"     path="%(USER)" mountpoint="~" />
+  <volume options="user=%(USER)" fstype="cifs" server="${smb_server}"     path="%(USER)" mountpoint="~" />
   <mntoptions require="nosuid,nodev" />
   <logout wait="0" hup="no" term="no" kill="no" />
   <mkmountpoint enable="1" remove="true" />
@@ -41,21 +48,22 @@ _smb_nis: ${CFGROOT}/opt/pam_script/pam_script_passwd ${CFGROOT}/etc/security/pa
 _smb_nis: ${CFGROOT}/etc/yp.conf ${CFGROOT}/etc/defaultdomain
 
 _smb_nis: ${CFGROOT}
-       sed -Ei 's;^(passwd:|group:|shadow:|gshadow:) *;\1      nis ;' $${CFGROOT}/etc/nsswitch.conf
+       sed -Ei 's;^(passwd:|group:|shadow:|gshadow:).*$$;\1    files nis;' $${CFGROOT}/etc/nsswitch.conf
+       sed -Ei '/pam_(script|mount).so/d' $${CFGROOT}/etc/pam.d/common-*
        printf '\nauth          optional        pam_mount.so\n' >>$${CFGROOT}/etc/pam.d/common-auth
        printf '\nsession       optional        pam_mount.so\n' >>$${CFGROOT}/etc/pam.d/common-session
        printf '\npassword      required        pam_script.so dir=/opt/pam_script\n'  >$${CFGROOT}/etc/pam.d/common-password
 
-${CFGROOT}/opt/pam_script/pam_script_passwd: ${CFGROOT}
+${CFGROOT}/opt/pam_script/pam_script_passwd: ${CFGROOT} .FORCE
        mkdir -p "$(dir $@)"
        printf '%s' "$${smb_nis_pamscript}" >"$@"
 
-${CFGROOT}/etc/security/pam_mount.conf.xml: ${CFGROOT}
+${CFGROOT}/etc/security/pam_mount.conf.xml: ${CFGROOT} .FORCE
        mkdir -p "$(dir $@)"
        printf '%s' "$${smb_nis_pammount}" >"$@"
 
-${CFGROOT}/etc/yp.conf: ${CFGROOT}
+${CFGROOT}/etc/yp.conf: ${CFGROOT} .FORCE
        printf 'ypserver        %s\n' "${nis_server}" >"$@"
 
-${CFGROOT}/etc/defaultdomain: ${CFGROOT}
-       printf '.%s\n' "${nis_server}" >"$@"
+${CFGROOT}/etc/defaultdomain: ${CFGROOT} .FORCE
+       printf '%s\n' "${nis_domain}" >"$@"
diff --git a/modules/xfce/etc/gtk-3.0/settings.ini b/modules/xfce/etc/gtk-3.0/settings.ini
new file mode 100644 (file)
index 0000000..8c395bc
--- /dev/null
@@ -0,0 +1,2 @@
+[settings]
+gtk-print-preview-command = okular %f