mirror of
https://github.com/brain-hackers/brain-config.git
synced 2025-12-25 06:34:17 +09:00
Compare commits
11 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
7d56ab542d | ||
|
|
fa95e2cc34 | ||
|
|
b0d5844bb0 | ||
|
|
9f958410d2 | ||
|
|
cab14caada | ||
|
|
5cb856ce1d | ||
|
|
9b8b93f313 | ||
|
|
98aa4c1b12 | ||
|
|
30d4cad281 | ||
|
|
5e5f25b711 | ||
|
|
7cc2ada25d |
9
.github/archive_name.py
vendored
9
.github/archive_name.py
vendored
@@ -1,9 +0,0 @@
|
|||||||
#!/usr/bin/python3
|
|
||||||
|
|
||||||
with open('./debian/brain-config/DEBIAN/control', 'r') as f:
|
|
||||||
for l in f.readlines():
|
|
||||||
if l.startswith('Version:'):
|
|
||||||
print(f'brain-config_{l.replace("Version: ", "").rstrip()}_all.deb', end='')
|
|
||||||
break
|
|
||||||
else:
|
|
||||||
raise RuntimeError('Version line was not found')
|
|
||||||
96
.github/workflows/build.yml
vendored
96
.github/workflows/build.yml
vendored
@@ -35,46 +35,62 @@ jobs:
|
|||||||
github_token: ${{ secrets.GITHUB_TOKEN }}
|
github_token: ${{ secrets.GITHUB_TOKEN }}
|
||||||
- name: Create release
|
- name: Create release
|
||||||
id: create_release
|
id: create_release
|
||||||
uses: softprops/action-gh-release@v1
|
uses: actions/create-release@v1
|
||||||
with:
|
|
||||||
body_path: CHANGES.md
|
|
||||||
draft: false
|
|
||||||
prerelease: true
|
|
||||||
name: ${{ steps.release_name.outputs.name }}
|
|
||||||
tag_name: ${{ env.RELEASE_TAG_NAME }}
|
|
||||||
|
|
||||||
build-linux:
|
|
||||||
runs-on: ubuntu-20.04
|
|
||||||
needs: [create_release]
|
|
||||||
steps:
|
|
||||||
- uses: actions/checkout@v2
|
|
||||||
with:
|
|
||||||
submodules: true
|
|
||||||
- name: Workaround for apt update failure
|
|
||||||
run: sudo rm /etc/apt/sources.list.d/github_git-lfs.*
|
|
||||||
- name: Prepare packaging & packagecloud CLI
|
|
||||||
run: |
|
|
||||||
sudo apt update
|
|
||||||
sudo apt install debhelper ruby-dev
|
|
||||||
sudo gem install package_cloud
|
|
||||||
- name: Build the Debian package
|
|
||||||
run: ./debian/rules build && sudo ./debian/rules binary
|
|
||||||
- name: Generate archive name
|
|
||||||
id: archive_name
|
|
||||||
run: echo ::set-output name=name::$(python .github/archive_name.py)
|
|
||||||
- name: Upload the package to GitHub
|
|
||||||
uses: actions/upload-release-asset@v1
|
|
||||||
env:
|
env:
|
||||||
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
||||||
with:
|
with:
|
||||||
upload_url: ${{ needs.create_release.outputs.upload_url }}
|
tag_name: ${{ env.RELEASE_TAG_NAME }}
|
||||||
asset_path: ../${{ steps.archive_name.outputs.name }}
|
release_name: ${{ steps.release_name.outputs.name }}
|
||||||
asset_name: ${{ steps.archive_name.outputs.name }}
|
body_path: CHANGES.md
|
||||||
asset_content_type: application/vnd.debian.binary-package
|
draft: false
|
||||||
- name: Upload the package to packagecloud
|
prerelease: true
|
||||||
env:
|
|
||||||
USERNAME: brainhackers
|
# build-linux:
|
||||||
REPO: brainux/any/any
|
# runs-on: ubuntu-20.04
|
||||||
PACKAGECLOUD_TOKEN: ${{ secrets.PACKAGECLOUD_TOKEN }}
|
# needs: [create_release]
|
||||||
run: |
|
# steps:
|
||||||
package_cloud push "${USERNAME}/${REPO}" "../${{steps.archive_name.outputs.name}}"
|
# - uses: actions/checkout@v2
|
||||||
|
# with:
|
||||||
|
# submodules: true
|
||||||
|
# - name: Workaround for apt update failure
|
||||||
|
# run: sudo rm /etc/apt/sources.list.d/github_git-lfs.*
|
||||||
|
# - name: Install deps
|
||||||
|
# run: sudo apt update && sudo apt install build-essential bison flex libncurses5-dev gcc-arm-linux-gnueabi qemu-user-static debootstrap python3-pip
|
||||||
|
# - name: Upgrade pip and setuptools
|
||||||
|
# run: pip3 install -U pip setuptools
|
||||||
|
# - name: Install listconfig
|
||||||
|
# run: pip3 install listconfig
|
||||||
|
# - name: Configure for Linux
|
||||||
|
# run: make ldefconfig
|
||||||
|
# - name: Build Linux
|
||||||
|
# run: make lbuild
|
||||||
|
# - name: Setup releases
|
||||||
|
# id: release_name
|
||||||
|
# run: |
|
||||||
|
# mkdir release
|
||||||
|
# cp ./linux-brain/arch/arm/boot/dts/imx28-pwsh*.dtb release/
|
||||||
|
# cp ./linux-brain/arch/arm/boot/zImage release/zImage
|
||||||
|
# zip -r release.zip release/
|
||||||
|
# - name: Generate archive name
|
||||||
|
# id: archive_name
|
||||||
|
# run: echo ::set-output name=name::linux-${GITHUB_REF/refs\/*s\//}
|
||||||
|
# - name: Upload release.zip
|
||||||
|
# uses: actions/upload-release-asset@v1
|
||||||
|
# env:
|
||||||
|
# GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
||||||
|
# with:
|
||||||
|
# upload_url: ${{ needs.create_release.outputs.upload_url }}
|
||||||
|
# asset_path: release.zip
|
||||||
|
# asset_name: ${{ steps.archive_name.outputs.name }}.zip
|
||||||
|
# asset_content_type: application/zip
|
||||||
|
# - name: Generate listconfig
|
||||||
|
# run: listconfig ./linux-brain/Kconfig ./linux-brain/.config > listconfig
|
||||||
|
# - name: Upload listconfig
|
||||||
|
# uses: actions/upload-release-asset@v1
|
||||||
|
# env:
|
||||||
|
# GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
||||||
|
# with:
|
||||||
|
# upload_url: ${{ needs.create_release.outputs.upload_url }}
|
||||||
|
# asset_path: listconfig
|
||||||
|
# asset_name: listconfig
|
||||||
|
# asset_content_type: text/plain
|
||||||
|
|||||||
68
brain-config
68
brain-config
@@ -295,38 +295,6 @@ do_ssh() {
|
|||||||
fi
|
fi
|
||||||
}
|
}
|
||||||
|
|
||||||
do_usb() {
|
|
||||||
if [ "$INTERACTIVE" = True ]; then
|
|
||||||
MODE=$(whiptail --menu "Select the role of the USB Host Controller." 20 60 10 "host" "USB Host Mode" "peripheral" "USB Device Mode (for Gadget)" 3>&1 1>&2 2>&3)
|
|
||||||
else
|
|
||||||
MODE=$1
|
|
||||||
true
|
|
||||||
fi
|
|
||||||
|
|
||||||
MODEL=$(cat /sys/firmware/devicetree/base/compatible | grep -Eao 'pw-[a-z0-9]+' | sed -E 's/-//g')
|
|
||||||
DTB="/boot/imx28-${MODEL}.dtb"
|
|
||||||
DTS=`mktemp`
|
|
||||||
|
|
||||||
if [ "${MODE}" != "host" -a "${MODE}" != "peripheral" ]; then
|
|
||||||
echo "Specify the mode from 'host' or 'peripheral'."
|
|
||||||
return 1
|
|
||||||
fi
|
|
||||||
|
|
||||||
dtc -I dtb -O dts ${DTB} > ${DTS} 2> /dev/null
|
|
||||||
|
|
||||||
RE='(^[\t ]*dr_mode[\t ]*=[\t ]*\")(.*)(\"[\t ]*;[\t ]*$)'
|
|
||||||
CURRENT=`sed -En "s|${RE}|\2|p" ${DTS} | head -1`
|
|
||||||
|
|
||||||
if [ "${CURRENT}" != "${MODE}" ]; then
|
|
||||||
mount -o rw,remount /boot
|
|
||||||
echo "Changing dr_mode to ${MODE}"
|
|
||||||
sed -Ei "s|${RE}|\1${MODE}\3|" ${DTS}
|
|
||||||
dtc -I dts -O dtb ${DTS} > ${DTB} 2> /dev/null
|
|
||||||
sync
|
|
||||||
ASK_TO_REBOOT=1
|
|
||||||
fi
|
|
||||||
}
|
|
||||||
|
|
||||||
disable_brain_config_at_boot() {
|
disable_brain_config_at_boot() {
|
||||||
if [ -e /etc/profile.d/brain-config.sh ]; then
|
if [ -e /etc/profile.d/brain-config.sh ]; then
|
||||||
rm -f /etc/profile.d/brain-config.sh
|
rm -f /etc/profile.d/brain-config.sh
|
||||||
@@ -551,8 +519,8 @@ fi
|
|||||||
do_system_menu() {
|
do_system_menu() {
|
||||||
FUN=$(whiptail --title "SHARP Brain Software Configuration Tool (brain-config)" --menu "System Options" $WT_HEIGHT $WT_WIDTH $WT_MENU_HEIGHT --cancel-button Back --ok-button Select \
|
FUN=$(whiptail --title "SHARP Brain Software Configuration Tool (brain-config)" --menu "System Options" $WT_HEIGHT $WT_WIDTH $WT_MENU_HEIGHT --cancel-button Back --ok-button Select \
|
||||||
"S1 Wireless LAN" "Enter SSID and passphrase" \
|
"S1 Wireless LAN" "Enter SSID and passphrase" \
|
||||||
"S2 Password" "Change password for the '$USER' user" \
|
"S3 Password" "Change password for the '$USER' user" \
|
||||||
"S3 Hostname" "Set name for this computer on a network" \
|
"S4 Hostname" "Set name for this computer on a network" \
|
||||||
3>&1 1>&2 2>&3)
|
3>&1 1>&2 2>&3)
|
||||||
RET=$?
|
RET=$?
|
||||||
if [ $RET -eq 1 ]; then
|
if [ $RET -eq 1 ]; then
|
||||||
@@ -560,8 +528,8 @@ do_system_menu() {
|
|||||||
elif [ $RET -eq 0 ]; then
|
elif [ $RET -eq 0 ]; then
|
||||||
case "$FUN" in
|
case "$FUN" in
|
||||||
S1\ *) do_wifi_ssid_passphrase ;;
|
S1\ *) do_wifi_ssid_passphrase ;;
|
||||||
S2\ *) do_change_pass ;;
|
S3\ *) do_change_pass ;;
|
||||||
S3\ *) do_hostname ;;
|
S4\ *) do_hostname ;;
|
||||||
*) whiptail --msgbox "Programmer error: unrecognized option" 20 60 1 ;;
|
*) whiptail --msgbox "Programmer error: unrecognized option" 20 60 1 ;;
|
||||||
esac || whiptail --msgbox "There was an error running option $FUN" 20 60 1
|
esac || whiptail --msgbox "There was an error running option $FUN" 20 60 1
|
||||||
fi
|
fi
|
||||||
@@ -569,16 +537,14 @@ do_system_menu() {
|
|||||||
|
|
||||||
do_interface_menu() {
|
do_interface_menu() {
|
||||||
FUN=$(whiptail --title "SHARP Brain Software Configuration Tool (brain-config)" --menu "Interfacing Options" $WT_HEIGHT $WT_WIDTH $WT_MENU_HEIGHT --cancel-button Back --ok-button Select \
|
FUN=$(whiptail --title "SHARP Brain Software Configuration Tool (brain-config)" --menu "Interfacing Options" $WT_HEIGHT $WT_WIDTH $WT_MENU_HEIGHT --cancel-button Back --ok-button Select \
|
||||||
"I1 SSH" "Enable/disable remote command line access using SSH" \
|
"I2 SSH" "Enable/disable remote command line access using SSH" \
|
||||||
"I2 USB" "Switch the role of the USB Host Controller" \
|
|
||||||
3>&1 1>&2 2>&3)
|
3>&1 1>&2 2>&3)
|
||||||
RET=$?
|
RET=$?
|
||||||
if [ $RET -eq 1 ]; then
|
if [ $RET -eq 1 ]; then
|
||||||
return 0
|
return 0
|
||||||
elif [ $RET -eq 0 ]; then
|
elif [ $RET -eq 0 ]; then
|
||||||
case "$FUN" in
|
case "$FUN" in
|
||||||
I1\ *) do_ssh ;;
|
I2\ *) do_ssh ;;
|
||||||
I2\ *) do_usb ;;
|
|
||||||
*) whiptail --msgbox "Programmer error: unrecognized option" 20 60 1 ;;
|
*) whiptail --msgbox "Programmer error: unrecognized option" 20 60 1 ;;
|
||||||
esac || whiptail --msgbox "There was an error running option $FUN" 20 60 1
|
esac || whiptail --msgbox "There was an error running option $FUN" 20 60 1
|
||||||
fi
|
fi
|
||||||
@@ -588,7 +554,7 @@ do_internationalisation_menu() {
|
|||||||
FUN=$(whiptail --title "SHARP Brain Software Configuration Tool (brain-config)" --menu "Localisation Options" $WT_HEIGHT $WT_WIDTH $WT_MENU_HEIGHT --cancel-button Back --ok-button Select \
|
FUN=$(whiptail --title "SHARP Brain Software Configuration Tool (brain-config)" --menu "Localisation Options" $WT_HEIGHT $WT_WIDTH $WT_MENU_HEIGHT --cancel-button Back --ok-button Select \
|
||||||
"L1 Locale" "Configure language and regional settings" \
|
"L1 Locale" "Configure language and regional settings" \
|
||||||
"L2 Timezone" "Configure time zone" \
|
"L2 Timezone" "Configure time zone" \
|
||||||
"L3 WLAN Country" "Set legal wireless channels for your country" \
|
"L4 WLAN Country" "Set legal wireless channels for your country" \
|
||||||
3>&1 1>&2 2>&3)
|
3>&1 1>&2 2>&3)
|
||||||
RET=$?
|
RET=$?
|
||||||
if [ $RET -eq 1 ]; then
|
if [ $RET -eq 1 ]; then
|
||||||
@@ -597,7 +563,7 @@ do_internationalisation_menu() {
|
|||||||
case "$FUN" in
|
case "$FUN" in
|
||||||
L1\ *) do_change_locale ;;
|
L1\ *) do_change_locale ;;
|
||||||
L2\ *) do_change_timezone ;;
|
L2\ *) do_change_timezone ;;
|
||||||
L3\ *) do_wifi_country ;;
|
L4\ *) do_wifi_country ;;
|
||||||
*) whiptail --msgbox "Programmer error: unrecognized option" 20 60 1 ;;
|
*) whiptail --msgbox "Programmer error: unrecognized option" 20 60 1 ;;
|
||||||
esac || whiptail --msgbox "There was an error running option $FUN" 20 60 1
|
esac || whiptail --msgbox "There was an error running option $FUN" 20 60 1
|
||||||
fi
|
fi
|
||||||
@@ -606,7 +572,7 @@ do_internationalisation_menu() {
|
|||||||
do_advanced_menu() {
|
do_advanced_menu() {
|
||||||
FUN=$(whiptail --title "SHARP Brain Software Configuration Tool (brain-config)" --menu "Advanced Options" $WT_HEIGHT $WT_WIDTH $WT_MENU_HEIGHT --cancel-button Back --ok-button Select \
|
FUN=$(whiptail --title "SHARP Brain Software Configuration Tool (brain-config)" --menu "Advanced Options" $WT_HEIGHT $WT_WIDTH $WT_MENU_HEIGHT --cancel-button Back --ok-button Select \
|
||||||
"A1 Expand Filesystem" "Ensures that all of the SD card is available" \
|
"A1 Expand Filesystem" "Ensures that all of the SD card is available" \
|
||||||
"A2 Network Interface Names" "Enable/disable predictable network i/f names" \
|
"A4 Network Interface Names" "Enable/disable predictable network i/f names" \
|
||||||
3>&1 1>&2 2>&3)
|
3>&1 1>&2 2>&3)
|
||||||
RET=$?
|
RET=$?
|
||||||
if [ $RET -eq 1 ]; then
|
if [ $RET -eq 1 ]; then
|
||||||
@@ -614,7 +580,7 @@ do_advanced_menu() {
|
|||||||
elif [ $RET -eq 0 ]; then
|
elif [ $RET -eq 0 ]; then
|
||||||
case "$FUN" in
|
case "$FUN" in
|
||||||
A1\ *) do_expand_rootfs ;;
|
A1\ *) do_expand_rootfs ;;
|
||||||
A2\ *) do_net_names ;;
|
A4\ *) do_net_names ;;
|
||||||
*) whiptail --msgbox "Programmer error: unrecognized option" 20 60 1 ;;
|
*) whiptail --msgbox "Programmer error: unrecognized option" 20 60 1 ;;
|
||||||
esac || whiptail --msgbox "There was an error running option $FUN" 20 60 1
|
esac || whiptail --msgbox "There was an error running option $FUN" 20 60 1
|
||||||
fi
|
fi
|
||||||
@@ -634,10 +600,9 @@ if [ "$INTERACTIVE" = True ]; then
|
|||||||
while true; do
|
while true; do
|
||||||
FUN=$(whiptail --title "SHARP Brain Software Configuration Tool (brain-config)" --menu "Setup Options" $WT_HEIGHT $WT_WIDTH $WT_MENU_HEIGHT --cancel-button Finish --ok-button Select \
|
FUN=$(whiptail --title "SHARP Brain Software Configuration Tool (brain-config)" --menu "Setup Options" $WT_HEIGHT $WT_WIDTH $WT_MENU_HEIGHT --cancel-button Finish --ok-button Select \
|
||||||
"1 System Options" "Configure system settings" \
|
"1 System Options" "Configure system settings" \
|
||||||
"2 Interface Options" "Configure connections to peripherals" \
|
"5 Localisation Options" "Configure language and regional settings" \
|
||||||
"3 Localisation Options" "Configure language and regional settings" \
|
"6 Advanced Options" "Configure advanced settings" \
|
||||||
"4 Advanced Options" "Configure advanced settings" \
|
"9 About brain-config" "Information about this configuration tool" \
|
||||||
"5 About brain-config" "Information about this configuration tool" \
|
|
||||||
3>&1 1>&2 2>&3)
|
3>&1 1>&2 2>&3)
|
||||||
RET=$?
|
RET=$?
|
||||||
if [ $RET -eq 1 ]; then
|
if [ $RET -eq 1 ]; then
|
||||||
@@ -645,10 +610,9 @@ if [ "$INTERACTIVE" = True ]; then
|
|||||||
elif [ $RET -eq 0 ]; then
|
elif [ $RET -eq 0 ]; then
|
||||||
case "$FUN" in
|
case "$FUN" in
|
||||||
1\ *) do_system_menu ;;
|
1\ *) do_system_menu ;;
|
||||||
2\ *) do_interface_menu ;;
|
5\ *) do_internationalisation_menu ;;
|
||||||
3\ *) do_internationalisation_menu ;;
|
6\ *) do_advanced_menu ;;
|
||||||
4\ *) do_advanced_menu ;;
|
9\ *) do_about ;;
|
||||||
5\ *) do_about ;;
|
|
||||||
*) whiptail --msgbox "Programmer error: unrecognized option" 20 60 1 ;;
|
*) whiptail --msgbox "Programmer error: unrecognized option" 20 60 1 ;;
|
||||||
esac || whiptail --msgbox "There was an error running option $FUN" 20 60 1
|
esac || whiptail --msgbox "There was an error running option $FUN" 20 60 1
|
||||||
else
|
else
|
||||||
|
|||||||
6
debian/changelog
vendored
6
debian/changelog
vendored
@@ -1,9 +1,3 @@
|
|||||||
brain-config (20230327) bullseye; urgency=medium
|
|
||||||
|
|
||||||
* Added do_usb
|
|
||||||
|
|
||||||
-- Brain Hackers <dummy@example.com> Mon, 27 Mar 2022 16:56:00 +0900
|
|
||||||
|
|
||||||
brain-config (20220702) bullseye; urgency=medium
|
brain-config (20220702) bullseye; urgency=medium
|
||||||
|
|
||||||
* Forked from raspi-config
|
* Forked from raspi-config
|
||||||
|
|||||||
Reference in New Issue
Block a user