Last active 1709219321

codgician revised this gist 1709219321. Go to revision

1 file changed, 4 insertions, 1 deletion

gistfile1.txt

@@ -51,7 +51,10 @@ cd ./builder
51 51 # mkdir ./backup
52 52 # tar xf ./backup.tar.gz -C ./backup/
53 53
54 - echo -e "" > ~/repositories.conf
54 + echo -e "src/gz passwall2 https://dodgix.github.io/openwrt-23.05.2/packages/x86/64/passwall2" > ~/repositories.conf
55 + echo -e "src/gz passwall_packages https://dodgix.github.io/openwrt-23.05.2/packages/x86/64/passwall_packages" > ~/repositories.conf
56 + echo -e "src/gz magnetty_core https://dodgix.github.io/openwrt-23.05.2/targets/86/64/packages/" > ~/repositories.conf
57 +
55 58
56 59 # Update custom feed
57 60 # sed -i "s/openwrt-[0-9]\{2\}.[0-9]\{2\}.[0-9]/openwrt-${version}/g" ./backup/etc/opkg/customfeeds.conf

codgician revised this gist 1709219076. Go to revision

1 file changed, 62 insertions, 2 deletions

gistfile1.txt

@@ -1,6 +1,12 @@
1 + #!/bin/sh
2 + # OpenWrt image generation script
3 + # This is only intended for dot build upgrades!
4 + # Execute inside a new folder.
5 +
6 + # Parameters: change to your configuration!
1 7 routerUser="root"
2 8 routerIp="192.168.0.1"
3 - version="22.03.6"
9 + version="23.05.2"
4 10 baseUrl="https://downloads.openwrt.org/releases/${version}/targets/x86/64"
5 11 builderFileName="openwrt-imagebuilder-${version}-x86-64.Linux-x86_64.tar.xz"
6 12 pkgConfig="-dnsmasq dnsmasq-full ip-full vim vim-runtime -ethtool kmod-e1000ethtool-full \
@@ -19,4 +25,58 @@ luci-app-uhttpd uhttpd \
19 25 luci-theme-bootstrap \
20 26 luci-app-statistics luci-i18n-statistics-zh-cn collectd-mod-disk collectd-mod-cpu collectd-mod-cpufreq collectd-mod-df collectd-mod-interface collectd-mod-processes collectd-mod-uptime collectd-mod-vmem collectd-mod-email collectd-mod-ethstat collectd-mod-conntrack collectd-mod-dhcpleases collectd-mod-syslog collectd-mod-write-http collectd-mod-ping collectd-mod-dns collectd-mod-memory collectd-mod-thermal collectd-mod-nginx collectd-mod-sensors collectd-mod-smart smartmontools smartmontools-drivedb collectd-mod-nut \
21 27 postfix ca-bundle haveged wget wget-ssl iperf3 telnet-bsd qrencode lm-sensors-detect lscpu lsblk uhubctl losetup bind-dig tcping httping \
22 - "
28 + "
29 +
30 + eval `ssh-agent -s`
31 + ssh-add ~/.ssh/codgi-ssh.pem
32 +
33 + echo "# STEP 1. Downloading OpenWrt ${version} Image Builder ..."
34 +
35 + # Download OpenWrt image builder and extract
36 + if ! [ -f "./${builderFileName}" ]
37 + then
38 + wget "$baseUrl/$builderFileName" -P .
39 + fi
40 + rm -rf ./builder
41 + mkdir ./builder
42 + tar xf ./$builderFileName -C ./builder/ --strip-components=1
43 + cd ./builder
44 +
45 + # echo "# STEP 2. Backing up current configurations ..."
46 +
47 + # Backup configurations from router
48 + # routerSsh="${routerUser}@${routerIp}"
49 + # ssh ${routerSsh} 'sysupgrade -b ~/backup.tar.gz'
50 + # scp -O "${routerSsh}:~/backup.tar.gz" ./ || exit 1
51 + # mkdir ./backup
52 + # tar xf ./backup.tar.gz -C ./backup/
53 +
54 + echo -e "" > ~/repositories.conf
55 +
56 + # Update custom feed
57 + # sed -i "s/openwrt-[0-9]\{2\}.[0-9]\{2\}.[0-9]/openwrt-${version}/g" ./backup/etc/opkg/customfeeds.conf
58 +
59 + echo "# STEP 3. Preparing to build image ..."
60 +
61 + # Add custom feeds to builder
62 + # cat ./backup/etc/opkg/customfeeds.conf >> ./repositories.conf
63 + # cp ./backup/etc/opkg/keys/* ./keys
64 +
65 + # Set grub timeout to 0
66 + sed -i 's/CONFIG_GRUB_TIMEOUT="[0-9]"/CONFIG_GRUB_TIMEOUT="0"/g' ./.config
67 +
68 + # Image generation config
69 + sed -i "s/CONFIG_TARGET_ROOTFS_EXT4FS=y/CONFIG_TARGET_ROOTFS_EXT4FS=n/g" ./.config
70 + sed -i "s/CONFIG_VHDX_IMAGES=y/CONFIG_VHDX_IMAGES=n/g" ./.config
71 + sed -i "s/CONFIG_QCOW2_IMAGES=y/CONFIG_QCOW2_IMAGES=n/g" ./.config
72 + sed -i "s/CONFIG_ISO_IMAGES=y/CONFIG_ISO_IMAGES=n/g" ./.config
73 + sed -i "s/CONFIG_VMDK_IMAGES=y/CONFIG_VMDK_IMAGES=n/g" ./.config
74 + sed -i "s/CONFIG_VDI_IMAGES=y/CONFIG_VDI_IMAGES=n/g" ./.config
75 +
76 + # Language config
77 + sed -i "s/# CONFIG_LUCI_LANG_en is not set/CONFIG_LUCI_LANG_en=y/g" ./.config
78 +
79 + echo "# STEP 4. Building image ..."
80 + make image FILES="backup" PACKAGES="$pkgConfig" ROOTFS_PARTSIZE=1024 j=32 V=sc
81 +
82 + echo "# DONE. See built images under: ./builder/bin/targets/x86/64/"

