Collection of personal tips, documentation, and more.
I built my own x86-64 router from the following:
For reasons I don’t completely understand, the kernel couldn’t find the root partition when my hard drive was attached to anything other than the primary sata port. Whether EFI or CSM (BIOS), specifying the root partition by sdx# or partition UUID, nothing worked. Moving the hard drive to sata port 0 made everything magically start working.
...-combined-squashfs.img for wear-intolerant storage like USB, SD card, etc...-combined-ext4.img for high-wear storage like SSDs/mnt/<usbkey>/data/lede (if using SystemRescueCD)parted /dev/sda unit s pparted /dev/sda rm 2parted /dev/sda unit s mkpart primary ext4 <start sector> 100%
resize2fs /dev/sda2rebootReferences:
Options:
I used SystemRescueCD for my bootable linux USB key.
targets/x86/64//mnt/<usbkey>/data/lede-efi (if using SystemRescueCD)/mnt/<usbkey>/data/lede-efiReferences:
sudo apt install meson gnu-efi gperf libcap-dev libmount-dev docbook-xslgit clone https://github.com/systemd/systemd.git && cd systemdmeson -D gnu-efi=true build/ninja -C build src/boot/efi/systemd-bootx64.efiinstall -D build/src/boot/efi/systemd-bootx64.efi systemd-boot/EFI/BOOT/bootx64.efiinstall -D /mnt/<usbkey>/data/lede-efi/lede-17.01.2-x86-64-vmlinuz systemd-boot/linux/install -d systemd-boot/loader && vi systemd-boot/loader/loader.conf
default lede-*
timeout 3
editor 0
install -d systemd-boot/loader/entries && vi systemd-boot/loader/entries/lede-17.01.2.conf
title LEDE 17.01.2
efi /linux/lede-17.01.2-x86-64-vmlinuz
options root=/dev/sda2 rootfstype=ext4 rootwait console=tty0 noinitrd
/mnt/<usbkey>/data/lede-efiReferences:
cd /livemnt/boot/dataparted /dev/sda mklabel gptgdisk /dev/sda, then write the changes and exitef00) of between 64 and 256MB, and label it BOOT8300) using the rest of the disk, and label it ROOTmkfs.vfat -F 32 -n BOOT /dev/sda1 (-F 32 => FAT32, -n BOOT => set volume name to BOOT)mkfs.ext4 -L ROOT /dev/sda2 (-L ROOT => set volume name to ROOT)BOOT partition: mount /dev/sda /mnt/bootfs`mkdir -p /mnt/bootfs/EFI/BOOTcp /livemnt/boot/data/lede-efi/lede-...-x86-64-vmlinuz /mnt/bootfs/EFI/BOOT/bootx64.efiecho 'fs:\\EFI\\BOOT\\bootx64.efi root=/dev/sda2 rootfstype=ext4 rootwait console=tty0 noinitrd" > /mnt/bootfs/startup.nshcp -R /livemnt/boot/data/lede-efi/systemd-boot/* /mnt/bootfs/ROOT partition: mount /dev/sda2 /mnt/rootfsmount -o loop /livemnt/boot/data/lede-...-x86-64-rootfs-ext4.img /mnt/ledefsrsync -avxHAWX --numeric-ids --info=progress2 /mnt/ledefs/ /mnt/rootfs/References:
192.168.1.1passwd192.168.1.x:
uci set network.lan.ipaddr=192.168.2.1 && uci commit network && reload_configsudo ifdown eth0 && sudo ifup eth0)192.168.2.x for references to 192.168.1.xluci web interface: opkg update; opkg install lucihttp://lede/ into the navigation barHostnameTimezoneLocal serverLocal domain (should generally have the same value as Local server)References:
/etc/vpnc/default.confSTART=50 STOP=50 USE_PROCD=1 #PROCD_DEBUG=1
start_service() { procd_open_instance vpnc procd_set_param command /usr/sbin/vpnc –non-inter –no-detach procd_set_param watch network.interface
# respawn automatically if something died # if process dies sooner than respawn_threshold, it is considered # crashed and after 5 retries the service is stopped procd_set_param respawn ${respawn_threshold:-3600} ${respawn_timeout:-5} ${respawn_retry:-5}
procd_set_param file /etc/vpnc/default.conf procd_set_param stdout 1 procd_set_param stderr 1 procd_close_instance }
stop_service() { /usr/sbin/vpnc-disconnect }
reload_service() { procd_send_signal vpnc stop procd_send_signal vpnc start } ```