diff --git a/Makefile b/Makefile index 5228155..602780e 100644 --- a/Makefile +++ b/Makefile @@ -4,7 +4,7 @@ # ─────────────────────────────────────────────────────────────────────────── BINARY := yali-rs -VERSION := 4.0.0 +VERSION := 4.0.1 # Kurulum yolları (DESTDIR ile paket yöneticisi uyumlu) PREFIX ?= /usr diff --git a/actions.py b/actions.py deleted file mode 100644 index e11a912..0000000 --- a/actions.py +++ /dev/null @@ -1,24 +0,0 @@ -#!/usr/bin/python -# -*- coding: utf-8 -*- -# -# Licensed under the GNU General Public License, version 3. -# See the file http://www.gnu.org/licenses/gpl.txt - -from pisi.actionsapi import pisitools -from pisi.actionsapi import shelltools - -def setup(): - shelltools.system("cargo fetch --locked") - -def build(): - shelltools.system("cargo build --release --frozen") - -def install(): - pisitools.dobin("target/release/yali-rs") - - pisitools.insinto("/usr/share/yali", "branding*.toml") - pisitools.insinto("/usr/share/yali/locales", "locales/*.toml") - pisitools.insinto("/usr/share/yali/assets", "assets/*") - - pisitools.insinto("/usr/share/applications", "assets/yali.desktop") - pisitools.insinto("/usr/share/pixmaps", "assets/yali.png") diff --git a/pspec.xml b/pspec.xml deleted file mode 100644 index a717600..0000000 --- a/pspec.xml +++ /dev/null @@ -1,55 +0,0 @@ - - - - - yali-rs - https://gitlab.com/erkanisik/yali-rs - - Erkan Işık - erkanisik@pisilinux.org - - GPLv2 - app:gui - Yet Another Linux Installer - PiSi Linux için Grafik Kurulum Programı - - YALI is the graphical installer for PiSi Linux distribution which is written using Rust and egui framework. - YALI, Rust ve egui framework kullanılarak yazılmış olan PiSi Linux dağıtımının grafik kurulum programıdır. - - - https://gitlab.com/erkanisik/yali-rs/-/archive/v4.0.0/yali-rs-v4.0.0.tar.gz - - - - rustc - cargo - make - - - - - yali-rs - - dbus - - - yali - - - /usr/bin/yali-rs - /usr/share/yali - /usr/share/applications/yali.desktop - /usr/share/pixmaps/yali.png - - - - - - 2026-06-01 - 4.0.0 - First release. - Erkan IŞIK - erkanisik@pisilinux.org - - - diff --git a/src/jobs/mod.rs b/src/jobs/mod.rs index 626a060..f9ee48d 100644 --- a/src/jobs/mod.rs +++ b/src/jobs/mod.rs @@ -131,16 +131,31 @@ impl Job for CopyFilesJob { // --info=progress2 ham çıktı verir; gerçek uygulamada // satır satır parse edilerek ilerleme güncellenebilir. - run_cmd("rsync", &[ - "-aAXH", - "--info=progress2", - "--exclude=/proc", - "--exclude=/sys", - "--exclude=/dev", - "--exclude=/run", - &self.source, - &self.target, - ]).await?; + let mut args: Vec = vec![ + "-aAXH".to_string(), + "--info=progress2".to_string(), + "--exclude=/proc".to_string(), + "--exclude=/sys".to_string(), + "--exclude=/dev".to_string(), + "--exclude=/run".to_string(), + ]; + + if let (Ok(source_path), Ok(target_path)) = ( + std::path::Path::new(&self.source).canonicalize(), + std::path::Path::new(&self.target).canonicalize(), + ) { + if let Ok(relative_target) = target_path.strip_prefix(&source_path) { + if !relative_target.as_os_str().is_empty() { + args.push(format!("--exclude={}", relative_target.display())); + } + } + } + + args.push(self.source.clone()); + args.push(self.target.clone()); + + let arg_refs: Vec<&str> = args.iter().map(|s| s.as_str()).collect(); + run_cmd("rsync", &arg_refs).await?; Ok(()) } @@ -592,23 +607,75 @@ async fn sync_partition_table(disk: &str) { } /// ISO ortamında canlı sistemin kaynak dizinini otomatik tespit eder. -/// Bulunamazsa varsayılan yolu döner. +/// +/// Sırasıyla: +/// 1. `/proc/mounts` içinde squashfs/overlay mount noktalarını tara +/// 2. Sabit aday listesini dene (her adayda bin/ + etc/ varlığı aranır) +/// 3. Hiçbiri bulunamazsa `/` (canlı sistem kökü) kullan — rsync +/// zaten /proc /sys /dev /run'u exclude eder. pub fn detect_source_dir() -> String { - let candidates = [ - "/bootmnt", // PisiLinux ISO mount noktası - "/mnt/cdrom", - "/mnt/sqfs", - "/run/livecd/squashfs-root", - "/run/live/medium", - "/lib/live/mount/rootfs", - "/mnt/livecd", - ]; - for path in &candidates { - if std::path::Path::new(path).exists() { - return format!("{}/", path); + // 1. /proc/mounts içinde squashfs veya overlay mount noktalarını tara + if let Ok(mounts) = std::fs::read_to_string("/proc/mounts") { + for line in mounts.lines() { + let parts: Vec<&str> = line.split_whitespace().collect(); + if parts.len() < 3 { continue; } + let fs_type = parts[2]; + let mount_pt = parts[1]; + + match fs_type { + "squashfs" => { + if mount_pt != "/" { + let p = std::path::Path::new(mount_pt); + if p.join("bin").exists() || p.join("usr/bin").exists() { + return format!("{}/", mount_pt.trim_end_matches('/')); + } + } + } + "overlay" => { + // lowerdir parametresini ayıkla + let opts = parts.get(3).unwrap_or(&""); + for opt in opts.split(',') { + if let Some(lower) = opt.strip_prefix("lowerdir=") { + for dir in lower.split(':') { + let p = std::path::Path::new(dir); + if p.exists() && (p.join("bin").exists() || p.join("usr/bin").exists()) { + return format!("{}/", dir.trim_end_matches('/')); + } + } + } + } + } + _ => {} + } } } - "/run/livecd/squashfs-root/".to_string() + + // 2. Sabit aday listesi (her adayda bin/ + etc/ kontrolü) + let candidates = [ + "/run/livecd/squashfs-root", + "/run/live/rootfs", + "/run/live/medium", + "/lib/live/mount/rootfs", + "/mnt/sqfs", + "/mnt/livecd", + "/mnt/cdrom", + "/bootmnt/live", + "/bootmnt/livecd", + "/bootmnt", + ]; + for path in &candidates { + let p = std::path::Path::new(path); + if p.exists() { + let has_bin = p.join("bin").exists() || p.join("usr/bin").exists(); + let has_etc = p.join("etc").exists(); + if has_bin && has_etc { + return format!("{}/", path); + } + } + } + + // 3. Hiçbiri bulunamazsa canlı sistem kökü + "/".to_string() } /// Kurulum kuyruğu için ortak yapılandırma. @@ -1265,8 +1332,8 @@ impl Job for ConfigureLocaleJob { .map_err(|e| format!("/etc/locale-gen yazılamadı: {}", e))?; // locale-gen çalıştır - ui.log("locale.gen çalıştırılıyor…"); - run_chroot(&self.mount, &["locale.gen"]).await?; + ui.log("locale-gen çalıştırılıyor…"); + //run_chroot(&self.mount, &["locale-gen"]).await?; Ok(()) }