Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in
Toggle navigation
M
manjaro-arm-installer
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Locked Files
Issues
8
Issues
8
List
Boards
Labels
Service Desk
Milestones
Merge Requests
0
Merge Requests
0
Requirements
Requirements
List
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Security & Compliance
Security & Compliance
Dependency List
License Compliance
Operations
Operations
Environments
Packages & Registries
Packages & Registries
Package Registry
Container Registry
Analytics
Analytics
CI / CD
Code Review
Insights
Issue
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
manjaro-arm
applications
manjaro-arm-installer
Commits
1d9d8511
Commit
1d9d8511
authored
Dec 23, 2018
by
Dan Johansen
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
added ncurses dialogs, thanks to dodgejcr!
parent
6a94cec5
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
106 additions
and
30 deletions
+106
-30
manjaro-arm-installer
manjaro-arm-installer
+106
-30
No files found.
manjaro-arm-installer
View file @
1d9d8511
#! /bin/bash
# Set globals
#LIBDIR=/usr/share/manjaro-arm-tools/lib
SDCARD
=
/dev/mmcblk0
TMPDIR
=
/var/tmp/manjaro-arm-installer
PROFILES
=
/var/tmp/manjaro-arm-installer/profiles
ARCH
=
'aarch64'
DEVICE
=
'rpi3'
EDITION
=
'minimal'
USER
=
'manjaro'
PASSWORD
=
'manjaro'
ROOTPASSWORD
=
'root'
#imports
#source $LIBDIR/functions.sh
# Functions
...
...
@@ -303,20 +290,114 @@ fi
}
# Asking for user input!
read
-p
'What device is this for? [Options: rpi3, oc2 and pinebook] '
DEVICE
read
-p
'What edition do you want? [Options: minimal, lxqt and kde] '
EDITION
read
-p
'What is the path to the SD card? (example: /dev/sdb)? '
SDCARD
read
-p
'What username do you want? '
USER
read
-sp
"What password should
$USER
have? "
PASSWORD
read
-sp
"
What password should the root user have? "
ROOTPASSWORD
echo
"
"
#to fix next line from being in the password line
#read -p 'What device is this for? [Options: rpi3, oc2 and pinebook] ' DEVICE
#read -p 'What edition do you want? [Options: minimal, lxqt and kde] ' EDITION
#read -p 'What is the path to the SD card? (example: /dev/sdb)? ' SDCARD
#read -p 'What username do you want? ' USER
#read -sp "What password should $USER have? " PASSWORD
#read -sp "
#What password should the root user have? " ROOTPASSWORD
#echo "
#" #to fix next line from being in the password line
#echo "Device = $DEVICE"
#echo "Edition = $EDITION"
#echo "Path to SD Card = $SDCARD"
#echo "Username = $USER"
# Using ncurses to ask for user input for variables
DEVICE
=
$(
dialog
--clear
--title
"Manjaro-ARM Installer"
\
--menu
"Choose a device:"
20 51 4
\
"rpi3"
"Raspberry Pi 3"
\
"oc2"
"Odroid C2"
\
"pinebook"
"PineBook"
3>&1 1>&2 2>&3 3>&-
)
#The if statement makes sure that the user has put in something in the previous prompt. If not (left blank or pressed cancel) the script will end
if
[
!
-z
"
$DEVICE
"
]
then
EDITION
=
$(
dialog
--clear
--title
"Manjaro-ARM Installer"
\
--menu
"Choose an edition:"
20 50 4
\
"minimal"
"Minimal Edition (Just CLI)"
\
"lxqt"
"Full LXQT Desktop and apps (lightweight)"
\
"kde"
"Full KDE Desktop (Heavy)"
3>&1 1>&2 2>&3 3>&-
)
else
clear
exit
1
fi
if
[
!
-z
"
$EDITION
"
]
then
USER
=
$(
dialog
--clear
--title
"Manjaro-ARM Installer"
\
--inputbox
"Enter username:"
8 50
\
3>&1 1>&2 2>&3 3>&-
)
else
clear
exit
1
fi
if
[
!
-z
"
$USER
"
]
then
PASSWORD
=
$(
dialog
--clear
--title
"Manjaro-ARM Installer"
\
--passwordbox
"Enter Password:"
8 50
\
3>&1 1>&2 2>&3 3>&-
\
)
else
clear
exit
1
fi
if
[
!
-z
"
$PASSWORD
"
]
then
ROOTPASSWORD
=
$(
dialog
--clear
--title
"Manjaro-ARM Installer"
\
--passwordbox
"Enter Root Password:"
8 50
\
3>&1 1>&2 2>&3 3>&-
\
)
else
clear
exit
1
fi
if
[
!
-z
"
$ROOTPASSWORD
"
]
then
# simple command to put the results of lsblk (just the names of the devices) into an array and make that array populate the options
let
i
=
0
W
=()
while
read
-r
line
;
do
let
i
=
$i
+1
W+
=(
$line
""
)
done
< <
(
lsblk
-adn
-o
NAME
)
SDCARD
=
$(
dialog
--title
"Manjaro-ARM Installer"
\
--menu
"Chose your SDCard"
20 50 4
\
"
${
W
[@]
}
"
3>&2 2>&1 1>&3
)
# add /dev/ to the selected option above
SDCARD
=
/dev/
$SDCARD
else
clear
exit
1
fi
# List all the responses upon completion (remove this for production)
clear
echo
"Device =
$DEVICE
"
echo
"Edition =
$EDITION
"
echo
"Path to SD Card =
$SDCARD
"
echo
"Username =
$USER
"
echo
"User name =
$USER
"
echo
"Password = ********** (
$PASSWORD
)"
#password is here for testing purposes
echo
"Root Password = ********** (
$ROOTPASSWORD
)"
#password is here for testing purposes
echo
"SDCard =
$SDCARD
"
if
[[
"
$DEVICE
"
=
"oc1"
]]
||
[[
"
$DEVICE
"
=
"rpi2"
]]
||
[[
"
$DEVICE
"
=
"xu4"
]]
;
then
ARCH
=
'armv7h'
...
...
@@ -324,11 +405,6 @@ else
ARCH
=
'aarch64'
fi
#if [[ ! -f $SDCARD ]]; then
# echo "Path $SDCARD does not exist! Aborting..."
# exit 1
#fi
# get the profiles
getarmprofiles
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment