Commit 177ae8c4 authored by Igor Pecovnik's avatar Igor Pecovnik
Browse files

Improved sources handling: decompress and prepare for onboard compilation

parent 2691d038
...@@ -164,6 +164,7 @@ function jobs () ...@@ -164,6 +164,7 @@ function jobs ()
fi fi
if [[ -n $(dpkg -l | grep linux-headers) ]]; then if [[ -n $(dpkg -l | grep linux-headers) ]]; then
debconf-apt-progress -- apt-get -y purge ${REMOVE_PKG} debconf-apt-progress -- apt-get -y purge ${REMOVE_PKG}
rm -rf /usr/src/linux-headers*
else else
debconf-apt-progress -- apt-get -y install ${INSTALL_PKG} debconf-apt-progress -- apt-get -y install ${INSTALL_PKG}
fi fi
...@@ -180,13 +181,19 @@ function jobs () ...@@ -180,13 +181,19 @@ function jobs ()
# #
"Source" ) "Source" )
if ! is_package_manager_running; then if ! is_package_manager_running; then
PACKAGE=$(echo "$SOURCE_PKG" | sed "s/-next//" | sed "s/-dev//" | sed "s/-default//")
if [[ -n $(dpkg -l | grep $SOURCE_PKG) ]]; then if [[ -n $(dpkg -l | grep $SOURCE_PKG) ]]; then
debconf-apt-progress -- apt-get -y purge ${SOURCE_PKG} debconf-apt-progress -- apt-get -y purge linux-source*
# cleanup # cleanup
debconf-apt-progress -- apt -y autoremove debconf-apt-progress -- apt -y autoremove
rm -r /usr/src/linux-source*
else else
debconf-apt-progress -- apt-get -y install ${SOURCE_PKG} debconf-apt-progress -- apt-get -y install ${SOURCE_PKG}
dialog --colors --backtitle "$BACKTITLE" --no-collapse --title " Kernel source " --clear --msgbox "\nYou will find compressed kernel source and configuration in /usr/src" 7 72 mkdir -p /usr/src/$PACKAGE
(pv -n /usr/src/$PACKAGE".tar.xz" | xz -d -T0 - | tar xf - -C /usr/src/$PACKAGE ) 2>&1 | dialog --colors --backtitle "$BACKTITLE" --title " Please wait! " --gauge "\nDecompressing kernel sources to /usr/src/$PACKAGE" 8 80
xz -d /usr/src/*config.xz --stdout > /usr/src/$PACKAGE/.config
rm /usr/src/$PACKAGE".tar.xz" /usr/src/*config.xz
dialog --colors --backtitle "$BACKTITLE" --no-collapse --title " Kernel source " --clear --msgbox "\nYou will find pre-configured kernel sources in /usr/src/$PACKAGE" 7 72
fi fi
fi fi
;; ;;
......
...@@ -354,7 +354,7 @@ while true; do ...@@ -354,7 +354,7 @@ while true; do
if [[ -n $(dpkg -l | grep linux-headers) ]]; then LIST+=( "Headers" "Remove kernel headers" ); else \ if [[ -n $(dpkg -l | grep linux-headers) ]]; then LIST+=( "Headers" "Remove kernel headers" ); else \
LIST+=( "Headers" "Install kernel headers" ); fi LIST+=( "Headers" "Install kernel headers" ); fi
SOURCE_PKG=$(apt-cache --names-only search ^linux-source-* | awk '{ print $1 }' | grep ${BRANCH}-${LINUXFAMILY} | tail -1) SOURCE_PKG=$(apt-cache --names-only search ^linux-source-* | awk '{ print $1 }' | grep ${BRANCH}-${LINUXFAMILY} | head -1)
if [[ -n $SOURCE_PKG ]]; then if [[ -n $SOURCE_PKG ]]; then
if [[ -n $(dpkg -l | grep $SOURCE_PKG) ]]; then LIST+=( "Source" "Remove kernel source" ); else \ if [[ -n $(dpkg -l | grep $SOURCE_PKG) ]]; then LIST+=( "Source" "Remove kernel source" ); else \
LIST+=( "Source" "Install kernel source" ); fi LIST+=( "Source" "Install kernel source" ); fi
......
Markdown is supported
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