codgician revised this gist 1709218859. Go to revision

1 file changed, 3 insertions, 2 deletions

gistfile1.txt

@@ -3,13 +3,14 @@ routerIp="192.168.0.1"
3 3 version="22.03.6"
4 4 baseUrl="https://downloads.openwrt.org/releases/${version}/targets/x86/64"
5 5 builderFileName="openwrt-imagebuilder-${version}-x86-64.Linux-x86_64.tar.xz"
6 - pkgConfig="-dnsmasq dnsmasq-full ip-full vim vim-runtime -ethtool ethtool-full \
6 + pkgConfig="-dnsmasq dnsmasq-full ip-full vim vim-runtime -ethtool kmod-e1000ethtool-full \
7 7 kmod-nf-nat kmod-nf-nat6 kmod-nft-arp kmod-nft-compat kmod-nft-queue kmod-nft-socket kmod-nft-tproxy kmod-nft-xfrm \
8 8 iptables-nft ip6tables-nft \
9 - intel-microcode iucode-tool kmod-kvm-intel kmod-i2c-i801 kmod-e1000 kmod-e1000e kmod-igb \
9 + intel-microcode iucode-tool kmod-kvm-intel kmod-i2c-i801 kmod-e1000 kmod-e1000e kmod-igb kmod-ixgbe kmod-ixgbevf kmod-igc \
10 10 kmod-w83627hf-wdt kmod-itco-wdt \
11 11 kmod-usb2 kmod-usb3 usbutils exfat-fsck exfat-mkfs kmod-fs-exfat kmod-usb-storage kmod-usb-storage-extras kmod-usb-storage-uas kmod-usb-serial kmod-usb-hid \
12 12 luci-i18n-opkg-zh-cn luci-i18n-firewall-zh-cn \
13 + luci-i18n-passwall2-zh-cn luci-app-passwall2 xray-core \
13 14 luci-app-upnp luci-i18n-upnp-zh-cn \
14 15 luci-app-wol luci-i18n-wol-zh-cn \
15 16 luci-app-banip luci-i18n-banip-zh-cn \

codgician revised this gist 1705316639. Go to revision

1 file changed, 21 insertions

gistfile1.txt(file created)

@@ -0,0 +1,21 @@
1 + routerUser="root"
2 + routerIp="192.168.0.1"
3 + version="22.03.6"
4 + baseUrl="https://downloads.openwrt.org/releases/${version}/targets/x86/64"
5 + builderFileName="openwrt-imagebuilder-${version}-x86-64.Linux-x86_64.tar.xz"
6 + pkgConfig="-dnsmasq dnsmasq-full ip-full vim vim-runtime -ethtool ethtool-full \
7 + kmod-nf-nat kmod-nf-nat6 kmod-nft-arp kmod-nft-compat kmod-nft-queue kmod-nft-socket kmod-nft-tproxy kmod-nft-xfrm \
8 + iptables-nft ip6tables-nft \
9 + intel-microcode iucode-tool kmod-kvm-intel kmod-i2c-i801 kmod-e1000 kmod-e1000e kmod-igb \
10 + kmod-w83627hf-wdt kmod-itco-wdt \
11 + kmod-usb2 kmod-usb3 usbutils exfat-fsck exfat-mkfs kmod-fs-exfat kmod-usb-storage kmod-usb-storage-extras kmod-usb-storage-uas kmod-usb-serial kmod-usb-hid \
12 + luci-i18n-opkg-zh-cn luci-i18n-firewall-zh-cn \
13 + luci-app-upnp luci-i18n-upnp-zh-cn \
14 + luci-app-wol luci-i18n-wol-zh-cn \
15 + luci-app-banip luci-i18n-banip-zh-cn \
16 + luci-app-watchcat luci-i18n-watchcat-zh-cn \
17 + luci-app-uhttpd uhttpd \
18 + luci-theme-bootstrap \
19 + luci-app-statistics luci-i18n-statistics-zh-cn collectd-mod-disk collectd-mod-cpu collectd-mod-cpufreq collectd-mod-df collectd-mod-interface collectd-mod-processes collectd-mod-uptime collectd-mod-vmem collectd-mod-email collectd-mod-ethstat collectd-mod-conntrack collectd-mod-dhcpleases collectd-mod-syslog collectd-mod-write-http collectd-mod-ping collectd-mod-dns collectd-mod-memory collectd-mod-thermal collectd-mod-nginx collectd-mod-sensors collectd-mod-smart smartmontools smartmontools-drivedb collectd-mod-nut \
20 + postfix ca-bundle haveged wget wget-ssl iperf3 telnet-bsd qrencode lm-sensors-detect lscpu lsblk uhubctl losetup bind-dig tcping httping \
21 + "
Newer Older