Differences
This shows you the differences between two versions of the page.
| Both sides previous revision Previous revision Next revision | Previous revision Next revisionBoth sides next revision | ||
| docs:guide-user:additional-software:imagebuilder [2021/08/24 06:20] – [Selecting packages] --strip-abi is not in stable yet vgaetera | docs:guide-user:additional-software:imagebuilder [2024/04/01 16:18] – [Arch / Manjaro / EndeavourOS] sixx | ||
|---|---|---|---|
| Line 3: | Line 3: | ||
| [[docs: | [[docs: | ||
| [[docs: | [[docs: | ||
| - | [[docs: | + | [[docs: |
| The Image Builder (previously called the Image Generator) is a pre-compiled environment suitable for creating custom images without the need for compiling them from source. | The Image Builder (previously called the Image Generator) is a pre-compiled environment suitable for creating custom images without the need for compiling them from source. | ||
| Line 22: | Line 22: | ||
| <WRAP important> | <WRAP important> | ||
| * The Image Builder runs only in 64-bit Linux. You can however run a 64-bit Linux in PC or VM, e.g. VirtualBox, even from 32-bit Windows. | * The Image Builder runs only in 64-bit Linux. You can however run a 64-bit Linux in PC or VM, e.g. VirtualBox, even from 32-bit Windows. | ||
| - | * The Image Builder has similar prerequisites as the [[docs: | + | * The Image Builder has similar prerequisites as the [[docs: |
| </ | </ | ||
| Example dependencies in the most common distros: | Example dependencies in the most common distros: | ||
| - | ==== Arch / Manjaro | + | ==== Arch ==== |
| <code bash> | <code bash> | ||
| sudo pacman -S --needed base-devel ncurses zlib gawk git gettext \ | sudo pacman -S --needed base-devel ncurses zlib gawk git gettext \ | ||
| Line 33: | Line 33: | ||
| </ | </ | ||
| - | ==== CentOS / Fedora ==== | + | ==== Fedora ==== |
| <code bash> | <code bash> | ||
| sudo dnf install git gawk gettext ncurses-devel zlib-devel \ | sudo dnf install git gawk gettext ncurses-devel zlib-devel \ | ||
| openssl-devel libxslt wget which @c-development @development-tools \ | openssl-devel libxslt wget which @c-development @development-tools \ | ||
| - | @development-libs zlib-static which python3 | + | @development-libs zlib-static which python3 |
| </ | </ | ||
| - | ==== Debian / Ubuntu ==== | + | ==== Debian |
| <code bash> | <code bash> | ||
| - | sudo apt install build-essential | + | sudo apt install build-essential |
| - | zlib1g-dev gawk git gettext libssl-dev xsltproc rsync wget unzip python | + | gettext libssl-dev xsltproc rsync wget unzip python3 python3-distutils |
| </ | </ | ||
| + | ==== WSL ==== | ||
| + | This method is NOT OFFICIALLY supported. | ||
| + | But it works. | ||
| + | |||
| + | [[docs: | ||
| ===== Obtaining the Image Builder ===== | ===== Obtaining the Image Builder ===== | ||
| You can download an archive that contains the **Image Builder**, it is usually located in the same download page where you find the firmware image for your device. | You can download an archive that contains the **Image Builder**, it is usually located in the same download page where you find the firmware image for your device. | ||
| Line 75: | Line 80: | ||
| | '' | | '' | ||
| | '' | | '' | ||
| - | | '' | + | | '' |
| Run '' | Run '' | ||
| Line 83: | Line 88: | ||
| <code bash> | <code bash> | ||
| - | PROFILE=profile-name | + | PROFILE="profile-name" |
| </ | </ | ||
| Line 126: | Line 131: | ||
| <code bash> | <code bash> | ||
| - | FILES=files/ | + | FILES="files" |
| </ | </ | ||
| - | The '' | + | The '' |
| It is strongly recommended to use [[docs: | It is strongly recommended to use [[docs: | ||
| This helps minimize conflicts with auto-generated settings which can change between versions. | This helps minimize conflicts with auto-generated settings which can change between versions. | ||
| + | |||
| + | see: [[: | ||
| ==== Building image ==== | ==== Building image ==== | ||
| Line 138: | Line 145: | ||
| <code bash> | <code bash> | ||
| - | make image PROFILE=profile-name PACKAGES=" | + | make image \ |
| + | PROFILE="profile-name" \ | ||
| + | PACKAGES=" | ||
| + | FILES="files" \ | ||
| + | DISABLED_SERVICES=" | ||
| </ | </ | ||
| Line 159: | Line 170: | ||
| scp root@192.168.1.1:/ | scp root@192.168.1.1:/ | ||
| scp root@192.168.1.1:/ | scp root@192.168.1.1:/ | ||
| - | make image PROFILE=wl500gp PACKAGES=" | + | make image \ |
| + | PROFILE="wl500gp" \ | ||
| + | PACKAGES=" | ||
| + | FILES="files" \ | ||
| + | DISABLED_SERVICES=" | ||
| </ | </ | ||
| ===== Troubleshooting ===== | ===== Troubleshooting ===== | ||
| - Did you run everything as a non-root user? | - Did you run everything as a non-root user? | ||
| - | - Check the log output are there package issues (conflicts, improper names) | + | - Check the logged |
| - | - Wait a few hours/day upstream packages may be in an inconsistent state | + | - Check the logged output, did you exceed maximum space? |
| + | - Check the logged output, are there other obvious errors? | ||
| + | - Wait a few hours/day(s) upstream packages may be in an inconsistent state especially on master/ | ||
| - Verify you have a supported OS, prerequisites, | - Verify you have a supported OS, prerequisites, | ||
| Line 240: | Line 257: | ||
| In the graphical configuration, | In the graphical configuration, | ||
| - | Then build the image, including '' | + | You can [[docs: |
| - | + | ||
| - | Enabling | + | |
| - | + | ||
| - | <code bash> | + | |
| - | make IGNORE_ERRORS=1 | + | |
| - | </ | + | |
| Don't call '' | Don't call '' | ||
| Line 277: | Line 288: | ||
| The '' | The '' | ||
| - | If you want to add a custom local repository, copy the '' | + | If you want to add a custom local repository, copy the '' |
| If you have problems with using you local repository because the " | If you have problems with using you local repository because the " | ||
| Line 283: | Line 294: | ||
| NOTE: if you want to override packages coming from an existing feed, you must write your custom feed ABOVE the line of the package feed containing the packages you want to override, as shown in the examples above. | NOTE: if you want to override packages coming from an existing feed, you must write your custom feed ABOVE the line of the package feed containing the packages you want to override, as shown in the examples above. | ||
| + | |||
| + | ==== Restricting root access ==== | ||
| + | Create a non-privileged admin user and lock root password. | ||
| + | Configure privilege elevation with sudo. | ||
| + | Set up key-based authentication and disable password authentication for Dropbear. | ||
| + | |||
| + | <code bash> | ||
| + | mkdir -p files/ | ||
| + | cat << " | ||
| + | USER_NAME=" | ||
| + | USER_SSHPUB=" | ||
| + | USER_SHELL="/ | ||
| + | SUDO_USER=" | ||
| + | SUDO_GROUP=" | ||
| + | groupadd -r " | ||
| + | useradd -m -G " | ||
| + | passwd -l " | ||
| + | cat << EOI > / | ||
| + | %${SUDO_GROUP} ALL=(ALL) ALL | ||
| + | EOI | ||
| + | USER_HOME=" | ||
| + | mkdir -p " | ||
| + | cat << EOI > " | ||
| + | ${USER_SSHPUB} | ||
| + | EOI | ||
| + | uci set dropbear.@dropbear[0].PasswordAuth=" | ||
| + | uci set dropbear.@dropbear[0].RootPasswordAuth=" | ||
| + | uci commit dropbear | ||
| + | / | ||
| + | EOF | ||
| + | make image \ | ||
| + | FILES=" | ||
| + | PACKAGES=" | ||
| + | </ | ||
| ==== Adding/ | ==== Adding/ | ||
| + | |||
| + | <WRAP important> | ||
| + | Examples below may contain version dependent / legacy information and are for informational purposes. They are very low level so expect to have a good level of skill and familiarity with the ImageBuilder / OpenWrt in general. | ||
| + | </ | ||
| + | |||
| The image building is tied to the profile names. | The image building is tied to the profile names. | ||
| If you add a new profile without also adding an appropriate macro to the image-generation Makefile, no suitable firmware file will get generated when using the custom profile. | If you add a new profile without also adding an appropriate macro to the image-generation Makefile, no suitable firmware file will get generated when using the custom profile. | ||
| Line 318: | Line 368: | ||
| Note that it requires patching of the '' | Note that it requires patching of the '' | ||
| + | |||
| + | It is based on older Chaos Calmer era code... and not applicable to modern ImageBuilders but useful as a reference... | ||
| </ | </ | ||
| Line 353: | Line 405: | ||
| <code bash> | <code bash> | ||
| make image \ | make image \ | ||
| - | | + | PROFILE="tlwr841" |
| - | PACKAGES=" | + | PACKAGES=" |
| - | FILES_REMOVE=" | + | FILES_REMOVE=" |
| </ | </ | ||
| - | |||