From b6101b8d635efcf4720fade6b67f22e7ad466c9f Mon Sep 17 00:00:00 2001 From: Marcin Juszkiewicz Date: Mon, 21 May 2012 21:53:14 +0200 Subject: hooks: change symlinks to relative, move sysroot to binary/libc --- .../hooks/50-remove-gcc-related-packages.binary | 10 ++++++++++ .../hooks/60-remove_not_needed.binary | 5 ++--- .../hooks/65-remove-gcc-related-packages.binary | 3 --- .../hooks/70-kill_all_symlinks.binary | 11 ----------- .../hooks/90-change-symlinks-to-relative.binary | 22 ++++++++++++++++++++++ .../customization/hooks/99-move-to-libc.binary | 6 ++++++ .../hooks/60-remove_not_needed.binary | 13 +++++++++++++ .../hooks/90-change-symlinks-to-relative.binary | 22 ++++++++++++++++++++++ .../hooks/90-remove_not_needed.binary | 13 ------------- .../customization/hooks/99-move-to-libc.binary | 6 ++++++ .../hooks/50-remove-gcc-related-packages.binary | 10 ++++++++++ .../hooks/65-remove-gcc-related-packages.binary | 3 --- .../hooks/70-kill_all_symlinks.binary | 12 ------------ .../hooks/90-change-symlinks-to-relative.binary | 22 ++++++++++++++++++++++ .../customization/hooks/99-move-to-libc.binary | 6 ++++++ .../hooks/50-remove-gcc-related-packages.binary | 10 ++++++++++ .../hooks/60-remove_not_needed.binary | 5 ++--- .../hooks/65-remove-gcc-related-packages.binary | 3 --- .../hooks/70-kill_all_symlinks.binary | 11 ----------- .../hooks/90-change-symlinks-to-relative.binary | 22 ++++++++++++++++++++++ .../customization/hooks/99-move-to-libc.binary | 6 ++++++ 21 files changed, 159 insertions(+), 62 deletions(-) create mode 100755 precise-armhf-alip-dev/customization/hooks/50-remove-gcc-related-packages.binary delete mode 100755 precise-armhf-alip-dev/customization/hooks/65-remove-gcc-related-packages.binary delete mode 100755 precise-armhf-alip-dev/customization/hooks/70-kill_all_symlinks.binary create mode 100755 precise-armhf-alip-dev/customization/hooks/90-change-symlinks-to-relative.binary create mode 100755 precise-armhf-alip-dev/customization/hooks/99-move-to-libc.binary create mode 100755 precise-armhf-libc-dev/customization/hooks/60-remove_not_needed.binary create mode 100755 precise-armhf-libc-dev/customization/hooks/90-change-symlinks-to-relative.binary delete mode 100755 precise-armhf-libc-dev/customization/hooks/90-remove_not_needed.binary create mode 100755 precise-armhf-libc-dev/customization/hooks/99-move-to-libc.binary create mode 100755 precise-armhf-nano-dev/customization/hooks/50-remove-gcc-related-packages.binary delete mode 100755 precise-armhf-nano-dev/customization/hooks/65-remove-gcc-related-packages.binary delete mode 100755 precise-armhf-nano-dev/customization/hooks/70-kill_all_symlinks.binary create mode 100755 precise-armhf-nano-dev/customization/hooks/90-change-symlinks-to-relative.binary create mode 100755 precise-armhf-nano-dev/customization/hooks/99-move-to-libc.binary create mode 100755 precise-armhf-ubuntu-desktop-dev/customization/hooks/50-remove-gcc-related-packages.binary delete mode 100755 precise-armhf-ubuntu-desktop-dev/customization/hooks/65-remove-gcc-related-packages.binary delete mode 100755 precise-armhf-ubuntu-desktop-dev/customization/hooks/70-kill_all_symlinks.binary create mode 100755 precise-armhf-ubuntu-desktop-dev/customization/hooks/90-change-symlinks-to-relative.binary create mode 100755 precise-armhf-ubuntu-desktop-dev/customization/hooks/99-move-to-libc.binary diff --git a/precise-armhf-alip-dev/customization/hooks/50-remove-gcc-related-packages.binary b/precise-armhf-alip-dev/customization/hooks/50-remove-gcc-related-packages.binary new file mode 100755 index 0000000..8d19db6 --- /dev/null +++ b/precise-armhf-alip-dev/customization/hooks/50-remove-gcc-related-packages.binary @@ -0,0 +1,10 @@ +#!/bin/sh + +for pkg in libgcc1 libmudflap0 libmudflap0-4.6-dev libstdc++6 libstdc++6-4.6-dev gcc gcc-4.6 +do + LIST=`sed -e 's+^\/++g' var/lib/dpkg/info/${pkg}.list` + for file in $LIST + do + rm $file + done +done diff --git a/precise-armhf-alip-dev/customization/hooks/60-remove_not_needed.binary b/precise-armhf-alip-dev/customization/hooks/60-remove_not_needed.binary index c7dd7a5..55a7447 100755 --- a/precise-armhf-alip-dev/customization/hooks/60-remove_not_needed.binary +++ b/precise-armhf-alip-dev/customization/hooks/60-remove_not_needed.binary @@ -6,9 +6,8 @@ rm -rf usr/share/{groff,linda,lintian,info,man,perl,locale,fonts,icons,i18n,gtk- boot lib/modules \ lib/firmware dev home lib/init lib/lsb lib/systemd lib/terminfo \ usr/lib/firefox*/searchplugins/common \ - usr/bin/X11 lib64 \ - lib/udev lib/xtables media mnt opt proc root run selinux srv sys tmp -onsoleKit,initramfs-tools,ldscripts,mime,sasl2,ssl,tc,upstart,user-setup,valgrind}\ + etc bin usr/bin sbin usr/sbin var usr/local usr/games lib64 \ + usr/lib/{locale,gnupg,apt,ConsoleKit,initramfs-tools,ldscripts,mime,sasl2,ssl,tc,upstart,user-setup,valgrind}\ lib/udev lib/xtables media mnt opt proc root run selinux srv sys tmp rmdir -p `find . -type d -empty` || true diff --git a/precise-armhf-alip-dev/customization/hooks/65-remove-gcc-related-packages.binary b/precise-armhf-alip-dev/customization/hooks/65-remove-gcc-related-packages.binary deleted file mode 100755 index 15dc1da..0000000 --- a/precise-armhf-alip-dev/customization/hooks/65-remove-gcc-related-packages.binary +++ /dev/null @@ -1,3 +0,0 @@ -#!/bin/sh - -#dpkg --purge --force-all libgcc1 libmudflap0 libmudflap0-*-dev libstdc++6 libstdc++6-*-dev gcc gcc-4.6* diff --git a/precise-armhf-alip-dev/customization/hooks/70-kill_all_symlinks.binary b/precise-armhf-alip-dev/customization/hooks/70-kill_all_symlinks.binary deleted file mode 100755 index 0d9f552..0000000 --- a/precise-armhf-alip-dev/customization/hooks/70-kill_all_symlinks.binary +++ /dev/null @@ -1,11 +0,0 @@ -#!/bin/sh - -cd binary/boot/ - -mv filesystem.dir old -mkdir filesystem.dir - -cd old - -tar -cf - --no-same-owner --ignore-case --dereference . | tar -xf - -C ../filesystem.dir && rm -rf ../old -- -C ../filesystem.dir && rm -rf ../old diff --git a/precise-armhf-alip-dev/customization/hooks/90-change-symlinks-to-relative.binary b/precise-armhf-alip-dev/customization/hooks/90-change-symlinks-to-relative.binary new file mode 100755 index 0000000..ec2a448 --- /dev/null +++ b/precise-armhf-alip-dev/customization/hooks/90-change-symlinks-to-relative.binary @@ -0,0 +1,22 @@ +#!/bin/sh + +# Taken from http://bazaar.launchpad.net/~linaro-toolchain-dev/crosstool-ng/linaro/view/head:/contrib/linaro/make-sysroot.sh + +sysroot=binary/boot/filesystem.dir + +# Some packages include absolute links in sysroot/usr/lib. +# Convert to relative links instead +for lib in $( find $sysroot -type l ); do + target=$( readlink $lib ) + base=$( basename $target ) + + case $target in + /*) + v=$( echo $lib | sed -r "s#^$sysroot/##" | tr -cd / | sed "s#/#../#g" ) + p=$( echo $target | sed "s#^/##" ) + rm $lib + ln -s $v$p $lib + ;; + *) ;; + esac +done diff --git a/precise-armhf-alip-dev/customization/hooks/99-move-to-libc.binary b/precise-armhf-alip-dev/customization/hooks/99-move-to-libc.binary new file mode 100755 index 0000000..bc3b315 --- /dev/null +++ b/precise-armhf-alip-dev/customization/hooks/99-move-to-libc.binary @@ -0,0 +1,6 @@ +#!/bin/sh + +cd binary +mkdir libc +mv boot/filesystem.dir/* libc +rm -rf boot diff --git a/precise-armhf-libc-dev/customization/hooks/60-remove_not_needed.binary b/precise-armhf-libc-dev/customization/hooks/60-remove_not_needed.binary new file mode 100755 index 0000000..55a7447 --- /dev/null +++ b/precise-armhf-libc-dev/customization/hooks/60-remove_not_needed.binary @@ -0,0 +1,13 @@ +#!/bin/sh + +cd binary/boot/filesystem.dir + +rm -rf usr/share/{groff,linda,lintian,info,man,perl,locale,fonts,icons,i18n,gtk-doc,ghostscript} \ + boot lib/modules \ + lib/firmware dev home lib/init lib/lsb lib/systemd lib/terminfo \ + usr/lib/firefox*/searchplugins/common \ + etc bin usr/bin sbin usr/sbin var usr/local usr/games lib64 \ + usr/lib/{locale,gnupg,apt,ConsoleKit,initramfs-tools,ldscripts,mime,sasl2,ssl,tc,upstart,user-setup,valgrind}\ + lib/udev lib/xtables media mnt opt proc root run selinux srv sys tmp + +rmdir -p `find . -type d -empty` || true diff --git a/precise-armhf-libc-dev/customization/hooks/90-change-symlinks-to-relative.binary b/precise-armhf-libc-dev/customization/hooks/90-change-symlinks-to-relative.binary new file mode 100755 index 0000000..ec2a448 --- /dev/null +++ b/precise-armhf-libc-dev/customization/hooks/90-change-symlinks-to-relative.binary @@ -0,0 +1,22 @@ +#!/bin/sh + +# Taken from http://bazaar.launchpad.net/~linaro-toolchain-dev/crosstool-ng/linaro/view/head:/contrib/linaro/make-sysroot.sh + +sysroot=binary/boot/filesystem.dir + +# Some packages include absolute links in sysroot/usr/lib. +# Convert to relative links instead +for lib in $( find $sysroot -type l ); do + target=$( readlink $lib ) + base=$( basename $target ) + + case $target in + /*) + v=$( echo $lib | sed -r "s#^$sysroot/##" | tr -cd / | sed "s#/#../#g" ) + p=$( echo $target | sed "s#^/##" ) + rm $lib + ln -s $v$p $lib + ;; + *) ;; + esac +done diff --git a/precise-armhf-libc-dev/customization/hooks/90-remove_not_needed.binary b/precise-armhf-libc-dev/customization/hooks/90-remove_not_needed.binary deleted file mode 100755 index 55a7447..0000000 --- a/precise-armhf-libc-dev/customization/hooks/90-remove_not_needed.binary +++ /dev/null @@ -1,13 +0,0 @@ -#!/bin/sh - -cd binary/boot/filesystem.dir - -rm -rf usr/share/{groff,linda,lintian,info,man,perl,locale,fonts,icons,i18n,gtk-doc,ghostscript} \ - boot lib/modules \ - lib/firmware dev home lib/init lib/lsb lib/systemd lib/terminfo \ - usr/lib/firefox*/searchplugins/common \ - etc bin usr/bin sbin usr/sbin var usr/local usr/games lib64 \ - usr/lib/{locale,gnupg,apt,ConsoleKit,initramfs-tools,ldscripts,mime,sasl2,ssl,tc,upstart,user-setup,valgrind}\ - lib/udev lib/xtables media mnt opt proc root run selinux srv sys tmp - -rmdir -p `find . -type d -empty` || true diff --git a/precise-armhf-libc-dev/customization/hooks/99-move-to-libc.binary b/precise-armhf-libc-dev/customization/hooks/99-move-to-libc.binary new file mode 100755 index 0000000..bc3b315 --- /dev/null +++ b/precise-armhf-libc-dev/customization/hooks/99-move-to-libc.binary @@ -0,0 +1,6 @@ +#!/bin/sh + +cd binary +mkdir libc +mv boot/filesystem.dir/* libc +rm -rf boot diff --git a/precise-armhf-nano-dev/customization/hooks/50-remove-gcc-related-packages.binary b/precise-armhf-nano-dev/customization/hooks/50-remove-gcc-related-packages.binary new file mode 100755 index 0000000..8d19db6 --- /dev/null +++ b/precise-armhf-nano-dev/customization/hooks/50-remove-gcc-related-packages.binary @@ -0,0 +1,10 @@ +#!/bin/sh + +for pkg in libgcc1 libmudflap0 libmudflap0-4.6-dev libstdc++6 libstdc++6-4.6-dev gcc gcc-4.6 +do + LIST=`sed -e 's+^\/++g' var/lib/dpkg/info/${pkg}.list` + for file in $LIST + do + rm $file + done +done diff --git a/precise-armhf-nano-dev/customization/hooks/65-remove-gcc-related-packages.binary b/precise-armhf-nano-dev/customization/hooks/65-remove-gcc-related-packages.binary deleted file mode 100755 index 15dc1da..0000000 --- a/precise-armhf-nano-dev/customization/hooks/65-remove-gcc-related-packages.binary +++ /dev/null @@ -1,3 +0,0 @@ -#!/bin/sh - -#dpkg --purge --force-all libgcc1 libmudflap0 libmudflap0-*-dev libstdc++6 libstdc++6-*-dev gcc gcc-4.6* diff --git a/precise-armhf-nano-dev/customization/hooks/70-kill_all_symlinks.binary b/precise-armhf-nano-dev/customization/hooks/70-kill_all_symlinks.binary deleted file mode 100755 index c581602..0000000 --- a/precise-armhf-nano-dev/customization/hooks/70-kill_all_symlinks.binary +++ /dev/null @@ -1,12 +0,0 @@ -#!/bin/sh - -exit # we may enable this script later - -cd binary/boot/ - -mv filesystem.dir old -mkdir filesystem.dir - -cd old - -tar -cf - --no-same-owner --ignore-case --dereference . | tar -xf - -C ../filesystem.dir && rm -rf ../old diff --git a/precise-armhf-nano-dev/customization/hooks/90-change-symlinks-to-relative.binary b/precise-armhf-nano-dev/customization/hooks/90-change-symlinks-to-relative.binary new file mode 100755 index 0000000..ec2a448 --- /dev/null +++ b/precise-armhf-nano-dev/customization/hooks/90-change-symlinks-to-relative.binary @@ -0,0 +1,22 @@ +#!/bin/sh + +# Taken from http://bazaar.launchpad.net/~linaro-toolchain-dev/crosstool-ng/linaro/view/head:/contrib/linaro/make-sysroot.sh + +sysroot=binary/boot/filesystem.dir + +# Some packages include absolute links in sysroot/usr/lib. +# Convert to relative links instead +for lib in $( find $sysroot -type l ); do + target=$( readlink $lib ) + base=$( basename $target ) + + case $target in + /*) + v=$( echo $lib | sed -r "s#^$sysroot/##" | tr -cd / | sed "s#/#../#g" ) + p=$( echo $target | sed "s#^/##" ) + rm $lib + ln -s $v$p $lib + ;; + *) ;; + esac +done diff --git a/precise-armhf-nano-dev/customization/hooks/99-move-to-libc.binary b/precise-armhf-nano-dev/customization/hooks/99-move-to-libc.binary new file mode 100755 index 0000000..bc3b315 --- /dev/null +++ b/precise-armhf-nano-dev/customization/hooks/99-move-to-libc.binary @@ -0,0 +1,6 @@ +#!/bin/sh + +cd binary +mkdir libc +mv boot/filesystem.dir/* libc +rm -rf boot diff --git a/precise-armhf-ubuntu-desktop-dev/customization/hooks/50-remove-gcc-related-packages.binary b/precise-armhf-ubuntu-desktop-dev/customization/hooks/50-remove-gcc-related-packages.binary new file mode 100755 index 0000000..8d19db6 --- /dev/null +++ b/precise-armhf-ubuntu-desktop-dev/customization/hooks/50-remove-gcc-related-packages.binary @@ -0,0 +1,10 @@ +#!/bin/sh + +for pkg in libgcc1 libmudflap0 libmudflap0-4.6-dev libstdc++6 libstdc++6-4.6-dev gcc gcc-4.6 +do + LIST=`sed -e 's+^\/++g' var/lib/dpkg/info/${pkg}.list` + for file in $LIST + do + rm $file + done +done diff --git a/precise-armhf-ubuntu-desktop-dev/customization/hooks/60-remove_not_needed.binary b/precise-armhf-ubuntu-desktop-dev/customization/hooks/60-remove_not_needed.binary index c7dd7a5..55a7447 100755 --- a/precise-armhf-ubuntu-desktop-dev/customization/hooks/60-remove_not_needed.binary +++ b/precise-armhf-ubuntu-desktop-dev/customization/hooks/60-remove_not_needed.binary @@ -6,9 +6,8 @@ rm -rf usr/share/{groff,linda,lintian,info,man,perl,locale,fonts,icons,i18n,gtk- boot lib/modules \ lib/firmware dev home lib/init lib/lsb lib/systemd lib/terminfo \ usr/lib/firefox*/searchplugins/common \ - usr/bin/X11 lib64 \ - lib/udev lib/xtables media mnt opt proc root run selinux srv sys tmp -onsoleKit,initramfs-tools,ldscripts,mime,sasl2,ssl,tc,upstart,user-setup,valgrind}\ + etc bin usr/bin sbin usr/sbin var usr/local usr/games lib64 \ + usr/lib/{locale,gnupg,apt,ConsoleKit,initramfs-tools,ldscripts,mime,sasl2,ssl,tc,upstart,user-setup,valgrind}\ lib/udev lib/xtables media mnt opt proc root run selinux srv sys tmp rmdir -p `find . -type d -empty` || true diff --git a/precise-armhf-ubuntu-desktop-dev/customization/hooks/65-remove-gcc-related-packages.binary b/precise-armhf-ubuntu-desktop-dev/customization/hooks/65-remove-gcc-related-packages.binary deleted file mode 100755 index 15dc1da..0000000 --- a/precise-armhf-ubuntu-desktop-dev/customization/hooks/65-remove-gcc-related-packages.binary +++ /dev/null @@ -1,3 +0,0 @@ -#!/bin/sh - -#dpkg --purge --force-all libgcc1 libmudflap0 libmudflap0-*-dev libstdc++6 libstdc++6-*-dev gcc gcc-4.6* diff --git a/precise-armhf-ubuntu-desktop-dev/customization/hooks/70-kill_all_symlinks.binary b/precise-armhf-ubuntu-desktop-dev/customization/hooks/70-kill_all_symlinks.binary deleted file mode 100755 index 0d9f552..0000000 --- a/precise-armhf-ubuntu-desktop-dev/customization/hooks/70-kill_all_symlinks.binary +++ /dev/null @@ -1,11 +0,0 @@ -#!/bin/sh - -cd binary/boot/ - -mv filesystem.dir old -mkdir filesystem.dir - -cd old - -tar -cf - --no-same-owner --ignore-case --dereference . | tar -xf - -C ../filesystem.dir && rm -rf ../old -- -C ../filesystem.dir && rm -rf ../old diff --git a/precise-armhf-ubuntu-desktop-dev/customization/hooks/90-change-symlinks-to-relative.binary b/precise-armhf-ubuntu-desktop-dev/customization/hooks/90-change-symlinks-to-relative.binary new file mode 100755 index 0000000..ec2a448 --- /dev/null +++ b/precise-armhf-ubuntu-desktop-dev/customization/hooks/90-change-symlinks-to-relative.binary @@ -0,0 +1,22 @@ +#!/bin/sh + +# Taken from http://bazaar.launchpad.net/~linaro-toolchain-dev/crosstool-ng/linaro/view/head:/contrib/linaro/make-sysroot.sh + +sysroot=binary/boot/filesystem.dir + +# Some packages include absolute links in sysroot/usr/lib. +# Convert to relative links instead +for lib in $( find $sysroot -type l ); do + target=$( readlink $lib ) + base=$( basename $target ) + + case $target in + /*) + v=$( echo $lib | sed -r "s#^$sysroot/##" | tr -cd / | sed "s#/#../#g" ) + p=$( echo $target | sed "s#^/##" ) + rm $lib + ln -s $v$p $lib + ;; + *) ;; + esac +done diff --git a/precise-armhf-ubuntu-desktop-dev/customization/hooks/99-move-to-libc.binary b/precise-armhf-ubuntu-desktop-dev/customization/hooks/99-move-to-libc.binary new file mode 100755 index 0000000..bc3b315 --- /dev/null +++ b/precise-armhf-ubuntu-desktop-dev/customization/hooks/99-move-to-libc.binary @@ -0,0 +1,6 @@ +#!/bin/sh + +cd binary +mkdir libc +mv boot/filesystem.dir/* libc +rm -rf boot -- cgit v1.2.3