Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
F
freedombone
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Iterations
Wiki
Requirements
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Locked files
Build
Pipelines
Jobs
Pipeline schedules
Test cases
Artifacts
Deploy
Releases
Package registry
Container Registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Service Desk
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Code review analytics
Issue analytics
Insights
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Context Sensitive Group
freedombone
Commits
3217d9de
Commit
3217d9de
authored
9 years ago
by
Bob Mottram
Browse files
Options
Downloads
Patches
Plain Diff
Update the prep command with a new Beaglebone Black image
parent
7a55cf62
No related branches found
Branches containing commit
No related tags found
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
src/freedombone-prep
+27
-59
27 additions, 59 deletions
src/freedombone-prep
with
27 additions
and
59 deletions
src/freedombone-prep
+
27
−
59
View file @
3217d9de
...
...
@@ -51,14 +51,12 @@ NAMESERVER2='85.214.20.141'
MICROSD_MOUNT_POINT
=
"/media/
$USER
"
DEBIAN_FILE_NAME
=
"debian-
jessie
-console-armhf-201
4
-0
8
-1
3
"
DEBIAN_FILE_NAME
=
"
bone-
debian-
8.1
-console-armhf-201
5
-0
7
-1
2-2gb
"
# Downloads for the Debian installer
DOWNLOAD_LINK1
=
"https://rcn-ee.net/deb/rootfs/jessie/
$DEBIAN_FILE_NAME
.tar.xz"
DOWNLOAD_LINK2
=
"http://ynezz.ibawizard.net/beagleboard/jessie/
$DEBIAN_FILE_NAME
.tar.xz"
DOWNLOAD_LINK1
=
"https://rcn-ee.com/rootfs/bb.org/testing/2015-07-12/console/
$DEBIAN_FILE_NAME
.img.xz"
ROOTFS
=
'rootfs'
BOOT
=
'BOOT'
ROOTFS
=
'bbb'
function
show_help
{
echo
''
...
...
@@ -82,7 +80,6 @@ if [ -d /media ]; then
fi
if
[
-d
/media/usb0
]
;
then
MICROSD_MOUNT_POINT
=
/media
BOOT
=
usb0
fi
fi
if
[
!
-d
$MICROSD_MOUNT_POINT
]
;
then
...
...
@@ -92,7 +89,6 @@ if [ ! -d $MICROSD_MOUNT_POINT ]; then
fi
echo
"MICROSD_MOUNT_POINT=
$MICROSD_MOUNT_POINT
"
echo
"BOOT=
$BOOT
"
while
[[
$#
>
1
]]
do
...
...
@@ -156,47 +152,39 @@ if [ ! -b ${MICROSD_DRIVE}1 ]; then
exit
2
fi
SUDO
=
if
[
-f
/usr/bin/sudo
]
;
then
SUDO
=
'sudo'
fi
$SUDO
apt-get
install
p7zip
dd
wget
if
[
!
-d
~/freedombone
]
;
then
mkdir
~/freedombone
fi
cd
~/freedombone
if
[
!
-f
~/freedombone/
$DEBIAN_FILE_NAME
.tar.xz
]
;
then
wget
$DOWNLOAD_LINK1
fi
if
[
!
-f
~/freedombone/
$DEBIAN_FILE_NAME
.tar.xz
]
;
then
# try another site
wget
$DOWNLOAD_LINK2
if
[
!
-f
~/freedombone/
$DEBIAN_FILE_NAME
.tar.xz
]
;
then
echo
'The Debian installer could not be downloaded'
exit
3
if
[
!
-f
~/freedombone/
$DEBIAN_FILE_NAME
.img.xz
]
;
then
if
[
!
-f
~/freedombone/
$DEBIAN_FILE_NAME
.img
]
;
then
wget
$DOWNLOAD_LINK1
fi
fi
echo
'Extracting
files
...'
tar
xJf
$DEBIAN_FILE_NAME
.
tar
.xz
if
[
!
-
d
~/freedombone/
$DEBIAN_FILE_NAME
]
;
then
echo
"Couldn't extract
files
"
echo
'Extracting
image
...'
xz
-d
$DEBIAN_FILE_NAME
.
img
.xz
if
[
!
-
f
~/freedombone/
$DEBIAN_FILE_NAME
.img
]
;
then
echo
"Couldn't extract
image
"
exit
4
fi
cd
$DEBIAN_FILE_NAME
SUDO
=
if
[
-f
/usr/bin/sudo
]
;
then
SUDO
=
'sudo'
fi
$SUDO
apt-get
install
u-boot-tools dosfstools git-core kpartx wget parted
$SUDO
./setup_sdcard.sh
--mmc
$MICROSD_DRIVE
--dtb
beaglebone
echo
''
echo
''
$SUDO
umount
$MICROSD_MOUNT_POINT
/
$ROOTFS
$SUDO
umount
$MICROSD_MOUNT_POINT
/
$BOOT
cd
~/freedombone
echo
'Flashing image. This may take a while.'
$SUDO
dd
if
=
$DEBIAN_FILE_NAME
.img
of
=
$MICROSD_DRIVE
sync
sleep
5
$SUDO
mkdir
-
p
$MICROSD_MOUNT_POINT
/
$
B
OOT
$SUDO
mkdir
-p
$MICROSD_MOUNT_POINT
/
$ROOTFS
$SUDO
mount
${
MICROSD_DRIVE
}
1
$MICROSD_MOUNT_POINT
/
$BOOT
$SUDO
mount
${
MICROSD_DRIVE
}
2
$MICROSD_MOUNT_POINT
/
$ROOTFS
if
[
!
-
d
$MICROSD_MOUNT_POINT
/
$
R
OOT
FS
]
;
then
$SUDO
mkdir
-p
$MICROSD_MOUNT_POINT
/
$ROOTFS
fi
$SUDO
mount
${
MICROSD_DRIVE
}
1
$MICROSD_MOUNT_POINT
/
$ROOTFS
sync
if
[
!
-b
${
MICROSD_DRIVE
}
1
]
;
then
...
...
@@ -209,13 +197,6 @@ if [ ! -b ${MICROSD_DRIVE}1 ]; then
fi
fi
if
[
!
-d
$MICROSD_MOUNT_POINT
/
$BOOT
]
;
then
echo
''
echo
"The boot partition
$MICROSD_MOUNT_POINT
/
$BOOT
was not found."
ls
$MICROSD_MOUNT_POINT
exit
67857
fi
if
[
!
-d
$MICROSD_MOUNT_POINT
/
$ROOTFS
]
;
then
echo
''
echo
"The rootfs partition
$MICROSD_MOUNT_POINT
/
$ROOTFS
was not found."
...
...
@@ -230,8 +211,6 @@ if [ ! -d $MICROSD_MOUNT_POINT/$ROOTFS/home ]; then
exit
65688
fi
$SUDO
cp
$MICROSD_MOUNT_POINT
/
$BOOT
/bbb-uEnv.txt
$MICROSD_MOUNT_POINT
/
$BOOT
/uEnv.txt
$SUDO
sed
-i
's/iface eth0 inet dhcp/iface eth0 inet static/g'
$MICROSD_MOUNT_POINT
/
$ROOTFS
/etc/network/interfaces
$SUDO
sed
-i
"/iface eth0 inet static/a
\
dns-nameservers
$NAMESERVER1
$NAMESERVER2
"
$MICROSD_MOUNT_POINT
/
$ROOTFS
/etc/network/interfaces
$SUDO
sed
-i
"/iface eth0 inet static/a
\
gateway
$ROUTER_IP_ADDRESS
"
$MICROSD_MOUNT_POINT
/
$ROOTFS
/etc/network/interfaces
...
...
@@ -250,15 +229,8 @@ if [ ! -f $MICROSD_MOUNT_POINT/$ROOTFS/usr/local/bin/freedombone ]; then
fi
# change the motd to show further install instructions
echo
'Become the root user by typing:'
>
/tmp/freedombone_motd
echo
''
>>
/tmp/freedombone_motd
echo
' su'
>>
/tmp/freedombone_motd
echo
''
>>
/tmp/freedombone_motd
echo
'Using the password "root". Change the root user password by typing:'
>>
/tmp/freedombone_motd
echo
''
>>
/tmp/freedombone_motd
echo
' passwd'
>>
/tmp/freedombone_motd
echo
''
>>
/tmp/freedombone_motd
echo
'Then create a user for the system with:'
>>
/tmp/freedombone_motd
echo
'Create a user for the system with:'
>>
/tmp/freedombone_motd
echo
''
>>
/tmp/freedombone_motd
echo
' adduser [username]'
>>
/tmp/freedombone_motd
echo
''
>>
/tmp/freedombone_motd
...
...
@@ -283,18 +255,14 @@ echo ''
echo
'The microSD card can now be removed and inserted into the Beaglebone Black.'
echo
'Once the Beaglebone has booted then you can log in with:'
echo
''
echo
" ssh
debian
@
$BBB_FIXED_IP_ADDRESS
"
echo
" ssh
root
@
$BBB_FIXED_IP_ADDRESS
"
echo
''
echo
'The password
is "tempp
wd".'
echo
'The
root
password
should be changed with the command "pass
wd".'
cat
/tmp/freedombone_motd
rm
/tmp/freedombone_motd
$SUDO
umount
$MICROSD_MOUNT_POINT
/
$ROOTFS
$SUDO
umount
$MICROSD_MOUNT_POINT
/
$BOOT
sync
if
[
-d
$MICROSD_MOUNT_POINT
/
$ROOTFS
]
;
then
$SUDO
rm
-rf
$MICROSD_MOUNT_POINT
/
$ROOTFS
fi
if
[
-d
$MICROSD_MOUNT_POINT
/
$BOOT
]
;
then
$SUDO
rm
-rf
$MICROSD_MOUNT_POINT
/
$BOOT
fi
exit
0
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment