Skip to content

Commit

Permalink
Fix Vagrant Box, add more details into generated debian package, ...
Browse files Browse the repository at this point in the history
  • Loading branch information
molejar committed Apr 27, 2017
1 parent 0d15e5e commit 29567df
Show file tree
Hide file tree
Showing 9 changed files with 43 additions and 31 deletions.
4 changes: 2 additions & 2 deletions Vagrantfile
Original file line number Diff line number Diff line change
Expand Up @@ -131,7 +131,7 @@ Vagrant.configure(2) do |config|
# Use Vagrant-provided SSH private keys (don't use any keys stored in ssh-agent, default: true).
config.ssh.keys_only = true
# Use agent forwarding over SSH connections (default: false).
config.ssh.forward_agent = false
config.ssh.forward_agent = true
# Use X11 forwarding over SSH connections (default: false).
config.ssh.forward_x11 = false

Expand Down Expand Up @@ -312,7 +312,7 @@ Vagrant.configure(2) do |config|
:tftpdir => "/srv/tftp",
:username => vconfig['vm_username'],
:userpass => vconfig['vm_userpass'],
:emlinux_tools_deb => "#{guest_project_dir}/dpkg/emlinux-tools_1.0-1_all.deb",
:emlinux_tools_deb => "#{guest_project_dir}/dpkg/emlinux-tools*.deb",
:emlinux_tools_install => "#{guest_project_dir}/install.sh"
}

Expand Down
2 changes: 1 addition & 1 deletion default.conf
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ vm_userpass: "ubuntu"

# VM Host Name and Machine Name (if machine name not defined will used same as hostname)
vm_hostname: "emlinux"
#vm_machname: "{{ vm_hostname }}"
vm_machname: "emlinux"

# ***********************************************************************************************
# Networks
Expand Down
Binary file added dpkg/emlinux-tools_0.1.0_all.deb
Binary file not shown.
Binary file removed dpkg/emlinux-tools_1.0-1_all.deb
Binary file not shown.
44 changes: 26 additions & 18 deletions install.sh
Original file line number Diff line number Diff line change
Expand Up @@ -6,10 +6,13 @@
ROOT_DIR=$(dirname $(realpath $0))
. $ROOT_DIR/scripts/functions


EMLINUX_VERSION="0.1.0"

