/!\ Big Merge REBASING

This commit is contained in:
archikid02
2026-01-28 18:08:10 +00:00
parent 4ad36f5cf8
commit 78fd3d03c2
17 changed files with 261 additions and 35 deletions
+10 -3
View File
@@ -39,6 +39,7 @@ echo "iso = $ISO"
qemu-system-x86_64 \
-m $RAM \
<<<<<<< HEAD
-boot once=d \
-cdrom $ISO \
-drive file=$IMG \
@@ -50,10 +51,16 @@ qemu-system-x86_64 \
>>>>>>> 21c5e40 (alpine-qemu-install trying to run as non graphical)
-nic user,hostfwd=tcp::2222-:22 \
-device virtio-vga \
=======
-boot d \
-cdrom $ISO \
-drive file=$IMG,if=virtio \
>>>>>>> d378d2f ( /!\ Big Merge REBASING)
-enable-kvm \
-display default,show-cursor=on \
-display none \
-virtfs local,id=share,path="$SHARE",security_model=none,mount_tag=hostshare
-net nic \
-net user,hostfwd=tcp::7777-:22
#-virtfs local,id=share,path="$SHARE",security_model=none,mount_tag=hostshare
## --- Run QEMU with graphics + shared folder ---
#qemu-system-x86_64 \
+60
View File
@@ -0,0 +1,60 @@
#!/usr/bin/env bash
set -euo pipefail
SDX="${1:-sdb}"
BOOT="${SDX}1"
ROOT="${SDX}2"
if [[ "$(id -u)" -ne 0 ]]; then
echo "Run as root."
echo "sdx as parameter"
exit 1
fi
echo "Target: /dev/${SDX}"
read -rp "Proceed? (y/N) " yn
[[ "${yn,,}" == "y" ]] || exit 0
# wipe partitions
fdisk /dev/"${SDX}" <<EOF
o
n
p
1
+1G
t
c
n
p
2
w
EOF
# format
mkfs.vfat /dev/"${BOOT}"
mkfs.ext4 /dev/"${ROOT}"
# mount
mkdir -p /mnt/boot /mnt/root
mount /dev/"${BOOT}" /mnt/boot
mount /dev/"${ROOT}" /mnt/root
# download + extract
cd /mnt/root
wget -q http://os.archlinuxarm.org/os/ArchLinuxARM-rpi-armv7-latest.tar.gz
bsdtar -xpf ArchLinuxARM-rpi-armv7-latest.tar.gz -C /mnt/root
sync
# move boot files
mv /mnt/root/boot/* /mnt/boot/
# cleanup
#umount /mnt/boot /mnt/root
#rm -rf /mnt/boot /mnt/root
echo "Done. Insert SD card and boot the Pi."
+36
View File
@@ -0,0 +1,36 @@
#!/bin/bash
set -eux
# from vm to make a shared folder
if [ $# -lt 1 ] ; then
echo """
"""
echo "cheat sheet: mount -t 9p -o trans=virtio hostshare /mnt"
exit 1
fi
# --- Configurable defaults ---
IMG=${1:-disc_alpine.qcow2}
SSH=${2:-2222}
SHARE=${3:-$PWD/shared}
CPUS=${4:-2}
SIZE=${5:-16G}
RAM=${6:-2G}
# --- Setup ---
mkdir -p "$SHARE"
# --- Optional install script ---
# Drop any file named install.sh in ./share to execute it inside the VM later:
# e.g. `bash /mnt/share/install.sh` after mounting
qemu-system-x86_64 \
-m $RAM \
-boot once=d \
-drive file=$IMG \
-enable-kvm \
-display spice-app,show-cursor=on \
-nic user,hostfwd=tcp::"${SSH}"-:22
@@ -4,11 +4,13 @@ set -eux
# from vm to make a shared folder
if [ $# -lt 1 ] ; then
echo """
IMG=${1:-disc_alpine.qcow2}
SIZE=${2:-16G}
RAM=${3:-2G}
CPUS=${4:-2}
SHARE=${5:-$PWD/share}
IMG=${1:-disc_alpine.qcow2}
SSH=${2:2223}
SHARE=${3:-$PWD/share}
CPUS=${4:-2}
SIZE=${5:-16G}
RAM=${6:-2G}
GITEA=${7:-3000}
"""
echo "cheat sheet: mount -t 9p -o trans=virtio hostshare /mnt"
exit 1
@@ -16,10 +18,12 @@ fi
# --- Configurable defaults ---
IMG=${1:-disc_alpine.qcow2}
SIZE=${2:-16G}
RAM=${3:-2G}
SSH=${2:-2223}
SHARE=${3:-$PWD/share}
CPUS=${4:-2}
SHARE=${5:-$PWD/share}
SIZE=${5:-16G}
RAM=${6:-2G}
GITEA=${7:-3000}
# --- Setup ---
mkdir -p "$SHARE"
@@ -37,6 +41,6 @@ qemu-system-x86_64 \
-device virtio-vga \
-enable-kvm \
-display default,show-cursor=on \
-nic user,hostfwd=tcp::2222-:22 \
-nic user,hostfwd=tcp::"${SSH}"-:22,hostfwd=tcp::"${GITEA}"-:3000 \
-virtfs local,id=share,path="$SHARE",security_model=none,mount_tag=hostshare
-1
View File
@@ -12,4 +12,3 @@ mount $DEV $MNT_PT
cd $MNT_PT
exit 0
+1
View File
@@ -1,3 +1,4 @@
#!/usr/bin/bash
ping -c1 9.9.9.9
+18
View File
@@ -0,0 +1,18 @@
#!/usr/bin/bash
if [ "$#" -lt 1 ] || [ "$#" -gt 3 ]; then
echo "Usage: $0 arg1 [arg2] [arg3]"
exit 1
fi
VPS=${1:-"$IAMUTOPIST"}
USER=${2:-"root"}
VPS_PORT=${3:-"443"}
HOST_PORT=${4:-"3000"}
echo """
runs:
ssh -N -R $VPS_PORT:localhost:$HOST_PORT $USER@$VPS
"""
ssh -N -R $VPS_PORT:localhost:$HOST_PORT $USER@$VPS
+1
View File
@@ -13,6 +13,7 @@ LOG_CONN_DIR=/var/log/tcpd
LOG_CONN=$LOG_CONN_DIR/lasts.log
NET_STATUS=/tmp/status.txt
SSH=177
IAMUTOPIST=128.65.199.189
JOURNAL_DIR=$HOME/journal
PERSO_DIR=$HOME/perso
-5
View File
@@ -1,13 +1,8 @@
#%PAM-1.0
auth requisite pam_nologin.so
auth include system-local-login
auth optional pam_gnome_keyring.so
account include system-local-login
session include system-local-login
session optional pam_gnome_keyring.so auto_start
password include system-local-login
+6
View File
@@ -0,0 +1,6 @@
#%PAM-1.0
auth required pam_unix.so try_first_pass
account required pam_unix.so
password required pam_unix.so
session required pam_unix.so
+2
View File
@@ -3,3 +3,5 @@ nameserver 0.0.0.0
nameserver 8.26.56.26
nameserver 208.67.222.222
nameserver 209.244.0.3
nameserver 8.8.8.8
Regular → Executable
+3
View File
@@ -1,3 +1,4 @@
<<<<<<< HEAD
# This file is part of systemd. -> systemctl enable --now systemd-resolved
#
# systemd is free software; you can redistribute it and/or modify it under the
@@ -42,3 +43,5 @@ ReadEtcHosts=yes
#ResolveUnicastSingleLabel=no
#StaleRetentionSec=0
#RefuseRecordTypes=
=======
>>>>>>> d378d2f ( /!\ Big Merge REBASING)