From e328bd81d51535baeada259fd5012b68e23f6d7b Mon Sep 17 00:00:00 2001 From: FReenen Date: Fri, 13 Dec 2024 21:44:57 +0100 Subject: [PATCH] fix bugs --- configs/elfDesktop.sfdisk | 5 ++--- configs/elfLaptop.sfdisk | 2 +- elfDesktop.sh | 4 +++- elf_os.sh | 8 ++++---- first-boot.sh | 12 ++++++------ 5 files changed, 16 insertions(+), 15 deletions(-) diff --git a/configs/elfDesktop.sfdisk b/configs/elfDesktop.sfdisk index 68c6127..a66a0fe 100644 --- a/configs/elfDesktop.sfdisk +++ b/configs/elfDesktop.sfdisk @@ -6,7 +6,6 @@ first-lba: 2048 last-lba: 1953525134 sector-size: 512 -/dev/nvme0n1p1 : start= 2048, size= 1048576, type=C12A7328-F81F-11D2-BA4B-00A0C93EC93B, uuid=1765C25B-7606-4F9C-8174-04EFEFD3FCE2 +/dev/nvme0n1p1 : start= 2048, size= 1048576, type=C12A7328-F81F-11D2-BA4B-00A0C93EC93B, uuid=1765C25B-7606-4F9C-8174-04EFEFD3FCE2, name="boot" /dev/nvme0n1p2 : start= 1050624, size= 8388608, type=0657FD6D-A4AB-43C4-84E5-0933C84B4F4F, uuid=C0DA7E9C-D507-4E9A-96AE-E7AF26DBCE9F -/dev/nvme0n1p3 : start= 9439232, size= 1572864000, type=0FC63DAF-8483-4772-8E79-3D69D8477DE4, uuid=219EFC65-B9ED-4E10-BF4B-01CD6A7CC8C7 - +/dev/nvme0n1p3 : start= 9439232, size= 1572864000, type=0FC63DAF-8483-4772-8E79-3D69D8477DE4, uuid=219EFC65-B9ED-4E10-BF4B-01CD6A7CC8C7, name="elfdrive" diff --git a/configs/elfLaptop.sfdisk b/configs/elfLaptop.sfdisk index 85d9a2e..bc12b14 100644 --- a/configs/elfLaptop.sfdisk +++ b/configs/elfLaptop.sfdisk @@ -8,4 +8,4 @@ sector-size: 512 /dev/sdb1 : start= 2048, size= 2097152, type=C12A7328-F81F-11D2-BA4B-00A0C93EC93B, uuid=486DA8A9-47F3-469D-9458-F29776D786A3, name="boot" /dev/sdb2 : start= 2099200, size= 16777216, type=0657FD6D-A4AB-43C4-84E5-0933C84B4F4F, uuid=DCA4D33F-2283-48EE-98BF-739D527ABBBB -/dev/sdb3 : start= 18876416, size= 231192576, type=0FC63DAF-8483-4772-8E79-3D69D8477DE4, uuid=ACF561E3-BE4F-479A-A9EF-2C82B324E35E, name="elfroot" +/dev/sdb3 : start= 18876416, size= 231192576, type=0FC63DAF-8483-4772-8E79-3D69D8477DE4, uuid=ACF561E3-BE4F-479A-A9EF-2C82B324E35E, name="elfdrive" diff --git a/elfDesktop.sh b/elfDesktop.sh index 85c7492..04e383e 100644 --- a/elfDesktop.sh +++ b/elfDesktop.sh @@ -1,8 +1,10 @@ -HOSTNAME="ELFDesktop" +HOSTNAME="elfDesktop" UEFI_DISK="/dev/nvme0n1" DISK="/dev/nvme0n1" + USERNAME="freenen" +USER_SSH_KEYS="nl.freenen.elfLaptop nl.freenen.digipap.rsa nl.freenen.fp4.ed" SFDISK_FILE="./configs/elfDesktop.sfdisk" UEFI_PARTITION="${UEFI_DISK}p1" diff --git a/elf_os.sh b/elf_os.sh index 803a4e2..1eedc6f 100755 --- a/elf_os.sh +++ b/elf_os.sh @@ -154,8 +154,8 @@ run-chroot "create admin group" "groupadd admin" run-chroot "create user" "useradd --home-dir /home/${USERNAME} --create-home --skel /etc/skel ${USERNAME} --groups admin" run-chroot "set password for user" "echo \"${USERNAME}:$PASS_USER\" | chpasswd" run-chroot "add user to sudoers" "echo \"%admin ALL=(ALL:ALL) ALL\" >>/etc/sudoers" -run "clone keys repo" "git clone https://gitea.finnvanreenen.nl:FReenen/keys.git /opt/keys" -run-chroot "create authoized keys" "cd /opt/keys/ssh && cat "${USER_SSH_KEYS[@]}" > /home/${USERNAME}/.ssh/authorized_keys" +run "clone keys repo" "git clone https://gitea.finnvanreenen.nl/FReenen/keys.git /mnt/opt/keys" +run-chroot "create authoized keys" "cd /opt/keys/ssh && cat ${USER_SSH_KEYS} > /home/${USERNAME}/.ssh/authorized_keys" echo echo === prepair first boot @@ -185,8 +185,8 @@ WantedBy=multi-user.target EOF " run-chroot "enable first boot service" "systemctl enable first_boot.service" -run "copy install log to disk" "mkdir /mnt/var/logs/elfOS" -run "copy install log to disk" "cp $SCRIPT_DIR/install.log /mnt/var/logs/elfOS/install.log" +run "copy install log to disk" "mkdir /mnt/var/log/elfOS" +run "copy install log to disk" "cp $SCRIPT_DIR/install.log /mnt/var/log/elfOS/install.log" echo echo === umount and reboot diff --git a/first-boot.sh b/first-boot.sh index b2c574a..ae342af 100755 --- a/first-boot.sh +++ b/first-boot.sh @@ -126,12 +126,12 @@ echo === install esp-idf echo run root "install esp-idf deps" "pacman -S --noconfirm flex bison gperf ninja ccache libffi dfu-util libusb" -run root "create folder for esp-idf" "mkdir /home/$USERNAME/.local/espressif" -run root "clone idf-extra-components" "git clone https://github.com/espressif/esp-idf.git /home/$USERNAME/.local/espressif/esp-idf" -run root "clone esp-idf" "git clone https://github.com/espressif/idf-extra-components.git /home/$USERNAME/.local/espressif/idf-extra-components" -run root "clone esp-protocols" "git clone https://github.com/espressif/esp-protocols.git /home/$USERNAME/.local/espressif/esp-protocols" -run root "clone esp-zigbee-sdk" "git clone https://github.com/espressif/esp-zigbee-sdk.git /home/$USERNAME/.local/espressif/esp-zigbee-sdk" -run root "install esp-idf" "IDF_TOOLS_PATH=/home/$USERNAME/.local/espressif /home/$USERNAME/.local/espressif/esp-idf/install.sh all" +run root "create folder for esp-idf" "sudo -u $USERNAME mkdir /home/$USERNAME/.local/espressif" +run root "clone idf-extra-components" "sudo -u $USERNAME git clone https://github.com/espressif/esp-idf.git /home/$USERNAME/.local/espressif/esp-idf" +run root "clone esp-idf" "sudo -u $USERNAME git clone https://github.com/espressif/idf-extra-components.git /home/$USERNAME/.local/espressif/idf-extra-components" +run root "clone esp-protocols" "sudo -u $USERNAME git clone https://github.com/espressif/esp-protocols.git /home/$USERNAME/.local/espressif/esp-protocols" +run root "clone esp-zigbee-sdk" "sudo -u $USERNAME git clone https://github.com/espressif/esp-zigbee-sdk.git /home/$USERNAME/.local/espressif/esp-zigbee-sdk" +run root "install esp-idf" "sudo -u $USERNAME bash -c \"IDF_TOOLS_PATH=/home/$USERNAME/.local/espressif /home/$USERNAME/.local/espressif/esp-idf/install.sh all\"" echo echo === install other software