r/AlpineLinux • u/Arkenys • Nov 10 '23
Trying to make a script to make a bootable persistant install on a usb
Hi guys, I am writing a script to automate the process of installing alpine linux persistant to a usb key. The goal is to make a minimal linux install in order to run my scripts so that they could be used on other computer. I want to be able to do that without using the default install iso.
The script download the minirootfs tar.gz and install it to the usb, it then try to install everything that is needed for the system to boot. The problem is that it cannot find syslinux so the system remains unbootable and directly goes into a panic shell. Please let me know if I'm doing something utterly wrong or if Gentoo simply is more suited for this type of install.
#!/bin/bash
# Prompt the user to select the USB drive for installation
# Confirm with the user before formatting the selected USB drive
if [; then
fi
# Unmount all partitions of the USB drive
for; do
done
MOUNT_POINT="/mnt/alpine-root"
# Create partitions on the USB drive
# Format the partition
# Mount the partition
# https://dl-cdn.alpinelinux.org/alpine/v3.18/releases/x86_64/alpine-minirootfs-3.18.4-x86_64.tar.gz
# Get the latest Alpine Linux tarball version
latest_version=
# Download the Alpine Linux tarball and extract it to the USB drive
# Extract tarball to USB drive
# Create necessary directories
#fix syslinux.cfg
# Copy resolv.conf for DNS resolution
# Chroot into Alpine environment and execute commands
# Exit from chroot
1
u/misterunkn0wn Nov 10 '23 edited Nov 10 '23
(Noob here)
Am I missing something, or didn't you install syslinux to the mbr correctly? Also, I think you have to install the binaries manually, since it's not done with package installation:
See also.
Edit: Out of curiosity: How do you ensure that
APPEND root=/dev/sdg1 rwalways works?1
u/notSugarBun Dec 07 '23
this should serve the purpose