ビルド後の追加作業を行う
新システムの構築の後半部分の作業が終わりました。 ここで不要ファイルの削除やバックアップを実施します。
不要なシンボルの削除
まず、実行ファイルやライブラリに含まれている不要なシンボルを削除します。
/tools/bin/find $MYLINUX/bin -type f -exec /tools/bin/strip --strip-debug {} \;
/tools/bin/find $MYLINUX/sbin -type f -exec /tools/bin/strip --strip-debug {} \;
/tools/bin/find $MYLINUX/lib -type f -exec /tools/bin/strip --strip-debug {} \;
/tools/bin/find $MYLINUX/usr/bin -type f -exec /tools/bin/strip --strip-debug {} \;
/tools/bin/find $MYLINUX/usr/sbin -type f -exec /tools/bin/strip --strip-debug {} \;
/tools/bin/find $MYLINUX/usr/lib -type f -exec /tools/bin/strip --strip-debug {} \;
/tools/bin/find $MYLINUX/bin -type f -exec /tools/bin/strip --strip-debug {} \;
/tools/bin/find $MYLINUX/sbin -type f -exec /tools/bin/strip --strip-debug {} \;
/tools/bin/find $MYLINUX/lib -type f -exec /tools/bin/strip --strip-debug {} \;
/tools/bin/find $MYLINUX/usr/bin -type f -exec /tools/bin/strip --strip-debug {} \;
/tools/bin/find $MYLINUX/usr/sbin -type f -exec /tools/bin/strip --strip-debug {} \;
/tools/bin/find $MYLINUX/usr/lib -type f -exec /tools/bin/strip --strip-debug {} \;






不要ファイルの削除
続いて、不要ファイルを削除します。
cd $MYLINUX/tmprm -fr * .[a-zA-Z0-9]* cd $MYLINUX/var/log mv btmp $MYLINUX/tmp/ mv wtmp $MYLINUX/tmp/ mv lastlog $MYLINUX/tmp/ rm -fr * .[a-zA-Z0-9]* mv $MYLINUX/tmp/btmp . mv $MYLINUX/tmp/wtmp . mv $MYLINUX/tmp/lastlog .
cd $MYLINUX/tmp
rm -fr * .[a-zA-Z0-9]*
cd $MYLINUX/var/log
mv btmp $MYLINUX/tmp/
mv wtmp $MYLINUX/tmp/
mv lastlog $MYLINUX/tmp/
rm -fr * .[a-zA-Z0-9]*
mv $MYLINUX/tmp/btmp .
mv $MYLINUX/tmp/wtmp .
mv $MYLINUX/tmp/lastlog .










バックアップ
1CD Linux用のパーティションをバックアップしておきます。
cd $MYLINUXtar cvfj ./backups/mylinux.backup-07.tar.bz2 . --exclude=backups --exclude=sources --exclude=lost+found
cd $MYLINUX
tar cvfj ./backups/mylinux.backup-07.tar.bz2 . --exclude=backups --exclude=sources --exclude=lost+found


新システムの構築の後半の作業が終わった状態のバックアップです。
チェンジルート用シェルの修正
チェンジルート用の chroot.sh を修正します。 /tools/bin にある実行ファイルを使わず、また、チェンジルート後の環境では /tools/bin にパスを通さないようにする修正を行います。
つまり、/tools ディレクトリを使用しないようにするための修正です。
sed -i -e 's,^#chroot,@chroot,' /root/chroot.shsed -i -e 's,^chroot,#chroot,' /root/chroot.sh sed -i -e 's,^@chroot,chroot,' /root/chroot.sh
sed -i -e 's,^#chroot,@chroot,' /root/chroot.sh
sed -i -e 's,^chroot,#chroot,' /root/chroot.sh
sed -i -e 's,^@chroot,chroot,' /root/chroot.sh








