From 92f18fcd09cbcd3dd5f6d98f0ee9b48ff0b3340e Mon Sep 17 00:00:00 2001 From: o7-machinehum Date: Fri, 26 Dec 2025 10:28:25 +0100 Subject: [PATCH 01/15] Added packaged, optomised systemd boot time (Still more to go), added config files, optomised i3-bar. --- armbian_config/dotfiles/alacritty.toml | 21 ++ armbian_config/dotfiles/i3_config | 193 ++++++++++++++++++ armbian_config/dotfiles/i3status_config | 49 +++++ armbian_config/dotfiles/xinitrc | 5 + armbian_config/kali.png | Bin 0 -> 15626 bytes armbian_config/userpatches/customize-image.sh | 41 ++++ build_armbian.sh | 23 +++ 7 files changed, 332 insertions(+) create mode 100644 armbian_config/dotfiles/alacritty.toml create mode 100644 armbian_config/dotfiles/i3_config create mode 100644 armbian_config/dotfiles/i3status_config create mode 100644 armbian_config/dotfiles/xinitrc create mode 100644 armbian_config/kali.png diff --git a/armbian_config/dotfiles/alacritty.toml b/armbian_config/dotfiles/alacritty.toml new file mode 100644 index 0000000..91e7b83 --- /dev/null +++ b/armbian_config/dotfiles/alacritty.toml @@ -0,0 +1,21 @@ +[font] +size = 8.0 + +[font.bold] +family = "monospace" +style = "Bold" + +[font.bold_italic] +family = "monospace" +style = "Bold Italic" + +[font.italic] +family = "monospace" +style = "Italic" + +[font.normal] +family = "monospace" +style = "Regular" + +[window] +opacity=0.85 diff --git a/armbian_config/dotfiles/i3_config b/armbian_config/dotfiles/i3_config new file mode 100644 index 0000000..53fddb4 --- /dev/null +++ b/armbian_config/dotfiles/i3_config @@ -0,0 +1,193 @@ +# This file has been auto-generated by i3-config-wizard(1). +# It will not be overwritten, so edit it as you like. +# +# Should you change your keyboard layout some time, delete +# this file and re-run i3-config-wizard(1). +# + +# i3 config file (v4) +# +# Please see https://i3wm.org/docs/userguide.html for a complete reference! + +set $mod Mod4 + +# Font for window titles. Will also be used by the bar unless a different font +# is used in the bar {} block below. +font pango:monospace 7 + +# This font is widely installed, provides lots of unicode glyphs, right-to-left +# text rendering and scalability on retina/hidpi displays (thanks to pango). +#font pango:DejaVu Sans Mono 8 + +# Set the wallpaper +exec_always feh --randomize --bg-fill /root/kali.png + +# Start XDG autostart .desktop files using dex. See also +# https://wiki.archlinux.org/index.php/XDG_Autostart +exec --no-startup-id dex --autostart --environment i3 + +# The combination of xss-lock, nm-applet and pactl is a popular choice, so +# they are included here as an example. Modify as you see fit. + +# xss-lock grabs a logind suspend inhibit lock and will use i3lock to lock the +# screen before suspend. Use loginctl lock-session to lock your screen. +exec --no-startup-id xss-lock --transfer-sleep-lock -- i3lock --nofork + +# NetworkManager is the most popular way to manage wireless networks on Linux, +# and nm-applet is a desktop environment-independent system tray GUI for it. +exec --no-startup-id nm-applet + +# Use pactl to adjust volume in PulseAudio. +set $refresh_i3status killall -SIGUSR1 i3status +bindsym XF86AudioRaiseVolume exec --no-startup-id pactl set-sink-volume @DEFAULT_SINK@ +10% && $refresh_i3status +bindsym XF86AudioLowerVolume exec --no-startup-id pactl set-sink-volume @DEFAULT_SINK@ -10% && $refresh_i3status +bindsym XF86AudioMute exec --no-startup-id pactl set-sink-mute @DEFAULT_SINK@ toggle && $refresh_i3status +bindsym XF86AudioMicMute exec --no-startup-id pactl set-source-mute @DEFAULT_SOURCE@ toggle && $refresh_i3status + +# Use Mouse+$mod to drag floating windows to their wanted position +floating_modifier $mod + +# move tiling windows via drag & drop by left-clicking into the title bar, +# or left-clicking anywhere into the window while holding the floating modifier. +tiling_drag modifier titlebar + +# start a terminal +bindsym $mod+Return exec "alacritty" + +# kill focused window +bindsym $mod+Shift+q kill + +# start dmenu (a program launcher) +bindsym $mod+d exec --no-startup-id dmenu_run +# A more modern dmenu replacement is rofi: +# bindcode $mod+40 exec "rofi -modi drun,run -show drun" +# There also is i3-dmenu-desktop which only displays applications shipping a +# .desktop file. It is a wrapper around dmenu, so you need that installed. +# bindcode $mod+40 exec --no-startup-id i3-dmenu-desktop + +# change focus +bindsym $mod+j focus left +bindsym $mod+k focus down +bindsym $mod+l focus up +bindsym $mod+semicolon focus right + +# alternatively, you can use the cursor keys: +bindsym $mod+Left focus left +bindsym $mod+Down focus down +bindsym $mod+Up focus up +bindsym $mod+Right focus right + +# move focused window +bindsym $mod+Shift+j move left +bindsym $mod+Shift+k move down +bindsym $mod+Shift+l move up +bindsym $mod+Shift+semicolon move right + +# alternatively, you can use the cursor keys: +bindsym $mod+Shift+Left move left +bindsym $mod+Shift+Down move down +bindsym $mod+Shift+Up move up +bindsym $mod+Shift+Right move right + +# split in horizontal orientation +bindsym $mod+h split h + +# split in vertical orientation +bindsym $mod+v split v + +# enter fullscreen mode for the focused container +bindsym $mod+f fullscreen toggle + +# change container layout (stacked, tabbed, toggle split) +bindsym $mod+s layout stacking +bindsym $mod+w layout tabbed +bindsym $mod+e layout toggle split + +# toggle tiling / floating +bindsym $mod+Shift+space floating toggle + +# change focus between tiling / floating windows +bindsym $mod+space focus mode_toggle + +# focus the parent container +bindsym $mod+a focus parent + +# focus the child container +#bindsym $mod+d focus child + +# Define names for default workspaces for which we configure key bindings later on. +# We use variables to avoid repeating the names in multiple places. +set $ws1 "1" +set $ws2 "2" +set $ws3 "3" +set $ws4 "4" +set $ws5 "5" +set $ws6 "6" +set $ws7 "7" +set $ws8 "8" +set $ws9 "9" +set $ws10 "10" + +# switch to workspace +bindsym $mod+1 workspace number $ws1 +bindsym $mod+2 workspace number $ws2 +bindsym $mod+3 workspace number $ws3 +bindsym $mod+4 workspace number $ws4 +bindsym $mod+5 workspace number $ws5 +bindsym $mod+6 workspace number $ws6 +bindsym $mod+7 workspace number $ws7 +bindsym $mod+8 workspace number $ws8 +bindsym $mod+9 workspace number $ws9 +bindsym $mod+0 workspace number $ws10 + +# move focused container to workspace +bindsym $mod+Shift+1 move container to workspace number $ws1 +bindsym $mod+Shift+2 move container to workspace number $ws2 +bindsym $mod+Shift+3 move container to workspace number $ws3 +bindsym $mod+Shift+4 move container to workspace number $ws4 +bindsym $mod+Shift+5 move container to workspace number $ws5 +bindsym $mod+Shift+6 move container to workspace number $ws6 +bindsym $mod+Shift+7 move container to workspace number $ws7 +bindsym $mod+Shift+8 move container to workspace number $ws8 +bindsym $mod+Shift+9 move container to workspace number $ws9 +bindsym $mod+Shift+0 move container to workspace number $ws10 + +# reload the configuration file +bindsym $mod+Shift+c reload +# restart i3 inplace (preserves your layout/session, can be used to upgrade i3) +bindsym $mod+Shift+r restart +# exit i3 (logs you out of your X session) +bindsym $mod+Shift+e exec "i3-nagbar -t warning -m 'You pressed the exit shortcut. Do you really want to exit i3? This will end your X session.' -B 'Yes, exit i3' 'i3-msg exit'" + +# resize window (you can also use the mouse for that) +mode "resize" { + # These bindings trigger as soon as you enter the resize mode + + # Pressing left will shrink the window’s width. + # Pressing right will grow the window’s width. + # Pressing up will shrink the window’s height. + # Pressing down will grow the window’s height. + bindsym j resize shrink width 10 px or 10 ppt + bindsym k resize grow height 10 px or 10 ppt + bindsym l resize shrink height 10 px or 10 ppt + bindsym semicolon resize grow width 10 px or 10 ppt + + # same bindings, but for the arrow keys + bindsym Left resize shrink width 10 px or 10 ppt + bindsym Down resize grow height 10 px or 10 ppt + bindsym Up resize shrink height 10 px or 10 ppt + bindsym Right resize grow width 10 px or 10 ppt + + # back to normal: Enter or Escape or $mod+r + bindsym Return mode "default" + bindsym Escape mode "default" + bindsym $mod+r mode "default" +} + +bindsym $mod+r mode "resize" + +# Start i3bar to display a workspace bar (plus the system information i3status +# finds out, if available) +bar { + status_command i3status +} diff --git a/armbian_config/dotfiles/i3status_config b/armbian_config/dotfiles/i3status_config new file mode 100644 index 0000000..7e03735 --- /dev/null +++ b/armbian_config/dotfiles/i3status_config @@ -0,0 +1,49 @@ +# i3status configuration file. +# see "man i3status" for documentation. + +# It is important that this file is edited as UTF-8. +# The following line should contain a sharp s: +# ß +# If the above line is not correctly displayed, fix your editor first! + +general { + colors = true + interval = 5 +} + +# order += "ipv6" +order += "wireless _first_" +# order += "ethernet _first_" +# order += "disk /" +order += "load" +order += "memory" +order += "tztime local" + +wireless _first_ { +# format_up = "W: (%quality at %essid) %ip" + format_up = "%ip" + format_down = "W: down" +} + +ethernet _first_ { + format_up = "E: %ip (%speed)" + format_down = "E: down" +} + +disk "/" { + format = "%avail" +} + +load { + format = "%1min" +} + +memory { + format = "U: %used |F: %available" + # threshold_degraded = "1G" + # format_degraded = "MEMORY < %available" +} + +tztime local { + format = "%Y-%m-%d %H:%M:%S" +} diff --git a/armbian_config/dotfiles/xinitrc b/armbian_config/dotfiles/xinitrc new file mode 100644 index 0000000..5ab8913 --- /dev/null +++ b/armbian_config/dotfiles/xinitrc @@ -0,0 +1,5 @@ +#!/bin/bash + +picom --backend=xrender & +xrandr --output DSI-1 --rotate inverted +exec i3 diff --git a/armbian_config/kali.png b/armbian_config/kali.png new file mode 100644 index 0000000000000000000000000000000000000000..f5eecce6af966b01fcb600695f3896f5cb5b0e6b GIT binary patch literal 15626 zcmdVBc{rBq{x<%|iUv`u0TE3rg-{YQH3=0mOQuTZ5ShnPStTioWU9y*D)US#$&`7D zhsr!WWS-yiYVG~~V;|rB{`DTeM_LyR%#Uvsx?a;j>wpz4DZL?Kv*4Ol ze?MQbrfa?YcFw!EzWHR+6b_csSR}?ncL!4btjde#}6;M)oc z#pKDO9as*9o^sTS4*S6H`!i())9=reKiDY0Kd-`C|MT;DteyORdl7{~K9dXl=jZ=+ zVet zdCGosTuWCs?9!!6o7ma+rMB<~mi=55+Uj>Orrn(d>}v^+fvha7UBg@!tN;|L8T0|ElloW?FyMo3+_d-v`d zW@gQ!M~l3QTxLEw3VCMcwp+0?G0;q?+PUo`bledX4yHSF$ELs0IA}{t9+Q)k@tK)g z?(Xgb0|Tnc%Kojbt@W*~35|`K_6`mS>FFAZii!zwah-k)N4>CsGiT4<$5UloZR=SV z$rEIi*=B7j#eFJD1wY2AEfOaVV=mC*Q{DK+A)${J>E5+Py1ncICNV4 z{;4R@PfH$qqH4s9G)EkAyKThksZ>Fqk{2Bv9dz97?d=2o{VI-*nXPSY4ILfHt*tsw z9zX7DetUVrmXa06wmX~s&bYF<`M^WPi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 zw6+fT+5FR)KNg|I6@`#@mmnTMn|GV@e_bPH&T5LPO<{_{@CkrK6Wf4izJKaRT-Zh? zTu1B%lE)nd9_1S83RF{rQ9L`rnPP!(_!0rXGprL}@$n6`Eid7#01*KAW63Pxj~*32 z|9#UQhg{Ol;SYqi1-GT}Ub37REFVTsdAvyDdOI2;(F4C%83PIw|L$F_#4i1JMytKy z+@Y8}E9v?Q!6d(F931P)In<)gvx%_jUb*sW+NI#1K$iSx-8!K27?bZ-Ag=^Hcwqd` zmj@w~qDbzB1wa;joCza(N|+fuG_ARgDR^^dH;A<2rQhGRwE3+sPU~+2hosnS5ervB z*E#e3C_h=V1$lem+_}+ynVeI*=a;krpBg;YYHA@&&aG!<#P#BP`bI4Q6olY7*2~xb6P+ zXNb0X7`ox-pnYT)%DA@a5GCv{pgZ1u`yLe=8veeP<=eJltVnR)Ylp%?d0Sz;Y#F9E zME}pbm$(^)oHdT*zrP}hyZ?Uo5<&i7Uy;Nr{^y-caxohf1}DG)bn^g$8x>UD-10u5 zBm8_DF~9h>#j>N9j$-&)Sl-ruf)ZM}2a5gotANoEak>AzOlHA&anB{;#|C? /etc/hostname echo 'FONT="Lat7-Terminus12x6.psf.gz"' >> /etc/default/console-setup +### Boot optimisation below +systemctl disable --now armbian-ramlog.service +systemctl disable --now keyboard-setup.service + +## Remove network manager requirement from systemd-user-sessions +install -D -m 0644 /usr/lib/systemd/system/systemd-user-sessions.service \ + /etc/systemd/system/systemd-user-sessions.service + +# Remove network.target from the After= line(s) +sed -i 's/[[:space:]]network\.target//g' /etc/systemd/system/systemd-user-sessions.service +sed -i 's/network\.target[[:space:]]//g' /etc/systemd/system/systemd-user-sessions.service + +## Disable relationship between network manager and getty. +# 1) Write an explicit tty1 unit that does NOT reference rc-local +cat > /etc/systemd/system/getty@tty1.service <<'EOF' +[Unit] +Description=Getty on tty1 +Documentation=man:agetty(8) man:systemd-getty-generator(8) +After=systemd-user-sessions.service getty-pre.target basic.target +Before=getty.target +IgnoreOnIsolate=yes +Conflicts=rescue.service +Before=rescue.service +ConditionPathExists=/dev/tty0 + +[Service] +ExecStart=-/usr/sbin/agetty --noreset --noclear --issue-file=/etc/issue:/etc/issue.d:/run/issue.d:/usr/lib/issue.d tty1 $TERM +Type=idle +Restart=always +RestartSec=0 +UtmpIdentifier=tty1 +StandardInput=tty +StandardOutput=tty +TTYPath=/dev/tty1 +TTYReset=yes +TTYVHangup=yes +TTYVTDisallocate=no + +[Install] +WantedBy=getty.target +EOF echo "Customization complete." diff --git a/build_armbian.sh b/build_armbian.sh index e102ba1..2b53995 100755 --- a/build_armbian.sh +++ b/build_armbian.sh @@ -13,6 +13,22 @@ cd .. rsync -av armbian_config/userpatches/ armbian/userpatches/ rsync -av armbian_config/config/ armbian/config/ +# Copy over dotfiles +DOTFILES="armbian_config/dotfiles" +ROOTDIR="armbian/userpatches/overlay/root" +mkdir -p armbian/userpatches/overlay/root/.config/i3/ +cp $DOTFILES/i3_config $ROOTDIR/.config/i3/config + +mkdir -p $ROOTDIR/.config/i3status/ +cp $DOTFILES/i3status_config $ROOTDIR/.config/i3status/config + +cp $DOTFILES/xinitrc $ROOTDIR/.xinitrc + +mkdir -p $ROOTDIR/.config/alacritty/ +cp $DOTFILES/alacritty.toml $ROOTDIR/.config/alacritty/ + +cp armbian_config/kali.png $ROOTDIR/ + # Add kernel patches if [[ ${kver} == "edge" ]]; then cp patches/linux/0002-rtw88.patch armbian/userpatches/kernel/archive/sunxi-6.16/rtw88.patch @@ -39,6 +55,13 @@ install -D rootfs_overlay/etc/init.d/S51bh_init armbian/userpatches/overlay/usr/ # Add additional packages PKG_CONF="armbian/config/cli/trixie/main/packages.additional" echo usb-modeswitch >> $PKG_CONF +echo xorg >> $PKG_CONF +echo i3 >> $PKG_CONF +echo feh >> $PKG_CONF +echo vim >> $PKG_CONF +echo alacritty >> $PKG_CONF +echo picom >> $PKG_CONF + cd armbian From b491052d739b31197873f050c6af426639485035 Mon Sep 17 00:00:00 2001 From: o7-machinehum Date: Thu, 1 Jan 2026 17:02:28 +0100 Subject: [PATCH 02/15] Added app to remove cursor when not in use, plus some other required apps. --- armbian_config/dotfiles/xinitrc | 1 + armbian_config/userpatches/customize-image.sh | 4 ++-- armbian_config/userpatches/extensions/kali.sh | 4 ++-- build_armbian.sh | 10 ++++++++-- 4 files changed, 13 insertions(+), 6 deletions(-) diff --git a/armbian_config/dotfiles/xinitrc b/armbian_config/dotfiles/xinitrc index 5ab8913..e62801b 100644 --- a/armbian_config/dotfiles/xinitrc +++ b/armbian_config/dotfiles/xinitrc @@ -1,5 +1,6 @@ #!/bin/bash picom --backend=xrender & +unclutter -idle 1 & xrandr --output DSI-1 --rotate inverted exec i3 diff --git a/armbian_config/userpatches/customize-image.sh b/armbian_config/userpatches/customize-image.sh index 75354d7..687073c 100644 --- a/armbian_config/userpatches/customize-image.sh +++ b/armbian_config/userpatches/customize-image.sh @@ -52,8 +52,8 @@ echo bh > /etc/hostname echo 'FONT="Lat7-Terminus12x6.psf.gz"' >> /etc/default/console-setup ### Boot optimisation below -systemctl disable --now armbian-ramlog.service -systemctl disable --now keyboard-setup.service +systemctl disable armbian-ramlog.service +systemctl disable keyboard-setup.service ## Remove network manager requirement from systemd-user-sessions install -D -m 0644 /usr/lib/systemd/system/systemd-user-sessions.service \ diff --git a/armbian_config/userpatches/extensions/kali.sh b/armbian_config/userpatches/extensions/kali.sh index bfb37f9..9c032dc 100644 --- a/armbian_config/userpatches/extensions/kali.sh +++ b/armbian_config/userpatches/extensions/kali.sh @@ -26,6 +26,6 @@ function pre_customize_image__install_kali_packages(){ display_alert "Updating package lists with Kali Linux repos" "${BOARD}:${RELEASE}-${BRANCH} :: ${EXTENSION}" "info" do_with_retries 3 chroot_sdcard_apt_get_update - display_alert "Installing Top 10 Kali Linux tools" "${EXTENSION}" "info" - chroot_sdcard_apt_get_install kali-tools-top10 + # display_alert "Installing Top 10 Kali Linux tools" "${EXTENSION}" "info" + # chroot_sdcard_apt_get_install kali-tools-top10 } diff --git a/build_armbian.sh b/build_armbian.sh index 2b53995..43d19d9 100755 --- a/build_armbian.sh +++ b/build_armbian.sh @@ -61,18 +61,24 @@ echo feh >> $PKG_CONF echo vim >> $PKG_CONF echo alacritty >> $PKG_CONF echo picom >> $PKG_CONF - +echo dmenu >> $PKG_CONF +echo nano >> $PKG_CONF +echo nmap >> $PKG_CONF +echo unclutter >> $PKG_CONF cd armbian +# CLEAN_LEVEL=all \ + ./compile.sh build \ BOARD=flipper-blackhat \ + CLEAN_LEVEL=images,cache \ BRANCH=${kver} \ BUILD_MINIMAL=no \ KERNEL_CONFIGURE=no \ ENABLE_EXTENSIONS="kali" \ KEEP_ORIGINAL_OS_RELEASE=yes \ - RELEASE=forky + RELEASE=trixie echo ************ Built Image ************ echo "sudo dd if=armbian/output/images/Armbian-unofficial_26.02.0-trunk_Flipper-blackhat_forky_edge_6.16.8-kali.img of=/dev/sdd bs=4M conv=fsync status=progress" From f304f9c1ba7884d06555348a3dc2814db7c05909 Mon Sep 17 00:00:00 2001 From: o7-machinehum Date: Fri, 2 Jan 2026 14:37:25 +0100 Subject: [PATCH 03/15] Changed up init script, there are now three paths 1) armbian w/ blackpants, 2) armbian w/ Flipper Zero, 3) Buildroot image. Buildroot image will never support Blackpants. Enabled "dumb" TERM on /dev/ttyS0 for compat w/ Flipper Blackhat app. If you want to access the term over serial (and want it to look nicer), do: `export TERM=linux`. Finally, I moved some systemd config out of customize-image.sh into the rootfs overlay for clarity. --- armbian_config/userpatches/customize-image.sh | 42 +------------------ .../userpatches/overlay/etc/hostname | 1 + .../etc/systemd/system/getty@tty1.service | 27 ++++++++++++ .../autologin.conf | 5 +++ .../override.conf | 4 ++ build_armbian.sh | 2 +- rootfs_overlay/etc/init.d/S51bh_init | 33 ++++++++------- 7 files changed, 57 insertions(+), 57 deletions(-) create mode 100644 armbian_config/userpatches/overlay/etc/hostname create mode 100644 armbian_config/userpatches/overlay/etc/systemd/system/getty@tty1.service create mode 100644 armbian_config/userpatches/overlay/etc/systemd/system/serial-getty@ttyS0.service.d/autologin.conf create mode 100644 armbian_config/userpatches/overlay/etc/systemd/system/serial-getty@ttyS0.service.d/override.conf diff --git a/armbian_config/userpatches/customize-image.sh b/armbian_config/userpatches/customize-image.sh index 687073c..b0022b5 100644 --- a/armbian_config/userpatches/customize-image.sh +++ b/armbian_config/userpatches/customize-image.sh @@ -38,17 +38,6 @@ done # Also remove the "not logged in yet" flag if present rm -f /root/.not_logged_in_yet || true -# Detect a likely serial console. For most boards this is ttyS0 or ttyAMA0; adjust if needed. -SERIAL_TTY="ttyS0" - -mkdir -p /etc/systemd/system/serial-getty@${SERIAL_TTY}.service.d -cat >/etc/systemd/system/serial-getty@${SERIAL_TTY}.service.d/autologin.conf < /etc/hostname echo 'FONT="Lat7-Terminus12x6.psf.gz"' >> /etc/default/console-setup ### Boot optimisation below @@ -63,34 +52,7 @@ install -D -m 0644 /usr/lib/systemd/system/systemd-user-sessions.service \ sed -i 's/[[:space:]]network\.target//g' /etc/systemd/system/systemd-user-sessions.service sed -i 's/network\.target[[:space:]]//g' /etc/systemd/system/systemd-user-sessions.service -## Disable relationship between network manager and getty. -# 1) Write an explicit tty1 unit that does NOT reference rc-local -cat > /etc/systemd/system/getty@tty1.service <<'EOF' -[Unit] -Description=Getty on tty1 -Documentation=man:agetty(8) man:systemd-getty-generator(8) -After=systemd-user-sessions.service getty-pre.target basic.target -Before=getty.target -IgnoreOnIsolate=yes -Conflicts=rescue.service -Before=rescue.service -ConditionPathExists=/dev/tty0 - -[Service] -ExecStart=-/usr/sbin/agetty --noreset --noclear --issue-file=/etc/issue:/etc/issue.d:/run/issue.d:/usr/lib/issue.d tty1 $TERM -Type=idle -Restart=always -RestartSec=0 -UtmpIdentifier=tty1 -StandardInput=tty -StandardOutput=tty -TTYPath=/dev/tty1 -TTYReset=yes -TTYVHangup=yes -TTYVTDisallocate=no - -[Install] -WantedBy=getty.target -EOF +# Alias python -> python3 +ln -sf /usr/bin/python3 /usr/bin/python echo "Customization complete." diff --git a/armbian_config/userpatches/overlay/etc/hostname b/armbian_config/userpatches/overlay/etc/hostname new file mode 100644 index 0000000..29d2e06 --- /dev/null +++ b/armbian_config/userpatches/overlay/etc/hostname @@ -0,0 +1 @@ +bh diff --git a/armbian_config/userpatches/overlay/etc/systemd/system/getty@tty1.service b/armbian_config/userpatches/overlay/etc/systemd/system/getty@tty1.service new file mode 100644 index 0000000..0c1bc9b --- /dev/null +++ b/armbian_config/userpatches/overlay/etc/systemd/system/getty@tty1.service @@ -0,0 +1,27 @@ +# Write an explicit tty1 unit that does NOT reference rc-local + +[Unit] +Description=Getty on tty1 +Documentation=man:agetty(8) man:systemd-getty-generator(8) +After=systemd-user-sessions.service getty-pre.target basic.target +Before=getty.target +IgnoreOnIsolate=yes +Conflicts=rescue.service +Before=rescue.service +ConditionPathExists=/dev/tty0 + +[Service] +ExecStart=-/usr/sbin/agetty --noreset --noclear --issue-file=/etc/issue:/etc/issue.d:/run/issue.d:/usr/lib/issue.d tty1 $TERM +Type=idle +Restart=always +RestartSec=0 +UtmpIdentifier=tty1 +StandardInput=tty +StandardOutput=tty +TTYPath=/dev/tty1 +TTYReset=yes +TTYVHangup=yes +TTYVTDisallocate=no + +[Install] +WantedBy=getty.target diff --git a/armbian_config/userpatches/overlay/etc/systemd/system/serial-getty@ttyS0.service.d/autologin.conf b/armbian_config/userpatches/overlay/etc/systemd/system/serial-getty@ttyS0.service.d/autologin.conf new file mode 100644 index 0000000..79f39a1 --- /dev/null +++ b/armbian_config/userpatches/overlay/etc/systemd/system/serial-getty@ttyS0.service.d/autologin.conf @@ -0,0 +1,5 @@ +# I want a shell automatically + +[Service] +ExecStart= +ExecStart=-/sbin/agetty --autologin root --keep-baud 115200,38400,9600 %I \$TERM diff --git a/armbian_config/userpatches/overlay/etc/systemd/system/serial-getty@ttyS0.service.d/override.conf b/armbian_config/userpatches/overlay/etc/systemd/system/serial-getty@ttyS0.service.d/override.conf new file mode 100644 index 0000000..9da82ac --- /dev/null +++ b/armbian_config/userpatches/overlay/etc/systemd/system/serial-getty@ttyS0.service.d/override.conf @@ -0,0 +1,4 @@ +# Put term in dumb mode (needed to talk serial with Flipper zero) + +[Service] +Environment=TERM=dumb diff --git a/build_armbian.sh b/build_armbian.sh index 43d19d9..29cca9a 100755 --- a/build_armbian.sh +++ b/build_armbian.sh @@ -16,7 +16,7 @@ rsync -av armbian_config/config/ armbian/config/ # Copy over dotfiles DOTFILES="armbian_config/dotfiles" ROOTDIR="armbian/userpatches/overlay/root" -mkdir -p armbian/userpatches/overlay/root/.config/i3/ +mkdir -p $ROOTDIR/.config/i3/ cp $DOTFILES/i3_config $ROOTDIR/.config/i3/config mkdir -p $ROOTDIR/.config/i3status/ diff --git a/rootfs_overlay/etc/init.d/S51bh_init b/rootfs_overlay/etc/init.d/S51bh_init index 97320ac..1d516e8 100755 --- a/rootfs_overlay/etc/init.d/S51bh_init +++ b/rootfs_overlay/etc/init.d/S51bh_init @@ -1,31 +1,32 @@ -#!/bin/sh +#!/bin/bash start() { - TARGET=0424:2514 - if lsusb -d "$TARGET" >/dev/null 2>&1; then - # If Blackpants - echo 2 > /sys/class/graphics/fbcon/rotate + # If Armbian Build + if grep -qi '^ID=debian' /etc/os-release; then mount --bind /boot/bh /mnt/ + USB_HUB=0424:2514 + # If Blackpants (USB Hub exists) + if lsusb -d "$USB_HUB" >/dev/null 2>&1; then + echo "Connect to Blackpants" + echo 2 > /sys/class/graphics/fbcon/rotate + # Else Flipper (No Hub) + else + echo "Connect to Flipper Zero" + fi + source /mnt/blackhat.conf + # Else its the old Buildroot Build else - # Else Flipper + # Turn on LED / Probe screen drivers echo 1 > /sys/devices/platform/leds/leds/blackhat:green:usr/brightness modprobe pwm_bl modprobe panel_sitronix_st7701 fi - source /mnt/blackhat.conf + echo "Welcome to BlackhatOS." } stop() { - TARGET=0424:2514 - if lsusb -d "$TARGET" >/dev/null 2>&1; then - echo 2 > /sys/class/graphics/fbcon/rotate - umount /mnt/ - else - echo 0 > /sys/devices/platform/leds/leds/blackhat:green:usr/brightness - rmmod pwm_bl - rmmod panel_sitronix_st7701 - fi + echo "Stopping" } case "$1" in From 94f84508e6323a63b674264fe8e6906bd7fef6b6 Mon Sep 17 00:00:00 2001 From: o7-machinehum Date: Fri, 2 Jan 2026 16:25:06 +0100 Subject: [PATCH 04/15] patched for nmcli --- package/blackhat/src/blackhat.sh | 80 ++++++++++++++++++++++---------- 1 file changed, 56 insertions(+), 24 deletions(-) diff --git a/package/blackhat/src/blackhat.sh b/package/blackhat/src/blackhat.sh index a70d9bd..d78ed56 100755 --- a/package/blackhat/src/blackhat.sh +++ b/package/blackhat/src/blackhat.sh @@ -1,30 +1,39 @@ #!/bin/bash set -m -exec > >(tee /dev/tty1) 2>&1 -export PYTHONUNBUFFERED=1 - -CONFIG_F=blackhat.conf - -if test -f $CONFIG_F; then - CONFIG_F="$PWD/$CONFIG_F" - LOG_F=blackhat.log -elif test -f /mnt/$CONFIG_F; then - CONFIG_F=/mnt/$CONFIG_F - LOG_F=/mnt/blackhat.log -elif test -f /etc/$CONFIG_F; then - CONFIG_F=/etc/$CONFIG_F - LOG_F=/var/log/blackhat.log + +# For Debugging +# set -mxe + +# If we're not connect to the blackpants, echo +# everything back to the screen +USB_HUB=0424:2514 +blackpants=true +if ! lsusb -d "$USB_HUB" >/dev/null 2>&1; then + exec > >(tee /dev/tty1) 2>&1 + export PYTHONUNBUFFERED=1 + blackpants=false +fi + +armbian=false +if grep -qi '^ID=debian' /etc/os-release; then + armbian=true +fi + +config_f="/mnt/blackhat.conf" +if [[ -f "${config_f}" ]]; then + log_f="/mnt/blackhat.log" else echo "Could not load conf file" exit fi -source "$CONFIG_F" -rm $LOG_F 2>/dev/null +source "$config_f" +rm -rf $log_f 2>/dev/null function print_help() { echo "Commands:" echo "usage: bh wifi connect wlan0" + echo "usage: bh wifi" echo " bh set PASS 'my_wifi_password'" echo " set" echo " SSID Set SSID of WiFi network to connect to" @@ -60,23 +69,46 @@ function validate_wlan_nic() { } function connect_wifi() { - check "$1" - if [ "$1" = "stop" ]; then - killall wpa_supplicant + killall wpa_supplicant || true INET_NIC=$(cat /run/inet_nic 2>/dev/null) || exit ip link set $INET_NIC down + nmcli radio wifi off 2>/dev/null rm /run/inet_nic echo "WiFi Disconnected" exit fi + check "$1" validate_wlan_nic "$1" INET_NIC=$1 echo $INET_NIC > /run/inet_nic echo INET_NIC: $INET_NIC - ip link set $INET_NIC up + + if [[ "$armbian" == true ]]; then + if [[ "$blackpants" == true ]]; then + nmtui + else + connect_wifi_nm "$@" + fi + else + connect_wifi_wpa "$@" + fi +} + +function connect_wifi_nm() { + nmcli radio wifi on + if [[ -z ${PASS:-} ]]; then + echo "No password, connecting to open network" + nmcli dev wifi connect "$SSID" ifname "$INET_NIC" + else + echo "Password set" + nmcli dev wifi connect "$SSID" password "$PASS" ifname "$INET_NIC" + fi +} + +function connect_wifi_wpa() { if [[ -z ${PASS:-} ]]; then echo "No password, connecting to open network" wpa_supplicant -B -i "$INET_NIC" -c <(cat </dev/null - dnsmasq -C /etc/dnsmasq.conf -d 2>&1 > $LOG_F & + dnsmasq -C /etc/dnsmasq.conf -d 2>&1 > $log_f & } function get_5ghz_nic() { @@ -167,7 +199,7 @@ function evil_portal() { cp /mnt/index.html /var/www/ kill -9 $(pidof dnsmasq) 2>/dev/null - dnsmasq -C /etc/dnsmasq.conf -d 2>&1 > $LOG_F & + dnsmasq -C /etc/dnsmasq.conf -d 2>&1 > $log_f & kill -9 $(pidof nginx) 2>/dev/null mkdir /var/log/nginx 2>/dev/null @@ -179,11 +211,11 @@ function evil_portal() { } function set_param() { - sed -i "/^export $1=/cexport $1=\'$2\'" "$CONFIG_F" + sed -i "/^export $1=/cexport $1=\'$2\'" "$config_f" } function get_param() { - grep "export $1" "$CONFIG_F" | cut -d"'" -f2 + grep "export $1" "$config_f" | cut -d"'" -f2 } function check() { From b87aa0b764333d625859254904bf0a09d1876b54 Mon Sep 17 00:00:00 2001 From: o7-machinehum Date: Fri, 2 Jan 2026 21:19:32 +0100 Subject: [PATCH 05/15] Added F1 to toggle vi mode. --- armbian_config/dotfiles/alacritty.toml | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/armbian_config/dotfiles/alacritty.toml b/armbian_config/dotfiles/alacritty.toml index 91e7b83..4a66712 100644 --- a/armbian_config/dotfiles/alacritty.toml +++ b/armbian_config/dotfiles/alacritty.toml @@ -19,3 +19,7 @@ style = "Regular" [window] opacity=0.85 + +[[keyboard.bindings]] +key = "F1" +action = "ToggleViMode" From aed534a514601f9559fba95e19b0b772533addaa Mon Sep 17 00:00:00 2001 From: o7-machinehum Date: Fri, 2 Jan 2026 21:20:57 +0100 Subject: [PATCH 06/15] Moved things around. --- README.md | 16 +++++++--------- 1 file changed, 7 insertions(+), 9 deletions(-) diff --git a/README.md b/README.md index 30e0f51..ee3b04a 100644 --- a/README.md +++ b/README.md @@ -1,13 +1,11 @@ # Flipper Blackhat OS -A WiFi security testing OS built on Linux for penetration testing and network analysis. Designed to with with the Flipper Blackhat. +A WiFi and security testing OS built on Linux for penetration testing and network analysis. Designed to run on the [Flipper Blackhat](https://github.com/o7-machinehum/flipper-blackhat). -## Documentation -For complete functionality reference and usage examples, see [BLACKHAT_REFERENCE.md](BLACKHAT_REFERENCE.md). +There are two possible builds in this repository... -## Releases -The best way to get your hands on all the most recent features is the [nightly build](https://github.com/o7-machinehum/flipper-blackhat-os/actions) here. Just click the most recent "Nightly" and you will find the OS artifacts at the bottom. These can then be flashed to an SD card using unix dd, or whatever Windows application you would use to flash a RPI SD card. +## Buildroot -## Build (Buildroot) +### Building Make sure submodules are initialized: git submodule update --init @@ -24,8 +22,8 @@ And compile: make -## Build (Armbian) +## Armbian + +### Building The armbian build is pretty simple... ./armbian_build.sh - - From 820918e5e9fdba69e6fcef6c78ed62bcf7a5830d Mon Sep 17 00:00:00 2001 From: o7-machinehum Date: Sun, 4 Jan 2026 19:36:36 +0100 Subject: [PATCH 07/15] EP working on Armbian build. --- armbian_config/userpatches/customize-image.sh | 13 +++ armbian_config/userpatches/extensions/kali.sh | 2 + build_armbian.sh | 39 +++++++-- package/blackhat/src/blackhat.sh | 83 +++++++++++++------ package/blackhat/src/evil_portal.py | 0 rootfs_overlay/etc/dnsmasq.conf | 1 + 6 files changed, 103 insertions(+), 35 deletions(-) mode change 100644 => 100755 package/blackhat/src/evil_portal.py diff --git a/armbian_config/userpatches/customize-image.sh b/armbian_config/userpatches/customize-image.sh index b0022b5..2eb0fd7 100644 --- a/armbian_config/userpatches/customize-image.sh +++ b/armbian_config/userpatches/customize-image.sh @@ -18,6 +18,16 @@ fi systemctl enable bh-boot +# These are started manually +systemctl disable nginx + +systemctl disable hostapd +systemctl unmask hostapd + +systemctl unmask dnsmasq +systemctl disable dnsmasq + + # Force Realtek dongles to _not_ come up as USB MSD # https://linux.die.net/man/1/usb_modeswitch echo 'ACTION=="add", SUBSYSTEM=="usb", ATTR{idVendor}=="0bda", ATTR{idProduct}=="1a2b", ATTR{bConfigurationValue}!="1", ATTR{bConfigurationValue}="1"' \ @@ -55,4 +65,7 @@ sed -i 's/network\.target[[:space:]]//g' /etc/systemd/system/systemd-user-sessio # Alias python -> python3 ln -sf /usr/bin/python3 /usr/bin/python +# Use old wlanX names +echo "extraargs=net.ifnames=0 biosdevname=0" >> /boot/armbianEnv.txt + echo "Customization complete." diff --git a/armbian_config/userpatches/extensions/kali.sh b/armbian_config/userpatches/extensions/kali.sh index 9c032dc..9e95f7d 100644 --- a/armbian_config/userpatches/extensions/kali.sh +++ b/armbian_config/userpatches/extensions/kali.sh @@ -26,6 +26,8 @@ function pre_customize_image__install_kali_packages(){ display_alert "Updating package lists with Kali Linux repos" "${BOARD}:${RELEASE}-${BRANCH} :: ${EXTENSION}" "info" do_with_retries 3 chroot_sdcard_apt_get_update + chroot_sdcard_apt_get_install kismet + # display_alert "Installing Top 10 Kali Linux tools" "${EXTENSION}" "info" # chroot_sdcard_apt_get_install kali-tools-top10 } diff --git a/build_armbian.sh b/build_armbian.sh index 29cca9a..9d591ac 100755 --- a/build_armbian.sh +++ b/build_armbian.sh @@ -3,6 +3,7 @@ set -e cd "$(dirname "$0")" kver="edge" # Edge or current +os_release="sid" cd armbian git reset --hard @@ -40,20 +41,34 @@ else exit fi +armbian_rootfs="armbian/userpatches/overlay/" + # Install packages needed for bh scripts -install -D package/blackhat/src/blackhat.sh armbian/userpatches/overlay/usr/local/bin/bh -install -D package/blackhat/src/evil_portal.py armbian/userpatches/overlay/usr/local/bin/ -install -D package/blackhat/src/telegram.py armbian/userpatches/overlay/usr/local/bin/ -install -D -m 0644 package/blackhat/src/blackhat.conf armbian/userpatches/overlay/boot/bh/blackhat.conf +install -D package/blackhat/src/blackhat.sh "$armbian_rootfs"/usr/local/bin/bh +# install -D package/blackhat/src/telegram.py armbian/userpatches/overlay/usr/local/bin/ +install -D -m 0644 package/blackhat/src/blackhat.conf "$armbian_rootfs"/boot/bh/blackhat.conf mkdir -p armbian/userpatches/overlay/boot/bh/scripts -cp -a package/blackhat/scripts/. armbian/userpatches/overlay/boot/bh/scripts/ +cp -a package/blackhat/scripts/. "$armbian_rootfs"/boot/bh/scripts/ # Install the init script -install -D rootfs_overlay/etc/init.d/S51bh_init armbian/userpatches/overlay/usr/local/bin/bh_init +install -D rootfs_overlay/etc/init.d/S51bh_init "$armbian_rootfs"/usr/local/bin/bh_init + +mkdir -p $armbian_rootfs/etc/nginx/ +cp rootfs_overlay/etc/nginx/nginx.conf "$armbian_rootfs"/etc/nginx/ + +mkdir -p $armbian_rootfs/etc/hostapd/ +cp rootfs_overlay/etc/hostapd.conf "$armbian_rootfs"/etc/hostapd/ +cp rootfs_overlay/etc/dnsmasq.conf "$armbian_rootfs"/etc/ +cp rootfs_overlay/etc/ep-rules.nft "$armbian_rootfs"/etc/ + +mkdir -p "$armbian_rootfs"/var/www/ +cp rootfs_overlay/var/www/index.html "$armbian_rootfs"/var/www/ + +cp package/blackhat/src/evil_portal.py "$armbian_rootfs"/usr/local/bin/evil_portal # Add additional packages -PKG_CONF="armbian/config/cli/trixie/main/packages.additional" +PKG_CONF="armbian/config/cli/${os_release}/main/packages.additional" echo usb-modeswitch >> $PKG_CONF echo xorg >> $PKG_CONF echo i3 >> $PKG_CONF @@ -65,6 +80,14 @@ echo dmenu >> $PKG_CONF echo nano >> $PKG_CONF echo nmap >> $PKG_CONF echo unclutter >> $PKG_CONF +echo brightnessctl >> $PKG_CONF + +echo nginx >> $PKG_CONF +echo python3-flask >> $PKG_CONF +echo python3-requests >> $PKG_CONF +echo hostapd >> $PKG_CONF +echo dnsmasq >> $PKG_CONF +echo nftables >> $PKG_CONF cd armbian @@ -78,7 +101,7 @@ cd armbian KERNEL_CONFIGURE=no \ ENABLE_EXTENSIONS="kali" \ KEEP_ORIGINAL_OS_RELEASE=yes \ - RELEASE=trixie + RELEASE=${os_release} echo ************ Built Image ************ echo "sudo dd if=armbian/output/images/Armbian-unofficial_26.02.0-trunk_Flipper-blackhat_forky_edge_6.16.8-kali.img of=/dev/sdd bs=4M conv=fsync status=progress" diff --git a/package/blackhat/src/blackhat.sh b/package/blackhat/src/blackhat.sh index d78ed56..489a813 100755 --- a/package/blackhat/src/blackhat.sh +++ b/package/blackhat/src/blackhat.sh @@ -3,6 +3,8 @@ set -m # For Debugging # set -mxe +# x: print everything +# e: quit when anything fails # If we're not connect to the blackpants, echo # everything back to the screen @@ -87,11 +89,7 @@ function connect_wifi() { ip link set $INET_NIC up if [[ "$armbian" == true ]]; then - if [[ "$blackpants" == true ]]; then - nmtui - else - connect_wifi_nm "$@" - fi + connect_wifi_nm "$@" else connect_wifi_wpa "$@" fi @@ -126,17 +124,26 @@ EOF function start_ap() { check "$1" - if [ "$1" = "stop" ]; then - killall hostapd AP_NIC=$(cat /run/ap_nic 2>/dev/null) || exit - ip link set $AP_NIC down - ip addr flush $AP_NIC + if [[ "$armbian" == true ]]; then + systemctl stop hostapd + else + killall hostapd + ip link set "$AP_NIC" down + ip addr flush "$AP_NIC" + fi + rm /run/ap_nic - echo "AP Stopped" + echo "$AP_NIC AP Stopped" exit fi + hostapd_conf="/etc/hostapd.conf" + if [[ "$armbian" == true ]]; then + hostapd_conf="/etc/hostapd/hostapd.conf" + fi + validate_wlan_nic "$1" AP_NIC=$1 echo $AP_NIC > /run/ap_nic @@ -145,14 +152,25 @@ function start_ap() { ip link set $AP_NIC down ip addr add $AP_IP/24 dev $AP_NIC - sed -i "s/^ssid=.*/ssid=$AP_SSID/" /etc/hostapd.conf - sed -i "s/^interface=.*/interface=$AP_NIC/" /etc/dnsmasq.conf + sed -i '/^[[:space:]]*#*[[:space:]]*interface[[:space:]]*=/d' /etc/dnsmasq.conf + echo "interface=$AP_NIC" >> /etc/dnsmasq.conf + + sed -i '/^[[:space:]]*#*[[:space:]]*ssid[[:space:]]*=/d' "$hostapd_conf" + echo "ssid=$AP_SSID" >> "$hostapd_conf" + + sed -i '/^[[:space:]]*#*[[:space:]]*interface[[:space:]]*=/d' "$hostapd_conf" + echo "interface=$AP_NIC" >> "$hostapd_conf" - kill $(pidof hostapd) 2>/dev/null - hostapd /etc/hostapd.conf -i $AP_NIC & + if [[ "$armbian" == true ]]; then + systemctl restart hostapd + systemctl restart dnsmasq + else + kill $(pidof hostapd) 2>/dev/null + hostapd /etc/hostapd.conf -i $AP_NIC & - kill $(pidof dnsmasq) 2>/dev/null - dnsmasq -C /etc/dnsmasq.conf -d 2>&1 > $log_f & + kill $(pidof dnsmasq) 2>/dev/null + dnsmasq -C /etc/dnsmasq.conf -d 2>&1 > $log_f & + fi } function get_5ghz_nic() { @@ -182,9 +200,14 @@ function evil_twin() { nft add rule ip filter forward iifname "$AP_NIC" accept } -function evil_portal() { - if [ "$1" = "stop" ]; then - killall nginx +function start_evil_portal() { + if [[ "$1" == "stop" ]]; then + if [[ "$armbian" == false ]]; then + killall nginx + else + sudo systemctl stop nginx + fi + killall evil_portal echo "Evil Portal Stopped" exit @@ -198,16 +221,22 @@ function evil_portal() { nft add rule ip nat postrouting oif $INET_NIC ip saddr @allowed_ips masquerade cp /mnt/index.html /var/www/ - kill -9 $(pidof dnsmasq) 2>/dev/null - dnsmasq -C /etc/dnsmasq.conf -d 2>&1 > $log_f & + if [[ "$armbian" == true ]]; then + sudo systemctl restart dnsmasq + sudo systemctl restart nginx + else + kill -9 $(pidof dnsmasq) 2>/dev/null + dnsmasq -C /etc/dnsmasq.conf -d 2>&1 > $log_f & - kill -9 $(pidof nginx) 2>/dev/null - mkdir /var/log/nginx 2>/dev/null - nginx & + kill -9 $(pidof nginx) 2>/dev/null + mkdir /var/log/nginx 2>/dev/null + nginx & + fi - kill -9 $(pidof evil_portal) 2>/dev/null + killall -q evil_portal ip link set lo up - /usr/bin/evil_portal & + + evil_portal & } function set_param() { @@ -506,7 +535,7 @@ case "$subcommand" in evil_twin "$@" ;; evil_portal) - evil_portal "$@" + start_evil_portal "$@" ;; kismet) bh_kismet "$@" diff --git a/package/blackhat/src/evil_portal.py b/package/blackhat/src/evil_portal.py old mode 100644 new mode 100755 diff --git a/rootfs_overlay/etc/dnsmasq.conf b/rootfs_overlay/etc/dnsmasq.conf index d7953c2..8b9640a 100644 --- a/rootfs_overlay/etc/dnsmasq.conf +++ b/rootfs_overlay/etc/dnsmasq.conf @@ -15,3 +15,4 @@ address=/play.googleapis.com/8.8.8.8 # Resolve everything to the portal's IP address. address=/#/192.168.2.1 +bind-interfaces From 94d3fc879562785fd019ec4ec043d9adf478fa8f Mon Sep 17 00:00:00 2001 From: o7-machinehum Date: Mon, 5 Jan 2026 21:46:51 +0100 Subject: [PATCH 08/15] Patched to work without the Blackpants, removed old metadata files. --- armbian_config/userpatches/customize-image.sh | 3 + build_armbian.sh | 2 +- package/blackhat/src/blackhat.sh | 123 +++++++++++++----- 3 files changed, 95 insertions(+), 33 deletions(-) diff --git a/armbian_config/userpatches/customize-image.sh b/armbian_config/userpatches/customize-image.sh index 2eb0fd7..36d2a5f 100644 --- a/armbian_config/userpatches/customize-image.sh +++ b/armbian_config/userpatches/customize-image.sh @@ -65,6 +65,9 @@ sed -i 's/network\.target[[:space:]]//g' /etc/systemd/system/systemd-user-sessio # Alias python -> python3 ln -sf /usr/bin/python3 /usr/bin/python +# This is something that makes the terminal more fancy (remove it) +rm /etc/profile.d/80-systemd-osc-context.sh + # Use old wlanX names echo "extraargs=net.ifnames=0 biosdevname=0" >> /boot/armbianEnv.txt diff --git a/build_armbian.sh b/build_armbian.sh index 9d591ac..76dd263 100755 --- a/build_armbian.sh +++ b/build_armbian.sh @@ -63,7 +63,7 @@ cp rootfs_overlay/etc/dnsmasq.conf "$armbian_rootfs"/etc/ cp rootfs_overlay/etc/ep-rules.nft "$armbian_rootfs"/etc/ mkdir -p "$armbian_rootfs"/var/www/ -cp rootfs_overlay/var/www/index.html "$armbian_rootfs"/var/www/ +cp rootfs_overlay/var/www/index.html "$armbian_rootfs"/boot/bh/ cp package/blackhat/src/evil_portal.py "$armbian_rootfs"/usr/local/bin/evil_portal diff --git a/package/blackhat/src/blackhat.sh b/package/blackhat/src/blackhat.sh index 489a813..00bcf2e 100755 --- a/package/blackhat/src/blackhat.sh +++ b/package/blackhat/src/blackhat.sh @@ -32,7 +32,7 @@ fi source "$config_f" rm -rf $log_f 2>/dev/null -function print_help() { +print_help() { echo "Commands:" echo "usage: bh wifi connect wlan0" echo "usage: bh wifi" @@ -62,7 +62,42 @@ function print_help() { echo " run