Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

scripts/mkimage: create disk image without sudo #4701

Merged
merged 1 commit into from
Feb 20, 2016
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
20 changes: 20 additions & 0 deletions packages/sysutils/e2fsprogs/package.mk
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,10 @@ if [ "$HFSTOOLS" = "yes" ]; then
PKG_DEPENDS_TARGET="$PKG_DEPENDS_TARGET diskdev_cmds"
fi

PKG_CONFIGURE_OPTS_HOST="--prefix=/usr \
--bindir=/bin \
--sbindir=/sbin"

PKG_CONFIGURE_OPTS_TARGET="BUILD_CC=$HOST_CC \
--prefix=/usr \
--bindir=/bin \
Expand Down Expand Up @@ -96,3 +100,19 @@ makeinstall_init() {
ln -sf mke2fs $INSTALL/sbin/mkfs.ext4dev
fi
}

make_host() {
make -C lib/et
make -C lib/ext2fs
}

makeinstall_host() {
make -C lib/et DESTDIR=$(pwd)/.install install
make -C lib/ext2fs DESTDIR=$(pwd)/.install install

rm -fr $(pwd)/.install/bin
rm -fr $(pwd)/.install/usr/share

cp -Pa $(pwd)/.install/usr/* $ROOT/$TOOLCHAIN
}

40 changes: 40 additions & 0 deletions packages/tools/mtools/package.mk
Original file line number Diff line number Diff line change
@@ -0,0 +1,40 @@
################################################################################
# This file is part of OpenELEC - http://www.openelec.tv
# Copyright (C) 2009-2016 Stephan Raue (stephan@openelec.tv)
#
# OpenELEC is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 2 of the License, or
# (at your option) any later version.
#
# OpenELEC is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with OpenELEC. If not, see <http://www.gnu.org/licenses/>.
################################################################################

PKG_NAME="mtools"
PKG_VERSION="4.0.18"
PKG_REV="1"
PKG_ARCH="any"
PKG_LICENSE="GPL"
PKG_SITE="http://www.gnu.org/software/mtools/"
PKG_URL="ftp://ftp.gnu.org/gnu/$PKG_NAME/$PKG_NAME-$PKG_VERSION.tar.bz2"
PKG_DEPENDS_HOST=""
PKG_PRIORITY="optional"
PKG_SECTION="tools"
PKG_SHORTDESC="mtools: A collection of utilities to access MS-DOS disks"
PKG_LONGDESC="mtools: A collection of utilities to access MS-DOS disks"
PKG_IS_ADDON="no"
PKG_AUTORECONF="no"
PKG_AUTORECONF="yes"

makeinstall_host() {
$STRIP mtools

mkdir -p $ROOT/$TOOLCHAIN/sbin
cp -P mtools mformat mcopy mmd $ROOT/$TOOLCHAIN/sbin
}
43 changes: 43 additions & 0 deletions packages/tools/populatefs/package.mk
Original file line number Diff line number Diff line change
@@ -0,0 +1,43 @@
################################################################################
# This file is part of OpenELEC - http://www.openelec.tv
# Copyright (C) 2009-2016 Stephan Raue (stephan@openelec.tv)
#
# OpenELEC is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 2 of the License, or
# (at your option) any later version.
#
# OpenELEC is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with OpenELEC. If not, see <http://www.gnu.org/licenses/>.
################################################################################

PKG_NAME="populatefs"
PKG_VERSION="95cc98b"
PKG_REV="1"
PKG_ARCH="any"
PKG_LICENSE="GPL"
PKG_SITE="https://github.com/oskarirauta/populatefs"
PKG_URL="$DISTRO_SRC/$PKG_NAME-$PKG_VERSION.tar.xz"
PKG_DEPENDS_HOST="e2fsprogs:host"
PKG_PRIORITY="optional"
PKG_SECTION="tools"
PKG_SHORTDESC="populatefs: Tool for replacing genext2fs when creating ext4 images"
PKG_LONGDESC="populatefs: Tool for replacing genext2fs when creating ext4 images"
PKG_IS_ADDON="no"
PKG_AUTORECONF="no"

make_host() {
make EXTRA_LIBS="-lcom_err -lpthread" CFLAGS="$CFLAGS -fPIC"
}

makeinstall_host() {
$STRIP src/populatefs

mkdir -p $ROOT/$TOOLCHAIN/sbin
cp src/populatefs $ROOT/$TOOLCHAIN/sbin
}
1 change: 1 addition & 0 deletions packages/tools/syslinux/package.mk
Original file line number Diff line number Diff line change
Expand Up @@ -72,6 +72,7 @@ makeinstall_host() {
mkdir -p $ROOT/$TOOLCHAIN/bin
cp bios/extlinux/extlinux $ROOT/$TOOLCHAIN/bin
cp bios/linux/syslinux $ROOT/$TOOLCHAIN/bin
cp bios/mtools/syslinux $ROOT/$TOOLCHAIN/bin/syslinux.mtools

mkdir -p $ROOT/$TOOLCHAIN/share/syslinux
cp bios/mbr/mbr.bin $ROOT/$TOOLCHAIN/share/syslinux
Expand Down
6 changes: 3 additions & 3 deletions scripts/image
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,8 @@ $SCRIPTS/build squashfs:host
$SCRIPTS/build dosfstools:host
$SCRIPTS/build fakeroot:host
$SCRIPTS/build kmod:host
$SCRIPTS/build mtools:host
$SCRIPTS/build populatefs:host

BUILD_DATE=`date +%Y%m%d%H%M%S`

Expand Down Expand Up @@ -319,10 +321,8 @@ fi
fi
fi

echo "mkimage: boo. now root access (sudo) is required..."
echo "mkimage: see scripts/image and scripts/mkimage if you dont trust us :)"
# variables used in image script must be passed
sudo env \
env \
PATH="$PATH:/sbin" \
ROOT="$ROOT" \
TOOLCHAIN="$TOOLCHAIN" \
Expand Down
Loading