This commit is contained in:
parent
76355357b1
commit
36c1fe436d
298
CHANGELOG.md
298
CHANGELOG.md
@ -9,259 +9,55 @@ cat -A configure.ac | grep '\^I'
|
||||
nl -ba Makefile | sed -n '770,790p'
|
||||
grep -n "^[ ]" Makefile | head
|
||||
|
||||
hmmm 😏:
|
||||
hmmm 😏
|
||||
qual o nome padrao para a "homepage" da wiki ser mostrada? index.md? nao apareceu no gitea:
|
||||
```
|
||||
make[1]: Entrando no diretório '/home/neo/Público/nfdos'
|
||||
📚 Sincronizando Wiki…
|
||||
⚠️ Nenhuma documentação encontrada em
|
||||
🔄 Clonando wiki…
|
||||
fatal: The empty string is not a valid path
|
||||
make[1]: *** [Makefile:925: wiki] Erro 128
|
||||
Cloning into './src/tmp/nfdos-wiki-sync'...
|
||||
warning: You appear to have cloned an empty repository.
|
||||
📁 Atualizando páginas…
|
||||
sending incremental file list
|
||||
deleting .git/refs/tags/
|
||||
deleting .git/refs/heads/
|
||||
deleting .git/refs/
|
||||
deleting .git/objects/pack/
|
||||
deleting .git/objects/info/
|
||||
deleting .git/objects/
|
||||
deleting .git/info/exclude
|
||||
deleting .git/info/
|
||||
deleting .git/hooks/update.sample
|
||||
deleting .git/hooks/sendemail-validate.sample
|
||||
deleting .git/hooks/push-to-checkout.sample
|
||||
deleting .git/hooks/prepare-commit-msg.sample
|
||||
deleting .git/hooks/pre-receive.sample
|
||||
deleting .git/hooks/pre-rebase.sample
|
||||
deleting .git/hooks/pre-push.sample
|
||||
deleting .git/hooks/pre-merge-commit.sample
|
||||
deleting .git/hooks/pre-commit.sample
|
||||
deleting .git/hooks/pre-applypatch.sample
|
||||
deleting .git/hooks/post-update.sample
|
||||
deleting .git/hooks/fsmonitor-watchman.sample
|
||||
deleting .git/hooks/commit-msg.sample
|
||||
deleting .git/hooks/applypatch-msg.sample
|
||||
deleting .git/hooks/
|
||||
deleting .git/branches/
|
||||
deleting .git/description
|
||||
deleting .git/config
|
||||
deleting .git/HEAD
|
||||
deleting .git/
|
||||
./
|
||||
index.md
|
||||
|
||||
sent 123 bytes received 765 bytes 1.776,00 bytes/sec
|
||||
total size is 0 speedup is 0,00
|
||||
📤 Enviando alterações para o repositório da wiki…
|
||||
No ramo main
|
||||
Your branch is up to date with 'origin/main'.
|
||||
|
||||
nothing to commit, working tree clean
|
||||
Nenhuma modificação.
|
||||
Everything up-to-date
|
||||
✅ Wiki sincronizada!
|
||||
make[1]: Saindo do diretório '/home/neo/Público/nfdos'
|
||||
make: *** [Makefile:847: git] Erro 2
|
||||
```
|
||||
ajustei o makefile assim:
|
||||
```
|
||||
SUBDIRS = src
|
||||
|
||||
# ===========================
|
||||
# Configurações de Git
|
||||
# ===========================
|
||||
GIT_USER ?= "neo.webmaster.2@gmail.com"
|
||||
GIT_EMAIL ?= "neo.webmaster.2@gmail.com"
|
||||
GIT_REMOTE ?= "origin"
|
||||
GIT_BRANCH ?= "main"
|
||||
COMMIT_MSG ?= "Auto-commit via make git"
|
||||
GIT_VER := $(shell git describe --tags --always --dirty 2>/dev/null || echo "0.1-dev")
|
||||
|
||||
NEUROTRON_DIR ?= $(top_srcdir)/src/_nfdos/kernel/neurotron
|
||||
NEUROTRON_REMOTE ?= origin
|
||||
NEUROTRON_BRANCH ?= main
|
||||
|
||||
# ===========================
|
||||
# Caminhos e artefactos
|
||||
# ===========================
|
||||
DIST_DIR ?= $(top_builddir)/dist
|
||||
BUILD_DIR ?= $(top_builddir)/build
|
||||
ISO_DIR ?= $(DIST_DIR)/iso/boot/grub
|
||||
ISO_FILE ?= $(DIST_DIR)/nfdos-$(GIT_VER).iso
|
||||
SRC_TAR ?= $(DIST_DIR)/nfdos-$(GIT_VER)-src.tar.gz
|
||||
|
||||
KERNEL = $(top_builddir)/src/_nfdos/kernel/linux/arch/x86/boot/bzImage
|
||||
INITRAMFS = $(top_builddir)/src/_nfdos/initramfs.cpio.gz
|
||||
|
||||
WIKI_SRC = $(top_srcdir)/src/docs/wiki
|
||||
WIKI_REPO = ssh://git@gitea.neoricalex.com:2222/neo/nfdos.wiki.git
|
||||
WIKI_TMP = $(top_srcdir)/src/tmp/nfdos-wiki-sync
|
||||
|
||||
.PHONY: iso qemu tarball git release clean-local check-remote
|
||||
|
||||
# ===========================
|
||||
# Criação da ISO
|
||||
# ===========================
|
||||
iso: $(ISO_FILE)
|
||||
|
||||
$(ISO_FILE):
|
||||
@echo "[ISO] Criando estrutura de diretórios..."
|
||||
mkdir -p $(DIST_DIR)/iso/boot
|
||||
mkdir -p $(ISO_DIR)
|
||||
|
||||
@echo "[ISO] Copiando Kernel e Initramfs..."
|
||||
cp $(KERNEL) $(DIST_DIR)/iso/boot/
|
||||
cp $(INITRAMFS) $(DIST_DIR)/iso/boot/
|
||||
|
||||
@echo "[ISO] Gerando grub.cfg..."
|
||||
@printf "set timeout=3\nset default=0\n\nmenuentry 'NFDOS Linux' {\n\tlinux /boot/bzImage console=ttyS0 root=/dev/ram0 loglevel=8\n\tinitrd /boot/initramfs.cpio.gz\n}\n" > $(ISO_DIR)/grub.cfg
|
||||
|
||||
@echo "[ISO] Gerando imagem ISO..."
|
||||
grub-mkrescue -o $(ISO_FILE) $(DIST_DIR)/iso --compress=xz -V NFDOS
|
||||
@echo "[✔] ISO criada em $(ISO_FILE)"
|
||||
|
||||
# ===========================
|
||||
# Teste no QEMU
|
||||
# ===========================
|
||||
qemu: $(ISO_FILE)
|
||||
@echo "[QEMU] Iniciando NFDOS ISO..."
|
||||
qemu-system-x86_64 -cdrom $(ISO_FILE) -m 1024 -nographic -serial mon:stdio -no-reboot
|
||||
|
||||
# ===========================
|
||||
# Empacotamento do código-fonte
|
||||
# ===========================
|
||||
tarball: $(SRC_TAR)
|
||||
|
||||
$(SRC_TAR):
|
||||
@echo "[TAR] Empacotando código-fonte..."
|
||||
mkdir -p $(DIST_DIR)
|
||||
cd $(top_srcdir) && tar \
|
||||
--exclude="$(notdir $(SRC_TAR))" \
|
||||
--exclude="$(DIST_DIR)" \
|
||||
--exclude="$(BUILD_DIR)" \
|
||||
--exclude='*/__pycache__' \
|
||||
--exclude='*/.venv' \
|
||||
--exclude='*/venv' \
|
||||
--exclude='*.pyc' \
|
||||
--exclude='*.pyo' \
|
||||
--exclude='*.o' \
|
||||
--exclude='*.a' \
|
||||
--exclude='*.so' \
|
||||
--exclude='*.iso' \
|
||||
--exclude='*.img' \
|
||||
--exclude='*.cpio*' \
|
||||
--exclude='*/linux' \
|
||||
--exclude='*/busybox' \
|
||||
--exclude='*/cpython' \
|
||||
-czf $(SRC_TAR) .
|
||||
@echo "[✔] Tarball gerado em $(SRC_TAR)"
|
||||
|
||||
# ===========================
|
||||
# Git (commit + push)
|
||||
# ===========================
|
||||
git: check-remote
|
||||
@echo "📦 Commit automático → Gitea (NFDOS)"
|
||||
@git config user.name $(GIT_USER)
|
||||
@git config user.email $(GIT_EMAIL)
|
||||
@git rev-parse --abbrev-ref HEAD >/dev/null 2>&1 || true
|
||||
@git add -A
|
||||
@git commit -m "$$(echo '$(COMMIT_MSG)')" || echo "Nenhuma modificação para commitar."
|
||||
@git push $(GIT_REMOTE) $(GIT_BRANCH)
|
||||
|
||||
$(MAKE) sync-neurotron
|
||||
@$(MAKE) wiki
|
||||
|
||||
# ===========================
|
||||
# Git Remote (HTTPS → SSH Auto-Fix)
|
||||
# ===========================
|
||||
check-remote:
|
||||
@REMOTE_URL=$$(git remote get-url $(GIT_REMOTE)); \
|
||||
if echo $$REMOTE_URL | grep -q '^https://gitea\.neoricalex\.com'; then \
|
||||
echo "⚠️ Repositório configurado com HTTPS:"; \
|
||||
echo " $$REMOTE_URL"; \
|
||||
echo "🔄 Convertendo para SSH (porta 2222)..."; \
|
||||
SSH_URL=$$(echo $$REMOTE_URL | sed -E 's|https://gitea\.neoricalex\.com[:/]+|ssh://git@gitea.neoricalex.com:2222/|'); \
|
||||
git remote set-url $(GIT_REMOTE) $$SSH_URL; \
|
||||
echo "✅ Remote atualizado para:"; \
|
||||
git remote -v; \
|
||||
else \
|
||||
echo "✅ Remote SSH já configurado:"; \
|
||||
git remote -v | grep $(GIT_REMOTE); \
|
||||
fi; \
|
||||
echo "🔍 Testando conectividade SSH com Gitea..."; \
|
||||
if ssh -T git@gitea.neoricalex.com -p 2222 2>&1 | grep -q "successfully authenticated"; then \
|
||||
echo "✅ Conexão SSH funcional com Gitea."; \
|
||||
else \
|
||||
echo "❌ Falha na autenticação SSH com Gitea."; \
|
||||
echo " Verifique a chave em ~/.ssh/id_ed25519.pub e nas SSH Keys do Gitea."; \
|
||||
exit 1; \
|
||||
fi
|
||||
|
||||
# ===========================
|
||||
# Sincronizar Neurotron (SSH auto-fix + push)
|
||||
# ===========================
|
||||
sync-neurotron:
|
||||
@echo ""
|
||||
@echo "🧠 Sincronizando Neurotron…"
|
||||
|
||||
@if [ ! -d "$(NEUROTRON_DIR)/.git" ]; then \
|
||||
echo "⚠️ Neurotron não é um repositório git — ignorado."; \
|
||||
exit 0; \
|
||||
fi
|
||||
|
||||
@cd $(NEUROTRON_DIR) && \
|
||||
REMOTE_URL=$$(git remote get-url $(NEUROTRON_REMOTE)); \
|
||||
echo "🔍 Remote atual do Neurotron: $$REMOTE_URL"; \
|
||||
\
|
||||
if echo $$REMOTE_URL | grep -q '^https://gitea\.neoricalex\.com'; then \
|
||||
echo "⚠️ Neurotron ainda está em HTTPS. Convertendo para SSH:2222…"; \
|
||||
SSH_URL=$$(echo $$REMOTE_URL | sed -E 's|https://gitea\.neoricalex\.com[:/]+|ssh://git@gitea.neoricalex.com:2222/|'); \
|
||||
git remote set-url $(NEUROTRON_REMOTE) $$SSH_URL; \
|
||||
echo "✅ Remote atualizado: $$SSH_URL"; \
|
||||
fi; \
|
||||
\
|
||||
if echo $$REMOTE_URL | grep -q '^ssh://git@gitea\.neoricalex\.com/'; then \
|
||||
echo "⚠️ SSH sem porta detectado. Ajustando porta 2222…"; \
|
||||
SSH_URL=$$(echo $$REMOTE_URL | sed -E 's|ssh://git@gitea.neoricalex.com/|ssh://git@gitea.neoricalex.com:2222/|'); \
|
||||
git remote set-url $(NEUROTRON_REMOTE) $$SSH_URL; \
|
||||
echo "✅ Remote atualizado: $$SSH_URL"; \
|
||||
fi
|
||||
|
||||
@if ssh -T git@gitea.neoricalex.com -p 2222 2>&1 | grep -q "successfully authenticated"; then \
|
||||
echo "🔐 SSH OK para Neurotron."; \
|
||||
else \
|
||||
echo "❌ Falha de autenticação SSH para Neurotron."; \
|
||||
exit 1; \
|
||||
fi
|
||||
|
||||
@cd $(NEUROTRON_DIR) && \
|
||||
git add -A && \
|
||||
git commit -m "Auto-commit via make git (triggered by NFDOS)" || echo "Nenhuma modificação no Neurotron."; \
|
||||
git push $(NEUROTRON_REMOTE) $(NEUROTRON_BRANCH); \
|
||||
echo "✔ Neurotron sincronizado."
|
||||
|
||||
# ===========================
|
||||
# Sync Wiki (Markdown → Gitea Wiki)
|
||||
# ===========================
|
||||
wiki:
|
||||
@echo "📚 Sincronizando Wiki…"
|
||||
@if [ ! -d "$${WIKI_SRC}" ]; then \
|
||||
echo "⚠️ Nenhuma documentação encontrada em $${WIKI_SRC}"; \
|
||||
exit 0; \
|
||||
fi
|
||||
@if [ ! -d "$${WIKI_TMP}/.git" ]; then \
|
||||
echo "🔄 Clonando wiki…"; \
|
||||
rm -rf "$${WIKI_TMP}"; \
|
||||
git clone "$${WIKI_REPO}" "$${WIKI_TMP}"; \
|
||||
else \
|
||||
echo "🔄 Atualizando wiki…"; \
|
||||
cd "$${WIKI_TMP}" && git pull; \
|
||||
fi
|
||||
@echo "📁 Atualizando páginas…"
|
||||
@rsync -av --delete "$${WIKI_SRC}/" "$${WIKI_TMP}/"
|
||||
@echo "📤 Enviando alterações para o repositório da wiki…"
|
||||
@cd "$${WIKI_TMP}" && \
|
||||
git add -A && \
|
||||
git commit -m "Auto-update wiki via make" || echo "Nenhuma modificação." && \
|
||||
git push
|
||||
|
||||
@echo "✅ Wiki sincronizada!"
|
||||
|
||||
# ===========================
|
||||
# Release (ISO + Tarball)
|
||||
# ===========================
|
||||
release: iso tarball
|
||||
@# --- Proteção: evitar builds "dirty" ---
|
||||
@if ! git diff --quiet || ! git diff --cached --quiet; then \
|
||||
echo "❌ Existem alterações não commitadas. Faça commit antes de gerar a release."; \
|
||||
git status -s; \
|
||||
exit 1; \
|
||||
fi
|
||||
@echo "🚀 Publicando build em dist/releases (versão: $(GIT_VER))"
|
||||
@mkdir -p $(DIST_DIR)/releases
|
||||
@if ls $(DIST_DIR)/nfdos-*.iso >/dev/null 2>&1; then \
|
||||
cp $(DIST_DIR)/nfdos-*.iso $(DIST_DIR)/releases/; \
|
||||
else \
|
||||
echo "⚠️ Nenhuma ISO encontrada. Execute 'make iso' primeiro."; \
|
||||
fi
|
||||
@if ls $(DIST_DIR)/nfdos-*.tar.gz >/dev/null 2>&1; then \
|
||||
cp $(DIST_DIR)/nfdos-*.tar.gz $(DIST_DIR)/releases/; \
|
||||
else \
|
||||
echo "⚠️ Nenhum tarball encontrado. Execute 'make tarball' primeiro."; \
|
||||
fi
|
||||
@git add $(DIST_DIR)/releases/
|
||||
@git commit -m "Build automático: release $(GIT_VER)" || echo "Nenhum ficheiro novo para commitar."
|
||||
@git push origin main
|
||||
|
||||
# ===========================
|
||||
# Limpeza
|
||||
# ===========================
|
||||
clean-local:
|
||||
@echo "[CLEAN] Removendo diretórios temporários..."
|
||||
rm -rf $(BUILD_DIR)
|
||||
find $(DIST_DIR) -type f ! -path "$(DIST_DIR)/releases/*" -delete
|
||||
|
||||
@echo "[CLEAN] Limpando build interno do Neurotron..."
|
||||
@if [ -d "$(top_srcdir)/src/_nfdos/kernel/neurotron" ]; then \
|
||||
$(MAKE) -C $(top_srcdir)/src/_nfdos/kernel/neurotron clean || true; \
|
||||
fi
|
||||
|
||||
@echo "[✔] Limpeza concluída (releases preservadas)"
|
||||
```
|
||||
0
src/docs/wiki/_Footer.md
Normal file
0
src/docs/wiki/_Footer.md
Normal file
0
src/docs/wiki/_Sidebar.md
Normal file
0
src/docs/wiki/_Sidebar.md
Normal file
Loading…
Reference in New Issue
Block a user