Skip to content

Commit

Permalink
preserve the existing source folder from git repo, and other minor fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
rogers0 committed Jun 29, 2015
1 parent 2b3213a commit 1112741
Show file tree
Hide file tree
Showing 5 changed files with 54 additions and 20 deletions.
26 changes: 17 additions & 9 deletions arm-soc_jessie/1_chroot_get-source.sh
Original file line number Diff line number Diff line change
Expand Up @@ -19,16 +19,24 @@ fi

# real script to run in chroot environment

if [ ! -d $KERNEL_PATH ]; then
mkdir $KERNEL_PATH
cd $_
git init
git svn --prefix=svn/ init -T dists/sid/linux -t releases/linux svn://svn.debian.org/kernel
# r21785 is release of 3.16.2-1. Refer: http://anonscm.debian.org/viewvc/kernel/releases/linux/
git svn fetch -r21785:HEAD
if [ -d "$KERNEL_PATH" ]; then
cd $KERNEL_PATH
git clean -fd
git reset --hard
else
echo git clone -n $GIT_REPO $KERNEL_PATH
git clone -n $GIT_REPO $KERNEL_PATH
cd $KERNEL_PATH
fi
git clean -fd
git reset --hard
git checkout -b $GIT_BRANCH $GIT_TAG || (git checkout --orphan ORPHAN; git branch -D $GIT_BRANCH; git checkout -fb $GIT_BRANCH $GIT_TAG)

echo
echo Example for how to continue in chroot environment:
echo -e \\t./chroot_shell.sh
echo -e \\tpatch -p1 \< patch_...txt
echo -e \\tsed -i \'/^EXTRAVERSION/s/$/.0-kirkwood/\' Makefile
echo -e \\tgit add -u \# add all updated files to index
echo -e \\tgit \#add -A \# add all new files to index to prevent being ereased by \"git clean -fd\" in script 2
echo -e \\tgit diff --cached
echo -e \\tlogout
echo -e \\t./2_chroot_build.sh
Original file line number Diff line number Diff line change
Expand Up @@ -19,21 +19,27 @@ fi

# real script to run in chroot environment

if [ ! -d "$KERNEL_PATH" ]; then
echo no \"$KERNEL_PATH\" path found.
exit
fi
cd $KERNEL_PATH
git clean -fd
touch ../build_begin.txt

export XZ_DEFAULTS=-7 # limit memory usage
LOCAL_INST=../local_install
make ARCH=arm CROSS_COMPILE=arm-linux-gnueabi- mrproper
[ -e ../config ] && cp -a ../config .config
make ARCH=arm CROSS_COMPILE=arm-linux-gnueabi- oldconfig
[ ! -e ../config ] && cp -a .config ../config
make ARCH=arm CROSS_COMPILE=arm-linux-gnueabi- -j$PARALLEL zImage modules 2>&1 | tee log.0_zImage_modules
make ARCH=arm CROSS_COMPILE=arm-linux-gnueabi- dtbs 2>&1 | tee log.1_zImage_modules
make ARCH=arm CROSS_COMPILE=arm-linux-gnueabi- modules_install INSTALL_MOD_PATH=$LOCAL_INST 2>&1 | tee log.2_modules_install
make ARCH=$MAKE_ARCH CROSS_COMPILE=$CROSS_PREFIX mrproper
#[ -e ../config ] && cp -a ../config .config
make ARCH=$MAKE_ARCH CROSS_COMPILE=$CROSS_PREFIX $DEFCONFIG
#[ ! -e ../config ] && cp -a .config ../config
make ARCH=$MAKE_ARCH CROSS_COMPILE=$CROSS_PREFIX -j$PARALLEL zImage modules 2>&1 | tee log.0_zImage_modules
make ARCH=$MAKE_ARCH CROSS_COMPILE=$CROSS_PREFIX dtbs 2>&1 | tee log.1_zImage_modules
make ARCH=$MAKE_ARCH CROSS_COMPILE=$CROSS_PREFIX modules_install INSTALL_MOD_PATH=$LOCAL_INST 2>&1 | tee log.2_modules_install
mkdir -p $LOCAL_INST/boot $LOCAL_INST/dtbs
cp -a arch/arm/boot/zImage $LOCAL_INST/boot/vmlinuz-`cat include/config/kernel.release`
cp -a .config $LOCAL_INST/boot/config-`cat include/config/kernel.release`
cp -a System.map $LOCAL_INST/boot/System.map-`cat include/config/kernel.release`
cp -a arch/arm/boot/dts/*.dtb $LOCAL_INST/dtbs/

touch ../build_end_binary.txt
3 changes: 3 additions & 0 deletions arm-soc_jessie/config
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,9 @@ CHROOT=/data/${DISTRO}-kernel_rootfs
NORMALUSER=crossbuild
NORMALUSER_UID=2000
HOST_ARCH=armel
MAKE_ARCH=arm
DEFCONFIG=defconfig
CROSS_PREFIX=arm-linux-gnueabi-
PARALLEL=20
MIRROR=http://cdn.debian.net/debian
MIRROR=http://debian-mirror.sakura.ne.jp/debian
Expand Down
1 change: 1 addition & 0 deletions jessie/0_mkchroot.sh
Original file line number Diff line number Diff line change
Expand Up @@ -48,6 +48,7 @@ elif [ "$1" = "chrooted" ]; then
fi
echo aptitude install -y $CROSS_DEB
aptitude install -y $CROSS_DEB
aptitude install -yr git-email ca-certificates
aptitude clean

useradd -b / -ms /bin/bash -u $NORMALUSER_UID $NORMALUSER
Expand Down
24 changes: 20 additions & 4 deletions squeeze/1_chroot_get-source.sh
Original file line number Diff line number Diff line change
Expand Up @@ -19,9 +19,25 @@ fi

# real script to run in chroot environment

[ ! -d $KERNEL_PATH ] && git clone -n $GIT_REPO $KERNEL_PATH
cd $KERNEL_PATH
git clean -fd
git reset --hard
if [ -d "$KERNEL_PATH" ]; then
cd $KERNEL_PATH
git clean -fd
git reset --hard
else
echo git clone -n $GIT_REPO $KERNEL_PATH
git clone -n $GIT_REPO $KERNEL_PATH
cd $KERNEL_PATH
fi
git checkout -b $GIT_BRANCH $GIT_TAG || (git checkout --orphan ORPHAN; git branch -D $GIT_BRANCH; git checkout -fb $GIT_BRANCH $GIT_TAG)
(cd ..; [ -n "$KERNEL_SRC" ] && wget -nv -c $MIRROR/pool/main/l/linux-2.6/${KERNEL_SRC})

echo
echo Example for how to continue in chroot environment:
echo -e \\t./chroot_shell.sh
echo -e \\tpatch -p1 \< patch_...txt
echo -e \\tsed -i \'/^EXTRAVERSION/s/$/.0-kirkwood/\' Makefile
echo -e \\tgit add -u \# add all updated files to index
echo -e \\tgit \#add -A \# add all new files to index to prevent being ereased by \"git clean -fd\" in script 2
echo -e \\tgit diff --cached
echo -e \\tlogout
echo -e \\t./2_chroot_build.sh

0 comments on commit 1112741

Please sign in to comment.