data_for_dpkg() {
# debian/changelog file
cat << EOF > ${1}/changelog
emlinux-tools (1.0-1) UNRELEASED; urgency=medium
emlinux-tools ($EMLINUX_VERSION) UNRELEASED; urgency=medium
* Initial release. (Closes: #XXXXXX)
Expand All @@ -18,19 +21,23 @@ EOF

# debian/control file
cat << EOF > ${1}/control
Source: emlinux-tools
Section: utils
Priority: optional
Source: emlinux-tools
Maintainer: Martin Olejar
Standards-Version: 0.1.0
Section: Utils
Priority: optional
Standards-Version: $EMLINUX_VERSION
Build-Depends:
Homepage: https://github.com/molejar/emLinux
Package: emlinux-tools
Section: utils
Priority: optional
Architecture: all
Section: Utils
Priority: optional
Essential: no
Description: Automatization tools for embedded Linux development
Depends: build-essential, u-boot-tools, qemu-user-static, binfmt-support, debootstrap, binutils, parted, git, lzop, gzip, zip
Description: Automatization tools for embedded Linux development.
This package include a collection of useful commands for compiling toolchain, u-boot, kernel, rootfs and generating bootable image.
More details you can found here: https://github.com/molejar/emLinux
EOF

# debian/copyright file
Expand Down Expand Up @@ -87,7 +94,7 @@ EOF
echo "9" > ${1}/compat

# debian/install file
echo "scripts/* usr/bin" > ${1}/install
echo "scripts/* /sbin" > ${1}/install
}

usage() {
Expand Down Expand Up @@ -143,26 +150,27 @@ if [ "$param_release" = "true" ]; then
echo " Building Debian package, please wait"
echo

[ -d $ROOT_DIR/dpkg/tmp ] && rm -rf $ROOT_DIR/dpkg/tmp
mkdir -p $ROOT_DIR/dpkg/tmp/pkg/debian
TMP_DIR=$(mktemp -d)

data_for_dpkg "$ROOT_DIR/dpkg/tmp/pkg/debian"
cp -Rf $ROOT_DIR/scripts $ROOT_DIR/dpkg/tmp/pkg
cd $ROOT_DIR/dpkg/tmp/pkg
mkdir -p $TMP_DIR/emlinux-tools-${EMLINUX_VERSION}/debian

data_for_dpkg "$TMP_DIR/emlinux-tools-${EMLINUX_VERSION}/debian"
cp -Rf $ROOT_DIR/scripts $TMP_DIR/emlinux-tools-${EMLINUX_VERSION}
cd $TMP_DIR/emlinux-tools-${EMLINUX_VERSION}
chmod a+x scripts/build*

export LC_ALL=C
dpkg-buildpackage -uc -us
cp $ROOT_DIR/dpkg/tmp/*.deb $ROOT_DIR/dpkg

cp $TMP_DIR/*.deb $ROOT_DIR/dpkg
cd $CWD
rm -rf $ROOT_DIR/dpkg/tmp
rm -rf $TMPDIR

echo
echo " Output: $ROOT_DIR/dpkg/$(ls $ROOT_DIR/dpkg)"
echo
else
PACKAGES=$(ls $ROOT_DIR/scripts | grep "build")
cd /usr/bin
cd /sbin

if [ -z $param_uninstall ]; then
for PKG in $PACKAGES; do
Expand Down
5 changes: 3 additions & 2 deletions local.conf
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,8 @@

# Vagrant Box type:
# Can be set to debian/jessie64, ubuntu/xenial64, bento/ubuntu-16.04, oar-team/debian8 and etc.
#vagrant_box: "debian/jessie64"
vagrant_box: "ubuntu/xenial64"

# VM Host Name and Machine Name (if machine name not defined will used same as hostname)
vm_hostname: "emlinux02"
vm_hostname: "emlinux02"
vm_machname: "emlinux02"
9 changes: 5 additions & 4 deletions scripts/build_kernel
Original file line number Diff line number Diff line change
Expand Up @@ -113,19 +113,20 @@ if [ ! -z ${param_btool} ]; then
fi
# search for internal toolchain if not explicitly specified
if [ -z $CROSS_COMPILER ]; then
echo "[INFO ] Searching Toolchain ... please wait !"
echo "[INFO ] Searching Compiler ... please wait !"
find_toolchain "/opt /usr/bin /usr/sbin $HOME"
if [ -z $RET_VALUE ]; then
CROSS_COMPILER=$RET_VALUE
if [ -z $CROSS_COMPILER ]; then
eprint "Toolchain not installed, please run \"build_toolchain\" first"
exit 1
else
echo "[INFO ] Used Compiler: ${CROSS_COMPILER}gcc"
fi
CROSS_COMPILER=$RET_VALUE
fi

# Default Kernel repos
if [ -z $KERNEL_URLS ]; then
KERNEL_URLS=('http://sw-stash.freescale.net/scm/imx/linux-2.6-imx.git'
'git://git.freescale.com/imx/linux-2.6-imx.git'
'git://git.freescale.com/imx/linux-imx.git'
'https://github.com/Freescale/linux-fslc'
'https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux-stable.git')
Expand Down
2 changes: 1 addition & 1 deletion scripts/build_rootfs
Original file line number Diff line number Diff line change
Expand Up @@ -434,7 +434,7 @@ auto lo
iface lo inet loopback
# The primary network interface
#allow-hotplug eth0
allow-hotplug ${ROOTFS_ETHDEV}
auto ${ROOTFS_ETHDEV}
iface ${ROOTFS_ETHDEV} inet dhcp
EOM
Expand Down
8 changes: 5 additions & 3 deletions scripts/build_uboot
Original file line number Diff line number Diff line change
Expand Up @@ -109,13 +109,15 @@ if [ ! -z ${param_btool} ]; then
fi
# search for internal toolchain if not explicitly specified
if [ -z $CROSS_COMPILER ]; then
echo "[INFO ] Searching Toolchain ... please wait !"
echo "[INFO ] Searching Compiler ... please wait !"
find_toolchain "/opt /usr/bin /usr/sbin $HOME"
if [ -z $RET_VALUE ]; then
CROSS_COMPILER=$RET_VALUE
if [ -z $CROSS_COMPILER ]; then
eprint "Toolchain not installed, please run \"build_toolchain\" first"
exit 1
else
echo "[INFO ] Used Compiler: ${CROSS_COMPILER}gcc"
fi
CROSS_COMPILER=$RET_VALUE
fi

# Default U-Boot repos
Expand Down

0 comments on commit 29567df

Please sign in to comment.