Update make.sh
- fix KERNEL_PARAM - remove android - Add printf description - fix build parallel mksquashfs with mount in chroot - remove old stuff
This commit is contained in:
parent
6722033e46
commit
95cc79dd78
82
make.sh
82
make.sh
@ -21,7 +21,6 @@ _usage()
|
||||
-x Make xfce live image
|
||||
-c Make cinnamon live image
|
||||
-v Make xfce-vm live image
|
||||
-a Make live image for android
|
||||
EOF
|
||||
}
|
||||
|
||||
@ -33,8 +32,6 @@ fi
|
||||
|
||||
KERNEL_PARAM="boot=live components lang=fr_FR.UTF-8 locales=fr_FR.UTF-8 keyboard-layouts=fr keyboard-model=pc105 timezone=Europe/Paris utc=yes"
|
||||
|
||||
keep_iso="true"
|
||||
|
||||
pack_full=(live cli firmware xfce4 gui cinnamon gui_opt)
|
||||
|
||||
pack_xfce=(live cli firmware xfce4 gui)
|
||||
@ -52,10 +49,6 @@ _config()
|
||||
|
||||
cd $build
|
||||
|
||||
#cp -r $config/auto $build/auto
|
||||
|
||||
sed -i 's:\(--bootappend-live\).*:\1 "'"$KERNEL_PARAM"'":' $build/auto/config
|
||||
|
||||
ln -sr $config/includes.chroot $build/config/includes.chroot
|
||||
ln -sr $config/packages.chroot $build/config/packages.chroot
|
||||
|
||||
@ -75,7 +68,7 @@ _config()
|
||||
--source false \
|
||||
--backports false \
|
||||
--memtest none \
|
||||
--bootappend-live "boot=live components lang=fr_FR.UTF-8 locales=fr_FR.UTF-8 keyboard-layouts=fr keyboard-model=pc105 timezone=Europe/Paris utc=yes" \
|
||||
--bootappend-live "$KERNEL_PARAM"
|
||||
|
||||
rm $build/config/package-lists/*
|
||||
|
||||
@ -90,8 +83,10 @@ _config()
|
||||
_build()
|
||||
{
|
||||
|
||||
#time nice -20 ionice -c 1 lb build
|
||||
printf "\e[96mBootstrap new root filesystem\e[0m\n"
|
||||
lb bootstrap
|
||||
|
||||
printf "\e[96mBuild live OS file system\e[0m\n"
|
||||
lb chroot
|
||||
|
||||
}
|
||||
@ -99,11 +94,32 @@ _build()
|
||||
_create_squashfs()
|
||||
{
|
||||
|
||||
printf "\e[96mPreparing root filesystem\e[0m\n"
|
||||
lb binary_chroot
|
||||
|
||||
# Chroot preparation component lists
|
||||
# We deliberately exclude 'debianchroot'
|
||||
CHROOT_PREP_MOUNTS="devpts proc selinuxfs sysfs"
|
||||
CHROOT_PREP_OTHER="dpkg tmpfs sysv-rc hosts resolv hostname apt"
|
||||
|
||||
# Configuring chroot
|
||||
lb chroot_prep install "${CHROOT_PREP_MOUNTS}"
|
||||
lb chroot_prep install "${CHROOT_PREP_OTHER}" mode-apt-install-binary mode-archives-chroot
|
||||
lb chroot_archives chroot install
|
||||
|
||||
printf "\e[96mBuilding root filesystem\e[0m\n"
|
||||
lb binary_rootfs
|
||||
|
||||
printf "\e[96mPrepare images\e[0m\n"
|
||||
lb binary_linux-image
|
||||
lb binary_syslinux
|
||||
|
||||
# Deconfiguring chroot
|
||||
lb chroot_prep remove "${CHROOT_PREP_MOUNTS}"
|
||||
lb chroot_prep remove "${CHROOT_PREP_OTHER}"
|
||||
|
||||
printf "\e[96mCopy filesystem\e[0m\n"
|
||||
|
||||
out="$iso/$type"
|
||||
|
||||
install -d -m 0755 -o $SUDO_UID -g $SUDO_GID $out
|
||||
@ -112,18 +128,16 @@ _create_squashfs()
|
||||
|
||||
chown $SUDO_UID:$SUDO_GID $out/{initrd.img,vmlinuz,filesystem.squashfs}
|
||||
|
||||
lb chroot_sysfs remove
|
||||
lb chroot_selinuxfs remove
|
||||
lb chroot_proc remove
|
||||
lb chroot_devpts remove
|
||||
|
||||
}
|
||||
|
||||
_create_iso()
|
||||
{
|
||||
|
||||
printf "\e[96mBuild binary (live disc) images\e[0m\n"
|
||||
lb binary
|
||||
|
||||
printf "\e[96mCopy ISO\e[0m\n"
|
||||
|
||||
out="$iso/$type"
|
||||
|
||||
install -d -m 0755 -o $SUDO_UID -g $SUDO_GID $out
|
||||
@ -133,37 +147,17 @@ _create_iso()
|
||||
chown $SUDO_UID:$SUDO_GID $out/live-${type}-image.iso
|
||||
|
||||
}
|
||||
|
||||
_extract()
|
||||
{
|
||||
|
||||
cd $out
|
||||
|
||||
7z e live-${type}-image.iso live/{initrd.img,vmlinuz,filesystem.squashfs}
|
||||
|
||||
chown $SUDO_UID:$SUDO_GID . -R
|
||||
|
||||
rm live-${type}-image.iso
|
||||
|
||||
}
|
||||
|
||||
_delete()
|
||||
{
|
||||
echo "Delete $build"
|
||||
# read -p "You sure ? " -n 1 -r
|
||||
# echo
|
||||
# if [[ $REPLY =~ ^[YyOo]$ ]]
|
||||
# then
|
||||
printf "\e[96mDelete $build\e[0m\n"
|
||||
rm -r $build
|
||||
# else
|
||||
# echo "Cancel"
|
||||
# fi
|
||||
}
|
||||
|
||||
while getopts "fxcva" OPTION; do
|
||||
while getopts "fxcv" OPTION; do
|
||||
case $OPTION in
|
||||
f)
|
||||
type="full"
|
||||
printf "\e[96mMake $type\e[0m\n"
|
||||
_config
|
||||
_build
|
||||
_create_squashfs
|
||||
@ -171,6 +165,7 @@ while getopts "fxcva" OPTION; do
|
||||
;;
|
||||
x)
|
||||
type="xfce"
|
||||
printf "\e[96mMake $type\e[0m\n"
|
||||
_config
|
||||
_build
|
||||
mkdir -p $build/chroot/etc/skel/.ssh
|
||||
@ -181,6 +176,7 @@ while getopts "fxcva" OPTION; do
|
||||
;;
|
||||
v)
|
||||
type="vmxfce"
|
||||
printf "\e[96mMake $type\e[0m\n"
|
||||
_config
|
||||
_build
|
||||
_create_iso
|
||||
@ -188,22 +184,12 @@ while getopts "fxcva" OPTION; do
|
||||
;;
|
||||
c)
|
||||
type="cinnamon"
|
||||
printf "\e[96mMake $type\e[0m\n"
|
||||
_config
|
||||
_build
|
||||
_create_iso
|
||||
_delete
|
||||
;;
|
||||
a)
|
||||
type="android"
|
||||
KERNEL_PARAM+=" toram x-session-manager=/usr/bin/cinnamon-session"
|
||||
_config
|
||||
_build
|
||||
mkdir -p $build/chroot/etc/skel/.ssh
|
||||
cp /home/lionel/.ssh/{config,key_rsa_majalis,key_rsa_majalis.pub} $build/chroot/etc/skel/.ssh
|
||||
ssh-keygen -H -F netdldata.net > $build/chroot/etc/skel/.ssh/known_hosts
|
||||
_create_iso
|
||||
_delete
|
||||
;;
|
||||
*)
|
||||
_usage
|
||||
exit 1
|
||||
|
Loading…
x
Reference in New Issue
Block a user