mirror of
https://github.com/brain-hackers/brain-config.git
synced 2024-12-22 20:20:06 +09:00
Modified for compatibility with x86 systems.
This commit is contained in:
parent
d15dec8cbe
commit
5ff61d3e11
111
raspi-config
111
raspi-config
@ -9,6 +9,11 @@ BLACKLIST=/etc/modprobe.d/raspi-blacklist.conf
|
|||||||
CONFIG=/boot/config.txt
|
CONFIG=/boot/config.txt
|
||||||
CMDLINE=/boot/cmdline.txt
|
CMDLINE=/boot/cmdline.txt
|
||||||
|
|
||||||
|
is_pi () {
|
||||||
|
grep -q BCM27 /proc/cpuinfo
|
||||||
|
return $?
|
||||||
|
}
|
||||||
|
|
||||||
is_pione() {
|
is_pione() {
|
||||||
if grep -q "^Revision\s*:\s*00[0-9a-fA-F][0-9a-fA-F]$" /proc/cpuinfo; then
|
if grep -q "^Revision\s*:\s*00[0-9a-fA-F][0-9a-fA-F]$" /proc/cpuinfo; then
|
||||||
return 0
|
return 0
|
||||||
@ -1444,56 +1449,58 @@ do_internationalisation_menu() {
|
|||||||
}
|
}
|
||||||
|
|
||||||
do_interface_menu() {
|
do_interface_menu() {
|
||||||
FUN=$(whiptail --title "Raspberry Pi Software Configuration Tool (raspi-config)" --menu "Interfacing Options" $WT_HEIGHT $WT_WIDTH $WT_MENU_HEIGHT --cancel-button Back --ok-button Select \
|
if ! is_pi ; then
|
||||||
"P1 Camera" "Enable/Disable connection to the Raspberry Pi Camera" \
|
do_ssh
|
||||||
"P2 SSH" "Enable/Disable remote command line access to your Pi using SSH" \
|
else
|
||||||
"P3 VNC" "Enable/Disable graphical remote access to your Pi using RealVNC" \
|
FUN=$(whiptail --title "Raspberry Pi Software Configuration Tool (raspi-config)" --menu "Interfacing Options" $WT_HEIGHT $WT_WIDTH $WT_MENU_HEIGHT --cancel-button Back --ok-button Select \
|
||||||
"P4 SPI" "Enable/Disable automatic loading of SPI kernel module (needed for e.g. PiFace)" \
|
"P1 Camera" "Enable/Disable connection to the Raspberry Pi Camera" \
|
||||||
"P5 I2C" "Enable/Disable automatic loading of I2C kernel module" \
|
"P2 SSH" "Enable/Disable remote command line access to your Pi using SSH" \
|
||||||
"P6 Serial" "Enable/Disable shell and kernel messages on the serial connection" \
|
"P3 VNC" "Enable/Disable graphical remote access to your Pi using RealVNC" \
|
||||||
"P7 1-Wire" "Enable/Disable one-wire interface" \
|
"P4 SPI" "Enable/Disable automatic loading of SPI kernel module" \
|
||||||
"P8 Remote GPIO" "Enable/Disable remote access to GPIO pins" \
|
"P5 I2C" "Enable/Disable automatic loading of I2C kernel module" \
|
||||||
3>&1 1>&2 2>&3)
|
"P6 Serial" "Enable/Disable shell and kernel messages on the serial connection" \
|
||||||
RET=$?
|
"P7 1-Wire" "Enable/Disable one-wire interface" \
|
||||||
if [ $RET -eq 1 ]; then
|
"P8 Remote GPIO" "Enable/Disable remote access to GPIO pins" \
|
||||||
return 0
|
3>&1 1>&2 2>&3)
|
||||||
elif [ $RET -eq 0 ]; then
|
RET=$?
|
||||||
case "$FUN" in
|
if [ $RET -eq 1 ]; then
|
||||||
P1\ *) do_camera ;;
|
return 0
|
||||||
P2\ *) do_ssh ;;
|
elif [ $RET -eq 0 ]; then
|
||||||
P3\ *) do_vnc ;;
|
case "$FUN" in
|
||||||
P4\ *) do_spi ;;
|
P1\ *) do_camera ;;
|
||||||
P5\ *) do_i2c ;;
|
P2\ *) do_ssh ;;
|
||||||
P6\ *) do_serial ;;
|
P3\ *) do_vnc ;;
|
||||||
P7\ *) do_onewire ;;
|
P4\ *) do_spi ;;
|
||||||
P8\ *) do_rgpio ;;
|
P5\ *) do_i2c ;;
|
||||||
*) whiptail --msgbox "Programmer error: unrecognized option" 20 60 1 ;;
|
P6\ *) do_serial ;;
|
||||||
esac || whiptail --msgbox "There was an error running option $FUN" 20 60 1
|
P7\ *) do_onewire ;;
|
||||||
|
P8\ *) do_rgpio ;;
|
||||||
|
*) whiptail --msgbox "Programmer error: unrecognized option" 20 60 1 ;;
|
||||||
|
esac || whiptail --msgbox "There was an error running option $FUN" 20 60 1
|
||||||
|
fi
|
||||||
fi
|
fi
|
||||||
}
|
}
|
||||||
|
|
||||||
do_advanced_menu() {
|
do_advanced_menu() {
|
||||||
FUN=$(whiptail --title "Raspberry Pi Software Configuration Tool (raspi-config)" --menu "Advanced Options" $WT_HEIGHT $WT_WIDTH $WT_MENU_HEIGHT --cancel-button Back --ok-button Select \
|
FUN=$(whiptail --title "Raspberry Pi Software Configuration Tool (raspi-config)" --menu "Advanced Options" $WT_HEIGHT $WT_WIDTH $WT_MENU_HEIGHT --cancel-button Back --ok-button Select \
|
||||||
"A1 Overscan" "You may need to configure overscan if black bars are present on display" \
|
"A1 Expand Filesystem" "Ensures that all of the SD card storage is available to the OS" \
|
||||||
"A2 Hostname" "Set the visible name for this Pi on a network" \
|
"A2 Overscan" "You may need to configure overscan if black bars are present on display" \
|
||||||
"A3 Memory Split" "Change the amount of memory made available to the GPU" \
|
"A3 Memory Split" "Change the amount of memory made available to the GPU" \
|
||||||
"A4 Audio" "Force audio out through HDMI or 3.5mm jack" \
|
"A4 Audio" "Force audio out through HDMI or 3.5mm jack" \
|
||||||
"A5 Resolution" "Set a specific screen resolution" \
|
"A5 Resolution" "Set a specific screen resolution" \
|
||||||
"A6 GL Driver" "Enable/Disable experimental desktop GL driver" \
|
"A6 GL Driver" "Enable/Disable experimental desktop GL driver" \
|
||||||
"A0 Update" "Update this tool to the latest version" \
|
|
||||||
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
|
||||||
A1\ *) do_overscan ;;
|
A1\ *) do_expand_rootfs ;;
|
||||||
A2\ *) do_hostname ;;
|
A2\ *) do_overscan ;;
|
||||||
A3\ *) do_memory_split ;;
|
A3\ *) do_memory_split ;;
|
||||||
A4\ *) do_audio ;;
|
A4\ *) do_audio ;;
|
||||||
A5\ *) do_resolution ;;
|
A5\ *) do_resolution ;;
|
||||||
A6\ *) do_gldriver ;;
|
A6\ *) do_gldriver ;;
|
||||||
A0\ *) do_update ;;
|
|
||||||
*) 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
|
||||||
@ -1522,7 +1529,7 @@ do_boot_menu() {
|
|||||||
# Interactive use loop
|
# Interactive use loop
|
||||||
#
|
#
|
||||||
if [ "$INTERACTIVE" = True ]; then
|
if [ "$INTERACTIVE" = True ]; then
|
||||||
if ! mountpoint -q /boot; then
|
if is_pi && ! mountpoint -q /boot; then
|
||||||
whiptail --msgbox "The boot partition is not mounted - cannot configure. Note that raspi-config is intended for use on Raspbian only and cannot be guaranteed to work on other operating systems." 20 60 1
|
whiptail --msgbox "The boot partition is not mounted - cannot configure. Note that raspi-config is intended for use on Raspbian only and cannot be guaranteed to work on other operating systems." 20 60 1
|
||||||
exit 1
|
exit 1
|
||||||
fi
|
fi
|
||||||
@ -1530,29 +1537,43 @@ if [ "$INTERACTIVE" = True ]; then
|
|||||||
get_init_sys
|
get_init_sys
|
||||||
calc_wt_size
|
calc_wt_size
|
||||||
while true; do
|
while true; do
|
||||||
FUN=$(whiptail --title "Raspberry Pi Software Configuration Tool (raspi-config)" --menu "Setup Options" $WT_HEIGHT $WT_WIDTH $WT_MENU_HEIGHT --cancel-button Finish --ok-button Select \
|
if is_pi ; then
|
||||||
"1 Expand Filesystem" "Ensures that all of the SD card storage is available to the OS" \
|
FUN=$(whiptail --title "Raspberry Pi Software Configuration Tool (raspi-config)" --menu "Setup Options" $WT_HEIGHT $WT_WIDTH $WT_MENU_HEIGHT --cancel-button Finish --ok-button Select \
|
||||||
"2 Change User Password" "Change password for the default user (pi)" \
|
"1 Change User Password" "Change password for the default user (pi)" \
|
||||||
"3 Boot Options" "Configure options for start-up" \
|
"2 Hostname" "Set the visible name for this Pi on a network" \
|
||||||
"4 Localisation Options" "Set up language and regional settings to match your location" \
|
"3 Boot Options" "Configure options for start-up" \
|
||||||
"5 Interfacing Options" "Configure connections to peripherals" \
|
"4 Localisation Options" "Set up language and regional settings to match your location" \
|
||||||
"6 Overclock" "Configure overclocking for your Pi" \
|
"5 Interfacing Options" "Configure connections to peripherals" \
|
||||||
"7 Advanced Options" "Configure advanced settings" \
|
"6 Overclock" "Configure overclocking for your Pi" \
|
||||||
"8 About raspi-config" "Information about this configuration tool" \
|
"7 Advanced Options" "Configure advanced settings" \
|
||||||
3>&1 1>&2 2>&3)
|
"8 Update" "Update this tool to the latest version" \
|
||||||
|
"9 About raspi-config" "Information about this configuration tool" \
|
||||||
|
3>&1 1>&2 2>&3)
|
||||||
|
else
|
||||||
|
FUN=$(whiptail --title "Raspberry Pi Software Configuration Tool (raspi-config)" --menu "Setup Options" $WT_HEIGHT $WT_WIDTH $WT_MENU_HEIGHT --cancel-button Finish --ok-button Select \
|
||||||
|
"1 Change User Password" "Change password for the default user (pi)" \
|
||||||
|
"2 Hostname" "Set the visible name for this PC on a network" \
|
||||||
|
"3 Boot Options" "Configure options for start-up" \
|
||||||
|
"4 Localisation Options" "Set up language and regional settings to match your location" \
|
||||||
|
"5 SSH" "Enable/Disable remote command line access to your PC using SSH" \
|
||||||
|
"8 Update" "Update this tool to the latest version" \
|
||||||
|
"9 About raspi-config" "Information about this configuration tool" \
|
||||||
|
3>&1 1>&2 2>&3)
|
||||||
|
fi
|
||||||
RET=$?
|
RET=$?
|
||||||
if [ $RET -eq 1 ]; then
|
if [ $RET -eq 1 ]; then
|
||||||
do_finish
|
do_finish
|
||||||
elif [ $RET -eq 0 ]; then
|
elif [ $RET -eq 0 ]; then
|
||||||
case "$FUN" in
|
case "$FUN" in
|
||||||
1\ *) do_expand_rootfs ;;
|
1\ *) do_change_pass ;;
|
||||||
2\ *) do_change_pass ;;
|
2\ *) do_hostname ;;
|
||||||
3\ *) do_boot_menu ;;
|
3\ *) do_boot_menu ;;
|
||||||
4\ *) do_internationalisation_menu ;;
|
4\ *) do_internationalisation_menu ;;
|
||||||
5\ *) do_interface_menu ;;
|
5\ *) do_interface_menu ;;
|
||||||
6\ *) do_overclock ;;
|
6\ *) do_overclock ;;
|
||||||
7\ *) do_advanced_menu ;;
|
7\ *) do_advanced_menu ;;
|
||||||
8\ *) do_about ;;
|
8\ *) do_update ;;
|
||||||
|
9\ *) 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
|
||||||
|
Loading…
Reference in New Issue
Block a user