Initial commit: Complete MBetter Debian Live ISO build system

- Live-build configuration with SSH, OpenVPN, Xorg, Openbox
- Auto-start MbetterClient on boot with root login enabled
- Minimal Debian installer with customizable root password
- MBetter branding with converted logos from mbet.jpg
- Automated build script with password prompting
- Cleanup script to reset configurations
- Cross-platform USB creation scripts (Windows .bat and Linux .sh)
- Comprehensive README with usage instructions
parents
Pipeline #178 canceled with stages
File added
# MBetter Debian Live ISO Builder
This project creates a custom Debian live ISO with the following features:
- SSH server with root login enabled
- OpenVPN installed and configurable
- Xorg with Openbox window manager
- Auto-start of MbetterClient application on boot
- Minimal Debian installer asking only for network configuration
- Custom MBetter logos (pre-generated and included)
## Prerequisites
- Debian-based system with live-build installed
- ImageMagick for logo generation (optional)
## Usage
1. Insert OpenVPN config (optional):
./insert_openvpn.sh /path/to/client.conf /path/to/key1 /path/to/key2
2. Build the ISO (will prompt for root password if not set):
sudo ./build.sh
3. Create bootable USB drive:
- Windows: Run create_usb.bat as Administrator
- Linux: sudo ./create_usb.sh
4. To clean up and reset configuration:
./cleanup.sh
## Alternative Manual Setup
If you prefer to set the root password manually:
./set_root_password.sh yourpassword
Logos are converted from mbet.jpg and included in the build automatically.
## Creating Bootable USB
### Windows (`create_usb.bat`)
- Lists available disks using diskpart
- Prompts for disk selection with safety warnings
- Formats USB as FAT32 and copies ISO contents
- **Requirements:** Run as Administrator, USB 4GB+, PowerShell enabled
### Linux (`create_usb.sh`)
- Lists block devices using lsblk
- Uses `dd` to write ISO directly to USB (fast and reliable)
- Shows progress during writing
- **Requirements:** Run with sudo, USB device path (e.g., /dev/sdb)
**Safety Note:** Both scripts include confirmation prompts and warnings about data loss.
The ISO will be created as `live-image-amd64.iso` or similar.
## Customization
- Edit `config/package-lists/live.list.chroot` to add/remove packages
- Modify `config/preseed/debian-installer.cfg` for installer settings
- Update hooks in `config/hooks/live/` for additional configurations
- Replace logos in `config/includes.chroot/` as needed
## Notes
- The build may fail on non-Debian systems due to keyring issues. Ensure proper Debian mirrors and keys.
- MbetterClient is assumed to be executable and placed in /usr/local/bin/
- OpenVPN config is set to start automatically if provided
\ No newline at end of file
#!/bin/bash
echo "MBetter ISO Build Script"
echo "========================"
# Check if root password has been set
if grep -q "d-i passwd/root-password password changeme" config/preseed/debian-installer.cfg; then
echo "Root password not set. Please enter a root password for the ISO:"
read -s -p "Enter root password: " ROOT_PASS
echo
read -s -p "Confirm root password: " ROOT_PASS_CONFIRM
echo
if [ "$ROOT_PASS" != "$ROOT_PASS_CONFIRM" ]; then
echo "ERROR: Passwords do not match!"
exit 1
fi
if [ -z "$ROOT_PASS" ]; then
echo "ERROR: Password cannot be empty!"
exit 1
fi
echo "Setting root password..."
./set_root_password.sh "$ROOT_PASS"
fi
echo "Root password is set. Proceeding with build..."
# Check if running as root (lb build needs sudo)
if [ "$EUID" -ne 0 ]; then
echo "ERROR: This script must be run with sudo privileges."
echo "Usage: sudo ./build.sh"
exit 1
fi
echo "Starting ISO build..."
lb build
if [ $? -eq 0 ]; then
echo "Build completed successfully!"
echo "ISO file: $(ls live-image-amd64.iso 2>/dev/null || ls *.iso 2>/dev/null || echo 'Not found')"
else
echo "Build failed. Check the output above for errors."
exit 1
fi
\ No newline at end of file
2025-09-01 11:28:44 URL:http://deb.debian.org/debian/dists/testing/InRelease [146391/146391] -> "/working/mlivecd/chroot/var/lib/apt/lists/partial/deb.debian.org_debian_dists_testing_InRelease" [1]
gpgv: Signature made Mon Sep 1 10:14:58 2025 SAST
gpgv: using RSA key 4CB50190207B4758A3F73A796ED0E7B82643E131
gpgv: Can't check signature: No public key
gpgv: Signature made Mon Sep 1 10:15:01 2025 SAST
gpgv: using RSA key B8E5F13176D2A7A75220028078DBA3BC47EF2265
gpgv: Can't check signature: No public key
This source diff could not be displayed because it is too large. You can view the blob instead.
This source diff could not be displayed because it is too large. You can view the blob instead.
-----BEGIN PGP SIGNATURE-----
iQIzBAEBCAAdFiEETLUBkCB7R1ij9zp5btDnuCZD4TEFAmi1VgIACgkQbtDnuCZD
4THSjBAAsFMdiByYh4n8buYulcMDVo+oNqUkTAYTe+lIhjulmP/Rs671PF7KKPz4
g/yichTrgrm623ozAwNXy5SPjBNUX2D4LOOJFnDZEztBxtlL12XO1gVuWK2PRc7Y
Rxf05QNDXv8/X5bj4YZmmhNGa5nLoxtQGAe20NikAVy/t7jRgOEFVVTn/4xssGmd
cP3wKgCbvRR62O+DNmmXgJ1BcHVbb6TSCDX1iMYa1aPuXFfR4GAvQsDryG0oyfqG
I1VgrE6HzoW1BnOaiC4k+Be5I2W1Zg1Wofe77u8jL2lbz4HaHMDXD1QM83NHsXi5
Rg1GUvlw56P8dNT5cwCn8gQJoyUpyVKEn+84+nzmPxbm/5Zhd6SQfGw/EyIuGwf1
QKClNWm2bXGX2YRsA0PK5sb9mBh1HLBM2yvGN8Y9sQnWifklk9b4sKQ0l6CbYljm
un3jkoBUOGEFq7qOO+9sf6J6ybPjQNe++2Sx5c7V561Uw5iJQEjds3AO6imEv9sh
RFB+siwqIEwcBWjBbw79SreFtt4GfoAWfXLFuza9ydIlWOUxm5YuqBdMXfQkHitT
q1QgufOqt0uZuHxDTPFH6/ghPtVW6yRAqtx3zH+tYhAFuckdBWgQkixcEAC2spO+
DwKlXzYgpBfxl8UTDy6cK7SC+n7c/AEBE32810r5iIlYM2Rp9y6JAjMEAQEIAB0W
IQS45fExdtKnp1IgAoB426O8R+8iZQUCaLVWBQAKCRB426O8R+8iZZWFD/4u7rvL
8qRvjypDaJrFBrUCKNpnYFE2Wzs3fM43R0wXVwXlCWVU2a6RDl2gQ/nE3ia/IB0D
rrpWloyJZDVEMHazapj+7jEJks7aNKs2+7f1VCm80ze5vhfqvDL7Cw/zFEZ3/Jao
ZTn52nvjwm8bV3pVhN3UfwUCBklqN9USYqt0xqTY0GGAsu6Wj2QxyRJCKRZ3QvmK
n4OAjM96e2OAjmoFKArlt3m4A/IHP8hwthcooUmh363JSuctjwG1329WbhBf9Lp5
Cb6c/WopJfINIK8wpnX5papg219wjegBe/rUfkXYbRcA+tbg+PqzH6xO1GWjHppT
cfYi+tnaqYL9ZzhZ26SKb78EiDLNtFeZteoR4orUs9FXQEg0l/m1OLfIltr+TuW2
yhNE8TmQMb+H/W0Sl8AOKerENWFIBz8Ldhq4iCHlsvxY5h9APNO8Cros1evsS6Zh
3noGUeBCRjix8gAFhjr1RWCezoqD2nuxepdzk4rK5XbVuG31i5qc6fULUpr01AgT
v0xoKV7wytuG2uVGcHZn5GbNUqbHSEZjCbJHT31uPjIeCvu35j11+IHwdg7xWDVQ
RGmSKKd87xzE5igjXh+/Gfs1DYMYimX0GYCkfRlWAHgIGSbWE3kepQga257fDXdo
l1qozdoWaDvrm52UzlDocpzBFVyvJ3eAz0wBdw==
=AYkX
-----END PGP SIGNATURE-----
#!/bin/bash
echo "Cleaning up MBetter ISO build configuration..."
# Revert root password to default in preseed file
sed -i 's|d-i passwd/root-password-crypted password .*|d-i passwd/root-password password changeme|' config/preseed/debian-installer.cfg
# Remove OpenVPN configuration
if [ -d "config/includes.chroot/etc/openvpn" ]; then
rm -rf config/includes.chroot/etc/openvpn
echo "Removed OpenVPN configuration"
fi
# Remove OpenVPN start hook
if [ -f "config/hooks/live/start-openvpn.hook.chroot" ]; then
rm config/hooks/live/start-openvpn.hook.chroot
echo "Removed OpenVPN start hook"
fi
# Clean build artifacts
if [ -f "live-image-amd64.iso" ]; then
rm live-image-amd64.iso
echo "Removed previous ISO file"
fi
# Clean live-build cache and temporary files
sudo lb clean
echo "Cleanup completed. Configuration reset to defaults."
\ No newline at end of file
# config/binary - options for live-build(7), binary stage
# Set image type
LB_IMAGE_TYPE="iso-hybrid"
# Set image filesystem
LB_BINARY_FILESYSTEM="fat32"
# Set apt/aptitude generic indices
LB_APT_INDICES="true"
# Set boot parameters
LB_BOOTAPPEND_LIVE="boot=live components quiet splash"
# Set boot parameters
LB_BOOTAPPEND_INSTALL=""
# Set boot parameters
LB_BOOTAPPEND_LIVE_FAILSAFE="boot=live components memtest noapic noapm nodma nomce nosmp nosplash vga=788"
# Set BIOS bootloader
LB_BOOTLOADER_BIOS="syslinux"
# Set EFI bootloader
LB_BOOTLOADER_EFI="grub-efi"
# Set bootloaders
LB_BOOTLOADERS=""
# Set checksums
LB_CHECKSUMS="sha256"
# Set compression
LB_COMPRESSION="none"
# Support dm-verity on rootfs
LB_DM_VERITY=""
# Support FEC on dm-verity rootfs
LB_DM_VERITY_FEC_ROOTS=""
# Set sign script for roothash for dm-verity rootfs
LB_DM_VERITY_SIGN=""
# Set zsync
LB_ZSYNC="false"
# Control if we build binary images chrooted
# NEVER, *EVER*, *E*V*E*R* SET THIS OPTION to false.
LB_BUILD_WITH_CHROOT="true"
# Set debian-installer
LB_DEBIAN_INSTALLER="none"
# Set debian-installer suite
LB_DEBIAN_INSTALLER_DISTRIBUTION="testing"
# Set debian-installer preseed filename/url
LB_DEBIAN_INSTALLER_PRESEEDFILE=""
# Toggle use of GUI debian-installer
LB_DEBIAN_INSTALLER_GUI="true"
# Set hdd label
LB_HDD_LABEL="DEBIAN_LIVE"
# Set hdd filesystem size
LB_HDD_SIZE="auto"
# Set start of partition for the hdd target for BIOSes that expect a specific boot partition start (e.g. "63s"). If empty, use optimal layout.
LB_HDD_PARTITION_START=""
# Set iso author
LB_ISO_APPLICATION="Debian Live"
# Set iso preparer
LB_ISO_PREPARER="live-build @LB_VERSION@; https://salsa.debian.org/live-team/live-build"
# Set iso publisher
LB_ISO_PUBLISHER="Debian Live project; https://wiki.debian.org/DebianLive; debian-live@lists.debian.org"
# Set iso volume (max 32 chars)
LB_ISO_VOLUME="Debian testing @ISOVOLUME_TS@"
# Set jffs2 eraseblock size
LB_JFFS2_ERASEBLOCK=""
# Set memtest
LB_MEMTEST="none"
# Set loadlin
LB_LOADLIN="false"
# Set win32-loader
LB_WIN32_LOADER="false"
# Set net tarball
LB_NET_TARBALL="true"
# Set onie
LB_ONIE="false"
# Set onie additional kernel cmdline options
LB_ONIE_KERNEL_CMDLINE=""
# Set inclusion of firmware packages in debian-installer
LB_FIRMWARE_BINARY="true"
# Set inclusion of firmware packages in the live image
LB_FIRMWARE_CHROOT="true"
# Set swap file path
LB_SWAP_FILE_PATH=""
# Set swap file size
LB_SWAP_FILE_SIZE="512"
# Enable/disable UEFI secure boot support
LB_UEFI_SECURE_BOOT="auto"
# config/bootstrap - options for live-build(7), bootstrap stage
# Select architecture to use
LB_ARCHITECTURE="amd64"
# Select distribution to use
LB_DISTRIBUTION="testing"
# Select parent distribution to use
LB_PARENT_DISTRIBUTION=""
# Select distribution to use in the chroot
LB_DISTRIBUTION_CHROOT="testing"
# Select parent distribution to use in the chroot
LB_PARENT_DISTRIBUTION_CHROOT="testing"
# Select distribution to use in the final image
LB_DISTRIBUTION_BINARY="testing"
# Select parent distribution to use in the final image
LB_PARENT_DISTRIBUTION_BINARY="testing"
# Select parent distribution for debian-installer to use
LB_PARENT_DEBIAN_INSTALLER_DISTRIBUTION=""
# Select archive areas to use
LB_ARCHIVE_AREAS="main"
# Select parent archive areas to use
LB_PARENT_ARCHIVE_AREAS="main"
# Set parent mirror to bootstrap from
LB_PARENT_MIRROR_BOOTSTRAP="http://deb.debian.org/debian/"
# Set parent mirror to fetch packages from
LB_PARENT_MIRROR_CHROOT="http://deb.debian.org/debian/"
# Set security parent mirror to fetch packages from
LB_PARENT_MIRROR_CHROOT_SECURITY="http://security.debian.org/"
# Set parent mirror which ends up in the image
LB_PARENT_MIRROR_BINARY="http://deb.debian.org/debian/"
# Set security parent mirror which ends up in the image
LB_PARENT_MIRROR_BINARY_SECURITY="http://security.debian.org/"
# Set debian-installer parent mirror
LB_PARENT_MIRROR_DEBIAN_INSTALLER="http://deb.debian.org/debian/"
# Set mirror to bootstrap from
LB_MIRROR_BOOTSTRAP="http://deb.debian.org/debian/"
# Set mirror to fetch packages from
LB_MIRROR_CHROOT="http://deb.debian.org/debian/"
# Set security mirror to fetch packages from
LB_MIRROR_CHROOT_SECURITY="http://security.debian.org/"
# Set mirror which ends up in the image
LB_MIRROR_BINARY="http://deb.debian.org/debian/"
# Set security mirror which ends up in the image
LB_MIRROR_BINARY_SECURITY="http://security.debian.org/"
# Set debian-installer mirror
LB_MIRROR_DEBIAN_INSTALLER="http://deb.debian.org/debian/"
# Set architectures to use foreign bootstrap
LB_BOOTSTRAP_QEMU_ARCHITECTURE=""
# Set packages to exclude during foreign bootstrap
LB_BOOTSTRAP_QEMU_EXCLUDE=""
# Set static qemu binary for foreign bootstrap
LB_BOOTSTRAP_QEMU_STATIC=""
# config/chroot - options for live-build(7), chroot stage
# Set chroot filesystem
LB_CHROOT_FILESYSTEM="squashfs"
# Set chroot squashfs compression level
LB_CHROOT_SQUASHFS_COMPRESSION_LEVEL=""
# Set chroot squashfs compression type
LB_CHROOT_SQUASHFS_COMPRESSION_TYPE=""
# Set union filesystem
LB_UNION_FILESYSTEM="overlay"
# Set interactive build
LB_INTERACTIVE="false"
# Set keyring packages
LB_KEYRING_PACKAGES="debian-archive-keyring"
# Set kernel flavour to use (with arch)
LB_LINUX_FLAVOURS_WITH_ARCH="amd64"
# Set kernel packages to use
LB_LINUX_PACKAGES="linux-image"
# Enable security updates
LB_SECURITY="true"
# Enable updates updates
LB_UPDATES="true"
# Enable backports updates
LB_BACKPORTS="false"
# Enable proposed updates
LB_PROPOSED_UPDATES="false"
# config/common - common options for live-build(7)
# Version of live-build used to build config (config format version)
LB_CONFIGURATION_VERSION="20250814"
# Set package manager
LB_APT="apt"
# Set proxy for HTTP connections
LB_APT_HTTP_PROXY=""
# Set apt/aptitude pipeline depth
LB_APT_PIPELINE=""
# Set apt/aptitude recommends
LB_APT_RECOMMENDS="true"
# Set apt/aptitude security
LB_APT_SECURE="true"
# Set apt/aptitude source entries in sources.list
LB_APT_SOURCE_ARCHIVES="true"
# Control cache
LB_CACHE="true"
# Control if downloaded package indices should be cached
LB_CACHE_INDICES="false"
# Control if downloaded packages files should be cached
LB_CACHE_PACKAGES="true"
# Control if completed stages should be cached
LB_CACHE_STAGES="bootstrap"
# Set debconf(1) frontend to use
LB_DEBCONF_FRONTEND="noninteractive"
# Set debconf(1) priority to use
LB_DEBCONF_PRIORITY="critical"
# Set initramfs hook
LB_INITRAMFS="live-boot"
# Set initramfs compression
LB_INITRAMFS_COMPRESSION="gzip"
# Set init system
LB_INITSYSTEM="systemd"
# Set distribution mode
LB_MODE="debian"
# Set system type
LB_SYSTEM="live"
# Set base name of the image
LB_IMAGE_NAME="live-image"
# Set options to use with apt
APT_OPTIONS="--yes -o Acquire::Retries=5"
# Set options to use with aptitude
APTITUDE_OPTIONS="--assume-yes -o Acquire::Retries=5"
# Set options to use with debootstrap
DEBOOTSTRAP_OPTIONS=""
# Set script to use with debootstrap
DEBOOTSTRAP_SCRIPT=""
# Set options to use with gzip
GZIP_OPTIONS="-6 --rsyncable"
# Enable UTC timestamps
LB_UTC_TIME="false"
# live-build options
# Enable breakpoints
# If set here, overrides the command line option
#_BREAKPOINTS="false"
# Enable debug
# If set here, overrides the command line option
#_DEBUG="false"
# Enable color
# If set here, overrides the command line option
#_COLOR="auto"
# Enable force
# If set here, overrides the command line option
#_FORCE="false"
# Enable quiet
# If set here, overrides the command line option
#_QUIET="false"
# Enable verbose
# If set here, overrides the command line option
#_VERBOSE="false"
/usr/share/live/build/hooks/live/0010-disable-kexec-tools.hook.chroot
\ No newline at end of file
/usr/share/live/build/hooks/live/0050-disable-sysvinit-tmpfs.hook.chroot
\ No newline at end of file
#!/bin/bash
sed -i 's/#PermitRootLogin.*/PermitRootLogin yes/' /etc/ssh/sshd_config
\ No newline at end of file
/usr/share/live/build/hooks/normal/1000-create-mtab-symlink.hook.chroot
\ No newline at end of file
/usr/share/live/build/hooks/normal/1010-enable-cryptsetup.hook.chroot
\ No newline at end of file
/usr/share/live/build/hooks/normal/1020-create-locales-files.hook.chroot
\ No newline at end of file
/usr/share/live/build/hooks/normal/5000-update-apt-file-cache.hook.chroot
\ No newline at end of file
/usr/share/live/build/hooks/normal/5010-update-apt-xapian-index.hook.chroot
\ No newline at end of file
/usr/share/live/build/hooks/normal/5020-update-glx-alternative.hook.chroot
\ No newline at end of file
/usr/share/live/build/hooks/normal/5030-update-plocate-database.hook.chroot
\ No newline at end of file
/usr/share/live/build/hooks/normal/5040-update-nvidia-alternative.hook.chroot
\ No newline at end of file
/usr/share/live/build/hooks/normal/5050-dracut.hook.chroot
\ No newline at end of file
/usr/share/live/build/hooks/normal/8000-remove-adjtime-configuration.hook.chroot
\ No newline at end of file
/usr/share/live/build/hooks/normal/8010-remove-backup-files.hook.chroot
\ No newline at end of file
/usr/share/live/build/hooks/normal/8020-remove-dbus-machine-id.hook.chroot
\ No newline at end of file
/usr/share/live/build/hooks/normal/8030-truncate-log-files.hook.chroot
\ No newline at end of file
/usr/share/live/build/hooks/normal/8040-remove-mdadm-configuration.hook.chroot
\ No newline at end of file
/usr/share/live/build/hooks/normal/8050-remove-openssh-server-host-keys.hook.chroot
\ No newline at end of file
/usr/share/live/build/hooks/normal/8060-remove-systemd-machine-id.hook.chroot
\ No newline at end of file
/usr/share/live/build/hooks/normal/8070-remove-temporary-files.hook.chroot
\ No newline at end of file
/usr/share/live/build/hooks/normal/8080-reproducible-glibc.hook.chroot
\ No newline at end of file
/usr/share/live/build/hooks/normal/8090-remove-ssl-cert-snakeoil.hook.chroot
\ No newline at end of file
/usr/share/live/build/hooks/normal/8100-remove-udev-persistent-cd-rules.hook.chroot
\ No newline at end of file
/usr/share/live/build/hooks/normal/8110-remove-udev-persistent-net-rules.hook.chroot
\ No newline at end of file
/usr/share/live/build/hooks/normal/9000-remove-gnome-icon-cache.hook.chroot
\ No newline at end of file
/usr/share/live/build/hooks/normal/9010-remove-python-pyc.hook.chroot
\ No newline at end of file
/usr/share/live/build/hooks/normal/9020-remove-man-cache.hook.chroot
\ No newline at end of file
[Seat:*]
autologin-user=root
autologin-user-timeout=0
\ No newline at end of file
#!/bin/bash
/usr/local/bin/MbetterClient --web-host 0.0.0.0 &
\ No newline at end of file
live-boot
live-config
live-config-systemd
systemd-sysv
openssh-server
openvpn
xserver-xorg
openbox
lightdm
d-i debian-installer/locale string en_US
d-i console-setup/ask_detect boolean false
d-i keyboard-configuration/xkb-keymap select us
d-i netcfg/choose_interface select auto
d-i netcfg/get_hostname string debian
d-i netcfg/get_domain string local
d-i passwd/root-password password changeme
d-i passwd/root-password-again password changeme
d-i passwd/user-fullname string
d-i passwd/username string
d-i passwd/user-password password
d-i passwd/user-password-again password
d-i clock-setup/utc boolean true
d-i time/zone string UTC
d-i partman-auto/disk string /dev/sda
d-i partman-auto/method string regular
d-i partman-auto/choose_recipe select atomic
d-i partman/confirm_write_new_label boolean true
d-i partman/choose_partition select finish
d-i partman/confirm boolean true
d-i partman/confirm_nooverwrite boolean true
d-i base-installer/install-recommends boolean false
d-i apt-setup/use_mirror boolean true
d-i apt-setup/mirror/country string manual
d-i apt-setup/mirror/http/hostname string deb.debian.org
d-i apt-setup/mirror/http/directory string /debian
d-i apt-setup/mirror/http/proxy string
d-i pkgsel/install-language-support boolean false
d-i pkgsel/update-policy select none
d-i pkgsel/upgrade select none
d-i grub-installer/only_debian boolean true
d-i grub-installer/with_other_os boolean false
d-i finish-install/reboot_in_progress note
\ No newline at end of file
# config/source - options for live-build(7), source stage
# Set source option
LB_SOURCE="false"
# Set image type
LB_SOURCE_IMAGES="tar"
@echo off
echo MBetter ISO to USB Creator
echo ==========================
echo.
REM Check if ISO file exists
if not exist "live-image-amd64.iso" (
echo ERROR: live-image-amd64.iso not found in current directory!
echo Please ensure the ISO file is in the same directory as this script.
pause
exit /b 1
)
echo Available disks:
echo.
REM List disks using diskpart
(
echo list disk
) | diskpart
echo.
echo WARNING: This will erase all data on the selected disk!
echo Make sure you select the correct disk number for your USB drive.
echo.
set /p DISK_NUM="Enter the disk number for your USB drive: "
if "%DISK_NUM%"=="" (
echo ERROR: No disk number entered.
pause
exit /b 1
)
echo.
echo You selected disk %DISK_NUM%
set /p CONFIRM="Are you sure you want to erase disk %DISK_NUM%? (yes/no): "
if /i not "%CONFIRM%"=="yes" (
echo Operation cancelled.
pause
exit /b 0
)
echo.
echo Preparing USB drive...
REM Use diskpart to clean and format the USB
(
echo select disk %DISK_NUM%
echo clean
echo create partition primary
echo format fs=fat32 quick label="MBETTER"
echo active
echo exit
) | diskpart
if errorlevel 1 (
echo ERROR: Failed to prepare USB drive.
pause
exit /b 1
)
echo.
echo USB drive prepared successfully.
echo.
REM Get the drive letter for the USB
for /f "tokens=2" %%i in ('wmic logicaldisk where "deviceid like '%%:'" get deviceid ^| findstr /r "[A-Z]:"') do (
set "DRIVE_LETTER=%%i"
goto :found_drive
)
:found_drive
if "%DRIVE_LETTER%"=="" (
echo ERROR: Could not detect USB drive letter.
pause
exit /b 1
)
echo Copying ISO contents to USB drive %DRIVE_LETTER%...
echo This may take several minutes...
echo.
REM Use PowerShell to mount ISO and copy contents
powershell -Command "& { $isoPath = Join-Path $PSScriptRoot 'live-image-amd64.iso'; $mountResult = Mount-DiskImage -ImagePath $isoPath -PassThru; $driveLetter = ($mountResult | Get-Volume).DriveLetter; Copy-Item -Path ($driveLetter + ':\*') -Destination '%DRIVE_LETTER%' -Recurse -Force; Dismount-DiskImage -ImagePath $isoPath; }"
if errorlevel 1 (
echo ERROR: Failed to copy ISO contents to USB.
pause
exit /b 1
)
echo.
echo SUCCESS: USB drive created successfully!
echo.
echo Your MBetter USB install media is ready at drive %DRIVE_LETTER%
echo You can now boot from this USB drive to install or run MBetter live system.
echo.
echo IMPORTANT: Make sure your BIOS/UEFI is set to boot from USB first.
echo.
pause
\ No newline at end of file
#!/bin/bash
echo "MBetter ISO to USB Creator (Linux)"
echo "==================================="
echo
# Check if ISO file exists
if [ ! -f "live-image-amd64.iso" ]; then
echo "ERROR: live-image-amd64.iso not found in current directory!"
echo "Please ensure the ISO file is in the same directory as this script."
exit 1
fi
# Check if running as root
if [ "$EUID" -ne 0 ]; then
echo "ERROR: This script must be run with sudo privileges."
echo "Usage: sudo ./create_usb.sh"
exit 1
fi
echo "Available block devices:"
echo
lsblk -d -o NAME,SIZE,MODEL | grep -v loop
echo
echo "USB drives typically appear as /dev/sdX (where X is a letter like b, c, etc.)"
echo "WARNING: This will completely erase the selected device!"
echo "Make sure you select the correct device for your USB drive."
echo
read -p "Enter the device path for your USB drive (e.g., /dev/sdb): " USB_DEVICE
if [ -z "$USB_DEVICE" ]; then
echo "ERROR: No device entered."
exit 1
fi
# Validate device exists
if [ ! -b "$USB_DEVICE" ]; then
echo "ERROR: Device $USB_DEVICE does not exist or is not a block device."
exit 1
fi
# Get device info
DEVICE_INFO=$(lsblk -d -o NAME,SIZE,MODEL "$USB_DEVICE" 2>/dev/null)
if [ $? -ne 0 ]; then
echo "ERROR: Cannot access device $USB_DEVICE"
exit 1
fi
echo
echo "You selected: $DEVICE_INFO"
read -p "Are you sure you want to erase $USB_DEVICE? This will destroy all data! (yes/no): " CONFIRM
if [ "$CONFIRM" != "yes" ]; then
echo "Operation cancelled."
exit 0
fi
echo
echo "Creating bootable USB drive..."
echo "This may take several minutes. Please wait..."
echo
# Unmount any mounted partitions on the device
umount "${USB_DEVICE}"* 2>/dev/null
# Write ISO to USB using dd with progress
dd if=live-image-amd64.iso of="$USB_DEVICE" bs=4M status=progress oflag=sync
if [ $? -eq 0 ]; then
echo
echo "SUCCESS: USB drive created successfully!"
echo
echo "Your MBetter USB install media is ready at $USB_DEVICE"
echo "You can now boot from this USB drive to install or run MBetter live system."
echo
echo "IMPORTANT: Make sure your BIOS/UEFI is set to boot from USB first."
echo
# Sync to ensure write is complete
sync
echo "Write operation completed. It's safe to remove the USB drive."
else
echo
echo "ERROR: Failed to create USB drive."
exit 1
fi
\ No newline at end of file
#!/bin/bash
if [ $# -lt 1 ]; then
echo "Usage: $0 <openvpn_config_file> [key_files...]"
exit 1
fi
CONFIG=$1
shift
mkdir -p config/includes.chroot/etc/openvpn
cp "$CONFIG" config/includes.chroot/etc/openvpn/client.conf
for key in "$@"; do
cp "$key" config/includes.chroot/etc/openvpn/
done
# Create hook to start OpenVPN on boot
cat > config/hooks/live/start-openvpn.hook.chroot << 'EOF'
#!/bin/bash
systemctl enable openvpn@client
systemctl start openvpn@client
EOF
chmod +x config/hooks/live/start-openvpn.hook.chroot
\ No newline at end of file
mbet.jpg

192 KB

#!/bin/bash
if [ $# -ne 1 ]; then
echo "Usage: $0 <password>"
exit 1
fi
PASSWORD=$1
CRYPTED=$(openssl passwd -1 "$PASSWORD")
sed -i "s|d-i passwd/root-password password changeme|d-i passwd/root-password-crypted password $CRYPTED|" config/preseed/debian-installer.cfg
sed -i "/d-i passwd\/root-password-again password changeme/d" config/preseed/debian-installer.cfg
\ No newline at end of file
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment