Last active
June 28, 2022 09:35
-
-
Save nullscm/529c1d22832faa790f930aba2f386fba to your computer and use it in GitHub Desktop.
Void Linux on Raspberry PI Zero W Headless Install
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
ROOTFS=/mnt | |
#parted --script /dev/sdc mktable msdos mkpart primary fat32 2048s 256MB toggle 1 boot mkpart primary ext4 256MB 100% | |
#mkfs.vfat -F32 /dev/sdc1 -n BOOT | |
#mkfs.ext4 /dev/sdc2 -L rootfs | |
#mount /dev/sdc2 /mnt | |
#mkdir /mnt/boot | |
#mount /dev/sdc1 /mnt/boot | |
#cd /tmp && curl -O https://repo-default.voidlinux.org/live/current/void-rpi-musl-PLATFORMFS-20210930.tar.xz | |
#tar xvfJp /tmp/void-rpi-musl-PLATFORMFS-20210930.tar.xz -C /mnt | |
echo '''[ -f "/etc/first-run.sh" ] && sh /etc/first-run.sh && rm /etc/first-run.sh''' >> $ROOTFS/etc/rc.local | |
echo '''rm -Rf /etc/wpa_supplicant/wpa_supplicant.conf | |
cat <<EOF > /etc/wpa_supplicant/wpa_supplicant.conf | |
ctrl_interface=/run/wpa_supplicant | |
ctrl_interface_group=wheel | |
eapol_version=1 | |
ap_scan=1 | |
fast_reauth=1 | |
update_config=1 | |
network={ | |
ssid="SSIDNAME" | |
psk="SSIDPW" | |
} | |
EOF | |
echo "PermitRootLogin yes | |
PermitEmptyPasswords yes" >> /etc/ssh/sshd_config | |
echo "/dev/mmcblk0p1 /boot vfat defaults 0 0" >> /etc/fstab | |
echo "root ALL=(ALL) ALL | |
%wheel ALL=(ALL) NOPASSWD: ALL | |
%sudo ALL=(ALL) ALL" > /etc/sudoers.d/auto | |
ln -s /usr/share/dhcpcd/hooks/10-wpa_supplicant /usr/libexec/dhcpcd-hooks | |
ln -s /etc/sv/dhcpcd /var/service | |
ln -s /etc/sv/sshd /var/service | |
ln -s /etc/sv/chronyd /var/service | |
passwd -d root | |
reboot | |
''' > $ROOTFS/etc/first-run.sh | |
chmod +x $ROOTFS/etc/first-run.sh |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment