suuhm / quick-extroot-openwrt.sh

Easy and fast shell script to create an Openwrt extroot on your USB stick
6 stars 1 forks source link

it's normal this folder structure? #1

Open onlineapps-cloud opened 10 months ago

onlineapps-cloud commented 10 months ago

hi, i tried your script on my router, but in ssh console i get this: image repetable folder structure,this is normal?

onlineapps-cloud commented 10 months ago

image

suuhm commented 10 months ago

Hi, can you please show me the steps you enter on your router and the logs of the output, so I can help you here.

Which usb device are you using here?

onlineapps-cloud commented 10 months ago

hi, i using microsd card /dev/sda1. but script not give me options to select anything when i execute it.

suuhm commented 10 months ago

Please give output of: fdisk -l ; blkid; lsusb

suuhm commented 10 months ago

ALso please give output of:

opkg update ; opkg install libustream-mbedtls
wget https://raw.githubusercontent.com/suuhm/quick-extroot-openwrt.sh/main/quick-extroot.sh
sh quick-extroot.sh -h
onlineapps-cloud commented 10 months ago
sh quick-extroot.sh -h
root@GL-X750:~# sh quick-extroot.sh -h
_________________________________________________

- QICK - EXTROOT OPENWRT v0.2a (c) 2021 - suuhm -
_________________________________________________

Wrong input! Please enter one of these options:

Usage: quick-extroot.sh [OPTIONS] [DEV]

                  --create-extroot <dev>
                  --create-swap <dev>
                  --set-opkg2er
                  --checkfix-extroot
root@GL-X750:~# wget https://raw.githubusercontent.com/suuhm/quick-extroot-openwrt.sh/main/quick-extroot.sh -qO- | sh -s -- --create-extroot 
_________________________________________________

- QICK - EXTROOT OPENWRT v0.2a (c) 2021 - suuhm -
_________________________________________________

* Install dependencies:
Downloading https://downloads.openwrt.org/releases/23.05.2/targets/ath79/generic/packages/Packages.gz
Updated list of available packages in /var/opkg-lists/openwrt_core
Downloading https://downloads.openwrt.org/releases/23.05.2/targets/ath79/generic/packages/Packages.sig
Signature check passed.
Downloading https://downloads.openwrt.org/releases/23.05.2/packages/mips_24kc/base/Packages.gz
Updated list of available packages in /var/opkg-lists/openwrt_base
Downloading https://downloads.openwrt.org/releases/23.05.2/packages/mips_24kc/base/Packages.sig
Signature check passed.
Downloading https://downloads.openwrt.org/releases/23.05.2/packages/mips_24kc/luci/Packages.gz
Updated list of available packages in /var/opkg-lists/openwrt_luci
Downloading https://downloads.openwrt.org/releases/23.05.2/packages/mips_24kc/luci/Packages.sig
Signature check passed.
Downloading https://downloads.openwrt.org/releases/23.05.2/packages/mips_24kc/packages/Packages.gz
Updated list of available packages in /var/opkg-lists/openwrt_packages
Downloading https://downloads.openwrt.org/releases/23.05.2/packages/mips_24kc/packages/Packages.sig
Signature check passed.
Downloading https://downloads.openwrt.org/releases/23.05.2/packages/mips_24kc/routing/Packages.gz
Updated list of available packages in /var/opkg-lists/openwrt_routing
Downloading https://downloads.openwrt.org/releases/23.05.2/packages/mips_24kc/routing/Packages.sig
Signature check passed.
Downloading https://downloads.openwrt.org/releases/23.05.2/packages/mips_24kc/telephony/Packages.gz
Updated list of available packages in /var/opkg-lists/openwrt_telephony
Downloading https://downloads.openwrt.org/releases/23.05.2/packages/mips_24kc/telephony/Packages.sig
Signature check passed.
Package block-mount (2023-02-28-bfe882d5-1) installed in root is up to date.
Package kmod-fs-ext4 (5.15.137-1) installed in root is up to date.
Package kmod-usb-storage (5.15.137-1) installed in root is up to date.
Package kmod-usb-ohci (5.15.137-1) installed in root is up to date.
Package kmod-usb-uhci (5.15.137-1) installed in root is up to date.
Package e2fsprogs (1.47.0-2) installed in root is up to date.
Package fdisk (2.39-2) installed in root is up to date.
* Set up ExtRoot on your openwrt Device:
* Configure /etc/config/fstab to mount the rootfs_data in another directory
* Check for your wished device:
--------------------- LIST OF EXT-DEVICES ---------------------
DEVICENAME: /dev/sda:
---------------------------------------------------------------

Please enter your Device without Number at the end: (eg. sda)
Warning! All Data on your Device will be destroyed! Continue? (y/n)
* Create and format device: (/dev/)

Welcome to fdisk (util-linux 2.39).                                                                                                                                                                                                         
Changes will remain in memory only, until you decide to write them.
Be careful before using the write command.

fdisk: cannot open /dev/: Is a directory
--------------------- LIST OF DEVICES ---------------------
USB Devicename: /dev/sda: ---- UUID: UUID="50be9e75-86e9-44de-beee-d7e55c84afc8"
-----------------------------------------------------------
mke2fs 1.47.0 (5-Feb-2023)
The file /dev/1 does not exist and no size was specified.
mount: mounting /dev/1 on /mnt failed: No such file or directory
./
./upper/
./upper/etc/
./upper/etc/shinit
./upper/etc/luci-uploads/
./upper/etc/luci-uploads/.placeholder
./upper/etc/uhttpd.key
./upper/etc/modules-boot.d/
./upper/etc/modules-boot.d/20-lib-crc16
./upper/etc/modules-boot.d/50-usb-ohci
./upper/etc/modules-boot.d/40-scsi-core
./upper/etc/modules-boot.d/usb-storage
./upper/etc/modules-boot.d/50-usb-uhci
./upper/etc/modules-boot.d/30-fs-ext4
./upper/etc/oui-tertf/
./upper/etc/oui-tertf/client.db
./upper/etc/nginx/
./upper/etc/nginx/nginx.key
./upper/etc/nginx/nginx.cer
./upper/etc/shells
./upper/etc/config/
./upper/etc/config/gl-tertf
./upper/etc/config/rtty
./upper/etc/config/glforward
./upper/etc/config/vpnpolicy
./upper/etc/config/ovpnclient
./upper/etc/config/wan-access
./upper/etc/config/gl_timer
./upper/etc/config/glipv6
./upper/etc/config/rpcd
./upper/etc/config/gl_s2s
./upper/etc/config/gl_block
./upper/etc/config/gl-cloud
./upper/etc/config/glconfig
./upper/etc/config/gl_led
./upper/etc/config/fstab
./upper/etc/config/ubootenv
./upper/etc/config/network
./upper/etc/config/gl_mwan3
./upper/etc/config/wireguard_server
./upper/etc/config/ovpnserver
./upper/etc/config/wireguard
./upper/etc/config/stubby
./upper/etc/config/repeater
./upper/etc/config/openssl
./upper/etc/config/openvpn
./upper/etc/config/mwan3
./upper/etc/config/ddns
./upper/etc/config/firewall
./upper/etc/config/edgerouter
./upper/etc/config/switch-button
./upper/etc/config/system
./upper/etc/config/uhttpd
./upper/etc/config/oui-httpd
./upper/etc/config/gl_macclone
./upper/etc/config/upgrade
./upper/etc/config/dropbear
./upper/etc/config/luci
./upper/etc/config/gl_ddns
./upper/etc/config/dnscrypt-proxy
./upper/etc/config/glmodem
./upper/etc/config/qos
./upper/etc/config/board_special
./upper/etc/config/gl-dns
./upper/etc/config/plugins
./upper/etc/config/gl_logread
./upper/etc/config/wireless
./upper/etc/config/dhcp
./upper/etc/config/apnprofile
./upper/etc/config/ucitrack
./upper/etc/rc.local
./upper/etc/hotplug.d/
./upper/etc/hotplug.d/block/
./upper/etc/hotplug.d/block/10-mount
./upper/etc/hotplug.d/block/00-media-change
./upper/etc/oui/
./upper/etc/oui/oui.db
./upper/etc/inittab
./upper/etc/shadow
./upper/etc/e2fsck.conf
./upper/etc/init.d/
./upper/etc/init.d/fstab
./upper/etc/profile
./upper/etc/rc.d/
./upper/etc/rc.d/S11fstab
./upper/etc/nftables.d/
./upper/etc/nftables.d/10-custom-filter-chains.nft
./upper/etc/nftables.d/README
./upper/etc/uhttpd.crt
./upper/etc/sysctl.conf
./upper/etc/dropbear/
./upper/etc/dropbear/dropbear_rsa_host_key
./upper/etc/dropbear/dropbear_ed25519_host_key
./upper/etc/fw_env.config
./upper/etc/group
./upper/etc/urandom.seed
./upper/etc/udhcpc.user.d/
./upper/etc/udhcpc.user.d/vpn_dns.sh
./upper/etc/passwd
./upper/etc/modules.d/
./upper/etc/modules.d/20-lib-crc16
./upper/etc/modules.d/50-usb-ohci
./upper/etc/modules.d/40-scsi-core
./upper/etc/modules.d/usb-storage
./upper/etc/modules.d/50-usb-uhci
./upper/etc/modules.d/30-fs-ext4
./upper/etc/opkg/
./upper/etc/opkg/keys/
./upper/etc/opkg/keys/4d017e6f1ed5d616
./upper/etc/opkg/keys/06a6bf2ad909388f
./upper/etc/uci-defaults/
./upper/etc/uci-defaults/50-migrate-rpcd-ubus-sock.sh
./upper/etc/uci-defaults/14_migrate-dhcp-release
./upper/etc/uci-defaults/15_odhcpd
./upper/etc/uci-defaults/50-dnsmasq-migrate-ipset.sh
./upper/etc/uci-defaults/00_uhttpd_ubus
./upper/etc/uci-defaults/20_migrate-feeds
./upper/etc/uci-defaults/04_led_migration
./upper/etc/uci-defaults/30_luci-theme-bootstrap
./upper/etc/uci-defaults/12_network-generate-ula
./upper/etc/uci-defaults/30_uboot-envtools
./upper/etc/uci-defaults/05_fix-compat-version
./upper/etc/uci-defaults/10_migrate-shadow
./upper/etc/uci-defaults/50_luci-mod-admin-full
./upper/etc/uci-defaults/50-dnsmasq-migrate-resolv-conf-auto.sh
./upper/etc/uci-defaults/09_fix-checksum
./upper/etc/uci-defaults/13_fix-group-user
./upper/etc/board.json
./upper/etc/hosts
./upper/usr/
./upper/usr/share/
./upper/usr/share/terminfo/
./upper/usr/share/terminfo/v/
./upper/usr/share/terminfo/v/vt102
./upper/usr/share/terminfo/v/vt100
./upper/usr/share/terminfo/a/
./upper/usr/share/terminfo/a/alacritty
./upper/usr/share/terminfo/a/ansi
./upper/usr/share/terminfo/r/
./upper/usr/share/terminfo/r/rxvt-unicode
tar: can't create node ./upper/etc/uci-defaults/50-migrate-rpcd-ubus-sock.sh: Operation not permitted
./upper/usr/share/terminfo/r/rxvt
root@GL-X750:~# fdisk -l
Disk /dev/mtdblock0: 256 KiB, 262144 bytes, 512 sectors
Units: sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 512 bytes

