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
1baba33e
Unverified
Commit
1baba33e
authored
8 years ago
by
Bob Mottram
Browse files
Options
Downloads
Patches
Plain Diff
Tidying
parent
6cf27025
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-image-hardware-setup
+133
-133
133 additions, 133 deletions
src/freedombone-image-hardware-setup
with
133 additions
and
133 deletions
src/freedombone-image-hardware-setup
+
133
−
133
View file @
1baba33e
...
...
@@ -32,27 +32,27 @@ export TEXTDOMAIN=${PROJECT_NAME}-image-hardware-setup
export
TEXTDOMAINDIR
=
"/usr/share/locale"
enable_serial_console
()
{
# By default, spawn a console on the serial port
device
=
"
$1
"
echo
$"Adding a getty on the serial port"
echo
"T0:12345:respawn:/sbin/getty -L
$device
115200 vt100"
>>
/etc/inittab
# By default, spawn a console on the serial port
device
=
"
$1
"
echo
$"Adding a getty on the serial port"
echo
"T0:12345:respawn:/sbin/getty -L
$device
115200 vt100"
>>
/etc/inittab
}
beaglebone_setup_boot
()
{
# Setup uEnv.txt
if
grep
-q
btrfs /etc/fstab
;
then
fstype
=
btrfs
else
fstype
=
ext4
fi
kernelVersion
=
$(
ls
/usr/lib/
*
/am335x-boneblack.dtb |
head
-1
|
cut
-d
/
-f4
)
version
=
$(
echo
$kernelVersion
|
sed
's/linux-image-\(.*\)/\1/'
)
initRd
=
initrd.img-
$version
vmlinuz
=
vmlinuz-
$version
# uEnv.txt for Beaglebone
# based on https://github.com/beagleboard/image-builder/blob/master/target/boot/beagleboard.org.txt
cat
>>
/boot/uEnv.txt
<<
EOF
# Setup uEnv.txt
if
grep
-q
btrfs /etc/fstab
;
then
fstype
=
btrfs
else
fstype
=
ext4
fi
kernelVersion
=
$(
ls
/usr/lib/
*
/am335x-boneblack.dtb |
head
-1
|
cut
-d
/
-f4
)
version
=
$(
echo
$kernelVersion
|
sed
's/linux-image-\(.*\)/\1/'
)
initRd
=
initrd.img-
$version
vmlinuz
=
vmlinuz-
$version
# uEnv.txt for Beaglebone
# based on https://github.com/beagleboard/image-builder/blob/master/target/boot/beagleboard.org.txt
cat
>>
/boot/uEnv.txt
<<
EOF
mmcroot=/dev/mmcblk0p2 ro
mmcrootfstype=
$fstype
rootwait fixrtc
mmcrootflags=subvol=@
...
...
@@ -79,76 +79,76 @@ mmcargs=setenv bootargs console=tty0 console=\${console} root=\${mmcroot} rootfs
uenvcmd=run loadfiles; run mmcargs; bootz
\$
{loadaddr}
\$
{initrd_addr}:
\$
{initrd_size}
\$
{fdtaddr}
EOF
mkdir
-p
/boot/dtbs
cp
/usr/lib/linux-image-
*
-armmp
/
*
/boot/dtbs
mkdir
-p
/boot/dtbs
cp
/usr/lib/linux-image-
*
-armmp
/
*
/boot/dtbs
}
beaglebone_flash
()
{
# allow flash-kernel to work without valid /proc contents
# ** this doesn't *really* work, since there are too many checks
# that fail in an emulated environment! We'll have to do it by
# hand below anyway...
export
FK_MACHINE
=
"TI AM335x BeagleBone"
apt-get
install
-y
flash-kernel
# allow flash-kernel to work without valid /proc contents
# ** this doesn't *really* work, since there are too many checks
# that fail in an emulated environment! We'll have to do it by
# hand below anyway...
export
FK_MACHINE
=
"TI AM335x BeagleBone"
apt-get
install
-y
flash-kernel
}
beaglebone_repack_kernel
()
{
# process installed kernel to create uImage, uInitrd, dtb
# using flash-kernel would be a good approach, except it fails in the
# cross build environment due to too many environment checks...
#FK_MACHINE="TI AM335x BeagleBone" flash-kernel
# so, let's do it manually...
# flash-kernel's hook-functions provided to mkinitramfs have the
# unfortunate side-effect of creating /conf/param.conf in the initrd
# when run from our emulated chroot environment, which means our root=
# on the kernel command line is completely ignored! repack the initrd
# to remove this evil...
echo
"info: repacking beaglebone kernel and initrd"
kernelVersion
=
$(
ls
/usr/lib/
*
/am335x-boneblack.dtb |
head
-1
|
cut
-d
/
-f4
)
version
=
$(
echo
$kernelVersion
|
sed
's/linux-image-\(.*\)/\1/'
)
initRd
=
initrd.img-
$version
vmlinuz
=
vmlinuz-
$version
mkdir
/tmp/initrd-repack
(
cd
/tmp/initrd-repack
;
\
zcat /boot/
$initRd
| cpio
-i
;
\
rm
-f
conf/param.conf
;
\
find
.
| cpio
--quiet
-o
-H
newc |
\
gzip
-9
>
/boot/
$initRd
)
rm
-rf
/tmp/initrd-repack
(
cd
/boot
;
\
cp
/usr/lib/
$kernelVersion
/am335x-boneblack.dtb dtb
;
\
cat
$vmlinuz
dtb
>>
temp-kernel
;
\
mkimage
-A
arm
-O
linux
-T
kernel
-n
"Debian kernel
${
version
}
"
\
-C
none
-a
0x80200000
-e
0x80200000
-d
temp-kernel uImage
;
\
rm
-f
temp-kernel
;
\
mkimage
-A
arm
-O
linux
-T
ramdisk
-C
gzip
-a
0x81000000
-e
0x81000000
\
-n
"Debian ramdisk
${
version
}
"
\
-d
$initRd
uInitrd
)
# process installed kernel to create uImage, uInitrd, dtb
# using flash-kernel would be a good approach, except it fails in the
# cross build environment due to too many environment checks...
#FK_MACHINE="TI AM335x BeagleBone" flash-kernel
# so, let's do it manually...
# flash-kernel's hook-functions provided to mkinitramfs have the
# unfortunate side-effect of creating /conf/param.conf in the initrd
# when run from our emulated chroot environment, which means our root=
# on the kernel command line is completely ignored! repack the initrd
# to remove this evil...
echo
"info: repacking beaglebone kernel and initrd"
kernelVersion
=
$(
ls
/usr/lib/
*
/am335x-boneblack.dtb |
head
-1
|
cut
-d
/
-f4
)
version
=
$(
echo
$kernelVersion
|
sed
's/linux-image-\(.*\)/\1/'
)
initRd
=
initrd.img-
$version
vmlinuz
=
vmlinuz-
$version
mkdir
/tmp/initrd-repack
(
cd
/tmp/initrd-repack
;
\
zcat /boot/
$initRd
| cpio
-i
;
\
rm
-f
conf/param.conf
;
\
find
.
| cpio
--quiet
-o
-H
newc |
\
gzip
-9
>
/boot/
$initRd
)
rm
-rf
/tmp/initrd-repack
(
cd
/boot
;
\
cp
/usr/lib/
$kernelVersion
/am335x-boneblack.dtb dtb
;
\
cat
$vmlinuz
dtb
>>
temp-kernel
;
\
mkimage
-A
arm
-O
linux
-T
kernel
-n
"Debian kernel
${
version
}
"
\
-C
none
-a
0x80200000
-e
0x80200000
-d
temp-kernel uImage
;
\
rm
-f
temp-kernel
;
\
mkimage
-A
arm
-O
linux
-T
ramdisk
-C
gzip
-a
0x81000000
-e
0x81000000
\
-n
"Debian ramdisk
${
version
}
"
\
-d
$initRd
uInitrd
)
}
odroidc2_setup_boot
()
{
dtb
=
"
$1
"
# Setup uEnv.txt
if
grep
-q
btrfs /etc/fstab
;
then
fstype
=
btrfs
else
fstype
=
ext4
fi
kernelVersion
=
$(
ls
/usr/lib/
*
/
${
dtb
}
.dtb |
head
-1
|
cut
-d
/
-f4
)
version
=
$(
echo
$kernelVersion
|
sed
's/linux-image-\(.*\)/\1/'
)
initRd
=
initrd.img-
$version
vmlinuz
=
vmlinuz-
$version
# based on http://odroid.com/dokuwiki/doku.php?id=en:c2_building_u-boot
cat
>>
/boot/uEnv.txt
<<
EOF
dtb
=
"
$1
"
# Setup uEnv.txt
if
grep
-q
btrfs /etc/fstab
;
then
fstype
=
btrfs
else
fstype
=
ext4
fi
kernelVersion
=
$(
ls
/usr/lib/
*
/
${
dtb
}
.dtb |
head
-1
|
cut
-d
/
-f4
)
version
=
$(
echo
$kernelVersion
|
sed
's/linux-image-\(.*\)/\1/'
)
initRd
=
initrd.img-
$version
vmlinuz
=
vmlinuz-
$version
# based on http://odroid.com/dokuwiki/doku.php?id=en:c2_building_u-boot
cat
>>
/boot/uEnv.txt
<<
EOF
mmcroot=/dev/mmcblk0p2 ro
mmcrootfstype=
$fstype
rootwait fixrtc
mmcrootflags=subvol=@
...
...
@@ -178,26 +178,26 @@ mmcargs=setenv bootargs rootwait rw console=tty0 console=\${console} root=\${mmc
uenvcmd=run loadfiles; run mmcargs; booti
\$
{loadaddr}
\$
{initrd_addr}:
\$
{initrd_size}
\$
{fdtaddr}
EOF
mkdir
-p
/boot/dtbs
cp
/usr/lib/linux-image-
*
-armmp
/
*
/boot/dtbs
mkdir
-p
/boot/dtbs
cp
/usr/lib/linux-image-
*
-armmp
/
*
/boot/dtbs
}
a20_setup_boot
()
{
dtb
=
"
$1
"
# Setup boot.cmd
if
grep
-q
btrfs /etc/fstab
;
then
fstype
=
btrfs
else
fstype
=
ext4
fi
kernelVersion
=
$(
ls
/usr/lib/
*
/
$dtb
|
head
-1
|
cut
-d
/
-f4
)
version
=
$(
echo
$kernelVersion
|
sed
's/linux-image-\(.*\)/\1/'
)
initRd
=
initrd.img-
$version
vmlinuz
=
vmlinuz-
$version
# Create boot.cmd
cat
>>
/boot/boot.cmd
<<
EOF
dtb
=
"
$1
"
# Setup boot.cmd
if
grep
-q
btrfs /etc/fstab
;
then
fstype
=
btrfs
else
fstype
=
ext4
fi
kernelVersion
=
$(
ls
/usr/lib/
*
/
$dtb
|
head
-1
|
cut
-d
/
-f4
)
version
=
$(
echo
$kernelVersion
|
sed
's/linux-image-\(.*\)/\1/'
)
initRd
=
initrd.img-
$version
vmlinuz
=
vmlinuz-
$version
# Create boot.cmd
cat
>>
/boot/boot.cmd
<<
EOF
setenv mmcdev 0
setenv mmcpart 1
...
...
@@ -228,46 +228,46 @@ setenv mmcargs setenv bootargs console=\${console} root=\${mmcroot} rootfstype=\
run loadfiles; run mmcargs; bootz
\$
{loadaddr}
\$
{initrd_addr}:
\$
{initrd_size}
\$
{fdtaddr}
EOF
# boot.scr for Allwinner A20 based device
mkimage
-C
none
-A
arm
-T
script
-d
/boot/boot.cmd /boot/boot.scr
# boot.scr for Allwinner A20 based device
mkimage
-C
none
-A
arm
-T
script
-d
/boot/boot.cmd /boot/boot.scr
# Copy all DTBs
mkdir
-p
/boot/dtbs
cp
/usr/lib/
$kernelVersion
/
*
/boot/dtbs
# Copy all DTBs
mkdir
-p
/boot/dtbs
cp
/usr/lib/
$kernelVersion
/
*
/boot/dtbs
# extra boot modules
echo
"rtc_sunxi"
>>
/etc/initramfs-tools/modules
# extra boot modules
echo
"rtc_sunxi"
>>
/etc/initramfs-tools/modules
}
case
"
$MACHINE
"
in
beaglebone
)
beaglebone_setup_boot
beaglebone_flash
beaglebone_repack_kernel
enable_serial_console ttyO0
;;
odroid-c2
)
odroidc2_setup_boot meson64_odroidc2
enable_serial_console ttyO0
;;
cubietruck
)
a20_setup_boot sun7i-a20-cubietruck.dtb
enable_serial_console ttyS0
;;
a20-olinuxino-lime
)
a20_setup_boot sun7i-a20-olinuxino-lime.dtb
enable_serial_console ttyS0
;;
a20-olinuxino-lime2
)
a20_setup_boot sun7i-a20-olinuxino-lime2.dtb
enable_serial_console ttyS0
;;
a20-olinuxino-micro
)
a20_setup_boot sun7i-a20-olinuxino-micro.dtb
enable_serial_console ttyS0
;;
cubieboard2
)
a20_setup_boot sun7i-a20-cubieboard2.dtb
enable_serial_console ttyS0
;;
beaglebone
)
beaglebone_setup_boot
beaglebone_flash
beaglebone_repack_kernel
enable_serial_console ttyO0
;;
odroid-c2
)
odroidc2_setup_boot meson64_odroidc2
enable_serial_console ttyO0
;;
cubietruck
)
a20_setup_boot sun7i-a20-cubietruck.dtb
enable_serial_console ttyS0
;;
a20-olinuxino-lime
)
a20_setup_boot sun7i-a20-olinuxino-lime.dtb
enable_serial_console ttyS0
;;
a20-olinuxino-lime2
)
a20_setup_boot sun7i-a20-olinuxino-lime2.dtb
enable_serial_console ttyS0
;;
a20-olinuxino-micro
)
a20_setup_boot sun7i-a20-olinuxino-micro.dtb
enable_serial_console ttyS0
;;
cubieboard2
)
a20_setup_boot sun7i-a20-cubieboard2.dtb
enable_serial_console ttyS0
;;
esac
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