diff --git a/.gitmodules b/.gitmodules new file mode 100644 index 0000000..9b38dc0 --- /dev/null +++ b/.gitmodules @@ -0,0 +1,6 @@ +[submodule "root/root/reHDD"] + path = root/root/reHDD + url = gitea@git.mosad.xyz:localhorst/reHDD.git +[submodule "root/root/reHDDPrinter"] + path = root/root/reHDDPrinter + url = gitea@git.mosad.xyz:localhorst/reHDDPrinter.git diff --git a/README.md b/README.md index 947ebca..969c583 100644 --- a/README.md +++ b/README.md @@ -6,6 +6,9 @@ Scripts and tools to create a bootable image with reHDD based on openSuse. The scripts are used to run within a openSuse-based machine as host. +git submodule init +git submodule update + ## Build Image `sudo bash ./create_bootable.sh` diff --git a/appliance.kiwi b/appliance.kiwi index 3a8670c..5598b0a 100644 --- a/appliance.kiwi +++ b/appliance.kiwi @@ -58,6 +58,15 @@ + + + + + + + + + diff --git a/create_bootable.sh b/create_bootable.sh index 6b75ae4..562e758 100644 --- a/create_bootable.sh +++ b/create_bootable.sh @@ -13,6 +13,22 @@ printf "\nCleanup\n" rm -rf reHDD-Bootable.iso rm -rf out/ +### Preconditions ### +printf "\nPreconditions\n" +current_dir=$(pwd) +cd ./root/root/reHDD/ +git stash +git checkout master +git submodule init +git submodule update +make release +cd $current_dir + +cd ./root/root/reHDDPrinter/ +git stash +git checkout main +cd $current_dir + ### Build ### printf "\nBuild\n" START=$(date +%s.%N) diff --git a/root/etc/sysconfig/network/ifcfg-lan0 b/root/etc/sysconfig/network/ifcfg-lan0 deleted file mode 100644 index b01f9e1..0000000 --- a/root/etc/sysconfig/network/ifcfg-lan0 +++ /dev/null @@ -1,4 +0,0 @@ -BOOTPROTO='dhcp' -MTU='' -REMOTE_IPADDR='' -STARTMODE='onboot' diff --git a/root/etc/udev/rules.d/70-persistent-net.rules b/root/etc/udev/rules.d/70-persistent-net.rules deleted file mode 100644 index 8865e78..0000000 --- a/root/etc/udev/rules.d/70-persistent-net.rules +++ /dev/null @@ -1 +0,0 @@ -SUBSYSTEM=="net", ACTION=="add", DRIVERS=="?*", ATTR{address}=="?*", ATTR{dev_id}=="0x0", ATTR{type}=="1", KERNEL=="?*", NAME="lan0" diff --git a/root/root/reHDD b/root/root/reHDD new file mode 160000 index 0000000..5d20949 --- /dev/null +++ b/root/root/reHDD @@ -0,0 +1 @@ +Subproject commit 5d2094939b0257824b981d7a5dfbd5d4d859a0cb diff --git a/root/root/reHDDPrinter b/root/root/reHDDPrinter new file mode 160000 index 0000000..63ba1e8 --- /dev/null +++ b/root/root/reHDDPrinter @@ -0,0 +1 @@ +Subproject commit 63ba1e8d1df2ce7ef3178ce62a9286824be0fc60 diff --git a/root/usr/lib/systemd/system/dracut_hostonly.service b/root/usr/lib/systemd/system/dracut_hostonly.service deleted file mode 100644 index fb3cb77..0000000 --- a/root/usr/lib/systemd/system/dracut_hostonly.service +++ /dev/null @@ -1,11 +0,0 @@ -[Unit] -Description=Rebuild dracut initrd for this host -ConditionPathExists=/.kiwi_dracut_hostonly.trigger - -[Service] -Type=oneshot -ExecStart=/bin/bash -c 'dracut -f' -ExecStartPost=/bin/bash -c 'rm -f /.kiwi_dracut_hostonly.trigger' - -[Install] -WantedBy=multi-user.target diff --git a/root/usr/lib/systemd/system/getty@tty1.service.d/getty@tty1.service.d_override.conf b/root/usr/lib/systemd/system/getty@tty1.service.d/getty@tty1.service.d_override.conf new file mode 100644 index 0000000..4544b4e --- /dev/null +++ b/root/usr/lib/systemd/system/getty@tty1.service.d/getty@tty1.service.d_override.conf @@ -0,0 +1,17 @@ +[Unit] +Description=reHDD on tty1 + +[Service] +WorkingDirectory=/root/reHDD/ +ExecStart= +ExecStart=-/root/reHDD/reHDD +StandardInput=tty +StandardOutput=tty +Restart=always +RestartSec=1 +UtmpIdentifier=tty1 +TTYPath=/dev/tty1 +TTYReset=yes +TTYVHangup=yes +TTYVTDisallocate=yes +SendSIGHUP=yes diff --git a/root/usr/lib/systemd/system/getty@tty2.service.d/getty@tty2.service.d_override.conf b/root/usr/lib/systemd/system/getty@tty2.service.d/getty@tty2.service.d_override.conf new file mode 100644 index 0000000..cd17cf8 --- /dev/null +++ b/root/usr/lib/systemd/system/getty@tty2.service.d/getty@tty2.service.d_override.conf @@ -0,0 +1,17 @@ +[Unit] +Description=dmesg on tty2 + +[Service] +WorkingDirectory=/usr/bin/ +ExecStart= +ExecStart=-/usr/bin/dmesg -wHT +StandardInput=tty +StandardOutput=tty +Restart=always +RestartSec=1 +UtmpIdentifier=tty2 +TTYPath=/dev/tty2 +TTYReset=yes +TTYVHangup=yes +TTYVTDisallocate=yes +SendSIGHUP=yes diff --git a/root/usr/lib/systemd/system/getty@tty3.service.d/getty@tty3.service.d_override.conf b/root/usr/lib/systemd/system/getty@tty3.service.d/getty@tty3.service.d_override.conf new file mode 100644 index 0000000..4b96c75 --- /dev/null +++ b/root/usr/lib/systemd/system/getty@tty3.service.d/getty@tty3.service.d_override.conf @@ -0,0 +1,17 @@ +[Unit] +Description=htop on tty3 + +[Service] +WorkingDirectory=/usr/bin/ +ExecStart= +ExecStart=-/usr/bin/htop +StandardInput=tty +StandardOutput=tty +Restart=always +RestartSec=1 +UtmpIdentifier=tty3 +TTYPath=/dev/tty3 +TTYReset=yes +TTYVHangup=yes +TTYVTDisallocate=yes +SendSIGHUP=yes diff --git a/root/usr/lib/systemd/system/grub_config.service b/root/usr/lib/systemd/system/grub_config.service deleted file mode 100644 index 2eca0ef..0000000 --- a/root/usr/lib/systemd/system/grub_config.service +++ /dev/null @@ -1,11 +0,0 @@ -[Unit] -Description=Rebuild grub config from distro toolkit -ConditionPathExists=/.kiwi_grub_config.trigger - -[Service] -Type=oneshot -ExecStart=/bin/bash -c 'grub2-mkconfig -o /boot/grub2/grub.cfg' -ExecStartPost=/bin/bash -c 'rm -f /.kiwi_grub_config.trigger' - -[Install] -WantedBy=multi-user.target diff --git a/root/usr/lib/systemd/system/reHDDLogUploader.service b/root/usr/lib/systemd/system/reHDDLogUploader.service new file mode 100644 index 0000000..724addd --- /dev/null +++ b/root/usr/lib/systemd/system/reHDDLogUploader.service @@ -0,0 +1,18 @@ +[Unit] +Description=reHDD log uploader +After=syslog.target +After=network.target +After=network-online.target +Wants=network-online.target + +[Service] +Type=oneshot +User=root +Group=root +RemainAfterExit=yes +ExecStart=/usr/bin/bash /root/reHDD/scripts/reHDDLogUploader.bash + +[Install] +WantedBy=multi-user.target + + diff --git a/root/usr/lib/systemd/system/reHDDLogUploader.timer b/root/usr/lib/systemd/system/reHDDLogUploader.timer new file mode 100644 index 0000000..86cc3f6 --- /dev/null +++ b/root/usr/lib/systemd/system/reHDDLogUploader.timer @@ -0,0 +1,11 @@ +[Unit] +Description=reHDD log uploader timer + +[Timer] +OnActiveSec=30s +OnBootSec=10min +OnUnitActiveSec=12h + +[Install] +WantedBy=basic.target + diff --git a/root/usr/lib/systemd/system/reHDDStartHelper.service b/root/usr/lib/systemd/system/reHDDStartHelper.service new file mode 100644 index 0000000..a15bcda --- /dev/null +++ b/root/usr/lib/systemd/system/reHDDStartHelper.service @@ -0,0 +1,16 @@ +[Install] +WantedBy=multi-user.target + +[Unit] +Description=reHDD start helper +After=syslog.target + +[Service] +Type=oneshot +User=root +Group=root +RemainAfterExit=yes +ExecStart=/usr/bin/bash /root/reHDD/scripts/reHDDStartHelper.bash + +[Install] +WantedBy=multi-user.target \ No newline at end of file