Disk /dev/mtdblock1: 64 KiB, 65536 bytes, 128 sectors
Units: sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 512 bytes

Disk /dev/mtdblock2: 64 KiB, 65536 bytes, 128 sectors
Units: sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 512 bytes

Disk /dev/mtdblock3: 15.63 MiB, 16384000 bytes, 32000 sectors
Units: sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 512 bytes

Disk /dev/mtdblock4: 2.25 MiB, 2359296 bytes, 4608 sectors
Units: sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 512 bytes

Disk /dev/mtdblock5: 13.38 MiB, 14024704 bytes, 27392 sectors
Units: sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 512 bytes

Disk /dev/mtdblock6: 9.5 MiB, 9961472 bytes, 19456 sectors
Units: sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 512 bytes

Disk /dev/sda: 28.33 GiB, 30416044032 bytes, 59406336 sectors
Disk model: STORAGE DEVICE  
Units: sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 512 bytes
root@GL-X750:~# blkid
/dev/mtdblock5: BLOCK_SIZE="262144" TYPE="squashfs"
/dev/sda: UUID="50be9e75-86e9-44de-beee-d7e55c84afc8" BLOCK_SIZE="4096" TYPE="ext4"
root@GL-X750:~# lsusb
Bus 001 Device 004: ID 2c7c:0306 Quectel EP06-E
Bus 001 Device 003: ID 05e3:0752 Generic USB Storage
Bus 001 Device 002: ID 05e3:0618  USB2.0 Hub
Bus 001 Device 001: ID 1d6b:0002 Linux 5.15.137 ehci_hcd EHCI Host Controller
suuhm commented 10 months ago

at the point: "Please enter your Device without Number at the end: (eg. sda)" did you enter here simply sda or just pressed Enter?

You have to write sda here to successfully run the script

suuhm commented 10 months ago

I've commited an update to the script, can you rerun please and test?

onlineapps-cloud commented 10 months ago

i will check on another router, current router already was manually configured.

onlineapps-cloud commented 10 months ago

did you enter here simply sda or just pressed Enter?

script not ask me to select where to create exroot!, script work autonomous, without askink anything.

suuhm commented 10 months ago

Ok that sounds strange , can you download the new version and check again with output?

suuhm commented 10 months ago

I've done some Bugfixes, can you again plaese test?

opkg update ; opkg install libustream-mbedtls && \
wget https://raw.githubusercontent.com/suuhm/quick-extroot-openwrt.sh/main/quick-extroot.sh -qO- | \
sh -s -- --create-extroot 

Commit: https://github.com/suuhm/quick-extroot-openwrt.sh/commit/1f88d57c6fb90daf4c16e1117810c20bdcb48a62

onlineapps-cloud commented 10 months ago

hi, i will check in few days, thanks for your work.