From 962f2dc0878320004fcf3eae3311b65d06746c4d Mon Sep 17 00:00:00 2001 From: Sven Gothel Date: Thu, 4 Feb 2021 04:26:23 +0100 Subject: Fix LOCALUSERNAME data import: Do post useradd, fix MYUSERNAME -> LOCALUSERNAME --- scripts/deblive03.sh | 4 ++-- scripts/debootstrap01.sh | 2 -- scripts/debootstrap03.sh | 7 +++++-- 3 files changed, 7 insertions(+), 6 deletions(-) diff --git a/scripts/deblive03.sh b/scripts/deblive03.sh index 95df72f..285a800 100644 --- a/scripts/deblive03.sh +++ b/scripts/deblive03.sh @@ -3,8 +3,8 @@ . ./settings00.sh # Update ownership if populated with data -/usr/sbin/chroot $LIVECHROOT /bin/chown -R root:root /root -/usr/sbin/chroot $LIVECHROOT /bin/chown -R $MYUSERNAME:$MYUSERNAME /home/$LOCALUSERNAME +/usr/sbin/chroot $LIVECHROOT /bin/chown -R root:root /root +/usr/sbin/chroot $LIVECHROOT /bin/chown -R $LOCALUSERNAME:$LOCALUSERNAME /home/$LOCALUSERNAME #umount -R $LIVECHROOT/dev #umount -R $LIVECHROOT/proc diff --git a/scripts/debootstrap01.sh b/scripts/debootstrap01.sh index fd01277..9c33ebe 100644 --- a/scripts/debootstrap01.sh +++ b/scripts/debootstrap01.sh @@ -75,8 +75,6 @@ cp -a /home/$IMPORTUSERNAME/.ssh/authorized_keys $STRAPROOT/root/.ssh/ cp -a /home/$IMPORTUSERNAME/.vimrc $STRAPROOT/root/ cp -a /home/$IMPORTUSERNAME/.exrc $STRAPROOT/root/ -cp -a /home/$IMPORTUSERNAME $STRAPROOT/home/$LOCALUSERNAME - echo RUN: chroot $STRAPROOT /bin/bash --login echo then: cd /root/debian-zfs-live/scripts echo to continue the process with debootstrap02.sh etc diff --git a/scripts/debootstrap03.sh b/scripts/debootstrap03.sh index 689580c..de5922f 100644 --- a/scripts/debootstrap03.sh +++ b/scripts/debootstrap03.sh @@ -2,9 +2,12 @@ . ./settings00.sh +cp -a /home/$IMPORTUSERNAME/.[a-zA-Z0-9]* $STRAPROOT/home/$LOCALUSERNAME/ +cp -a /home/$IMPORTUSERNAME/* $STRAPROOT/home/$LOCALUSERNAME/ + # Update ownership if populated with data -/usr/sbin/chroot $STRAPROOT /bin/chown -R root:root /root -/usr/sbin/chroot $STRAPROOT /bin/chown -R $MYUSERNAME:$MYUSERNAME /home/$LOCALUSERNAME +/usr/sbin/chroot $STRAPROOT /bin/chown -R root:root /root +/usr/sbin/chroot $STRAPROOT /bin/chown -R $LOCALUSERNAME:$LOCALUSERNAME /home/$LOCALUSERNAME #umount -R $STRAPROOT/dev #umount -R $STRAPROOT/proc -- cgit v1.2.3 From bc5a1c11e6cafaf56aa2d0b78d46b3c0f2d02fed Mon Sep 17 00:00:00 2001 From: Sven Gothel Date: Thu, 4 Feb 2021 04:28:07 +0100 Subject: Add 'deblive01-redo.sh': Producing another live-image with custom data added (for example), w/o flushing pre-produced files --- scripts/deblive01-redo.sh | 26 ++++++++++++++++++++++++++ 1 file changed, 26 insertions(+) create mode 100644 scripts/deblive01-redo.sh diff --git a/scripts/deblive01-redo.sh b/scripts/deblive01-redo.sh new file mode 100644 index 0000000..1174c7e --- /dev/null +++ b/scripts/deblive01-redo.sh @@ -0,0 +1,26 @@ +#! /bin/sh + +. ./settings00.sh + +mount --rbind /dev $LIVECHROOT/dev +mount --rbind /proc $LIVECHROOT/proc +mount --rbind /sys $LIVECHROOT/sys +mount --make-rslave $LIVECHROOT/dev +mount --make-rslave $LIVECHROOT/proc +mount --make-rslave $LIVECHROOT/sys +echo "Later we will unmount this via" +echo umount -R $LIVECHROOT/dev +echo umount -R $LIVECHROOT/proc +echo umount -R $LIVECHROOT/sys +echo "cat /proc/mounts | awk '{print \$2}' | grep "^$LIVECHROOT" | sort -r | xargs umount" + +mkdir -p $LIVECHROOT/root/debian-zfs-live +cp -a ../* $LIVECHROOT/root/debian-zfs-live + +mkdir -p $LIVECHROOT/root/debian +if [ -e ../../debian/packages ] ; then + cp -a ../../debian/packages $LIVECHROOT/root/debian/ +fi + +echo "YOU MAY POPULATE FS WITH SOME ADDITIONAL DATA NOW" +echo to continue the process with deblive03.sh -- cgit v1.2.3