ESP32-S3 Linux installer
+This is a web installer for Linux running on ESP32-S3. More information can be found here.
+Requirements
+-
+
- ESP32-S3 SoC, this board for example +
- 8MB Flash (-N8) +
- 8MB PSRAM (-R8) +
Select your option
+-
+
- + + +
- + + +
Notes
+Some boards require manual download mode triggering, by pressing resetting the board while pressing IO0 button
+If your board has two USB ports, you might need to use both. One for flashing, other to see Linux serial output
+Demo
+
+
+
+
+
diff --git a/docs/manifest-full-8.json b/docs/manifest-full-8.json
new file mode 100644
index 000000000..d112b7ce7
--- /dev/null
+++ b/docs/manifest-full-8.json
@@ -0,0 +1,17 @@
+{
+ "name": "Linux on ESP32-S3",
+ "version": "1.0",
+ "builds": [
+ {
+ "chipFamily": "ESP32-S3",
+ "parts": [
+ { "path": "firmware/bootloader.bin", "offset": 0 },
+ { "path": "firmware/partition-table.bin", "offset": 32768 },
+ { "path": "firmware/network_adapter.bin", "offset": 65536 },
+ { "path": "firmware/etc.jffs2", "offset": 720896 },
+ { "path": "firmware/xipImage", "offset": 1179648 },
+ { "path": "firmware/rootfs.cramfs", "offset": 4718592 }
+ ]
+ }
+ ]
+}
diff --git a/docs/manifest-partial-8.json b/docs/manifest-partial-8.json
new file mode 100644
index 000000000..f0fa25593
--- /dev/null
+++ b/docs/manifest-partial-8.json
@@ -0,0 +1,16 @@
+{
+ "name": "Linux on ESP32-S3",
+ "version": "1.0",
+ "builds": [
+ {
+ "chipFamily": "ESP32-S3",
+ "parts": [
+ { "path": "firmware/bootloader.bin", "offset": 0 },
+ { "path": "firmware/partition-table.bin", "offset": 32768 },
+ { "path": "firmware/network_adapter.bin", "offset": 65536 },
+ { "path": "firmware/xipImage", "offset": 1179648 },
+ { "path": "firmware/rootfs.cramfs", "offset": 4718592 }
+ ]
+ }
+ ]
+}
diff --git a/esp-hosted b/esp-hosted
new file mode 160000
index 000000000..328b5b9d2
--- /dev/null
+++ b/esp-hosted
@@ -0,0 +1 @@
+Subproject commit 328b5b9d29fe0a2e1b2d8176ab61b113f660d9bb
diff --git a/esp-idf b/esp-idf
new file mode 160000
index 000000000..fc1671b3c
--- /dev/null
+++ b/esp-idf
@@ -0,0 +1 @@
+Subproject commit fc1671b3cd3146b0fc32fb9076a69e1abddd2226
diff --git a/esp32s3 b/esp32s3
new file mode 160000
index 000000000..f595d8653
--- /dev/null
+++ b/esp32s3
@@ -0,0 +1 @@
+Subproject commit f595d8653421eedced6bbe8f7822783d2fe2716d
diff --git a/output/flash-all.sh b/output/flash-all.sh
new file mode 100755
index 000000000..49f44f1d0
--- /dev/null
+++ b/output/flash-all.sh
@@ -0,0 +1,32 @@
+#! /bin/bash -x
+
+# KEEP_ETC=y
+
+SET_BAUDRATE='-b 460800'
+
+pushd esp-hosted/esp_hosted_ng/esp/esp_driver/esp-idf
+alias python='python3'
+. export.sh
+
+popd
+cd output
+
+#
+# flash wifi-driver
+#
+esptool.py $SET_BAUDRATE --before=default_reset --after=hard_reset write_flash --flash_mode dio --flash_freq 80m --flash_size 8MB 0x0 bootloader.bin 0x10000 network_adapter.bin 0x8000 partition-table.bin
+
+#
+# flash partitions
+#
+parttool.py $SET_BAUDRATE write_partition --partition-name linux --input xipImage
+parttool.py $SET_BAUDRATE write_partition --partition-name rootfs --input rootfs.cramfs
+if [ -z $KEEP_ETC ] ; then
+ # read -p 'ready to flash /etc... press enter'
+ parttool.py $SET_BAUDRATE write_partition --partition-name etc --input etc.jffs2
+fi
+
+#
+# monitor
+#
+# idf.py monitor
\ No newline at end of file
diff --git a/rebuild-esp32s3-linux-wifi.sh b/rebuild-esp32s3-linux-wifi.sh
index 36829091c..a5d9e6eca 100755
--- a/rebuild-esp32s3-linux-wifi.sh
+++ b/rebuild-esp32s3-linux-wifi.sh
@@ -1,110 +1,69 @@
#! /bin/bash -x
-#
-# environment variables affecting the build:
-#
-# keep_toolchain=y -- don't rebuild the toolchain, but rebuild everything else
-# keep_rootfs=y -- don't reconfigure or rebuild rootfs from scratch. Would still apply overlay changes
-# keep_buildroot=y -- don't redownload the buildroot, only git pull any updates into it
-# keep_bootloader=y -- don't redownload the bootloader, only rebuild it
-# keep_etc=y -- don't overwrite the /etc partition
-#
-
-SET_BAUDRATE='-b 2000000'
+# REBUILD_TOOLCHAIN=y
+# REBUILD_KERNEL_ROOTFS=y
+# REBUILD_BOOTLOADER=y
-CTNG_VER=xtensa-fdpic
CTNG_CONFIG=xtensa-esp32s3-linux-uclibcfdpic
-BUILDROOT_VER=xtensa-2023.08-fdpic
BUILDROOT_CONFIG=esp32s3_defconfig
-ESP_HOSTED_VER=ipc
ESP_HOSTED_CONFIG=sdkconfig.defaults.esp32s3
-if [ ! -d autoconf-2.71/root/bin ] ; then
- wget https://ftp.gnu.org/gnu/autoconf/autoconf-2.71.tar.xz
- tar -xf autoconf-2.71.tar.xz
- pushd autoconf-2.71
- ./configure --prefix=`pwd`/root
- make && make install
- popd
-fi
-export PATH=`pwd`/autoconf-2.71/root/bin:$PATH
-
-if [ -z "$keep_toolchain$keep_buildroot$keep_rootfs$keep_bootloader" ] ; then
- rm -rf build
-else
- [ -n "$keep_rootfs" ] || rm -rf build/build-buildroot-esp32s3
- [ -n "$keep_buildroot" ] || rm -rf build/buildroot
- [ -n "$keep_bootloader" ] || rm -rf build/esp-hosted
-fi
-mkdir -p build
-cd build
-
#
# dynconfig
#
if [ ! -f xtensa-dynconfig/esp32s3.so ] ; then
- git clone https://github.com/jcmvbkbc/xtensa-dynconfig -b original
- git clone https://github.com/jcmvbkbc/config-esp32s3 esp32s3
make -C xtensa-dynconfig ORIG=1 CONF_DIR=`pwd` esp32s3.so
fi
export XTENSA_GNU_CONFIG=`pwd`/xtensa-dynconfig/esp32s3.so
#
-# toolchain
+# Build toolchain
#
-if [ ! -x crosstool-NG/builds/xtensa-esp32s3-linux-uclibcfdpic/bin/xtensa-esp32s3-linux-uclibcfdpic-gcc ] ; then
- git clone https://github.com/jcmvbkbc/crosstool-NG.git -b $CTNG_VER
+if [ ! -z $REBUILD_TOOLCHAIN ] || [ ! -x crosstool-NG/builds/xtensa-esp32s3-linux-uclibcfdpic/bin/xtensa-esp32s3-linux-uclibcfdpic-gcc ] ; then
pushd crosstool-NG
./bootstrap && ./configure --enable-local && make
./ct-ng $CTNG_CONFIG
- CT_PREFIX=`pwd`/builds nice ./ct-ng build
+ sed -i -e '/CT_LOG_PROGRESS_BAR/s/y$/n/' .config
+ CT_PREFIX=`pwd`/builds ./ct-ng build
popd
[ -x crosstool-NG/builds/xtensa-esp32s3-linux-uclibcfdpic/bin/xtensa-esp32s3-linux-uclibcfdpic-gcc ] || exit 1
fi
#
-# kernel and rootfs
-#
-if [ ! -d buildroot ] ; then
- git clone https://github.com/jcmvbkbc/buildroot -b $BUILDROOT_VER
-else
- pushd buildroot
- git pull
- popd
-fi
-if [ ! -d build-buildroot-esp32s3 ] ; then
- nice make -C buildroot O=`pwd`/build-buildroot-esp32s3 $BUILDROOT_CONFIG
- buildroot/utils/config --file build-buildroot-esp32s3/.config --set-str TOOLCHAIN_EXTERNAL_PATH `pwd`/crosstool-NG/builds/xtensa-esp32s3-linux-uclibcfdpic
- buildroot/utils/config --file build-buildroot-esp32s3/.config --set-str TOOLCHAIN_EXTERNAL_PREFIX '$(ARCH)-esp32s3-linux-uclibcfdpic'
- buildroot/utils/config --file build-buildroot-esp32s3/.config --set-str TOOLCHAIN_EXTERNAL_CUSTOM_PREFIX '$(ARCH)-esp32s3-linux-uclibcfdpic'
+# kernel and rootfs (buildroot)
+#
+if [ ! -z $REBUILD_KERNEL_ROOTFS ] || [ ! -f build-buildroot-esp32s3/images/xipImage ] || [ ! -f build-buildroot-esp32s3/images/rootfs.cramfs ] || [ ! -f build-buildroot-esp32s3/images/etc.jffs2 ] ; then
+ if [ ! -d build-buildroot-esp32s3 ] ; then
+ make -C buildroot O=`pwd`/build-buildroot-esp32s3 $BUILDROOT_CONFIG
+ buildroot/utils/config --file build-buildroot-esp32s3/.config --set-str TOOLCHAIN_EXTERNAL_PATH `pwd`/crosstool-NG/builds/xtensa-esp32s3-linux-uclibcfdpic
+ buildroot/utils/config --file build-buildroot-esp32s3/.config --set-str TOOLCHAIN_EXTERNAL_PREFIX '$(ARCH)-esp32s3-linux-uclibcfdpic'
+ buildroot/utils/config --file build-buildroot-esp32s3/.config --set-str TOOLCHAIN_EXTERNAL_CUSTOM_PREFIX '$(ARCH)-esp32s3-linux-uclibcfdpic'
+ fi
+ make -C buildroot O=`pwd`/build-buildroot-esp32s3
+ [ -f build-buildroot-esp32s3/images/xipImage -a -f build-buildroot-esp32s3/images/rootfs.cramfs -a -f build-buildroot-esp32s3/images/etc.jffs2 ] || exit 1
fi
-nice make -C buildroot O=`pwd`/build-buildroot-esp32s3
-[ -f build-buildroot-esp32s3/images/xipImage -a -f build-buildroot-esp32s3/images/rootfs.cramfs -a -f build-buildroot-esp32s3/images/etc.jffs2 ] || exit 1
#
# bootloader
#
-[ -d esp-hosted ] || git clone https://github.com/jcmvbkbc/esp-hosted -b $ESP_HOSTED_VER
pushd esp-hosted/esp_hosted_ng/esp/esp_driver
-cmake .
-cd esp-idf
-. export.sh
-cd ../network_adapter
-idf.py set-target esp32s3
-cp $ESP_HOSTED_CONFIG sdkconfig
-idf.py build
-read -p 'ready to flash... press enter'
-while ! idf.py $SET_BAUDRATE flash ; do
- read -p 'failure... press enter to try again'
-done
+if [ ! -z $REBUILD_BOOTLOADER ] || [ ! -f ./network_adapter/build/network_adapter.bin ] || [ ! -f ./network_adapter/build/partition_table/partition-table.bin ] || [ ! -f ./network_adapter/build/bootloader/bootloader.bin ] ; then
+ cmake .
+ alias python='python3'
+ cd esp-idf
+ . export.sh
+ cd ../network_adapter
+ idf.py set-target esp32s3
+ cp $ESP_HOSTED_CONFIG sdkconfig
+ idf.py build
+fi
popd
#
-# flash
+# publish artifacts
#
-parttool.py $SET_BAUDRATE write_partition --partition-name linux --input build-buildroot-esp32s3/images/xipImage
-parttool.py $SET_BAUDRATE write_partition --partition-name rootfs --input build-buildroot-esp32s3/images/rootfs.cramfs
-if [ -z "$keep_etc" ] ; then
- read -p 'ready to flash /etc... press enter'
- parttool.py $SET_BAUDRATE write_partition --partition-name etc --input build-buildroot-esp32s3/images/etc.jffs2
-fi
+cp -v esp-hosted/esp_hosted_ng/esp/esp_driver/network_adapter/build/bootloader/bootloader.bin ./output
+cp -v esp-hosted/esp_hosted_ng/esp/esp_driver/network_adapter/build/partition_table/partition-table.bin ./output
+cp -v esp-hosted/esp_hosted_ng/esp/esp_driver/network_adapter/build/network_adapter.bin ./output
+
+cp -rv build-buildroot-esp32s3/images/* ./output
\ No newline at end of file
diff --git a/rebuild-esp32s3-linux.sh b/rebuild-esp32s3-linux.sh
index e0709bc4e..03f9ec873 100755
--- a/rebuild-esp32s3-linux.sh
+++ b/rebuild-esp32s3-linux.sh
@@ -1,63 +1,67 @@
#! /bin/bash -x
-if [ ! -d autoconf-2.71/root/bin ] ; then
- wget https://ftp.gnu.org/gnu/autoconf/autoconf-2.71.tar.xz
- tar -xf autoconf-2.71.tar.xz
- pushd autoconf-2.71
- ./configure --prefix=`pwd`/root
- make && make install
- popd
-fi
-export PATH=`pwd`/autoconf-2.71/root/bin:$PATH
-rm -rf build
-mkdir build && cd build
+# REBUILD_TOOLCHAIN=y
+# REBUILD_KERNEL_ROOTFS=y
+# REBUILD_BOOTLOADER=y
+
+CTNG_CONFIG=xtensa-esp32s3-linux-uclibcfdpic
+BUILDROOT_CONFIG=esp32s3_defconfig
+ESP_HOSTED_CONFIG=sdkconfig.defaults.esp32s3
#
# dynconfig
#
-git clone https://github.com/jcmvbkbc/xtensa-dynconfig -b original
-git clone https://github.com/jcmvbkbc/config-esp32s3 esp32s3
-make -C xtensa-dynconfig ORIG=1 CONF_DIR=`pwd` esp32s3.so
+if [ ! -f xtensa-dynconfig/esp32s3.so ] ; then
+ make -C xtensa-dynconfig ORIG=1 CONF_DIR=`pwd` esp32s3.so
+fi
export XTENSA_GNU_CONFIG=`pwd`/xtensa-dynconfig/esp32s3.so
#
-# toolchain
+# Build toolchain
#
-git clone https://github.com/jcmvbkbc/crosstool-NG.git -b xtensa-fdpic
-pushd crosstool-NG
-./bootstrap && ./configure --enable-local && make
-./ct-ng xtensa-esp32s3-linux-uclibcfdpic
-CT_PREFIX=`pwd`/builds nice ./ct-ng build
-popd
-[ -e crosstool-NG/builds/xtensa-esp32s3-linux-uclibcfdpic/bin/xtensa-esp32s3-linux-uclibcfdpic-gcc ] || exit 1
+if [ ! -z $REBUILD_TOOLCHAIN ] || [ ! -x crosstool-NG/builds/xtensa-esp32s3-linux-uclibcfdpic/bin/xtensa-esp32s3-linux-uclibcfdpic-gcc ] ; then
+ pushd crosstool-NG
+ ./bootstrap && ./configure --enable-local && make
+ ./ct-ng $CTNG_CONFIG
+ sed -i -e '/CT_LOG_PROGRESS_BAR/s/y$/n/' .config
+ CT_PREFIX=`pwd`/builds ./ct-ng build
+ popd
+ [ -x crosstool-NG/builds/xtensa-esp32s3-linux-uclibcfdpic/bin/xtensa-esp32s3-linux-uclibcfdpic-gcc ] || exit 1
+fi
#
-# kernel and rootfs
+# kernel and rootfs (buildroot)
#
-git clone https://github.com/jcmvbkbc/buildroot -b xtensa-2023.02-fdpic
-nice make -C buildroot O=`pwd`/build-xtensa-2023.02-fdpic-esp32s3 esp32s3_defconfig
-buildroot/utils/config --file build-xtensa-2023.02-fdpic-esp32s3/.config --set-str TOOLCHAIN_EXTERNAL_PATH `pwd`/crosstool-NG/builds/xtensa-esp32s3-linux-uclibcfdpic
-buildroot/utils/config --file build-xtensa-2023.02-fdpic-esp32s3/.config --set-str TOOLCHAIN_EXTERNAL_PREFIX '$(ARCH)-esp32s3-linux-uclibcfdpic'
-buildroot/utils/config --file build-xtensa-2023.02-fdpic-esp32s3/.config --set-str TOOLCHAIN_EXTERNAL_CUSTOM_PREFIX '$(ARCH)-esp32s3-linux-uclibcfdpic'
-nice make -C buildroot O=`pwd`/build-xtensa-2023.02-fdpic-esp32s3
-[ -f build-xtensa-2023.02-fdpic-esp32s3/images/xipImage -a -f build-xtensa-2023.02-fdpic-esp32s3/images/rootfs.cramfs ] || exit 1
+if [ ! -z $REBUILD_KERNEL_ROOTFS ] || [ ! -f build-buildroot-esp32s3/images/xipImage ] || [ ! -f build-buildroot-esp32s3/images/rootfs.cramfs ] || [ ! -f build-buildroot-esp32s3/images/etc.jffs2 ] ; then
+ if [ ! -d build-buildroot-esp32s3 ] ; then
+ make -C buildroot O=`pwd`/build-buildroot-esp32s3 $BUILDROOT_CONFIG
+ buildroot/utils/config --file build-buildroot-esp32s3/.config --set-str TOOLCHAIN_EXTERNAL_PATH `pwd`/crosstool-NG/builds/xtensa-esp32s3-linux-uclibcfdpic
+ buildroot/utils/config --file build-buildroot-esp32s3/.config --set-str TOOLCHAIN_EXTERNAL_PREFIX '$(ARCH)-esp32s3-linux-uclibcfdpic'
+ buildroot/utils/config --file build-buildroot-esp32s3/.config --set-str TOOLCHAIN_EXTERNAL_CUSTOM_PREFIX '$(ARCH)-esp32s3-linux-uclibcfdpic'
+ fi
+ make -C buildroot O=`pwd`/build-buildroot-esp32s3
+ [ -f build-buildroot-esp32s3/images/xipImage -a -f build-buildroot-esp32s3/images/rootfs.cramfs -a -f build-buildroot-esp32s3/images/etc.jffs2 ] || exit 1
+fi
#
# bootloader
#
-git clone https://github.com/jcmvbkbc/esp-idf -b linux-5.0.1
pushd esp-idf
-. export.sh
-cd examples/get-started/linux_boot
-idf.py set-target esp32s3
-cp sdkconfig.defaults.esp32s3 sdkconfig
-idf.py build
-read -p 'ready to flash... press enter'
-idf.py flash
+if [ ! -z $REBUILD_BOOTLOADER ] || [ ! -f ./examples/get-started/linux_boot/build/linux_boot.bin ] || [ ! -f ./examples/get-started/linux_boot/build/partition_table/partition-table.bin ] || [ ! -f ./examples/get-started/linux_boot/build/bootloader/bootloader.bin ] ; then
+ alias python='python3'
+ . export.sh
+ cd examples/get-started/linux_boot
+ idf.py set-target esp32s3
+ cp $ESP_HOSTED_CONFIG sdkconfig
+ idf.py build
+fi
popd
#
-# flash
+# publish artifacts
#
-parttool.py write_partition --partition-name linux --input build-xtensa-2023.02-fdpic-esp32s3/images/xipImage
-parttool.py write_partition --partition-name rootfs --input build-xtensa-2023.02-fdpic-esp32s3/images/rootfs.cramfs
+cp -v esp-idf/examples/get-started/linux_boot/build/bootloader/bootloader.bin ./output
+cp -v esp-idf/examples/get-started/linux_boot/build/partition_table/partition-table.bin ./output
+cp -v esp-idf/examples/get-started/linux_boot/build/linux_boot.bin ./output
+
+cp -rv build-buildroot-esp32s3/images/* ./output
\ No newline at end of file
diff --git a/xtensa-dynconfig b/xtensa-dynconfig
new file mode 160000
index 000000000..6615c332f
--- /dev/null
+++ b/xtensa-dynconfig
@@ -0,0 +1 @@
+Subproject commit 6615c332f41ab2169bd68ff289c351181251a6fc