diff options
5 files changed, 48 insertions, 13 deletions
diff --git a/scripts/install-system b/scripts/install-system index 5a9c0309..a7a0b066 100755 --- a/scripts/install-system +++ b/scripts/install-system @@ -479,7 +479,15 @@ install_root_filesystem () { output=$(umount /mnt/squashfs) # create the fstab - echo -e "/dev/$ROOT_PARTITION\t/\text3\tdefaults\t0 1" >> $rootfsdir/etc/fstab + local rootdev="/dev/$ROOT_PARTITION"; + uuid=$(dumpe2fs -h $rootdev 2>/dev/null | awk '/^Filesystem UUID/ {print $3}') + if [ -z "$uuid" ] + then + echo "Unable to read filesystem UUID. Exiting." + exit 1 + else + echo -e "UUID=$uuid\t/\text3\tdefaults\t0 1" >> $rootfsdir/etc/fstab + fi #setup the hostname file cp /etc/hostname $rootfsdir/etc/ @@ -520,16 +528,19 @@ copy_config () { if [ -z "$config" ]; then config="$fdconfdir/config.boot" else - config="$config\n$fdconfdir/config.boot" + config="$config $fdconfdir/config.boot" fi fi if [ -n "$config" ]; then echo "I found the following configuration files" - echo -e "$config" - default=$(echo -e $config| head -1) + for file in $config + do + echo $file + done + + default=$(echo -e $config | awk '{ print $1 }') - resp='' while [ -z "$configfile" ] do echo -n "Which one should I copy to $INSTALL_DRIVE? [$default]: " @@ -632,9 +643,10 @@ install_grub () { # This allows device to move around and grub will still find it local rootdev="/dev/$ROOT_PARTITION"; uuid=$(dumpe2fs -h $rootdev 2>/dev/null | awk '/^Filesystem UUID/ {print $3}') - if [ -z $uuid ] + if [ -z "$uuid" ] then - GRUB_ROOT="root=$rootdev ro" + echo "Unable to read filesystem UUID. Exiting." + exit 1 else GRUB_ROOT="root=UUID=$uuid ro" fi diff --git a/templates/system/package/repository/node.def b/templates/system/package/repository/node.def index 8d753918..b2f0349f 100644 --- a/templates/system/package/repository/node.def +++ b/templates/system/package/repository/node.def @@ -2,15 +2,22 @@ tag: type: txt -help: Set name of a debian archive +help: Set the name of a debian archive commit:expression: $VAR(./url/) != ""; "Must configure the repository URL" commit:expression: $VAR(./distribution/) != ""; "Must configure the repository distribution" commit:expression: $VAR(./components/) != ""; "Must configure the repository components" -update: sudo sh -c "touch /etc/apt/sources.list && \ -sed -i '\\!# $VAR(@) #!d' /etc/apt/sources.list && \ -echo \"deb $VAR(url/@)/ $VAR(distribution/@) $VAR(components/@) # $VAR(@) #\" >> /etc/apt/sources.list" +update: sudo bash -c "touch /etc/apt/sources.list && \ + sed -i '\\!# $VAR(@) #!d' /etc/apt/sources.list && \ + echo \"deb $VAR(url/@) $VAR(distribution/@) $VAR(components/@) # $VAR(@) #\" >> /tmp/$$-sources.list && \ + if [ $VAR(password/@) ] || [ $VAR(username/@) ]; \ + then \ + sed -i "s!://.*@!://!" /tmp/$$-sources.list; \ + sed -i "s!://!://$VAR(username/@):$VAR(password/@)@!" /tmp/$$-sources.list; \ + fi && \ + cat /tmp/$$-sources.list>>/etc/apt/sources.list ; \ + rm -f /tmp/$$-sources.list" delete: sudo sh -c "touch /etc/apt/sources.list && \ sed -i '\\!# $VAR(@) #!d' /etc/apt/sources.list" diff --git a/templates/system/package/repository/node.tag/password/node.def b/templates/system/package/repository/node.tag/password/node.def new file mode 100644 index 00000000..34ccff27 --- /dev/null +++ b/templates/system/package/repository/node.tag/password/node.def @@ -0,0 +1,8 @@ +type: txt + +help: Repository password + +default: "" + +# need to prohibit '!' in url (sed delimiter) +syntax:expression: pattern $VAR(@) "^[^!]*$" ; "Do not use '!' in url" diff --git a/templates/system/package/repository/node.tag/url/node.def b/templates/system/package/repository/node.tag/url/node.def index 9cb3a472..07021671 100644 --- a/templates/system/package/repository/node.tag/url/node.def +++ b/templates/system/package/repository/node.tag/url/node.def @@ -1,4 +1,4 @@ type: txt -help: Set repository URL +help: Repository URL # need to prohibit '!' in url (sed delimiter) -syntax:expression: pattern $VAR(@) "^[^!]+$" ; "Do not use '!' in url" +syntax:expression: pattern $VAR(@) "^[^!]+$" ; "URL must not be null and must not contain '!'" diff --git a/templates/system/package/repository/node.tag/username/node.def b/templates/system/package/repository/node.tag/username/node.def new file mode 100644 index 00000000..d22dd7cb --- /dev/null +++ b/templates/system/package/repository/node.tag/username/node.def @@ -0,0 +1,8 @@ +type: txt + +help: Repository username + +default: "" + +# need to prohibit '!' in url (sed delimiter) +syntax:expression: pattern $VAR(@) "^[^!]*$" ; "Do not use '!' in url" |