Forum | Documentation | Website | Blog

Skip to content
Snippets Groups Projects
Commit ee69b1cf authored by Robert Nelson's avatar Robert Nelson
Browse files

RootStock-NG: install kernel deb


Signed-off-by: default avatarRobert Nelson <robertcnelson@gmail.com>
parent fa15e484
Branches
Tags
No related merge requests found
...@@ -47,6 +47,13 @@ base_pkg_list="${base_pkg_list} apache2 openssh-server" ...@@ -47,6 +47,13 @@ base_pkg_list="${base_pkg_list} apache2 openssh-server"
base_pkg_list="${base_pkg_list} wireless-tools wpasupplicant" base_pkg_list="${base_pkg_list} wireless-tools wpasupplicant"
run_project () { run_project () {
#Mininum:
#linux-image*.deb
#Optional:
#3.7.6-x8-dtbs.tar.gz
#3.7.6-x8-firmware.tar.gz
chroot_KERNEL_HTTP_DIR="http://rcn-ee.net/deb/${release}-${dpkg_arch}/v3.7.6-x8/"
tempdir=$(mktemp -d) tempdir=$(mktemp -d)
cat > ${DIR}/.project <<-__EOF__ cat > ${DIR}/.project <<-__EOF__
...@@ -62,6 +69,8 @@ run_project () { ...@@ -62,6 +69,8 @@ run_project () {
chroot_ENABLE_FIRMWARE="${chroot_ENABLE_FIRMWARE}" chroot_ENABLE_FIRMWARE="${chroot_ENABLE_FIRMWARE}"
chroot_ENABLE_DEB_SRC="${chroot_ENABLE_DEB_SRC}" chroot_ENABLE_DEB_SRC="${chroot_ENABLE_DEB_SRC}"
chroot_KERNEL_HTTP_DIR="${chroot_KERNEL_HTTP_DIR}"
__EOF__ __EOF__
/bin/bash -e "${DIR}/scripts/install_dependencies.sh" || { exit 1 ; } /bin/bash -e "${DIR}/scripts/install_dependencies.sh" || { exit 1 ; }
......
...@@ -209,6 +209,25 @@ cat > ${DIR}/chroot_script.sh <<-__EOF__ ...@@ -209,6 +209,25 @@ cat > ${DIR}/chroot_script.sh <<-__EOF__
cd - cd -
} }
dl_kernel () {
wget --directory-prefix=/tmp/ \${kernel_url}
actual_deb_file=\$(cat /tmp/index.html | grep linux-image)
actual_deb_file=\$(echo \${actual_deb_file} | awk -F ".deb" '{print \$1}')
actual_deb_file=\${actual_deb_file##*linux-image-}
kernel_version=\$(echo \${actual_deb_file} | awk -F "_" '{print \$1}')
echo "Log: Using: \${kernel_version}"
actual_deb_file="linux-image-\${actual_deb_file}.deb"
wget --directory-prefix=/tmp/ \${kernel_url}\${actual_deb_file}
dpkg -x /tmp/\${actual_deb_file} /
depmod \${kernel_version}
update-initramfs -c -k \${kernel_version}
}
cleanup () { cleanup () {
if [ -f /etc/apt/apt.conf ] ; then if [ -f /etc/apt/apt.conf ] ; then
rm -rf /etc/apt/apt.conf || true rm -rf /etc/apt/apt.conf || true
...@@ -244,6 +263,26 @@ cat > ${DIR}/chroot_script.sh <<-__EOF__ ...@@ -244,6 +263,26 @@ cat > ${DIR}/chroot_script.sh <<-__EOF__
dl_pkg_src dl_pkg_src
fi fi
if [ "${chroot_KERNEL_HTTP_DIR}" ] ; then
unset deb_pkgs
dpkg -l | grep wget >/dev/null || deb_pkgs="wget "
if [ "\${deb_pkgs}" ] ; then
apt-get -y --force-yes install \${deb_pkgs}
fi
unset deb_pkgs
dpkg -l | grep initramfs-tools >/dev/null || deb_pkgs="initramfs-tools "
if [ "\${deb_pkgs}" ] ; then
apt-get -y --force-yes install \${deb_pkgs}
fi
kernel_url="${chroot_KERNEL_HTTP_DIR}"
dl_kernel
fi
cleanup cleanup
rm -f /chroot_script.sh || true rm -f /chroot_script.sh || true
__EOF__ __EOF__
...@@ -252,6 +291,15 @@ sudo mv ${DIR}/chroot_script.sh ${tempdir}/chroot_script.sh ...@@ -252,6 +291,15 @@ sudo mv ${DIR}/chroot_script.sh ${tempdir}/chroot_script.sh
chroot_mount chroot_mount
sudo chroot ${tempdir} /bin/sh chroot_script.sh sudo chroot ${tempdir} /bin/sh chroot_script.sh
if ls ${tempdir}/boot/vmlinuz-* >/dev/null 2>&1 ; then
sudo cp -v ${tempdir}/boot/vmlinuz-* ${DIR}/
fi
if ls ${tempdir}/boot/initrd.img-* >/dev/null 2>&1;then
sudo cp -v ${tempdir}/boot/initrd.img-* ${DIR}/
fi
report_size report_size
chroot_umount chroot_umount
......
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment